1{ lib
2, buildPythonPackage
3, fetchPypi
4, isPy3k
5, cairocffi
6, cssselect2
7, defusedxml
8, pillow
9, tinycss2
10, pytestCheckHook
11}:
12
13buildPythonPackage rec {
14 pname = "CairoSVG";
15 version = "2.5.2";
16 disabled = !isPy3k;
17
18 src = fetchPypi {
19 inherit pname version;
20 sha256 = "sha256-sLmSnPXboAUXjXRqgDb88AJVUPSYylTbYYczIjhHg7w=";
21 };
22
23 propagatedBuildInputs = [ cairocffi cssselect2 defusedxml pillow tinycss2 ];
24
25 propagatedNativeBuildInputs = [ cairocffi ];
26
27 checkInputs = [ pytestCheckHook ];
28
29 postPatch = ''
30 substituteInPlace setup.cfg \
31 --replace "pytest-runner" "" \
32 --replace "pytest-flake8" "" \
33 --replace "pytest-isort" "" \
34 --replace "pytest-cov" "" \
35 --replace "--flake8" "" \
36 --replace "--isort" ""
37 '';
38
39 pytestFlagsArray = [
40 "cairosvg/test_api.py"
41 ];
42
43 pythonImportsCheck = [ "cairosvg" ];
44
45 meta = with lib; {
46 homepage = "https://cairosvg.org";
47 license = licenses.lgpl3Plus;
48 description = "SVG converter based on Cairo";
49 maintainers = with maintainers; [ SuperSandro2000 ];
50 };
51}