1{
2 lib,
3 fetchFromRepoOrCz,
4 buildPythonPackage,
5 flit-core,
6 pillow,
7 python,
8 pythonOlder,
9}:
10
11# Note: this package is used to build LLVM’s documentation, which is part of the Darwin stdenv.
12# It cannot use `fetchgit` because that would pull curl into the bootstrap, which is disallowed.
13
14let
15 self = buildPythonPackage rec {
16 pname = "docutils";
17 version = "0.21.2";
18 pyproject = true;
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromRepoOrCz {
23 repo = "docutils";
24 rev = "docutils-${version}";
25 hash = "sha256-Q+9yW+BYUEvPYV504368JsAoKKoaTZTeKh4tVeiNv5Y=";
26 };
27
28 build-system = [ flit-core ];
29
30 # infinite recursion via sphinx and pillow
31 doCheck = false;
32 passthru.tests.pytest = self.overridePythonAttrs { doCheck = true; };
33
34 nativeCheckInputs = [ pillow ];
35
36 checkPhase = ''
37 ${python.interpreter} test/alltests.py
38 '';
39
40 # Create symlinks lacking a ".py" suffix, many programs depend on these names
41 postFixup = ''
42 for f in $out/bin/*.py; do
43 ln -s $(basename $f) $out/bin/$(basename $f .py)
44 done
45 '';
46
47 meta = with lib; {
48 description = "Python Documentation Utilities";
49 homepage = "http://docutils.sourceforge.net/";
50 license = with licenses; [
51 publicDomain
52 bsd2
53 psfl
54 gpl3Plus
55 ];
56 maintainers = with maintainers; [ ];
57 };
58 };
59in
60self