guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/04: gnu: gtksourceview: Enable documentation.


From: guix-commits
Subject: 03/04: gnu: gtksourceview: Enable documentation.
Date: Tue, 7 Sep 2021 15:22:43 -0400 (EDT)

raghavgururajan pushed a commit to branch wip-gnome
in repository guix.

commit da2b1ab03098a05e4c72ba1418743152b831c82e
Author: Raghav Gururajan <rg@raghavgururajan.name>
AuthorDate: Mon Sep 6 19:03:06 2021 -0400

    gnu: gtksourceview: Enable documentation.
    
    * gnu/packages/gtk.scm (gtksourceview)[outputs]: New output "doc".
    [configure-flags](gtk-doc): New flag.
    [phases](patch-docbook-xml,move-doc): New phases.
    [native-inputs]: Add docbook-xml-4.3, docbook-xsl, gtk-doc and libxslt.
---
 gnu/packages/gtk.scm | 33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index fa3a69d..b815c8e 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -548,9 +548,24 @@ printing and other features typical of a source code 
editor.")
               (base32
                "1hcswszqnsyqzzf5zk8iflxdvkfvvcg89pf6xsqwbyyabwdxfqyi"))))
    (build-system meson-build-system)
+   (outputs '("out" "doc"))
    (arguments
-    '(#:phases
+    `(#:configure-flags
+      (list
+       ,@(if (%current-target-system)
+             ;; If true, gtkdoc-scangobj will try to execute a
+             ;; cross-compiled binary.
+             '("-Dgtk_doc=false")
+             '("-Dgtk_doc=true")))
+      #:phases
       (modify-phases %standard-phases
+        (add-after 'unpack 'patch-docbook-xml
+          (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
+            (substitute* (find-files "docs" "\\.xml\\.in$")
+              (("http://www.oasis-open.org/docbook/xml/4.3/";)
+               (string-append
+                (assoc-ref (or native-inputs inputs) "docbook-xml-4.3")
+                "/xml/dtd/docbook/")))))
         (add-before
          'check 'pre-check
          (lambda* (#:key inputs #:allow-other-keys)
@@ -560,12 +575,24 @@ printing and other features typical of a source code 
editor.")
              (setenv "DISPLAY" ":1")
              ;; For the missing /etc/machine-id.
              (setenv "DBUS_FATAL_WARNINGS" "0")
-             #t))))))
+             #t)))
+        (add-after 'install 'move-doc
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let* ((out (assoc-ref outputs "out"))
+                   (doc (assoc-ref outputs "doc")))
+              (mkdir-p (string-append doc "/share/gtk-doc"))
+              (rename-file
+               (string-append out "/share/gtk-doc")
+               (string-append doc "/share/gtk-doc"))))))))
    (native-inputs
-    `(("glib:bin" ,glib "bin") ; for glib-genmarshal, etc.
+    `(("docbook-xml-4.3" ,docbook-xml-4.3)
+      ("docbook-xsl" ,docbook-xsl)
+      ("glib:bin" ,glib "bin") ; for glib-genmarshal, etc.
+      ("gtk-doc" ,gtk-doc)
       ("intltool" ,intltool)
       ("itstool" ,itstool)
       ("gobject-introspection" ,gobject-introspection)
+      ("libxslt" ,libxslt)
       ("pkg-config" ,pkg-config)
       ("vala" ,vala)
       ;; For testing.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]