Subject: [PATCH gnome-team 16/44] gnu: glib: Fix build.

From: Maxim Cournoyer <[email-masked]>
Date: Mon, 11 Nov 2024 15:16:59 +0900

* gnu/packages/glib.scm (glib-with-documentation) [native-inputs]: Remove
docbook-xml-4.2, docbook-xml, docbook-xsl, gtk-doc, libxml2, libxslt inputs.
Add gi-docgen and python-docutils.
[arguments] <configure-flags> Replace 'gtk_doc' option with 'documentation'.
<phases>: Delete patch-docbook-xml phase.  Adjust move-doc phase.

Change-Id: I964a79603ff80ee8a22bb2d9ebe07f05a1f79e57
---
 gnu/packages/glib.scm | 35 +++++++++--------------------------
 1 file changed, 9 insertions(+), 26 deletions(-)

diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 1a8ecdad35..2732d739bf 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -545,41 +545,24 @@ (define-public glib-with-documentation
   (let ((base glib))
     (package/inherit base
       (properties (alist-delete 'hidden? (package-properties base)))
-      (outputs (cons "doc" (package-outputs base))) ; 20 MiB of GTK-Doc reference
+      (outputs (cons "doc" (package-outputs base)))
       (native-inputs
-       `(("docbook-xml-4.2" ,docbook-xml-4.2)
-         ("docbook-xml-4.5" ,docbook-xml)
-         ("docbook-xsl" ,docbook-xsl)
-         ("gtk-doc" ,gtk-doc/stable)
-         ("libxml2" ,libxml2)
-         ("xsltproc" ,libxslt)
-         ,@(package-native-inputs base)))
+       (modify-inputs (package-native-inputs base)
+         (append gi-docgen python-docutils)))
       (arguments
        (substitute-keyword-arguments (package-arguments base)
          ((#:configure-flags flags ''())
-          #~(cons "-Dgtk_doc=true"
+          #~(cons "-Ddocumentation=true"
                   (delete "-Dman=false" #$flags)))
          ((#:phases phases)
           #~(modify-phases #$phases
-              (add-after 'unpack 'patch-docbook-xml
-                (lambda* (#:key inputs #:allow-other-keys)
-                  (with-directory-excursion "docs"
-                    (substitute* (find-files "." "\\.xml$")
-                      (("http://www.oasis-open.org/docbook/xml/4\\.5/")
-                       (string-append (assoc-ref inputs "docbook-xml-4.5")
-                                      "/xml/dtd/docbook/"))
-                      (("http://www.oasis-open.org/docbook/xml/4\\.2/")
-                       (string-append (assoc-ref inputs "docbook-xml-4.2")
-                                      "/xml/dtd/docbook/"))))))
               (add-after 'install 'move-doc
-                (lambda* (#:key outputs #:allow-other-keys)
-                  (let* ((out (assoc-ref outputs "out"))
-                         (doc (assoc-ref outputs "doc"))
-                         (html (string-append "/share/gtk-doc")))
-                    (mkdir-p (string-append doc "/share"))
+                (lambda _
+                  (let ((doc "/share/doc"))
+                    (mkdir-p (string-append #$output:doc "/share"))
                     (rename-file
-                     (string-append out html)
-                     (string-append doc html))))))))))))
+                     (string-append #$output doc)
+                     (string-append #$output:doc doc))))))))))))
 
 (define (python-extension-suffix python triplet)
   "Determine the suffix for C extensions for PYTHON when compiled
-- 
2.46.0