summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/hdf5plugin/default.nix
blob: 935fa2f65dc8ce5f0f5571d57d32e3ea935d80f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  py-cpuinfo,
  h5py,
  pkgconfig,
  c-blosc2,
  charls,
  lz4,
  zlib,
  zstd,
}:

buildPythonPackage rec {
  pname = "hdf5plugin";
  version = "5.1.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "silx-kit";
    repo = "hdf5plugin";
    tag = "v${version}";
    hash = "sha256-12OWsNZfKToNLyokNrwgPc7WRISJI4nRA0J/zwgCZwI=";
  };

  build-system = [
    setuptools
    py-cpuinfo
    pkgconfig # only needed if HDF5PLUGIN_SYSTEM_LIBRARIES is used
  ];

  dependencies = [ h5py ];

  buildInputs = [
    #c-blosc
    c-blosc2
    # bzip2_1_1
    charls
    lz4
    # snappy
    # zfp
    zlib
    zstd
  ];

  # opt-in to use use system libs instead
  env.HDF5PLUGIN_SYSTEM_LIBRARIES = lib.concatStringsSep "," [
    #"blosc" # AssertionError: 4000 not less than 4000
    "blosc2"
    # "bz2" # only works with bzip2_1_1
    "charls"
    "lz4"
    # "snappy" # snappy tests fail
    # "sperr" # not packaged?
    # "zfp" #  pkgconfig: (lib)zfp not found
    "zlib"
    "zstd"
  ];

  checkPhase = ''
    python test/test.py
  '';

  pythonImportsCheck = [ "hdf5plugin" ];

  preBuild = ''
    mkdir src/hdf5plugin/plugins
  '';

  meta = {
    description = "Additional compression filters for h5py";
    longDescription = ''
      hdf5plugin provides HDF5 compression filters and makes them usable from h5py.
      Supported encodings: Blosc, Blosc2, BitShuffle, BZip2, FciDecomp, LZ4, SZ, SZ3, Zfp, ZStd
    '';
    homepage = "http://www.silx.org/doc/hdf5plugin/latest/";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ pbsds ];
  };
}