about summary refs log tree commit diff
path: root/pkgs/development/python-modules/rst2pdf/default.nix
blob: ae81f6d2ff31c54058a800d3963c4fd722c43c81 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{
  lib,
  buildPythonPackage,
  fetchPypi,
  installShellFiles,
  setuptools,
  setuptools-scm,
  wheel,
  docutils,
  importlib-metadata,
  jinja2,
  packaging,
  pygments,
  pyyaml,
  reportlab,
  smartypants,
  pillow,
  pytestCheckHook,
  pymupdf,
  sphinx,
}:

buildPythonPackage rec {
  pname = "rst2pdf";
  version = "0.101";
  format = "pyproject";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-AF8FssEIFHmeY2oVrAPNe85pbmgKWO52yD6ycNNzTSg=";
  };

  outputs = [
    "out"
    "man"
  ];

  nativeBuildInputs = [
    installShellFiles
    setuptools
    setuptools-scm
    wheel
  ];

  propagatedBuildInputs = [
    docutils
    importlib-metadata
    jinja2
    packaging
    pygments
    pyyaml
    reportlab
    smartypants
    pillow
  ];

  pythonImportsCheck = [ "rst2pdf" ];

  nativeCheckInputs = [
    pytestCheckHook
    pymupdf
    sphinx
  ];

  # Test suite fails: https://github.com/rst2pdf/rst2pdf/issues/1067
  doCheck = false;

  postInstall = ''
    ${lib.getExe' docutils "rst2man"} doc/rst2pdf.rst rst2pdf.1
    installManPage rst2pdf.1
  '';

  meta = with lib; {
    description = "Convert reStructured Text to PDF via ReportLab";
    mainProgram = "rst2pdf";
    homepage = "https://rst2pdf.org/";
    changelog = "https://github.com/rst2pdf/rst2pdf/blob/${version}/CHANGES.rst";
    license = licenses.mit;
    maintainers = with maintainers; [ pyrox0 ];
  };
}