1{ lib
2, arabic-reshaper
3, buildPythonPackage
4, fetchFromGitHub
5, html5lib
6, pillow
7, pyhanko
8, pypdf3
9, pytestCheckHook
10, python-bidi
11, pythonOlder
12, reportlab
13, svglib
14}:
15
16buildPythonPackage rec {
17 pname = "xhtml2pdf";
18 version = "0.2.8";
19 format = "setuptools";
20
21 disabled = pythonOlder "3.7";
22
23 # Tests are only available on GitHub
24 src = fetchFromGitHub {
25 owner = pname;
26 repo = pname;
27 # Currently it is not possible to fetch from version as there is a branch with the same name
28 rev = "refs/tags/v${version}";
29 sha256 = "sha256-zWzg/r18wjzxWyD5QJ7l4pY+4bJTvHjrD11FRuuy8H8=";
30 };
31
32 propagatedBuildInputs = [
33 arabic-reshaper
34 html5lib
35 pillow
36 pyhanko
37 pypdf3
38 python-bidi
39 reportlab
40 svglib
41 ];
42
43 checkInputs = [
44 pytestCheckHook
45 ];
46
47 pythonImportsCheck = [
48 "xhtml2pdf"
49 ];
50
51 meta = with lib; {
52 description = "A PDF generator using HTML and CSS";
53 homepage = "https://github.com/xhtml2pdf/xhtml2pdf";
54 license = licenses.asl20;
55 maintainers = with maintainers; [ ];
56 };
57}