diff options
| author | Robert Scott <code@humanleg.org.uk> | 2024-02-11 13:30:26 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-11 13:30:26 +0000 |
| commit | 5e8daf8461a49c3b41b972de7a106c6349831497 (patch) | |
| tree | 0446690c377a10bcdc5a78ff9814d4c9c2d6f9e8 | |
| parent | Merge pull request #286905 from r-ryantm/auto-update/cpp-utilities (diff) | |
| parent | python3Packages.blosc2: 2.3.2 -> 2.5.1, use system c-blosc2 (diff) | |
| download | nixpkgs-5e8daf8461a49c3b41b972de7a106c6349831497.tar.gz | |
Merge pull request #287081 from risicle/ris-c-blosc-2.13.2
c-blosc2: init at 2.13.2, python3Packages.blosc2: 2.3.2 -> 2.5.1
| -rw-r--r-- | pkgs/development/libraries/c-blosc/1.nix | 69 | ||||
| -rw-r--r-- | pkgs/development/libraries/c-blosc/2.nix | 71 | ||||
| -rw-r--r-- | pkgs/development/libraries/c-blosc/default.nix | 73 | ||||
| -rw-r--r-- | pkgs/development/python-modules/blosc2/default.nix | 19 | ||||
| -rw-r--r-- | pkgs/development/python-modules/tables/default.nix | 2 | ||||
| -rw-r--r-- | pkgs/top-level/all-packages.nix | 3 |
6 files changed, 162 insertions, 75 deletions
diff --git a/pkgs/development/libraries/c-blosc/1.nix b/pkgs/development/libraries/c-blosc/1.nix new file mode 100644 index 000000000000..1060e44af075 --- /dev/null +++ b/pkgs/development/libraries/c-blosc/1.nix @@ -0,0 +1,69 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, testers + +, static ? stdenv.hostPlatform.isStatic + +, lz4 +, zlib +, zstd +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "c-blosc"; + version = "1.21.5"; + + src = fetchFromGitHub { + owner = "Blosc"; + repo = "c-blosc"; + rev = "v${finalAttrs.version}"; + sha256 = "sha256-bz922lWiap3vMy8qS9dmXa8zUg5NJlg0bx3+/xz7QAk="; + }; + + # https://github.com/NixOS/nixpkgs/issues/144170 + postPatch = '' + sed -i -E \ + -e '/^libdir[=]/clibdir=@CMAKE_INSTALL_FULL_LIBDIR@' \ + -e '/^includedir[=]/cincludedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@' \ + blosc.pc.in + ''; + + nativeBuildInputs = [ cmake ]; + + buildInputs = [ + lz4 + zlib + zstd + ]; + + cmakeFlags = [ + "-DBUILD_STATIC=${if static then "ON" else "OFF"}" + "-DBUILD_SHARED=${if static then "OFF" else "ON"}" + + "-DPREFER_EXTERNAL_LZ4=ON" + "-DPREFER_EXTERNAL_ZLIB=ON" + "-DPREFER_EXTERNAL_ZSTD=ON" + + "-DBUILD_EXAMPLES=OFF" + "-DBUILD_BENCHMARKS=OFF" + "-DBUILD_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" + ]; + + doCheck = !static; + + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + + meta = with lib; { + description = "A blocking, shuffling and loss-less compression library"; + homepage = "https://www.blosc.org"; + changelog = "https://github.com/Blosc/c-blosc/releases/tag/v${version}"; + pkgConfigModules = [ + "blosc" + ]; + license = licenses.bsd3; + platforms = platforms.all; + maintainers = with maintainers; [ ris ]; + }; +}) diff --git a/pkgs/development/libraries/c-blosc/2.nix b/pkgs/development/libraries/c-blosc/2.nix new file mode 100644 index 000000000000..a431b7f59a85 --- /dev/null +++ b/pkgs/development/libraries/c-blosc/2.nix @@ -0,0 +1,71 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, testers + +, static ? stdenv.hostPlatform.isStatic + +, lz4 +, zlib-ng +, zstd +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "c-blosc2"; + version = "2.13.2"; + + src = fetchFromGitHub { + owner = "Blosc"; + repo = "c-blosc2"; + rev = "v${finalAttrs.version}"; + sha256 = "sha256-RNIvg6p/+brW7oboTDH0bbRfIQDaZwtZbbWFbftfWTk="; + }; + + # https://github.com/NixOS/nixpkgs/issues/144170 + postPatch = '' + sed -i -E \ + -e '/^libdir[=]/clibdir=@CMAKE_INSTALL_FULL_LIBDIR@' \ + -e '/^includedir[=]/cincludedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@' \ + blosc2.pc.in + ''; + + nativeBuildInputs = [ cmake ]; + + buildInputs = [ + lz4 + zlib-ng + zstd + ]; + + cmakeFlags = [ + "-DBUILD_STATIC=${if static then "ON" else "OFF"}" + "-DBUILD_SHARED=${if static then "OFF" else "ON"}" + + "-DPREFER_EXTERNAL_LZ4=ON" + "-DPREFER_EXTERNAL_ZLIB=ON" + "-DPREFER_EXTERNAL_ZSTD=ON" + + "-DBUILD_EXAMPLES=OFF" + "-DBUILD_BENCHMARKS=OFF" + "-DBUILD_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" + ]; + + doCheck = !static; + # possibly https://github.com/Blosc/c-blosc2/issues/432 + enableParallelChecking = false; + + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + + meta = with lib; { + description = "A fast, compressed, persistent binary data store library for C"; + homepage = "https://www.blosc.org"; + changelog = "https://github.com/Blosc/c-blosc2/releases/tag/v${version}"; + pkgConfigModules = [ + "blosc2" + ]; + license = licenses.bsd3; + platforms = platforms.all; + maintainers = with maintainers; [ ris ]; + }; +}) diff --git a/pkgs/development/libraries/c-blosc/default.nix b/pkgs/development/libraries/c-blosc/default.nix index 1060e44af075..4ebe3622af4c 100644 --- a/pkgs/development/libraries/c-blosc/default.nix +++ b/pkgs/development/libraries/c-blosc/default.nix @@ -1,69 +1,4 @@ -{ lib -, stdenv -, fetchFromGitHub -, cmake -, testers - -, static ? stdenv.hostPlatform.isStatic - -, lz4 -, zlib -, zstd -}: - -stdenv.mkDerivation (finalAttrs: { - pname = "c-blosc"; - version = "1.21.5"; - - src = fetchFromGitHub { - owner = "Blosc"; - repo = "c-blosc"; - rev = "v${finalAttrs.version}"; - sha256 = "sha256-bz922lWiap3vMy8qS9dmXa8zUg5NJlg0bx3+/xz7QAk="; - }; - - # https://github.com/NixOS/nixpkgs/issues/144170 - postPatch = '' - sed -i -E \ - -e '/^libdir[=]/clibdir=@CMAKE_INSTALL_FULL_LIBDIR@' \ - -e '/^includedir[=]/cincludedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@' \ - blosc.pc.in - ''; - - nativeBuildInputs = [ cmake ]; - - buildInputs = [ - lz4 - zlib - zstd - ]; - - cmakeFlags = [ - "-DBUILD_STATIC=${if static then "ON" else "OFF"}" - "-DBUILD_SHARED=${if static then "OFF" else "ON"}" - - "-DPREFER_EXTERNAL_LZ4=ON" - "-DPREFER_EXTERNAL_ZLIB=ON" - "-DPREFER_EXTERNAL_ZSTD=ON" - - "-DBUILD_EXAMPLES=OFF" - "-DBUILD_BENCHMARKS=OFF" - "-DBUILD_TESTS=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" - ]; - - doCheck = !static; - - passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - - meta = with lib; { - description = "A blocking, shuffling and loss-less compression library"; - homepage = "https://www.blosc.org"; - changelog = "https://github.com/Blosc/c-blosc/releases/tag/v${version}"; - pkgConfigModules = [ - "blosc" - ]; - license = licenses.bsd3; - platforms = platforms.all; - maintainers = with maintainers; [ ris ]; - }; -}) +{ callPackage }: { + c-blosc = callPackage ./1.nix {}; + c-blosc2 = callPackage ./2.nix {}; +} diff --git a/pkgs/development/python-modules/blosc2/default.nix b/pkgs/development/python-modules/blosc2/default.nix index 1bc55fbdcf0a..d960139a7d6e 100644 --- a/pkgs/development/python-modules/blosc2/default.nix +++ b/pkgs/development/python-modules/blosc2/default.nix @@ -7,10 +7,14 @@ , cython_3 , ninja , oldest-supported-numpy +, pkg-config , scikit-build , setuptools , wheel +# c library +, c-blosc2 + # propagates , msgpack , ndindex @@ -26,15 +30,14 @@ buildPythonPackage rec { pname = "blosc2"; - version = "2.3.2"; - format = "pyproject"; + version = "2.5.1"; + pyproject = true; src = fetchFromGitHub { owner = "Blosc"; repo = "python-blosc2"; rev = "refs/tags/v${version}"; - fetchSubmodules = true; - hash = "sha256-tRcyntJlmLPbqnX7nzdBQ/50uXy0fVLb2YGVOIwJjxU="; + hash = "sha256-yBgnNJU1q+FktIkpQn74LuRP19Ta/fNC60Z8TxzlWPk="; }; postPatch = '' @@ -47,12 +50,16 @@ buildPythonPackage rec { cython_3 ninja oldest-supported-numpy + pkg-config scikit-build setuptools wheel ]; + buildInputs = [ c-blosc2 ]; + dontUseCmakeConfigure = true; + env.CMAKE_ARGS = "-DUSE_SYSTEM_BLOSC2:BOOL=YES"; propagatedBuildInputs = [ msgpack @@ -68,11 +75,13 @@ buildPythonPackage rec { torch ]; + passthru.c-blosc2 = c-blosc2; + meta = with lib; { description = "Python wrapper for the extremely fast Blosc2 compression library"; homepage = "https://github.com/Blosc/python-blosc2"; changelog = "https://github.com/Blosc/python-blosc2/releases/tag/v${version}"; license = licenses.bsd3; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ ris ]; }; } diff --git a/pkgs/development/python-modules/tables/default.nix b/pkgs/development/python-modules/tables/default.nix index 70a6f86231e8..fd034b209133 100644 --- a/pkgs/development/python-modules/tables/default.nix +++ b/pkgs/development/python-modules/tables/default.nix @@ -41,6 +41,7 @@ buildPythonPackage rec { buildInputs = [ bzip2 c-blosc + blosc2.c-blosc2 hdf5 lzo ]; @@ -75,6 +76,7 @@ buildPythonPackage rec { "--lzo=${lib.getDev lzo}" "--bzip2=${lib.getDev bzip2}" "--blosc=${lib.getDev c-blosc}" + "--blosc2=${lib.getDev blosc2.c-blosc2}" ]; nativeCheckInputs = [ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9f90f3168a48..e6a31b7f7699 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20626,7 +20626,8 @@ with pkgs; withCMake = false; }; - c-blosc = callPackage ../development/libraries/c-blosc { }; + inherit (callPackages ../development/libraries/c-blosc { }) + c-blosc c-blosc2; cachix = lib.getBin haskellPackages.cachix; |
