From 924c38214da8d2d190eab1d3736348f0e9c07f27 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Mon, 19 Oct 2015 12:57:24 +0000 Subject: [PATCH 1/4] pkgs.hdf5: Add c++ and fortran variants --- pkgs/tools/misc/hdf5/default.nix | 5 +++++ pkgs/top-level/all-packages.nix | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix index bcfca5fddb5d..5981cdc3a5c3 100644 --- a/pkgs/tools/misc/hdf5/default.nix +++ b/pkgs/tools/misc/hdf5/default.nix @@ -1,6 +1,8 @@ { stdenv , fetchurl +, cpp ? false +, gfortran ? null , zlib ? null , szip ? null , mpi ? null @@ -20,6 +22,7 @@ stdenv.mkDerivation rec { }; buildInputs = [] + ++ stdenv.lib.optional (gfortran != null) gfortran ++ stdenv.lib.optional (zlib != null) zlib ++ stdenv.lib.optional (szip != null) szip; @@ -27,6 +30,8 @@ stdenv.mkDerivation rec { ++ stdenv.lib.optional (mpi != null) mpi; configureFlags = " + ${if cpp then "--enable-cxx" else ""} + ${if gfortran != null then "--enable-fortran" else ""} ${if szip != null then "--with-szlib=${szip}" else ""} ${if mpi != null then "--enable-parallel" else ""} ${if enableShared then "--enable-shared" else ""} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 634ec4fdbd16..3916505c7f88 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1814,6 +1814,7 @@ let hddtemp = callPackage ../tools/misc/hddtemp { }; hdf5 = callPackage ../tools/misc/hdf5 { + gfortran = null; szip = null; mpi = null; }; @@ -1823,6 +1824,14 @@ let mpi = pkgs.openmpi; }; + hdf5-cpp = hdf5.override { + cpp = true; + }; + + hdf5-fortran = hdf5.override { + inherit gfortran; + }; + heimdall = callPackage ../tools/misc/heimdall { }; hevea = callPackage ../tools/typesetting/hevea { }; From 27eeb48cd86369594868e97cda7ad3c25fd6dd9a Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Mon, 19 Oct 2015 13:07:53 +0000 Subject: [PATCH 2/4] pkgs.hdf5: 1.8.14 -> 1.8.15-patch1 --- pkgs/tools/misc/hdf5/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix index 5981cdc3a5c3..f8e316d93776 100644 --- a/pkgs/tools/misc/hdf5/default.nix +++ b/pkgs/tools/misc/hdf5/default.nix @@ -9,11 +9,11 @@ , enableShared ? true }: stdenv.mkDerivation rec { - version = "1.8.14"; + version = "1.8.15-patch1"; name = "hdf5-${version}"; src = fetchurl { url = "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-${version}/src/hdf5-${version}.tar.gz"; - sha256 = "0f86gv32pjrrphvamgims1dd7f3bp46hjarbcdy8k4gmyzpgxghx"; + sha256 = "19k39da6zzxyr0fnffn4iqlls9v1fsih877rznq8ypqy8mzf5dci"; }; passthru = { From 9c3c4d8b2dc5ba3aa998ba5b03d00b83324cd1ed Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Mon, 19 Oct 2015 13:36:57 +0000 Subject: [PATCH 3/4] pkgs.hdf5-*: use appendToName for specialized derivations --- pkgs/top-level/all-packages.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3916505c7f88..0ce306769636 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1819,18 +1819,18 @@ let mpi = null; }; - hdf5-mpi = hdf5.override { + hdf5-mpi = appendToName "mpi" (hdf5.override { szip = null; mpi = pkgs.openmpi; - }; + }); - hdf5-cpp = hdf5.override { + hdf5-cpp = appendToName "cpp" (hdf5.override { cpp = true; - }; + }); - hdf5-fortran = hdf5.override { + hdf5-fortran = appendToName "fortran" (hdf5.override { inherit gfortran; - }; + }); heimdall = callPackage ../tools/misc/heimdall { }; From 6a2a2f4ad5c5e09e736931b4e831ac14725e923b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 11 Nov 2015 15:14:28 +0100 Subject: [PATCH 4/4] hdf5: refactor the expression It's possible enableShared has little impact, as we pass --disable-static to all packages by default. --- pkgs/tools/misc/hdf5/default.nix | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix index f8e316d93776..0655fddeb87a 100644 --- a/pkgs/tools/misc/hdf5/default.nix +++ b/pkgs/tools/misc/hdf5/default.nix @@ -1,4 +1,3 @@ - { stdenv , fetchurl , cpp ? false @@ -8,6 +7,9 @@ , mpi ? null , enableShared ? true }: + +with { inherit (stdenv.lib) optional; }; + stdenv.mkDerivation rec { version = "1.8.15-patch1"; name = "hdf5-${version}"; @@ -22,23 +24,22 @@ stdenv.mkDerivation rec { }; buildInputs = [] - ++ stdenv.lib.optional (gfortran != null) gfortran - ++ stdenv.lib.optional (zlib != null) zlib - ++ stdenv.lib.optional (szip != null) szip; + ++ optional (gfortran != null) gfortran + ++ optional (zlib != null) zlib + ++ optional (szip != null) szip; 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 cpp then "--enable-cxx" else ""} - ${if gfortran != null then "--enable-fortran" else ""} - ${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]; - + meta = { description = "Data model, library, and file format for storing and managing data"; longDescription = ''