Merge pull request #320172 from bcdarwin/init-python3-pylibjpeg-openjpeg

python312Packages.pylibjpeg-openjpeg: init at 2.3.0
This commit is contained in:
Peder Bergebakken Sundt 2024-07-25 14:17:54 +02:00 committed by GitHub
commit 1632aa8758
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 124 additions and 22 deletions

View File

@ -10,6 +10,7 @@
pydicom,
pylibjpeg,
pylibjpeg-libjpeg,
pylibjpeg-openjpeg,
}:
let
@ -45,7 +46,7 @@ buildPythonPackage rec {
libjpeg = [
pylibjpeg
pylibjpeg-libjpeg
#pylibjpeg-openjpeg # not in nixpkgs yet
#pylibjpeg-openjpeg # broken on aarch64-linux
];
};

View File

@ -0,0 +1,39 @@
{
lib,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
flit-core,
}:
buildPythonPackage rec {
pname = "pylibjpeg-data";
version = "unstable-2024-03-28";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "pydicom";
repo = "pylibjpeg-data";
rev = "8253566715800a7fc3d4d949abab102c8172bca0";
hash = "sha256-TzhiZ4LCFZX75h3YRrEFO5kRVc5VwTOJd+1VFW3LsaQ=";
};
build-system = [ flit-core ];
doCheck = false; # no tests
pythonImportsCheck = [
"ljdata"
"ljdata.ds"
"ljdata.jpg"
];
meta = {
description = "JPEG and DICOM data used for testing pylibjpeg";
homepage = "https://github.com/pydicom/pylibjpeg-data";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.bcdarwin ];
};
}

View File

@ -0,0 +1,76 @@
{
stdenv,
lib,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
cmake,
cython,
poetry-core,
setuptools,
numpy,
openjpeg,
pytestCheckHook,
pydicom,
pylibjpeg,
pylibjpeg-data,
}:
buildPythonPackage rec {
pname = "pylibjpeg-openjpeg";
version = "2.3.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "pydicom";
repo = "pylibjpeg-openjpeg";
rev = "refs/tags/v${version}";
hash = "sha256-cCDnARElNn+uY+HQ39OnGJRz2vTz0I8s0Oe+qGvqM1o=";
};
# don't use vendored openjpeg submodule:
# (note build writes into openjpeg source dir, so we have to make it writable)
postPatch = ''
rmdir lib/openjpeg
cp -r ${openjpeg.src} lib/openjpeg
chmod +rwX -R lib/openjpeg
'';
dontUseCmakeConfigure = true;
build-system = [
cmake
cython
poetry-core
setuptools
];
dependencies = [ numpy ];
nativeCheckInputs = [
pytestCheckHook
pydicom
pylibjpeg-data
pylibjpeg
];
disabledTestPaths = [
# ignore a few Python test files (e.g. performance tests) in openjpeg itself:
"lib/openjpeg"
];
pytestFlagsArray = [ "openjpeg/tests" ];
pythonImportsCheck = [ "openjpeg" ];
meta = {
description = "A J2K and JP2 plugin for pylibjpeg";
homepage = "https://github.com/pydicom/pylibjpeg-openjpeg";
license = [ lib.licenses.mit ];
maintainers = with lib.maintainers; [ bcdarwin ];
# x86-linux: test_encode.py::TestEncodeBuffer failures
# darwin: numerous test failures, seemingly due to issues setting up test data
broken = (stdenv.isAarch64 && stdenv.isLinux) || stdenv.isDarwin;
};
}

View File

@ -8,28 +8,10 @@
setuptools,
numpy,
pydicom,
pylibjpeg-data,
pylibjpeg-libjpeg,
}:
let
pylibjpeg-data = buildPythonPackage {
pname = "pylibjpeg-data";
version = "1.0.0dev0";
pyproject = true;
nativeBuildInputs = [ setuptools ];
src = fetchFromGitHub {
owner = "pydicom";
repo = "pylibjpeg-data";
rev = "2ab4b8a65b070656eca2582bd23197a3d01cdccd";
hash = "sha256-cFE1XjrqyGqwHCYGRucXK+q4k7ftUIbYwBw4WwIFtEc=";
};
doCheck = false;
};
in
buildPythonPackage rec {
pname = "pylibjpeg";
version = "2.0.0";
@ -44,9 +26,9 @@ buildPythonPackage rec {
hash = "sha256-qGtrphsBBVieGS/8rdymbsjLMU/QEd7zFNAANN8bD+k=";
};
nativeBuildInputs = [ flit-core ];
build-system = [ flit-core ];
propagatedBuildInputs = [ numpy ];
dependencies = [ numpy ];
nativeCheckInputs = [
pytestCheckHook

View File

@ -11542,8 +11542,12 @@ self: super: with self; {
pylibjpeg = callPackage ../development/python-modules/pylibjpeg { };
pylibjpeg-data = callPackage ../development/python-modules/pylibjpeg-data { };
pylibjpeg-libjpeg = callPackage ../development/python-modules/pylibjpeg-libjpeg { };
pylibjpeg-openjpeg = callPackage ../development/python-modules/pylibjpeg-openjpeg { };
pyliblo = callPackage ../development/python-modules/pyliblo { };
pylibmc = callPackage ../development/python-modules/pylibmc { };