From dc7f28eac50cdf6c06d36dcdb51732e5aa5dfdf1 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Fri, 12 Mar 2021 10:51:35 -0500 Subject: [PATCH 60/68] gnu: json-glib: Enable documentation and man-pages. * gnu/packages/gnome.scm (json-glib) [outputs]: New output "doc". [arguments]<#:configure-flags>[-Ddocs]: New flag. [-Dman]: New flag. <#:phases>['patch-docbook]: New phase. ['move-doc]: New phase. [native-inputs]: Add docbook-xml, docbook-xsl, gtk-doc and libxslt. --- gnu/packages/gnome.scm | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index d4b3f4aa14..887f40f950 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -4544,13 +4544,44 @@ configuration storage systems.") (base32 "0ixwyis47v5bkx6h8a1iqlw3638cxcv57ivxv4gw2gaig51my33j")))) (build-system meson-build-system) + (outputs '("out" "doc")) (arguments - `(#:glib-or-gtk? #t)) ; To wrap binaries and/or compile schemas + `(#:glib-or-gtk? #t ; To wrap binaries and/or compile schemas + #:configure-flags + (list + "-Ddocs=true" + "-Dman=true") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-docbook + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion "doc" + (substitute* "json-glib-docs.xml" + (("http://www.oasis-open.org/docbook/xml/4.3/") + (string-append (assoc-ref inputs "docbook-xml") + "/xml/dtd/docbook/"))) + (substitute* "meson.build" + (("http://docbook.sourceforge.net/release/xsl/current/") + (string-append (assoc-ref inputs "docbook-xsl") + "/xml/xsl/docbook-xsl-1.79.1/")))) + #t)) + (add-after 'install 'move-docs + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (doc (assoc-ref outputs "doc"))) + (mkdir-p (string-append doc "/share")) + (rename-file + (string-append out "/share/gtk-doc") + (string-append doc "/share/gtk-doc")) + #t)))))) (native-inputs - `(("gettext" ,gettext-minimal) + `(("docbook-xml" ,docbook-xml-4.3) + ("docbook-xsl" ,docbook-xsl) + ("gettext" ,gettext-minimal) ("glib" ,glib "bin") ;for glib-mkenums and glib-genmarshal ("gobject-introspection" ,gobject-introspection) - ("pkg-config" ,pkg-config))) + ("pkg-config" ,pkg-config) + ("xsltproc" ,libxslt))) (propagated-inputs `(("glib" ,glib))) ;according to json-glib-1.0.pc (home-page "https://wiki.gnome.org/Projects/JsonGlib") -- 2.30.1