hdf5: consistently use *Support arguments

This commit is contained in:
Doron Behar 2021-09-26 16:33:31 +03:00 committed by Shamrock Lee
parent 499eb1b56a
commit 72a4341129
3 changed files with 39 additions and 28 deletions

View File

@ -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 = [

View File

@ -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";

View File

@ -5972,23 +5972,22 @@ with pkgs;
hdf4 = callPackage ../tools/misc/hdf4 { };
hdf5 = callPackage ../tools/misc/hdf5 {
gfortran = null;
szip = null;
fortranSupport = false;
fortran = gfortran;
};
hdf5_1_10 = callPackage ../tools/misc/hdf5/1.10.nix { };
hdf5-mpi = appendToName "mpi" (hdf5.override {
szip = null;
mpiSupport = true;
});
hdf5-cpp = appendToName "cpp" (hdf5.override {
cpp = true;
cppSupport = true;
});
hdf5-fortran = appendToName "fortran" (hdf5.override {
inherit gfortran;
fortranSupport = true;
});
hdf5-threadsafe = appendToName "threadsafe" (hdf5.overrideAttrs (oldAttrs: {