diff options
author | Phillip Seeber <phillip.seeber@uni-jena.de> | 2023-09-11 11:03:46 +0200 |
---|---|---|
committer | Phillip Seeber <phillip.seeber@uni-jena.de> | 2023-09-15 13:21:33 +0200 |
commit | cbd4d659e34c27cae5f48d7fdf6b2863f6492e6f (patch) | |
tree | a0f090bdffa450c2cb48be0b4d66a4af36e66ef8 /pkgs/tools/misc/hdf5/default.nix | |
parent | 65bc8eea630a6c38601d53de87f8d54104fd7e33 (diff) |
hdf5: switch to cmake build
Diffstat (limited to 'pkgs/tools/misc/hdf5/default.nix')
-rw-r--r-- | pkgs/tools/misc/hdf5/default.nix | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix index 3c9c6169192d8..dc2a1d284527a 100644 --- a/pkgs/tools/misc/hdf5/default.nix +++ b/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} '{}' + |