@@ -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