Subject: [bug#49025] [PATCH core-updates 33/37] tk: Do not use %build-inputs when cross-compiling.

From: Maxime Devos <[email-masked]>
Date: Mon, 14 Jun 2021 17:39:22 +0200

%build-inputs does not exists when cross-compiling,
so use #$(this-package-input ...) instead.

* gnu/packages/tcl.scm
  (tk)[arguments]<#:configure-flags>: Use 'this-package-input'
  instead of '%build-inputs' when cross-compiling.
---
 gnu/packages/tcl.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/tcl.scm b/gnu/packages/tcl.scm
index c87a8187f2..91ba8bbb3f 100644
--- a/gnu/packages/tcl.scm
+++ b/gnu/packages/tcl.scm
@@ -29,6 +29,7 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix utils)
+  #:use-module (guix gexp)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
   #:use-module (guix build-system perl)
@@ -232,7 +233,9 @@ X11 GUIs.")
        #:configure-flags
        ,#~
        (list (string-append "--with-tcl="
-                            (assoc-ref %build-inputs "tcl")
+                            #$(if (%current-target-system)
+                                  (this-package-input "tcl")
+                                  #~(assoc-ref %build-inputs "tcl"))
                             "/lib")
              ;; This is needed when cross-compiling, see:
              ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247