depot/third_party/nixpkgs/pkgs/development/python-modules/pyturbojpeg/default.nix
Default email 2189cff663 Project import generated by Copybara.
GitOrigin-RevId: 1fe6ed37fd9beb92afe90671c0c2a662a03463dd
2021-04-24 22:57:28 -05:00

45 lines
1,022 B
Nix

{ lib
, stdenv
, python
, buildPythonPackage
, fetchPypi
, substituteAll
, libjpeg_turbo
, numpy
}:
buildPythonPackage rec {
pname = "pyturbojpeg";
version = "1.4.3";
src = fetchPypi {
pname = "PyTurboJPEG";
inherit version;
sha256 = "sha256-Q7KVfR9kA32QPQFWgSSCVB5sNOmSF8y5J4dmBc14jvg=";
};
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 ];
};
}