gtk-doc: clean up

* use buildPythonApplication instead of symlinking
   * but do not propagate Python
* Add lxml & anytree for gtkdoc-mkhtml2
This commit is contained in:
Jan Tojnar 2019-12-14 17:37:26 +01:00
parent 4522205507
commit 1c2019fe01
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4

View File

@ -2,9 +2,8 @@
, fetchFromGitLab
, meson
, ninja
, pkgconfig
, pkg-config
, python3
, libxml2Python
, docbook_xml_dtd_43
, docbook_xsl
, libxslt
@ -13,10 +12,12 @@
, withDblatex ? false, dblatex
}:
stdenv.mkDerivation rec {
python3.pkgs.buildPythonApplication rec {
pname = "gtk-doc";
version = "1.32";
format = "other";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "GNOME";
@ -32,37 +33,41 @@ stdenv.mkDerivation rec {
outputDevdoc = "out";
nativeBuildInputs = [
pkg-config
gettext
meson
ninja
libxslt # for xsltproc
];
buildInputs = [
docbook_xml_dtd_43
docbook_xsl
libxslt
pkgconfig
python3
python3.pkgs.pygments # Needed for https://gitlab.gnome.org/GNOME/gtk-doc/blob/GTK_DOC_1_32/meson.build#L42
libxml2Python
]
++ stdenv.lib.optional withDblatex dblatex
;
] ++ stdenv.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
(anytree.override { withGraphviz = false; })
lxml
];
mesonFlags = [
"-Dtests=false"
"-Dyelp_manual=false"
];
# Make pygments available for binaries, python.withPackages creates a wrapper
# but scripts are not allowed in shebangs so we link it into sys.path.
postInstall = ''
ln -s ${python3.pkgs.pygments}/${python3.sitePackages}/* $out/share/gtk-doc/python/
'';
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;