Subject: [bug#50201] [PATCH 47/52] gnu: wayland: Find docbook-xml when cross-compiling.

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

* gnu/packages/freedesktop.scm
  (wayland)[arguments]<#:phases>{patchdocbook-xml}: Look in 'native-inputs'
  instead of 'inputs' when cross-compiling.
---
 gnu/packages/freedesktop.scm | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 9384ecd3f2..2e696f3848 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -979,14 +979,22 @@ Python.")
         #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-docbook-xml
-           (lambda* (#:key inputs #:allow-other-keys)
+           ;; TODO(core-updates): Use 'native-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\\.5/")
-                  (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/"))
                  (("http://www.oasis-open.org/docbook/xml/4\\.2/")
-                  (string-append (assoc-ref inputs "docbook-xml-4.2")
+                  (string-append (assoc-ref ,(if (%current-target-system)
+                                                 '(or native-inputs inputs)
+                                                 'inputs) "docbook-xml-4.2")
                                  "/xml/dtd/docbook/"))))
              #t))
          (add-after 'install 'move-doc
-- 
2.33.0