diff options
author | Frederik Rietdijk <freddyrietdijk@fridh.nl> | 2017-07-01 10:38:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-01 10:38:36 +0200 |
commit | 9c05499de972ba3d990002cbdf2530d3b273a836 (patch) | |
tree | bea342a648cb20471efa83e23ab416a63ccaeed8 /pkgs/tools | |
parent | e071756043bab71432b800af0dd55805b80b0b76 (diff) | |
parent | 7b25d31825efa3a05ad76277c9042f86f918d5ef (diff) | |
download | nixlib-9c05499de972ba3d990002cbdf2530d3b273a836.tar nixlib-9c05499de972ba3d990002cbdf2530d3b273a836.tar.gz nixlib-9c05499de972ba3d990002cbdf2530d3b273a836.tar.bz2 nixlib-9c05499de972ba3d990002cbdf2530d3b273a836.tar.lz nixlib-9c05499de972ba3d990002cbdf2530d3b273a836.tar.xz nixlib-9c05499de972ba3d990002cbdf2530d3b273a836.tar.zst nixlib-9c05499de972ba3d990002cbdf2530d3b273a836.zip |
Merge pull request #26039 from knedlsepp/add-gdal-hdf4-support
gdal: Add hdf4 support
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/misc/hdf4/default.nix | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/pkgs/tools/misc/hdf4/default.nix b/pkgs/tools/misc/hdf4/default.nix new file mode 100644 index 000000000000..a227030f0bc4 --- /dev/null +++ b/pkgs/tools/misc/hdf4/default.nix @@ -0,0 +1,76 @@ +{ stdenv +, fetchurl +, cmake +, libjpeg +, szip +, zlib +}: + +stdenv.mkDerivation rec { + name = "hdf-${version}"; + version = "4.2.12"; + src = fetchurl { + url = "https://support.hdfgroup.org/ftp/HDF/releases/HDF${version}/src/hdf-${version}.tar.bz2"; + sha256 = "020jh563sjyxsgml8l809d2i1d4ms9shivwj3gbm7n0ilxbll8id"; + }; + + buildInputs = [ + cmake + libjpeg + szip + zlib + ]; + + preConfigure = "export SZIP_INSTALL=${szip}"; + + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + "-DBUILD_TESTING=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_SZIP_ENCODING=ON" + "-DHDF4_ENABLE_SZIP_SUPPORT=ON" + "-DHDF4_ENABLE_Z_LIB_SUPPORT=ON" + "-DHDF4_BUILD_FORTRAN=OFF" + "-DJPEG_DIR=${libjpeg}" + ]; + + doCheck = true; + + preCheck = '' + export LD_LIBRARY_PATH=$(pwd)/bin + '' + stdenv.lib.optionalString (stdenv.isDarwin) '' + export DYLD_LIBRARY_PATH=$(pwd)/bin + ''; + + excludedTests = [ + "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" + ''; + + meta = { + description = "Data model, library, and file format for storing and managing data"; + homepage = https://support.hdfgroup.org/products/hdf4/; + maintainers = with stdenv.lib.maintainers; [ knedlsepp ]; + platforms = stdenv.lib.platforms.unix; + }; +} |