1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 py-cpuinfo,
7 h5py,
8 pkgconfig,
9 c-blosc2,
10 charls,
11 lz4,
12 zlib,
13 zstd,
14}:
15
16buildPythonPackage rec {
17 pname = "hdf5plugin";
18 version = "5.1.0";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "silx-kit";
23 repo = "hdf5plugin";
24 tag = "v${version}";
25 hash = "sha256-12OWsNZfKToNLyokNrwgPc7WRISJI4nRA0J/zwgCZwI=";
26 };
27
28 build-system = [
29 setuptools
30 py-cpuinfo
31 pkgconfig # only needed if HDF5PLUGIN_SYSTEM_LIBRARIES is used
32 ];
33
34 dependencies = [ h5py ];
35
36 buildInputs = [
37 #c-blosc
38 c-blosc2
39 # bzip2_1_1
40 charls
41 lz4
42 # snappy
43 # zfp
44 zlib
45 zstd
46 ];
47
48 # opt-in to use use system libs instead
49 env.HDF5PLUGIN_SYSTEM_LIBRARIES = lib.concatStringsSep "," [
50 #"blosc" # AssertionError: 4000 not less than 4000
51 "blosc2"
52 # "bz2" # only works with bzip2_1_1
53 "charls"
54 "lz4"
55 # "snappy" # snappy tests fail
56 # "sperr" # not packaged?
57 # "zfp" # pkgconfig: (lib)zfp not found
58 "zlib"
59 "zstd"
60 ];
61
62 checkPhase = ''
63 python test/test.py
64 '';
65
66 pythonImportsCheck = [ "hdf5plugin" ];
67
68 preBuild = ''
69 mkdir src/hdf5plugin/plugins
70 '';
71
72 meta = with lib; {
73 description = "Additional compression filters for h5py";
74 longDescription = ''
75 hdf5plugin provides HDF5 compression filters and makes them usable from h5py.
76 Supported encodings: Blosc, Blosc2, BitShuffle, BZip2, FciDecomp, LZ4, SZ, SZ3, Zfp, ZStd
77 '';
78 homepage = "http://www.silx.org/doc/hdf5plugin/latest/";
79 license = licenses.mit;
80 maintainers = with maintainers; [ pbsds ];
81 };
82}