nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, intervaltree
6, pyflakes
7, requests
8, lxml
9, google-i18n-address
10, pycountry
11, html5lib
12, six
13, kitchen
14, pypdf2
15, dict2xml
16, weasyprint
17, pyyaml
18, jinja2
19, configargparse
20, appdirs
21, decorator
22, pycairo
23, pytestCheckHook
24, python-fontconfig
25}:
26
27buildPythonPackage rec {
28 pname = "xml2rfc";
29 version = "3.12.4";
30
31 disabled = pythonOlder "3.6";
32
33 src = fetchFromGitHub {
34 owner = "ietf-tools";
35 repo = "xml2rfc";
36 rev = "v${version}";
37 sha256 = "sha256-TAu2Ls553t7wJ/Jhgu+Ff+H4P6az0Du8OL00JjZyCDs=";
38 };
39
40 postPatch = ''
41 substituteInPlace Makefile \
42 --replace "SHELL := /bin/bash" "SHELL := bash" \
43 --replace "test flaketest" "test" \
44 --replace "python setup.py --quiet install" ""
45 substituteInPlace setup.py \
46 --replace "'tox'," ""
47 substituteInPlace requirements.txt \
48 --replace "jinja2>=2.11,<3.0" "jinja2" \
49 --replace "markupsafe==2.0.1" "markupsafe"
50 '';
51
52 propagatedBuildInputs = [
53 intervaltree
54 jinja2
55 pyflakes
56 pyyaml
57 requests
58 lxml
59 google-i18n-address
60 pycountry
61 html5lib
62 six
63 kitchen
64 pypdf2
65 dict2xml
66 weasyprint
67 configargparse
68 appdirs
69 ];
70
71 checkInputs = [
72 decorator
73 pycairo
74 pytestCheckHook
75 python-fontconfig
76 ];
77
78 # requires Noto Serif and Roboto Mono font
79 doCheck = false;
80
81 checkPhase = ''
82 make tests-no-network
83 '';
84
85 pythonImportsCheck = [ "xml2rfc" ];
86
87 meta = with lib; {
88 description = "Tool generating IETF RFCs and drafts from XML sources";
89 homepage = "https://github.com/ietf-tools/xml2rfc";
90 # Well, parts might be considered unfree, if being strict; see:
91 # http://metadata.ftp-master.debian.org/changelogs/non-free/x/xml2rfc/xml2rfc_2.9.6-1_copyright
92 license = licenses.bsd3;
93 maintainers = with maintainers; [ vcunat yrashk ];
94 };
95}