depot/third_party/nixpkgs/pkgs/development/python-modules/pyturbojpeg/default.nix
Default email 5e9e1146e1 Project import generated by Copybara.
GitOrigin-RevId: 18036c0be90f4e308ae3ebcab0e14aae0336fe42
2023-08-05 00:07:22 +02:00

48 lines
1 KiB
Nix

{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, libjpeg_turbo
, numpy
, python
, substituteAll
}:
buildPythonPackage rec {
pname = "pyturbojpeg";
version = "1.7.2";
format = "setuptools";
src = fetchPypi {
pname = "PyTurboJPEG";
inherit version;
hash = "sha256-ChFD05ZK0TCVvM+uqGzma2x5qqyD94uBvFpSnWuyL2c=";
};
patches = [
(substituteAll {
src = ./lib-path.patch;
libturbojpeg = "${libjpeg_turbo.out}/lib/libturbojpeg${stdenv.hostPlatform.extensions.sharedLibrary}";
})
];
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 ];
};
}