1{ stdenv, buildPythonPackage, fetchFromGitHub, cairocffi, nose, fontconfig
2, cssselect2, defusedxml, pillow, tinycss2 }:
3
4# CairoSVG 2.x dropped support for Python 2 so offer CairoSVG 1.x as an
5# alternative
6buildPythonPackage rec {
7 pname = "CairoSVG";
8 version = "1.0.22";
9
10 # PyPI doesn't include tests so use GitHub
11 src = fetchFromGitHub {
12 owner = "Kozea";
13 repo = pname;
14 rev = version;
15 sha256 = "15z0cag5s79ghhrlgs5xc9ayvzzdr3v8151vf6k819f1drsfjfxl";
16 };
17
18 propagatedBuildInputs = [ cairocffi ];
19
20 checkInputs = [ nose fontconfig cssselect2 defusedxml pillow tinycss2 ];
21
22 # Almost all tests just fail. Not sure how to fix them.
23 doCheck = false;
24
25 # checkInputs = [ nose fontconfig cssselect2 defusedxml pillow tinycss2 ];
26
27 # checkPhase = ''
28 # FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf nosetests .
29 # '';
30
31 meta = with stdenv.lib; {
32 homepage = https://cairosvg.org;
33 license = licenses.lgpl3;
34 description = "SVG converter based on Cairo";
35 maintainers = with maintainers; [ jluttine ];
36 };
37}