1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchPypi,
6 cssselect2,
7 lxml,
8 pillow,
9 pytestCheckHook,
10 reportlab,
11 tinycss2,
12}:
13
14buildPythonPackage rec {
15 pname = "svglib";
16 version = "1.5.1";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-Oudl06lAnuYMD7TSTC3raoBheqknBU9bzX/JjwaV5Yc=";
24 };
25
26 propagatedBuildInputs = [
27 cssselect2
28 lxml
29 pillow
30 reportlab
31 tinycss2
32 ];
33
34 nativeCheckInputs = [ pytestCheckHook ];
35
36 disabledTests = [
37 # Ignore tests that require network access (TestWikipediaFlags and TestW3CSVG), and tests that
38 # require files missing in the 1.0.0 PyPI release (TestOtherFiles).
39 "TestWikipediaFlags"
40 "TestW3CSVG"
41 "TestOtherFiles"
42 ];
43
44 pythonImportsCheck = [ "svglib.svglib" ];
45
46 meta = with lib; {
47 description = "Pure-Python library for reading and converting SVG";
48 mainProgram = "svg2pdf";
49 homepage = "https://github.com/deeplook/svglib";
50 changelog = "https://github.com/deeplook/svglib/blob/v${version}/CHANGELOG.rst";
51 license = licenses.lgpl3Only;
52 maintainers = with maintainers; [ trepetti ];
53 };
54}