1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 installShellFiles,
6 setuptools,
7 setuptools-scm,
8 wheel,
9 docutils,
10 importlib-metadata,
11 jinja2,
12 packaging,
13 pygments,
14 pyyaml,
15 reportlab,
16 smartypants,
17 pillow,
18 pytestCheckHook,
19 pymupdf,
20 sphinx,
21}:
22
23buildPythonPackage rec {
24 pname = "rst2pdf";
25 version = "0.103.1";
26 format = "pyproject";
27
28 src = fetchPypi {
29 inherit pname version;
30 hash = "sha256-P/6BbUsyda7iG4/90Isua+TXWQzYixifczy8aZbWN4Y=";
31 };
32
33 outputs = [
34 "out"
35 "man"
36 ];
37
38 nativeBuildInputs = [
39 installShellFiles
40 setuptools
41 setuptools-scm
42 wheel
43 ];
44
45 propagatedBuildInputs = [
46 docutils
47 importlib-metadata
48 jinja2
49 packaging
50 pygments
51 pyyaml
52 reportlab
53 smartypants
54 pillow
55 ];
56
57 pythonImportsCheck = [ "rst2pdf" ];
58
59 nativeCheckInputs = [
60 pytestCheckHook
61 pymupdf
62 sphinx
63 ];
64
65 # Test suite fails: https://github.com/rst2pdf/rst2pdf/issues/1067
66 doCheck = false;
67
68 postInstall = ''
69 ${lib.getExe' docutils "rst2man"} doc/rst2pdf.rst rst2pdf.1
70 installManPage rst2pdf.1
71 '';
72
73 meta = with lib; {
74 description = "Convert reStructured Text to PDF via ReportLab";
75 mainProgram = "rst2pdf";
76 homepage = "https://rst2pdf.org/";
77 changelog = "https://github.com/rst2pdf/rst2pdf/blob/${version}/CHANGES.rst";
78 license = licenses.mit;
79 maintainers = with maintainers; [ pyrox0 ];
80 };
81}