diff options
author | Doron Behar <doron.behar@gmail.com> | 2021-09-26 16:33:31 +0300 |
---|---|---|
committer | Shamrock Lee <44064051+ShamrockLee@users.noreply.github.com> | 2021-10-05 00:19:56 +0800 |
commit | 72a43411299409918f0482d69625169ea99e1d2c (patch) | |
tree | ac7dc9a32e2d9c35397b136578945d4f8454fecf /pkgs/tools/misc/hdf5 | |
parent | 499eb1b56a4ef24d7279920661e3ef865b0d0e37 (diff) |
hdf5: consistently use *Support arguments
Diffstat (limited to 'pkgs/tools/misc/hdf5')
-rw-r--r-- | pkgs/tools/misc/hdf5/1.10.nix | 11 | ||||
-rw-r--r-- | pkgs/tools/misc/hdf5/default.nix | 47 |
2 files changed, 35 insertions, 23 deletions
diff --git a/pkgs/tools/misc/hdf5/1.10.nix b/pkgs/tools/misc/hdf5/1.10.nix index 4e57a1c8e48a5..74d8fce599a84 100644 --- a/pkgs/tools/misc/hdf5/1.10.nix +++ b/pkgs/tools/misc/hdf5/1.10.nix @@ -1,7 +1,9 @@ -{ lib, stdenv +{ lib +, stdenv , fetchurl , removeReferencesTo -, zlib ? null +, zlibSupport ? true +, zlib , enableShared ? !stdenv.hostPlatform.isStatic , javaSupport ? false , jdk @@ -24,10 +26,9 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ removeReferencesTo ]; - propagatedBuildInputs = optional (zlib != null) zlib; + propagatedBuildInputs = optional zlibSupport zlib; - configureFlags = [] - ++ optional enableShared "--enable-shared" + configureFlags = optional enableShared "--enable-shared" ++ optional javaSupport "--enable-java"; patches = [ diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix index c5485a5b3fb1d..43c156de419e8 100644 --- a/pkgs/tools/misc/hdf5/default.nix +++ b/pkgs/tools/misc/hdf5/default.nix @@ -1,10 +1,14 @@ -{ lib, stdenv +{ lib +, stdenv , fetchurl , removeReferencesTo -, cpp ? false -, gfortran ? null -, zlib ? null -, szip ? null +, cppSupport ? false +, fortranSupport ? false +, fortran +, zlibSupport ? true +, zlib +, szipSupport ? false +, szip , mpiSupport ? false , mpi , enableShared ? !stdenv.hostPlatform.isStatic @@ -15,7 +19,7 @@ # cpp and mpi options are mutually exclusive # (--enable-unsupported could be used to force the build) -assert !cpp || !mpiSupport; +assert !cppSupport || !mpiSupport; let inherit (lib) optional optionals; in @@ -28,28 +32,35 @@ stdenv.mkDerivation rec { }; passthru = { - inherit mpiSupport; - inherit mpi; + inherit + cppSupport + fortranSupport + fortran + zlibSupport + zlib + szipSupport + szip + mpiSupport + mpi + ; }; outputs = [ "out" "dev" ]; nativeBuildInputs = [ removeReferencesTo ] - ++ optional (gfortran != null) gfortran; + ++ optional fortranSupport fortran; - buildInputs = [] - ++ optional (szip != null) szip + buildInputs = optional fortranSupport fortran + ++ optional szipSupport szip ++ optional javaSupport jdk; - propagatedBuildInputs = [] - ++ optional (zlib != null) zlib + propagatedBuildInputs = optional zlibSupport zlib ++ optional mpiSupport mpi; - configureFlags = [] - ++ optional cpp "--enable-cxx" - ++ optional (gfortran != null) "--enable-fortran" - ++ optional (szip != null) "--with-szlib=${szip}" - ++ optionals mpiSupport ["--enable-parallel" "CC=${mpi}/bin/mpicc"] + configureFlags = optional cppSupport "--enable-cxx" + ++ optional fortranSupport "--enable-fortran" + ++ optional szipSupport "--with-szlib=${szip}" + ++ optionals mpiSupport [ "--enable-parallel" "CC=${mpi}/bin/mpicc" ] ++ optional enableShared "--enable-shared" ++ optional javaSupport "--enable-java" ++ optional usev110Api "--with-default-api-version=v110"; |