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 pythonRelaxDeps = [ "packaging" ];
34
35 outputs = [
36 "out"
37 "man"
38 ];
39
40 nativeBuildInputs = [
41 installShellFiles
42 setuptools
43 setuptools-scm
44 wheel
45 ];
46
47 propagatedBuildInputs = [
48 docutils
49 importlib-metadata
50 jinja2
51 packaging
52 pygments
53 pyyaml
54 reportlab
55 smartypants
56 pillow
57 ];
58
59 pythonImportsCheck = [ "rst2pdf" ];
60
61 nativeCheckInputs = [
62 pytestCheckHook
63 pymupdf
64 sphinx
65 ];
66
67 # Test suite fails: https://github.com/rst2pdf/rst2pdf/issues/1067
68 doCheck = false;
69
70 postInstall = ''
71 ${lib.getExe' docutils "rst2man"} doc/rst2pdf.rst rst2pdf.1
72 installManPage rst2pdf.1
73 '';
74
75 meta = with lib; {
76 description = "Convert reStructured Text to PDF via ReportLab";
77 mainProgram = "rst2pdf";
78 homepage = "https://rst2pdf.org/";
79 changelog = "https://github.com/rst2pdf/rst2pdf/blob/${version}/CHANGES.rst";
80 license = licenses.mit;
81 maintainers = with maintainers; [ pyrox0 ];
82 };
83}