nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, fetchFromGitLab
3, meson
4, ninja
5, pkg-config
6, python3
7, docbook_xml_dtd_43
8, docbook-xsl-nons
9, libxslt
10, gettext
11, gnome
12, withDblatex ? false, dblatex
13}:
14
15python3.pkgs.buildPythonApplication rec {
16 pname = "gtk-doc";
17 version = "1.33.2";
18
19 outputDevdoc = "out";
20
21 format = "other";
22
23 src = fetchFromGitLab {
24 domain = "gitlab.gnome.org";
25 owner = "GNOME";
26 repo = pname;
27 rev = version;
28 sha256 = "A6OXpazrJ05SUIO1ZPVN0xHTXOSov8UnPvUolZAv/Iw=";
29 };
30
31 patches = [
32 passthru.respect_xml_catalog_files_var_patch
33 ];
34
35 postPatch = ''
36 substituteInPlace meson.build \
37 --replace "pkg-config" "$PKG_CONFIG"
38 '';
39
40 strictDeps = true;
41
42 depsBuildBuild = [
43 python3
44 pkg-config
45 ];
46
47 nativeBuildInputs = [
48 pkg-config
49 gettext
50 meson
51 ninja
52 libxslt # for xsltproc
53 ];
54
55 buildInputs = [
56 docbook_xml_dtd_43
57 docbook-xsl-nons
58 libxslt
59 ] ++ lib.optionals withDblatex [
60 dblatex
61 ];
62
63 pythonPath = with python3.pkgs; [
64 pygments # Needed for https://gitlab.gnome.org/GNOME/gtk-doc/blob/GTK_DOC_1_32/meson.build#L42
65 lxml
66 ];
67
68 mesonFlags = [
69 "-Dtests=false"
70 "-Dyelp_manual=false"
71 ];
72
73 doCheck = false; # requires a lot of stuff
74 doInstallCheck = false; # fails
75
76 postFixup = ''
77 # Do not propagate Python
78 substituteInPlace $out/nix-support/propagated-build-inputs \
79 --replace "${python3}" ""
80 '';
81
82 passthru = {
83 # Consumers are expected to copy the m4 files to their source tree, let them reuse the patch
84 respect_xml_catalog_files_var_patch = ./respect-xml-catalog-files-var.patch;
85 updateScript = gnome.updateScript {
86 packageName = pname;
87 versionPolicy = "none";
88 };
89 };
90
91 meta = with lib; {
92 description = "Tools to extract documentation embedded in GTK and GNOME source code";
93 homepage = "https://gitlab.gnome.org/GNOME/gtk-doc";
94 license = licenses.gpl2Plus;
95 maintainers = teams.gnome.members ++ (with maintainers; [ pSub ]);
96 };
97}