Files
Martin Weinelt b861bdeea5 python3Packages.pyturbojpeg: 1.8.0 -> 1.8.2
https://github.com/lilohuang/PyTurboJPEG/releases/tag/v1.8.2

This commit was automatically generated using update-python-libraries.
2025-08-09 19:03:53 +02:00

54 lines
1.2 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
libjpeg_turbo,
setuptools,
numpy,
python,
replaceVars,
}:
buildPythonPackage rec {
pname = "pyturbojpeg";
version = "1.8.2";
pyproject = true;
src = fetchFromGitHub {
owner = "lilohuang";
repo = "PyTurboJPEG";
tag = "v${version}";
hash = "sha256-zyLNIo7hQuzTlEgdvri3bSnAiRRKKup57tfCIxiBq24=";
};
patches = [
(replaceVars ./lib-path.patch {
libturbojpeg = "${lib.getLib libjpeg_turbo}/lib/libturbojpeg${stdenv.hostPlatform.extensions.sharedLibrary}";
})
];
build-system = [ setuptools ];
dependencies = [ numpy ];
# upstream has no tests, but we want to test whether the library is found
checkPhase = ''
runHook preCheck
${python.interpreter} -c 'from turbojpeg import TurboJPEG; TurboJPEG()'
runHook postCheck
'';
pythonImportsCheck = [ "turbojpeg" ];
meta = with lib; {
changelog = "https://github.com/lilohuang/PyTurboJPEG/releases/tag/${src.tag}";
description = "Python wrapper of libjpeg-turbo for decoding and encoding JPEG image";
homepage = "https://github.com/lilohuang/PyTurboJPEG";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}