1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 cython,
6 djvulibre,
7 ghostscript_headless,
8 packaging,
9 pkg-config,
10 setuptools,
11 unittestCheckHook,
12 wheel,
13}:
14
15buildPythonPackage rec {
16 pname = "python-djvulibre";
17 version = "0.9.1";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "FriedrichFroebel";
22 repo = "python-djvulibre";
23 tag = version;
24 hash = "sha256-5jOJyVPGJvR4YgxgJgyN47/OzsK3ASJXfn1Gt9y8rbs=";
25 };
26
27 nativeBuildInputs = [
28 cython
29 packaging
30 pkg-config
31 setuptools
32 wheel
33 ];
34
35 buildInputs = [
36 djvulibre
37 ghostscript_headless
38 ];
39
40 preCheck = ''
41 rm -rf djvu
42 '';
43
44 nativeCheckInputs = [ unittestCheckHook ];
45
46 unittestFlagsArray = [
47 "tests"
48 "-v"
49 ];
50
51 meta = with lib; {
52 description = "Python support for the DjVu image format";
53 homepage = "https://github.com/FriedrichFroebel/python-djvulibre";
54 license = licenses.gpl2Only;
55 changelog = "https://github.com/FriedrichFroebel/python-djvulibre/releases/tag/${src.tag}";
56 maintainers = with maintainers; [ dansbandit ];
57 };
58}