diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-03-24 11:04:41 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-03-24 11:04:41 +0100 |
commit | 5423cabbbf2b6dec5568f1ecabd288d5d9a642ec (patch) | |
tree | f316a6a921bfefd3a63bd4502c2eb50ff1644f67 /nixpkgs/pkgs/tools/misc/hdf5/default.nix | |
parent | 46a88117a05c3469af5d99433af140c3de8ca088 (diff) | |
parent | 8aa81f34981add12aecada6c702ddbbd0375ca36 (diff) | |
download | nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.gz nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.bz2 nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.lz nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.xz nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.zst nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.zip |
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/hdf5/default.nix')
-rw-r--r-- | nixpkgs/pkgs/tools/misc/hdf5/default.nix | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/tools/misc/hdf5/default.nix b/nixpkgs/pkgs/tools/misc/hdf5/default.nix index ba00746c08f9..c6855a47f8e6 100644 --- a/nixpkgs/pkgs/tools/misc/hdf5/default.nix +++ b/nixpkgs/pkgs/tools/misc/hdf5/default.nix @@ -3,7 +3,7 @@ , fetchurl , cmake , removeReferencesTo -, cppSupport ? false +, cppSupport ? true , fortranSupport ? false , fortran , zlibSupport ? true @@ -13,6 +13,7 @@ , mpiSupport ? false , mpi , enableShared ? !stdenv.hostPlatform.isStatic +, enableStatic ? stdenv.hostPlatform.isStatic , javaSupport ? false , jdk , usev110Api ? false @@ -58,7 +59,7 @@ stdenv.mkDerivation rec { ; }; - outputs = [ "out" "dev" ]; + outputs = [ "out" "dev" "bin" ]; nativeBuildInputs = [ removeReferencesTo cmake ] ++ optional fortranSupport fortran; @@ -72,6 +73,7 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DHDF5_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake" + "-DBUILD_STATIC_LIBS=${lib.boolToString enableStatic}" ] ++ lib.optional stdenv.isDarwin "-DHDF5_BUILD_WITH_INSTALL_NAME=ON" ++ lib.optional cppSupport "-DHDF5_BUILD_CPP_LIB=ON" ++ lib.optional fortranSupport "-DHDF5_BUILD_FORTRAN=ON" @@ -85,10 +87,22 @@ stdenv.mkDerivation rec { postInstall = '' find "$out" -type f -exec remove-references-to -t ${stdenv.cc} '{}' + + moveToOutput 'bin/' "''${!outputBin}" moveToOutput 'bin/h5cc' "''${!outputDev}" moveToOutput 'bin/h5c++' "''${!outputDev}" moveToOutput 'bin/h5fc' "''${!outputDev}" moveToOutput 'bin/h5pcc' "''${!outputDev}" + moveToOutput 'bin/h5hlcc' "''${!outputDev}" + moveToOutput 'bin/h5hlc++' "''${!outputDev}" + '' + lib.optionalString enableShared + # The shared build creates binaries with -shared suffixes, + # so we remove these suffixes. + '' + pushd ''${!outputBin}/bin + for file in *-shared; do + mv "$file" "''${file%%-shared}" + done + popd ''; enableParallelBuilding = true; |