Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions pkgs/development/libraries/c-blosc/1.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
})
71 changes: 71 additions & 0 deletions pkgs/development/libraries/c-blosc/2.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
})
73 changes: 4 additions & 69 deletions pkgs/development/libraries/c-blosc/default.nix
Original file line number Diff line number Diff line change
@@ -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 {};
}
19 changes: 14 additions & 5 deletions pkgs/development/python-modules/blosc2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
, cython_3
, ninja
, oldest-supported-numpy
, pkg-config
, scikit-build
, setuptools
, wheel

# c library
, c-blosc2

# propagates
, msgpack
, ndindex
Expand All @@ -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 = ''
Expand All @@ -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
Expand All @@ -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 ];
};
}
2 changes: 2 additions & 0 deletions pkgs/development/python-modules/tables/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ buildPythonPackage rec {
buildInputs = [
bzip2
c-blosc
blosc2.c-blosc2
hdf5
lzo
];
Expand Down Expand Up @@ -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 = [
Expand Down
3 changes: 2 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20613,7 +20613,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;

Expand Down