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 = [ "numpy" ];
31
32 dependencies = [
33 cssselect
34 lxml
35 numpy
36 pillow
37 pygobject3
38 pyparsing
39 pyserial
40 scour
41 tinycss2
42 ];
43
44 pythonImportsCheck = [ "inkex" ];
45
46 nativeCheckInputs = [
47 gobject-introspection
48 pytestCheckHook
49 ];
50
51 checkInputs = [
52 gtk3
53 ];
54
55 disabledTests = [
56 "test_extract_multiple"
57 "test_lookup_and"
58 ]
59 ++ lib.optional stdenv.hostPlatform.isDarwin [
60 "test_image_extract"
61 "test_path_number_nodes"
62 "test_plotter" # Hangs
63 ];
64
65 disabledTestPaths = [
66 # Fatal Python error: Segmentation fault
67 "tests/test_inkex_gui.py"
68 "tests/test_inkex_gui_listview.py"
69 "tests/test_inkex_gui_window.py"
70 # Failed to find pixmap 'image-missing' in /build/source/tests/data/
71 "tests/test_inkex_gui_pixmaps.py"
72 ];
73
74 postPatch = ''
75 cd share/extensions
76
77 substituteInPlace pyproject.toml \
78 --replace-fail 'scour = "^0.37"' 'scour = ">=0.37"'
79 '';
80
81 meta = {
82 description = "Library for manipulating SVG documents which is the basis for Inkscape extensions";
83 homepage = "https://gitlab.com/inkscape/extensions";
84 license = lib.licenses.gpl2Plus;
85 maintainers = with lib.maintainers; [ dotlambda ];
86 };
87}