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
This commit is contained in:
Robert Scott 2024-02-11 13:30:26 +00:00 committed by GitHub
commit 5e8daf8461
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 162 additions and 75 deletions

View File

@ -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 ];
};
})

View File

@ -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 ];
};
})

View File

@ -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 {};
}

View File

@ -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 ];
};
}

View File

@ -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 = [

View File

@ -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;