summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorRaghav Gururajan <rg@raghavgururajan.name>2021-03-26 10:27:59 -0400
committerRaghav Gururajan <rg@raghavgururajan.name>2021-03-26 16:34:58 -0400
commitb0e5b89976ab103effdd27c35d2d733b7d3a82ad (patch)
treecb754c8cded09fb10de512cc12dc4c1d44ae3136 /gnu
parentbe06dea224dd222386725f056980c3999c7ac36d (diff)
downloadguix-b0e5b89976ab103effdd27c35d2d733b7d3a82ad.tar.gz
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.

Signed-off-by: Léo Le Bouter <lle-bout@zaclys.net>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/gnome.scm38
1 files changed, 35 insertions, 3 deletions
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 22fd435feb..e56adee111 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -4562,13 +4562,45 @@ configuration storage systems.")
                (base32
                 "092g2dyy1hhl0ix9kp33wcab0pg1qicnsv0cj5ms9g9qs336cgd3"))))
     (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* (find-files "." "\\.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.2/"))))
+             #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)))
+       ("gtk-doc" ,gtk-doc)
+       ("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")