blob: 79a23cdeae7ec238cd3cb254b203fa5044f8aebf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
{
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 = {
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 = lib.licenses.mit;
maintainers = with lib.maintainers; [ dotlambda ];
};
}
|