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