e7ec2969af
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
53 lines
1.1 KiB
Nix
53 lines
1.1 KiB
Nix
{ lib
|
|
, stdenv
|
|
, buildPythonPackage
|
|
, fetchPypi
|
|
, libjpeg_turbo
|
|
, setuptools
|
|
, numpy
|
|
, python
|
|
, substituteAll
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pyturbojpeg";
|
|
version = "1.7.3";
|
|
pyproject = true;
|
|
|
|
src = fetchPypi {
|
|
pname = "PyTurboJPEG";
|
|
inherit version;
|
|
hash = "sha256-edSOOrU0YVKP+4AJxCCYnQh6iewxVFTM1QmU88mukis=";
|
|
};
|
|
|
|
patches = [
|
|
(substituteAll {
|
|
src = ./lib-path.patch;
|
|
libturbojpeg = "${libjpeg_turbo.out}/lib/libturbojpeg${stdenv.hostPlatform.extensions.sharedLibrary}";
|
|
})
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
setuptools
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
numpy
|
|
];
|
|
|
|
# upstream has no tests, but we want to test whether the library is found
|
|
checkPhase = ''
|
|
${python.interpreter} -c 'from turbojpeg import TurboJPEG; TurboJPEG()'
|
|
'';
|
|
|
|
pythonImportsCheck = [
|
|
"turbojpeg"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "A Python wrapper of libjpeg-turbo for decoding and encoding JPEG image";
|
|
homepage = "https://github.com/lilohuang/PyTurboJPEG";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
};
|
|
}
|