nixpkgs/pkgs/tools/misc/hdf4/default.nix

82 lines
1.9 KiB
Nix
Raw Normal View History

2017-05-23 19:53:04 +01:00
{ stdenv
, fetchpatch
2017-05-23 19:53:04 +01:00
, fetchurl
, cmake
, libjpeg
, zlib
2017-07-05 15:12:50 +01:00
, szip ? null
2017-05-23 19:53:04 +01:00
}:
stdenv.mkDerivation rec {
pname = "hdf";
2020-10-15 22:55:55 +01:00
version = "4.2.15";
2017-05-23 19:53:04 +01:00
src = fetchurl {
url = "https://support.hdfgroup.org/ftp/HDF/releases/HDF${version}/src/hdf-${version}.tar.bz2";
2020-10-15 22:55:55 +01:00
sha256 = "04nbgfxyj5jg4d6sr28162cxbfwqgv0sa7vz1ayzvm8wbbpkbq5x";
2017-05-23 19:53:04 +01:00
};
2020-10-15 22:55:55 +01:00
nativeBuildInputs = [
cmake
];
2017-05-23 19:53:04 +01:00
buildInputs = [
libjpeg
szip
zlib
];
2017-07-05 15:12:50 +01:00
preConfigure = stdenv.lib.optionalString (szip != null) "export SZIP_INSTALL=${szip}";
2017-05-23 19:53:04 +01:00
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DHDF4_BUILD_TOOLS=ON"
"-DHDF4_BUILD_UTILS=ON"
"-DHDF4_BUILD_WITH_INSTALL_NAME=OFF"
"-DHDF4_ENABLE_JPEG_LIB_SUPPORT=ON"
"-DHDF4_ENABLE_NETCDF=OFF"
"-DHDF4_ENABLE_Z_LIB_SUPPORT=ON"
"-DHDF4_BUILD_FORTRAN=OFF"
"-DJPEG_DIR=${libjpeg}"
2017-07-05 15:12:50 +01:00
] ++ stdenv.lib.optionals (szip != null) [
"-DHDF4_ENABLE_SZIP_ENCODING=ON"
"-DHDF4_ENABLE_SZIP_SUPPORT=ON"
2017-05-23 19:53:04 +01:00
];
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH=$(pwd)/bin
'' + stdenv.lib.optionalString (stdenv.isDarwin) ''
export DYLD_LIBRARY_PATH=$(pwd)/bin
'';
2019-05-06 19:52:16 +01:00
excludedTests = stdenv.lib.optionals stdenv.isDarwin [
2017-05-23 19:53:04 +01:00
"MFHDF_TEST-hdftest"
"MFHDF_TEST-hdftest-shared"
"HDP-dumpsds-18"
"NC_TEST-nctest"
];
checkPhase = let excludedTestsRegex = if (excludedTests != [])
then "(" + (stdenv.lib.concatStringsSep "|" excludedTests) + ")"
else ""; in ''
runHook preCheck
ctest -E "${excludedTestsRegex}" --output-on-failure
runHook postCheck
'';
outputs = [ "bin" "dev" "out" ];
postInstall = ''
moveToOutput bin "$bin"
'';
2020-06-11 10:37:41 +01:00
meta = with stdenv.lib; {
2017-05-23 19:53:04 +01:00
description = "Data model, library, and file format for storing and managing data";
homepage = "https://support.hdfgroup.org/products/hdf4/";
2020-06-11 10:37:41 +01:00
maintainers = with maintainers; [ knedlsepp ];
platforms = platforms.unix;
license = licenses.bsdOriginal;
2017-05-23 19:53:04 +01:00
};
}