nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 configargparse,
5 decorator,
6 dict2xml,
7 fetchFromGitHub,
8 google-i18n-address,
9 intervaltree,
10 jinja2,
11 lxml,
12 platformdirs,
13 pycairo,
14 pycountry,
15 pypdf,
16 pytestCheckHook,
17 python-fontconfig,
18 pyyaml,
19 requests,
20 setuptools,
21 wcwidth,
22}:
23
24buildPythonPackage rec {
25 pname = "xml2rfc";
26 version = "3.31.0";
27 pyproject = true;
28
29 src = fetchFromGitHub {
30 owner = "ietf-tools";
31 repo = "xml2rfc";
32 tag = "v${version}";
33 hash = "sha256-thgLt1PHXbKxDDhqQcHUP/AZsGq/OfAOSRV9KrFmPWw=";
34 };
35
36 postPatch = ''
37 substituteInPlace Makefile \
38 --replace-fail "SHELL := /bin/bash" "SHELL := bash" \
39 --replace-fail "test flaketest" "test"
40 '';
41
42 build-system = [ setuptools ];
43
44 pythonRelaxDeps = [ "lxml" ];
45
46 dependencies = [
47 configargparse
48 dict2xml
49 google-i18n-address
50 intervaltree
51 jinja2
52 lxml
53 platformdirs
54 pycountry
55 pypdf
56 pyyaml
57 requests
58 wcwidth
59 ];
60
61 nativeCheckInputs = [
62 decorator
63 pycairo
64 pytestCheckHook
65 python-fontconfig
66 ];
67
68 # Requires Noto Serif and Roboto Mono font
69 doCheck = false;
70
71 checkPhase = ''
72 make tests-no-network
73 '';
74
75 pythonImportsCheck = [ "xml2rfc" ];
76
77 meta = {
78 description = "Tool generating IETF RFCs and drafts from XML sources";
79 mainProgram = "xml2rfc";
80 homepage = "https://github.com/ietf-tools/xml2rfc";
81 changelog = "https://github.com/ietf-tools/xml2rfc/blob/${src.tag}/CHANGELOG.md";
82 # Well, parts might be considered unfree, if being strict; see:
83 # http://metadata.ftp-master.debian.org/changelogs/non-free/x/xml2rfc/xml2rfc_2.9.6-1_copyright
84 license = lib.licenses.bsd3;
85 maintainers = with lib.maintainers; [
86 vcunat
87 yrashk
88 ];
89 };
90}