diff mbox series

[bug#49025,[PATCH,v2,core-updates] 26/37] bash: Fix cross-compilation build error.

Message ID 20210618160936.18972-26-maximedevos@telenet.be
State Accepted
Headers show
Series [bug#49025,[PATCH,v2,core-updates] 26/37] bash: Fix cross-compilation build error. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

M June 18, 2021, 4:09 p.m. UTC
%build-inputs does not exist when cross-compiling,
so use this-package-input instead.

* gnu/packages/bash.scm
  (bash)[arguments]<#:configure-flags>: Use this-package-input
  instead of %build-inputs.
---
 gnu/packages/bash.scm | 35 +++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index b3af873a66..d51ab26bc8 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -103,22 +103,25 @@  number/base32-hash tuples, directly usable in the 'patch-series' form."
           1))
 
 (define-public bash
-  (let* ((cppflags (string-join '("-DDEFAULT_PATH_VALUE='\"/no-such-path\"'"
-                                  "-DSTANDARD_UTILS_PATH='\"/no-such-path\"'"
-                                  "-DNON_INTERACTIVE_LOGIN_SHELLS"
-                                  "-DSSH_SOURCE_BASHRC")
-                                " "))
-         (configure-flags
-          #~`("--with-installed-readline"
-              ,#$(string-append "CPPFLAGS=" cppflags)
-              ,(string-append
-                "LDFLAGS=-Wl,-rpath -Wl,"
-                (assoc-ref %build-inputs "readline")
-                "/lib"
-                " -Wl,-rpath -Wl,"
-                (assoc-ref %build-inputs "ncurses")
-                "/lib")))
-         (version "5.1"))
+  (let ((cppflags (string-join '("-DDEFAULT_PATH_VALUE='\"/no-such-path\"'"
+                                 "-DSTANDARD_UTILS_PATH='\"/no-such-path\"'"
+                                 "-DNON_INTERACTIVE_LOGIN_SHELLS"
+                                 "-DSSH_SOURCE_BASHRC")
+                               " "))
+        (version "5.1"))
+    ;; Delay expansion to inside a lexical environment
+    ;; where this-package is bound.
+    (define-syntax configure-flags
+      (identifier-syntax
+       #~`("--with-installed-readline"
+           ,#$(string-append "CPPFLAGS=" cppflags)
+           ,(string-append
+             "LDFLAGS=-Wl,-rpath -Wl,"
+             ;; %build-inputs does not exist when cross-compiling,
+             ;; so use this-package-input instead.
+             #$(file-append (this-package-input "readline") "/lib")
+             " -Wl,-rpath -Wl,"
+             #$(file-append (this-package-input "ncurses") "/lib")))))
     (package
      (name "bash")
      (source (origin