summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pylibjpeg-rle/default.nix
blob: 250a0ee91c375bd370d29c6f0d47bd9d00beb3a2 (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  cargo,
  rustPlatform,
  rustc,
  numpy,
  pydicom,
  pylibjpeg-data,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "pylibjpeg-rle";
  version = "2.2.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "pydicom";
    repo = "pylibjpeg-rle";
    tag = "v${version}";
    hash = "sha256-hAtseH4akBCKhlWsPGXeQRYUK0BiytFrLFCmeg7nUXY=";
  };

  cargoDeps = rustPlatform.fetchCargoVendor {
    inherit pname version src;
    hash = "sha256-QprjrR/AelrC+6n7uWZicO9QH0OAJCR7DSE1JuQOMCI=";
  };

  build-system = [
    cargo
    rustPlatform.cargoSetupHook
    rustPlatform.maturinBuildHook
    rustc
  ];

  dependencies = [
    numpy
  ];

  nativeCheckInputs = [
    pydicom
    pylibjpeg-data
    pytestCheckHook
  ];

  preCheck = ''
    mv rle/tests .
    rm -r rle
  '';

  pythonImportsCheck = [
    "rle"
    "rle.rle"
    "rle.utils"
  ];

  meta = {
    description = "Fast DICOM RLE plugin for pylibjpeg";
    homepage = "https://github.com/pydicom/pylibjpeg-rle";
    changelog = "https://github.com/pydicom/pylibjpeg-rle/releases/tag/${src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ bcdarwin ];
  };
}