nixpkgs/pkgs/by-name/gt/gtk-doc/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

102 lines
2.0 KiB
Nix

{
lib,
fetchFromGitLab,
meson,
ninja,
pkg-config,
python3,
docbook_xml_dtd_43,
docbook-xsl-nons,
libxslt,
gettext,
gnome,
withDblatex ? false,
dblatex,
}:
python3.pkgs.buildPythonApplication rec {
pname = "gtk-doc";
version = "1.34.0";
outputDevdoc = "out";
format = "other";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "GNOME";
repo = pname;
rev = version;
hash = "sha256-Jt6d5wbhAoSQ2sWyYWW68Y81duc3+QOJK/5JR/lCmnQ=";
};
patches = [
passthru.respect_xml_catalog_files_var_patch
];
postPatch = ''
substituteInPlace meson.build \
--replace "pkg-config" "$PKG_CONFIG"
'';
strictDeps = true;
depsBuildBuild = [
python3
pkg-config
];
nativeBuildInputs = [
pkg-config
gettext
meson
ninja
libxslt # for xsltproc
];
buildInputs =
[
docbook_xml_dtd_43
docbook-xsl-nons
libxslt
]
++ lib.optionals withDblatex [
dblatex
];
pythonPath = with python3.pkgs; [
pygments # Needed for https://gitlab.gnome.org/GNOME/gtk-doc/blob/GTK_DOC_1_32/meson.build#L42
lxml
];
mesonFlags = [
"-Dtests=false"
"-Dyelp_manual=false"
];
doCheck = false; # requires a lot of stuff
doInstallCheck = false; # fails
postFixup = ''
# Do not propagate Python
substituteInPlace $out/nix-support/propagated-build-inputs \
--replace "${python3}" ""
'';
passthru = {
# Consumers are expected to copy the m4 files to their source tree, let them reuse the patch
respect_xml_catalog_files_var_patch = ./respect-xml-catalog-files-var.patch;
updateScript = gnome.updateScript {
packageName = pname;
versionPolicy = "none";
};
};
meta = with lib; {
description = "Tools to extract documentation embedded in GTK and GNOME source code";
homepage = "https://gitlab.gnome.org/GNOME/gtk-doc";
license = licenses.gpl2Plus;
maintainers = teams.gnome.members ++ (with maintainers; [ pSub ]);
};
}