1{
2 lib,
3 arabic-reshaper,
4 buildPythonPackage,
5 fetchFromGitHub,
6 html5lib,
7 pillow,
8 pyhanko,
9 pyhanko-certvalidator,
10 pypdf,
11 pytestCheckHook,
12 python-bidi,
13 pythonOlder,
14 reportlab,
15 setuptools,
16 svglib,
17}:
18
19buildPythonPackage rec {
20 pname = "xhtml2pdf";
21 version = "0.2.17";
22 pyproject = true;
23
24 disabled = pythonOlder "3.8";
25
26 src = fetchFromGitHub {
27 owner = "xhtml2pdf";
28 repo = "xhtml2pdf";
29 tag = "v${version}";
30 hash = "sha256-qp0JVp5efIrI98YT0rwFAMSEW+0aIhedfYGND4V7Mto=";
31 };
32
33 build-system = [
34 setuptools
35 ];
36
37 dependencies = [
38 arabic-reshaper
39 html5lib
40 pillow
41 pyhanko
42 pyhanko-certvalidator
43 pypdf
44 python-bidi
45 reportlab
46 svglib
47 ];
48
49 nativeCheckInputs = [ pytestCheckHook ];
50
51 disabledTests = [
52 # Tests requires network access
53 "test_document_cannot_identify_image"
54 "test_document_with_broken_image"
55 ];
56
57 pythonImportsCheck = [
58 "xhtml2pdf"
59 "xhtml2pdf.pisa"
60 ];
61
62 meta = {
63 changelog = "https://github.com/xhtml2pdf/xhtml2pdf/releases/tag/${src.tag}";
64 description = "PDF generator using HTML and CSS";
65 homepage = "https://github.com/xhtml2pdf/xhtml2pdf";
66 license = lib.licenses.asl20;
67 mainProgram = "xhtml2pdf";
68 maintainers = with lib.maintainers; [ ];
69 };
70}