Subject: [bug#50201] [PATCH 30/52] gnu: json-glib: Find docbook inputs when cross-compiling.

From: Maxime Devos <[email-masked]>
Date: Wed, 25 Aug 2021 20:03:10 +0200

* gnu/packages/gnome.scm (json-glib)[arguments]<#:phases>{patch-docbook}:
  Look up "docbook-xml" in 'native-inputs', not 'inputs', when
  cross-compiling.
---
 gnu/packages/gnome.scm | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index f0f3c0aeef..c0b6d010c7 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -4581,15 +4581,24 @@ configuration storage systems.")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-docbook
-           (lambda* (#:key inputs #:allow-other-keys)
+           ;; TODO(core-updates): Use (or native-inputs inputs)
+           ;; unconditionally.
+           (lambda* (#:key ,@(if (%current-target-system)
+                                 '(native-inputs)
+                                 '()) 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")
+                  (string-append (assoc-ref ,(if (%current-target-system)
+                                                 '(or native-inputs inputs)
+                                                 'inputs)
+                                            "docbook-xml")
                                  "/xml/dtd/docbook/")))
                (substitute* "meson.build"
                  (("http://docbook.sourceforge.net/release/xsl/current/")
-                  (string-append (assoc-ref inputs "docbook-xsl")
+                  (string-append (assoc-ref ,(if (%current-target-system)
+                                                 '(or native-inputs inputs)
+                                                 'inputs) "docbook-xsl")
                                  "/xml/xsl/docbook-xsl-1.79.2/"))))
              #t))
          (add-after 'install 'move-docs
-- 
2.33.0