From 65a8685443af217d206ed9afabbc6c46c22f73fc Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Sun, 31 May 2026 17:31:47 +0300 Subject: [PATCH] python3Packages.hdf5plugin: build ZFP filter against system zfp H5Z-ZFP needs an 8-bit bitstream word for byte-portable data, so use a zfp built with bitStreamWordSize=8. zfp ships only a CMake config, so synthesise the pkg-config module hdf5plugin probes for. Assisted-by: claude-code with claude-opus-4-8[1m]-high --- .../python-modules/hdf5plugin/default.nix | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/hdf5plugin/default.nix b/pkgs/development/python-modules/hdf5plugin/default.nix index 60b14a8e4100..a52e339e0630 100644 --- a/pkgs/development/python-modules/hdf5plugin/default.nix +++ b/pkgs/development/python-modules/hdf5plugin/default.nix @@ -11,6 +11,7 @@ bzip2, charls, lz4, + zfp, zlib, zstd, stdenv, @@ -22,6 +23,8 @@ let c-blosc' = c-blosc.override { snappySupport = true; }; + # H5Z-ZFP needs an 8-bit bitstream word so the compressed HDF5 data is byte-portable + zfp' = zfp.override { bitStreamWordSize = 8; }; in buildPythonPackage (finalAttrs: { pname = "hdf5plugin"; @@ -49,7 +52,7 @@ buildPythonPackage (finalAttrs: { bzip2 charls lz4 - # zfp + zfp' zlib zstd ]; @@ -62,7 +65,7 @@ buildPythonPackage (finalAttrs: { "charls" "lz4" # "sperr" # not packaged? - # "zfp" # pkgconfig: (lib)zfp not found + "zfp" "zlib" "zstd" ]; @@ -86,9 +89,18 @@ buildPythonPackage (finalAttrs: { preBuild = '' mkdir src/hdf5plugin/plugins - mkdir -p pkg-config-bz2 - ln -s ${lib.getDev bzip2}/lib/pkgconfig/bzip2.pc pkg-config-bz2/bz2.pc - export PKG_CONFIG_PATH="$PWD/pkg-config-bz2''${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" + mkdir -p pkg-config + ln -s ${lib.getDev bzip2}/lib/pkgconfig/bzip2.pc pkg-config/bz2.pc + # zfp ships only a CMake config; synthesise the pkg-config module hdf5plugin probes for + { + echo "includedir=${lib.getDev zfp'}/include" + echo "Name: zfp" + echo "Version: ${zfp'.version}" + echo "Description: zfp" + echo "Libs: -L${lib.getLib zfp'}/lib -lzfp" + echo "Cflags: -I${lib.getDev zfp'}/include" + } > pkg-config/zfp.pc + export PKG_CONFIG_PATH="$PWD/pkg-config''${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" ''; meta = {