Unverified Commit 8b1d6772 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

python313Packages.pylibjpeg-rle: init at 2.1.0 (#434880)

parents 5ff851bb 834b4478
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ buildPythonPackage rec {
      pillow
      pyjpegls
      #pylibjpeg.optional-dependencies.openjpeg # infinite recursion
      #pylibjpeg.optional-dependencies.rle # not in nixpkgs
      #pylibjpeg.optional-dependencies.rle # infinite recursion
      pylibjpeg-libjpeg
      gdcm
    ];
+66 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  cargo,
  rustPlatform,
  rustc,
  numpy,
  pydicom,
  pylibjpeg-data,
  pytestCheckHook,
}:

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

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

  cargoDeps = rustPlatform.fetchCargoVendor {
    inherit pname version src;
    hash = "sha256-ZkaDnG7wXQeaefASdsUFxuDKxjLukczyJeUgfG9uIyo=";
  };

  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 ];
  };
}
+10 −5
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
  pylibjpeg-data,
  pylibjpeg-libjpeg,
  pylibjpeg-openjpeg,
  pylibjpeg-rle,
}:

buildPythonPackage rec {
@@ -30,11 +31,15 @@ buildPythonPackage rec {

  dependencies = [ numpy ];

  optional-dependencies = {
  optional-dependencies =
    let
      extras = {
        libjpeg = [ pylibjpeg-libjpeg ];
        openjpeg = [ pylibjpeg-openjpeg ];
    #rle = [ pylibjpeg-rle ]; # not in Nixpkgs
        rle = [ pylibjpeg-rle ];
      };
    in
    extras // { all = lib.concatLists (lib.attrValues extras); };

  nativeCheckInputs = [
    pytestCheckHook
+2 −0
Original line number Diff line number Diff line
@@ -13292,6 +13292,8 @@ self: super: with self; {
  pylibjpeg-openjpeg = callPackage ../development/python-modules/pylibjpeg-openjpeg { };
  pylibjpeg-rle = callPackage ../development/python-modules/pylibjpeg-rle { };
  pyliblo3 = callPackage ../development/python-modules/pyliblo3 { };
  pylibmc = callPackage ../development/python-modules/pylibmc { };