1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, poetry-core
6, inkex
7, lxml
8, pytestCheckHook
9}:
10
11buildPythonPackage rec {
12 pname = "svg2tikz";
13 version = "1.2.0";
14
15 disabled = pythonOlder "3.10";
16
17 format = "pyproject";
18
19 src = fetchFromGitHub {
20 owner = "xyz2tex";
21 repo = "svg2tikz";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-oFcKRcXef1Uz0qFi6Gga/D4u8zW0RjXAnHDlhRr33Ts=";
24 };
25
26 postPatch = ''
27 substituteInPlace pyproject.toml \
28 --replace "+dairiki.1" ""
29 '';
30
31 nativeBuildInputs = [
32 poetry-core
33 ];
34
35 propagatedBuildInputs = [
36 inkex
37 lxml
38 ];
39
40 nativeCheckInputs = [
41 pytestCheckHook
42 ];
43
44 pythonImportsCheck = [ "svg2tikz" ];
45
46 meta = with lib; {
47 changelog = "https://github.com/xyz2tex/svg2tikz/blob/${src.rev}/README.md#changes-bug-fixes-and-known-problems-from-the-original";
48 homepage = "https://github.com/xyz2tex/svg2tikz";
49 description = "Set of tools for converting SVG graphics to TikZ/PGF code";
50 license = licenses.gpl2Plus;
51 maintainers = with maintainers; [ dotlambda gal_bolle ];
52 };
53}