1{
2 lib,
3 buildPythonPackage,
4 cairocffi,
5 cssselect2,
6 defusedxml,
7 fetchPypi,
8 pillow,
9 pytestCheckHook,
10 setuptools,
11 tinycss2,
12}:
13
14buildPythonPackage rec {
15 pname = "cairosvg";
16 version = "2.7.1";
17 pyproject = true;
18
19 src = fetchPypi {
20 pname = "CairoSVG";
21 inherit version;
22 hash = "sha256-QyUx1yNHKRuanr+2d3AmtgdWP9hxnEbudC2wrvcnG6A=";
23 };
24
25 nativeBuildInputs = [ setuptools ];
26
27 propagatedBuildInputs = [
28 cairocffi
29 cssselect2
30 defusedxml
31 pillow
32 tinycss2
33 ];
34
35 propagatedNativeBuildInputs = [ cairocffi ];
36
37 nativeCheckInputs = [ pytestCheckHook ];
38
39 postPatch = ''
40 substituteInPlace setup.cfg \
41 --replace "pytest-runner" "" \
42 --replace "pytest-flake8" "" \
43 --replace "pytest-isort" "" \
44 --replace "pytest-cov" "" \
45 --replace "--flake8" "" \
46 --replace "--isort" ""
47 '';
48
49 pytestFlagsArray = [ "cairosvg/test_api.py" ];
50
51 pythonImportsCheck = [ "cairosvg" ];
52
53 meta = with lib; {
54 homepage = "https://cairosvg.org";
55 changelog = "https://github.com/Kozea/CairoSVG/releases/tag/${version}";
56 license = licenses.lgpl3Plus;
57 description = "SVG converter based on Cairo";
58 mainProgram = "cairosvg";
59 maintainers = with maintainers; [ ];
60 };
61}