diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/hdf5')
-rw-r--r-- | nixpkgs/pkgs/tools/misc/hdf5/default.nix | 38 | ||||
-rw-r--r-- | nixpkgs/pkgs/tools/misc/hdf5/hdf5-more-determinism.patch | 15 |
2 files changed, 17 insertions, 36 deletions
diff --git a/nixpkgs/pkgs/tools/misc/hdf5/default.nix b/nixpkgs/pkgs/tools/misc/hdf5/default.nix index 3c9c6169192d..dc2a1d284527 100644 --- a/nixpkgs/pkgs/tools/misc/hdf5/default.nix +++ b/nixpkgs/pkgs/tools/misc/hdf5/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchurl +, cmake , removeReferencesTo , cppSupport ? false , fortranSupport ? false @@ -34,10 +35,12 @@ stdenv.mkDerivation rec { + lib.optionalString threadsafe "-threadsafe"; src = fetchurl { - url = let + url = + let majorMinor = lib.versions.majorMinor version; majorMinorPatch = with lib.versions; "${major version}.${minor version}.${patch version}"; - in "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${majorMinor}/hdf5-${majorMinorPatch}/src/hdf5-${version}.tar.bz2"; + in + "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${majorMinor}/hdf5-${majorMinorPatch}/src/hdf5-${version}.tar.bz2"; sha256 = "sha256-6jxeJX7zIq9ed/weUurTrWvzu0rAZIDdF+45ANeiTPs="; }; @@ -57,7 +60,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; - nativeBuildInputs = [ removeReferencesTo ] + nativeBuildInputs = [ removeReferencesTo cmake ] ++ optional fortranSupport fortran; buildInputs = optional fortranSupport fortran @@ -67,24 +70,17 @@ stdenv.mkDerivation rec { propagatedBuildInputs = optional zlibSupport zlib ++ optional mpiSupport mpi; - 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" - # hdf5 hl (High Level) library is not considered stable with thread safety and should be disabled. - ++ optionals threadsafe [ "--enable-threadsafe" "--disable-hl" ]; - - patches = [ - # Avoid non-determinism in autoconf build system: - # - build time - # - build user - # - uname -a (kernel version) - # Can be dropped once/if we switch to cmake. - ./hdf5-more-determinism.patch - ]; + cmakeFlags = [ + "-DHDF5_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake" + ] ++ lib.optional cppSupport "-DHDF5_BUILD_CPP_LIB=ON" + ++ lib.optional fortranSupport "-DHDF5_BUILD_FORTRAN=ON" + ++ lib.optional szipSupport "-DHDF5_ENABLE_SZIP_SUPPORT=ON" + ++ lib.optionals mpiSupport [ "-DHDF5_ENABLE_PARALLEL=ON" "CC=${mpi}/bin/mpicc" ] + ++ lib.optional enableShared "-DBUILD_SHARED_LIBS=ON" + ++ lib.optional javaSupport "-DHDF5_BUILD_JAVA=ON" + ++ lib.optional usev110Api "-DDEFAULT_API_VERSION=v110" + ++ lib.optionals threadsafe [ "-DDHDF5_ENABLE_THREADSAFE:BOOL=ON" "-DHDF5_BUILD_HL_LIB=OFF" ] + ; postInstall = '' find "$out" -type f -exec remove-references-to -t ${stdenv.cc} '{}' + diff --git a/nixpkgs/pkgs/tools/misc/hdf5/hdf5-more-determinism.patch b/nixpkgs/pkgs/tools/misc/hdf5/hdf5-more-determinism.patch deleted file mode 100644 index 9a9bfe24af7b..000000000000 --- a/nixpkgs/pkgs/tools/misc/hdf5/hdf5-more-determinism.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in -index a4d4af6..70f1909 100644 ---- a/src/libhdf5.settings.in -+++ b/src/libhdf5.settings.in -@@ -4,10 +4,7 @@ - General Information: - ------------------- - HDF5 Version: @H5_VERSION@ -- Configured on: @CONFIG_DATE@ -- Configured by: @CONFIG_USER@ - Host system: @host_cpu@-@host_vendor@-@host_os@ -- Uname information: @UNAME_INFO@ - Byte sex: @BYTESEX@ - Installation point: @prefix@ - |