janneke pushed a commit to branch wip-hurd-vm in repository guix. commit fcc40787d29a8ca10bfa93656d2ef4c8bef0b1f7 Author: Jan (janneke) Nieuwenhuizen <jann...@gnu.org> AuthorDate: Wed Apr 8 09:43:51 2020 +0200
gnu: guix: Cross-build fixup for wrap-program. This allows running: guix build hello * gnu/packages/package-management.scm (guix)[arguments]: When cross-compiling, add 'wrap-program:substitute-host-bash phase to fixup the shebang generated by wrap-program. [inputs]: When cross-compiling, include bash-minimal. --- gnu/packages/package-management.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 94003fa..69d325a 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -37,6 +37,7 @@ #:use-module (gnu packages autotools) #:use-module (gnu packages backup) #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages bdw-gc) #:use-module (gnu packages bison) #:use-module (gnu packages bootstrap) ;for 'bootstrap-guile-origin' @@ -183,7 +184,14 @@ $(prefix)/etc/init.d\n"))) (invoke "sh" "bootstrap"))) ,@(if (%current-target-system) - '() + `((add-after 'wrap-program 'wrap-program:substitute-host-bash + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; XXX Touching wrap-program rebuilds world + (let ((out (assoc-ref outputs "out")) + (bash (assoc-ref inputs "bash"))) + (substitute* (string-append out "/bin/guix") + (("^#!.*/bash") (string-append "#! " bash "/bin/bash"))) + #t)))) `((add-before 'check 'copy-bootstrap-guile (lambda* (#:key system inputs #:allow-other-keys) ;; Copy the bootstrap guile tarball in the store used @@ -333,6 +341,9 @@ $(prefix)/etc/init.d\n"))) (string=? (%current-system) "x86_64-linux")) `(("boot-guile/i686" ,(bootstrap-guile-origin "i686-linux"))) '()) + ,@(if (%current-target-system) + `(("bash" ,bash-minimal)) + '()) ;; Tests also rely on these bootstrap executables. ("bootstrap/bash" ,(bootstrap-executable "bash" (%current-system)))