2017-05-23 18:53:04 +00:00
|
|
|
{ stdenv
|
2018-09-23 21:56:58 +00:00
|
|
|
, fetchpatch
|
2017-05-23 18:53:04 +00:00
|
|
|
, fetchurl
|
|
|
|
, cmake
|
|
|
|
, libjpeg
|
|
|
|
, zlib
|
2017-07-05 14:12:50 +00:00
|
|
|
, szip ? null
|
2017-05-23 18:53:04 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "hdf";
|
2018-07-14 21:02:59 +00:00
|
|
|
version = "4.2.14";
|
2017-05-23 18:53:04 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://support.hdfgroup.org/ftp/HDF/releases/HDF${version}/src/hdf-${version}.tar.bz2";
|
2018-07-14 21:02:59 +00:00
|
|
|
sha256 = "0n29klrrbwan9307np0d9hr128dlpc4nnlf57a140080ll3jmp8l";
|
2017-05-23 18:53:04 +00:00
|
|
|
};
|
|
|
|
|
2018-09-23 21:56:58 +00:00
|
|
|
patches = let
|
|
|
|
# The Debian patch revision to fetch from; this may differ from our package
|
|
|
|
# version, but older patches should still apply.
|
|
|
|
patchRev = "4.2.13-4";
|
|
|
|
getPatch = name: sha256: fetchpatch {
|
|
|
|
inherit sha256;
|
|
|
|
url = "https://salsa.debian.org/debian-gis-team/hdf4/raw/debian/${patchRev}/debian/patches/${name}";
|
|
|
|
};
|
|
|
|
|
|
|
|
in [
|
|
|
|
(getPatch "64bit" "1xqk9zpch4m6ipa0f3x2cm8rwaz4p0ppp1vqglvz18j6q91p8b5y")
|
|
|
|
(getPatch "hdfi.h" "01fr9csylnvk9jd9jn9y23bvxy192s07p32pr76mm3gwhgs9h7r4")
|
|
|
|
(getPatch "hdf-4.2.10-aarch64.patch" "1hl0xw5pd9xhpq49xpwgg7c4z6vv5p19x6qayixw0myvgwj1r4zn")
|
|
|
|
(getPatch "reproducible-builds.patch" "02j639w26xkxpxx3pdhbi18ywz8w3qmjpqjb83n47gq29y4g13hc")
|
|
|
|
];
|
|
|
|
|
2017-05-23 18:53:04 +00:00
|
|
|
buildInputs = [
|
|
|
|
cmake
|
|
|
|
libjpeg
|
|
|
|
szip
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
2017-07-05 14:12:50 +00:00
|
|
|
preConfigure = stdenv.lib.optionalString (szip != null) "export SZIP_INSTALL=${szip}";
|
2017-05-23 18:53:04 +00: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 14:12:50 +00:00
|
|
|
] ++ stdenv.lib.optionals (szip != null) [
|
|
|
|
"-DHDF4_ENABLE_SZIP_ENCODING=ON"
|
|
|
|
"-DHDF4_ENABLE_SZIP_SUPPORT=ON"
|
2017-05-23 18:53:04 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export LD_LIBRARY_PATH=$(pwd)/bin
|
|
|
|
'' + stdenv.lib.optionalString (stdenv.isDarwin) ''
|
|
|
|
export DYLD_LIBRARY_PATH=$(pwd)/bin
|
|
|
|
'';
|
|
|
|
|
2019-05-06 18:52:16 +00:00
|
|
|
excludedTests = stdenv.lib.optionals stdenv.isDarwin [
|
2017-05-23 18:53:04 +00: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 09:37:41 +00:00
|
|
|
meta = with stdenv.lib; {
|
2017-05-23 18:53:04 +00:00
|
|
|
description = "Data model, library, and file format for storing and managing data";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://support.hdfgroup.org/products/hdf4/";
|
2020-06-11 09:37:41 +00:00
|
|
|
maintainers = with maintainers; [ knedlsepp ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.bsdOriginal;
|
2017-05-23 18:53:04 +00:00
|
|
|
};
|
|
|
|
}
|