diff options
author | John Ericson <git@JohnEricson.me> | 2021-01-14 17:03:07 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-14 17:03:07 -0500 |
commit | 3d9a14f76cfa7bc2eeed35563b618f672f7fdff2 (patch) | |
tree | 88370a44edd6252bb89b837ca7fd370dfb7d60f2 | |
parent | 3893d6c6d76ca2b51ef3694a6c0f27dc8eb01ef5 (diff) | |
parent | 741aab97c441369bde826bf685e4395ee16460d7 (diff) |
Merge pull request #109326 from HectorAE/hdf5-blosc-init
hdf5-blosc: init at 1.0.0
-rw-r--r-- | pkgs/development/libraries/hdf5-blosc/blosc_filter.pc.in | 13 | ||||
-rw-r--r-- | pkgs/development/libraries/hdf5-blosc/default.nix | 39 | ||||
-rw-r--r-- | pkgs/development/libraries/hdf5-blosc/no-external-blosc.patch | 26 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
4 files changed, 80 insertions, 0 deletions
diff --git a/pkgs/development/libraries/hdf5-blosc/blosc_filter.pc.in b/pkgs/development/libraries/hdf5-blosc/blosc_filter.pc.in new file mode 100644 index 000000000000..04e29515d9b1 --- /dev/null +++ b/pkgs/development/libraries/hdf5-blosc/blosc_filter.pc.in @@ -0,0 +1,13 @@ +prefix=@out@ +includedir=${prefix}/include +libdir=${prefix}/lib + +Name: blosc_filter +Description: Blosc Filter +URL: http://blosc.org/ +Version: @version@ +Requires: \ + blosc \ + hdf5 +Cflags: -isystem${includedir} +Libs: -L${libdir} -Wl,-rpath,${libdir} -lblosc_filter diff --git a/pkgs/development/libraries/hdf5-blosc/default.nix b/pkgs/development/libraries/hdf5-blosc/default.nix new file mode 100644 index 000000000000..ebce203125c6 --- /dev/null +++ b/pkgs/development/libraries/hdf5-blosc/default.nix @@ -0,0 +1,39 @@ +{ stdenv, c-blosc, cmake, hdf5, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "hdf5-blosc"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "Blosc"; + repo = pname; + rev = "v${version}"; + sha256 = "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs"; + }; + + patches = [ ./no-external-blosc.patch ]; + + outputs = [ "out" "dev" "plugin" ]; + + buildInputs = [ c-blosc cmake hdf5 ]; + + preConfigure = '' + substituteInPlace CMakeLists.txt --replace 'set(BLOSC_INSTALL_DIR "''${CMAKE_CURRENT_BINARY_DIR}/blosc")' 'set(BLOSC_INSTALL_DIR "${c-blosc}")' + ''; + + cmakeFlags = [ + "-DPLUGIN_INSTALL_PATH=${placeholder "plugin"}/hdf5/lib/plugin" + ]; + + postInstall = '' + mkdir -p $out/lib/pkgconfig + substituteAll ${./blosc_filter.pc.in} $out/lib/pkgconfig/blosc_filter.pc + ''; + + meta = with stdenv.lib; { + description = "Filter for HDF5 that uses the Blosc compressor"; + homepage = "https://github.com/Blosc/hdf5-blosc"; + license = licenses.mit; + maintainers = with maintainers; [ bhipple ]; + }; +} diff --git a/pkgs/development/libraries/hdf5-blosc/no-external-blosc.patch b/pkgs/development/libraries/hdf5-blosc/no-external-blosc.patch new file mode 100644 index 000000000000..8f2bd8579ed8 --- /dev/null +++ b/pkgs/development/libraries/hdf5-blosc/no-external-blosc.patch @@ -0,0 +1,26 @@ +--- a/CMakeLists.txt 2019-10-11 12:12:27.445417039 -0400 ++++ b/CMakeLists.txt 2019-10-11 12:27:26.630691742 -0400 +@@ -22,14 +22,6 @@ + message("BLOSC_CMAKE_ARGS='${BLOSC_CMAKE_ARGS}'") + message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'") + +-ExternalProject_Add(project_blosc +- PREFIX ${BLOSC_PREFIX} +- GIT_REPOSITORY https://github.com/Blosc/c-blosc.git +- INSTALL_DIR ${BLOSC_INSTALL_DIR} +- CMAKE_ARGS ${BLOSC_CMAKE_ARGS} +-) +- +- + # sources + set(SOURCES src/blosc_filter.c) + set(PLUGIN_SOURCES src/blosc_filter.c src/blosc_plugin.c ) +@@ -53,7 +45,6 @@ + # add blosc libraries + add_library(blosc_shared SHARED IMPORTED) + set_property(TARGET blosc_shared PROPERTY IMPORTED_LOCATION ${BLOSC_INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}blosc${CMAKE_SHARED_LIBRARY_SUFFIX}) +-add_dependencies(blosc_shared project_blosc) + include_directories(${BLOSC_INSTALL_DIR}/include) + + add_library(blosc_filter_shared SHARED ${SOURCES}) + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 001880bbb3ed..aedbddf12697 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4957,6 +4957,8 @@ in configureFlags = oldAttrs.configureFlags ++ ["--enable-threadsafe" "--disable-hl" ]; })); + hdf5-blosc = callPackage ../development/libraries/hdf5-blosc { }; + hdfview = callPackage ../tools/misc/hdfview { javac = jdk8; # TODO: https://github.com/NixOS/nixpkgs/pull/89731 }; |