nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchpatch,
6 inkscape,
7 poetry-core,
8 cssselect,
9 lxml,
10 numpy,
11 pillow,
12 pygobject3,
13 pyparsing,
14 pyserial,
15 scour,
16 tinycss2,
17 gobject-introspection,
18 pytestCheckHook,
19 gtk3,
20}:
21
22buildPythonPackage {
23 pname = "inkex";
24 inherit (inkscape) version;
25 pyproject = true;
26
27 inherit (inkscape) src;
28
29 patches = [
30 # Fix tests with newer libxml2
31 # https://gitlab.com/inkscape/extensions/-/merge_requests/712
32 (fetchpatch {
33 url = "https://gitlab.com/inkscape/extensions/-/commit/b04ab718b400778a264f2085bbc779faebc08368.patch";
34 hash = "sha256-BXRcfoeX7X8+x6CuKKBhrnzUHIwgnPay22Z8+rPZS54=";
35 stripLen = 1;
36 extraPrefix = "share/extensions/";
37 })
38 ];
39
40 build-system = [ poetry-core ];
41
42 pythonRelaxDeps = [
43 "lxml"
44 "numpy"
45 ];
46
47 dependencies = [
48 cssselect
49 lxml
50 numpy
51 pillow
52 pygobject3
53 pyparsing
54 pyserial
55 scour
56 tinycss2
57 ];
58
59 pythonImportsCheck = [ "inkex" ];
60
61 nativeCheckInputs = [
62 gobject-introspection
63 pytestCheckHook
64 ];
65
66 checkInputs = [
67 gtk3
68 ];
69
70 disabledTests = [
71 "test_extract_multiple"
72 "test_lookup_and"
73 ]
74 ++ lib.optional stdenv.hostPlatform.isDarwin [
75 "test_image_extract"
76 "test_path_number_nodes"
77 "test_plotter" # Hangs
78 ];
79
80 disabledTestPaths = [
81 # Fatal Python error: Segmentation fault
82 "tests/test_inkex_gui.py"
83 "tests/test_inkex_gui_listview.py"
84 "tests/test_inkex_gui_window.py"
85 # Failed to find pixmap 'image-missing' in /build/source/tests/data/
86 "tests/test_inkex_gui_pixmaps.py"
87 ];
88
89 postPatch = ''
90 cd share/extensions
91
92 substituteInPlace pyproject.toml \
93 --replace-fail 'scour = "^0.37"' 'scour = ">=0.37"'
94 '';
95
96 meta = {
97 description = "Library for manipulating SVG documents which is the basis for Inkscape extensions";
98 homepage = "https://gitlab.com/inkscape/extensions";
99 license = lib.licenses.gpl2Plus;
100 maintainers = with lib.maintainers; [ dotlambda ];
101 };
102}