Merge #10477: hdf5: improve options

This commit is contained in:
Vladimír Čunát 2015-11-11 15:18:46 +01:00
commit e8ee8496e5
2 changed files with 30 additions and 15 deletions

View File

@ -1,17 +1,21 @@
{ stdenv { stdenv
, fetchurl , fetchurl
, cpp ? false
, gfortran ? null
, zlib ? null , zlib ? null
, szip ? null , szip ? null
, mpi ? null , mpi ? null
, enableShared ? true , enableShared ? true
}: }:
with { inherit (stdenv.lib) optional; };
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "1.8.14"; version = "1.8.15-patch1";
name = "hdf5-${version}"; name = "hdf5-${version}";
src = fetchurl { src = fetchurl {
url = "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-${version}/src/hdf5-${version}.tar.gz"; url = "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-${version}/src/hdf5-${version}.tar.gz";
sha256 = "0f86gv32pjrrphvamgims1dd7f3bp46hjarbcdy8k4gmyzpgxghx"; sha256 = "19k39da6zzxyr0fnffn4iqlls9v1fsih877rznq8ypqy8mzf5dci";
}; };
passthru = { passthru = {
@ -20,20 +24,22 @@ stdenv.mkDerivation rec {
}; };
buildInputs = [] buildInputs = []
++ stdenv.lib.optional (zlib != null) zlib ++ optional (gfortran != null) gfortran
++ stdenv.lib.optional (szip != null) szip; ++ optional (zlib != null) zlib
++ optional (szip != null) szip;
propagatedBuildInputs = [] propagatedBuildInputs = []
++ stdenv.lib.optional (mpi != null) mpi; ++ optional (mpi != null) mpi;
configureFlags = []
++ optional cpp "--enable-cxx"
++ optional (gfortran != null) "--enable-fortran"
++ optional (szip != null) "--with-szlib=${szip}"
++ optional (mpi != null) "--enable-parallel"
++ optional enableShared "--enable-shared";
configureFlags = "
${if szip != null then "--with-szlib=${szip}" else ""}
${if mpi != null then "--enable-parallel" else ""}
${if enableShared then "--enable-shared" else ""}
";
patches = [./bin-mv.patch]; patches = [./bin-mv.patch];
meta = { meta = {
description = "Data model, library, and file format for storing and managing data"; description = "Data model, library, and file format for storing and managing data";
longDescription = '' longDescription = ''

View File

@ -1808,14 +1808,23 @@ let
hddtemp = callPackage ../tools/misc/hddtemp { }; hddtemp = callPackage ../tools/misc/hddtemp { };
hdf5 = callPackage ../tools/misc/hdf5 { hdf5 = callPackage ../tools/misc/hdf5 {
gfortran = null;
szip = null; szip = null;
mpi = null; mpi = null;
}; };
hdf5-mpi = hdf5.override { hdf5-mpi = appendToName "mpi" (hdf5.override {
szip = null; szip = null;
mpi = pkgs.openmpi; mpi = pkgs.openmpi;
}; });
hdf5-cpp = appendToName "cpp" (hdf5.override {
cpp = true;
});
hdf5-fortran = appendToName "fortran" (hdf5.override {
inherit gfortran;
});
heimdall = callPackage ../tools/misc/heimdall { }; heimdall = callPackage ../tools/misc/heimdall { };