diff mbox series

[bug#49327,core-updates,005/128] gnu: guix-build-coordinator: Simplify usage of 'wrap-program'.

Message ID 20210702100814.23249-5-maximedevos@telenet.be
State New
Headers show
Series Add 'bash' input for 'wrap-program'. | expand

Commit Message

M July 2, 2021, 10:06 a.m. UTC
* gnu/packages/package-management.scm
  (guix-build-coordinator)[arguments]<#:phases>{wrap-executable}:
  Set #:sh argument of 'wrap-program'. Don't substitute the interpreter
  with another interpreter. Drop the 'target' argument.
  (guix-build-coordinator)[inputs]{bash}: Make this input unconditional.
---
 gnu/packages/package-management.scm | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

Comments

Ludovic Courtès July 8, 2021, 1:35 p.m. UTC | #1
Hi!

Maxime Devos <maximedevos@telenet.be> skribis:

> * gnu/packages/package-management.scm
>   (guix-build-coordinator)[arguments]<#:phases>{wrap-executable}:
>   Set #:sh argument of 'wrap-program'. Don't substitute the interpreter
>   with another interpreter. Drop the 'target' argument.
>   (guix-build-coordinator)[inputs]{bash}: Make this input unconditional.

[...]

> +                      (bash (assoc-ref inputs "bash"))
>                        (version (target-guile-effective-version))
>                        (scm (string-append out "/share/guile/site/" version))
>                        (go  (string-append out "/lib/guile/" version "/site-ccache")))
> @@ -1079,7 +1081,7 @@ environments.")
>                                           ,@(if (hurd-target?)
>                                                 '()
>                                                 '("guile-fibers")))))
> -                      (wrap-program file
> +                      (wrap-program file #:sh (string-append bash "/bin/bash")

I think we should write:

  (search-input-file inputs "/bin/bash")

in such cases from now on, rather than (assoc-ref inputs …) & co.

Ludo’.
Maxim Cournoyer Oct. 20, 2023, 4:09 a.m. UTC | #2
Hi,

Maxime Devos <maximedevos@telenet.be> writes:

> * gnu/packages/package-management.scm
>   (guix-build-coordinator)[arguments]<#:phases>{wrap-executable}:
>   Set #:sh argument of 'wrap-program'. Don't substitute the interpreter
>   with another interpreter. Drop the 'target' argument.
>   (guix-build-coordinator)[inputs]{bash}: Make this input unconditional.

Appears obsolete on current core-updates.
diff mbox series

Patch

diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 7229723ab8..680fd18a7e 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -17,6 +17,7 @@ 
 ;;; Copyright © 2020 Jesse Gibbons <jgibbons2357+guix@gmail.com>
 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1056,10 +1057,11 @@  environments.")
                (setenv "GUILE_AUTO_COMPILE" "0")
                #t))
            (add-after 'install 'wrap-executable
-             (lambda* (#:key inputs outputs target #:allow-other-keys)
+             (lambda* (#:key inputs outputs #:allow-other-keys)
                (let* ((out (assoc-ref outputs "out"))
                       (bin (string-append out "/bin"))
                       (guile (assoc-ref inputs "guile"))
+                      (bash (assoc-ref inputs "bash"))
                       (version (target-guile-effective-version))
                       (scm (string-append out "/share/guile/site/" version))
                       (go  (string-append out "/lib/guile/" version "/site-ccache")))
@@ -1079,7 +1081,7 @@  environments.")
                                          ,@(if (hurd-target?)
                                                '()
                                                '("guile-fibers")))))
-                      (wrap-program file
+                      (wrap-program file #:sh (string-append bash "/bin/bash")
                         `("PATH" ":" prefix
                           (,bin
                            ;; Support building without sqitch as an input, as it
@@ -1104,14 +1106,7 @@  environments.")
                                          (assoc-ref inputs input)
                                          version))
                                       guile-inputs)
-                                 ":"))))
-                      (when target
-                        ;; XXX work around wrap-program picking bash for the
-                        ;; host rather than target
-                        (let ((bash (assoc-ref inputs "bash")))
-                          (substitute* file
-                            (("^#!.*/bash")
-                             (string-append "#! " bash "/bin/bash")))))))
+                                 ":"))))))
                   (find-files bin)))
                #t))
            (delete 'strip))))             ; As the .go files aren't compatible
@@ -1131,9 +1126,7 @@  environments.")
          ("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))))
       (inputs
        `(("guile" ,@(assoc-ref (package-native-inputs guix) "guile"))
-         ,@(if (%current-target-system)
-               `(("bash" ,bash-minimal))
-               '())
+         ("bash" ,bash-minimal) ; for wrap-program
          ("sqlite" ,sqlite)
          ,@(if (hurd-target?)
                '()