unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: 47869@debbugs.gnu.org
Subject: [bug#47869] [PATCH v4 core-updates] various cross-compilation fixes in guix/build/utils.scm
Date: Wed, 02 Jun 2021 09:56:11 +0200	[thread overview]
Message-ID: <c7e4fc629adaf7c44f618cfdb38c05d34cb5aec4.camel@telenet.be> (raw)
In-Reply-To: <0892bdfbc097b07631190c8526a41d57b456d343.camel@telenet.be>


[-- Attachment #1.1: Type: text/plain, Size: 387 bytes --]

Hi guix,

This is version 4 of the patch series.
It lets 'search-input-file' raise the new
&search-error exception instead of misc-error.

The documentation of 'search-input-file' has been
adjusted to give an example of how it can be used.

Also, there is one new test in tests/build-utils.scm
("search-input-file: can search in multiple directories").

Greetings,
Maxime.

[-- Attachment #1.2: 0001-build-Allow-overriding-the-shell-interpreter-in-wrap.patch --]
[-- Type: text/x-patch, Size: 3141 bytes --]

From 02d2b52458fae1c391e79f89a89696f3b07fdb2b Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 18:22:31 +0200
Subject: [PATCH 01/18] =?UTF-8?q?build:=20Allow=20overriding=20the=20shell?=
 =?UTF-8?q?=20interpreter=20in=20=E2=80=98wrap-program=E2=80=99.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Previously, when creating new wrappers, 'wrap-program' would search
for an interpreter to use in PATH. However, this is incorrect when
cross-compiling. Allow overriding the shell interpreter to use,
via an optional keyword argument #:sh.

In time, when all users of 'wrap-program' have been corrected,
this keyword argument can be made mandatory.

* guix/build/utils.scm (wrap-program): Introduce a #:sh keyword
  argument, defaulting to (which "sh"). Use this keyword argument.

Partially-Fixes: <https://issues.guix.gnu.org/47869>
---
 guix/build/utils.scm | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index dbfc0a9142..c6731b37ae 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1234,7 +1235,7 @@ known as `nuke-refs' in Nixpkgs."
          (and (string-prefix? "." base)
               (string-suffix? "-real" base)))))
 
-(define* (wrap-program prog #:rest vars)
+(define* (wrap-program prog #:key (sh (which "bash")) #:rest vars)
   "Make a wrapper for PROG.  VARS should look like this:
 
   '(VARIABLE DELIMITER POSITION LIST-OF-DIRECTORIES)
@@ -1261,7 +1262,12 @@ programs that expect particular shared libraries to be in $LD_LIBRARY_PATH, or
 modules in $GUILE_LOAD_PATH, etc.
 
 If PROG has previously been wrapped by 'wrap-program', the wrapper is extended
-with definitions for VARS."
+with definitions for VARS. If it is not, SH will be used as interpreter."
+  (define vars/filtered
+    (match vars
+      ((#:sh _ . vars) vars)
+      (vars vars)))
+
   (define wrapped-file
     (string-append (dirname prog) "/." (basename prog) "-real"))
 
@@ -1315,7 +1321,7 @@ with definitions for VARS."
         (for-each (lambda (var)
                     (display (export-variable var) port)
                     (newline port))
-                  vars)
+                  vars/filtered)
         (display last port)
         (close-port port))
 
@@ -1327,8 +1333,8 @@ with definitions for VARS."
           (lambda (port)
             (format port
                     "#!~a~%~a~%exec -a \"$0\" \"~a\" \"$@\"~%"
-                    (which "bash")
-                    (string-join (map export-variable vars) "\n")
+                    sh
+                    (string-join (map export-variable vars/filtered) "\n")
                     (canonicalize-path wrapped-file))))
 
         (chmod prog-tmp #o755)
-- 
2.31.1


[-- Attachment #1.3: 0002-build-Define-search-input-file-procedure.patch --]
[-- Type: text/x-patch, Size: 6023 bytes --]

From 232d0c5a8814690ecb39af86b0d30c174003c752 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 18:36:09 +0200
Subject: [PATCH 02/18] =?UTF-8?q?build:=20Define=20=E2=80=98search-input-f?=
 =?UTF-8?q?ile=E2=80=99=20procedure.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The procedure ‘which’ from (guix build utils)
is used for two different purposes:

  1. for finding the absolute file name of a binary
     that needs to run during the build process

  2. for finding the absolute file name of a binary,
     for the target system (as in --target=TARGET),
     e.g. for substituting sh->/gnu/store/.../bin/sh,
     python->/gnu/store/.../bin/python.

When compiling natively (target=#f in Guix parlance),
this is perfectly fine.

However, when cross-compiling, there is a problem.
"which" looks in $PATH for binaries.  That's good for purpose (1),
but incorrect for (2), as the $PATH contains binaries from native-inputs
instead of inputs.

This commit defines a ‘search-input-file’ procedure. It functions
like 'which', but instead of searching in $PATH, it searches in
the 'inputs' of the build phase, which must be passed to
‘search-input-file’ as an argument. Also, the file name must
include "bin/" or "sbin/" as appropriate.

* guix/build/utils.scm (search-input-file): New procedure.
* tests/build-utils.scm
  ("search-input-file: exception if not found")
  ("search-input-file: can find if existent"): Test it.
* doc/guix.texi (File Search): Document it.

Partially-Fixes: <https://issues.guix.gnu.org/47869>
Co-Authored-By: Ludovic Courtès <ludo@gnu.org>
---
 doc/guix.texi         | 20 ++++++++++++++++++++
 guix/build/utils.scm  | 21 ++++++++++++++++++++-
 tests/build-utils.scm | 25 +++++++++++++++++++++++++
 3 files changed, 65 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 535e7614fd..3557c977e1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8661,6 +8661,26 @@ Return the complete file name for @var{program} as found in
 @code{$PATH}, or @code{#f} if @var{program} could not be found.
 @end deffn
 
+@deffn {Scheme Procedure} search-input-file @var{inputs} @var{name}
+Return the complete file name for @var{name} as found in @var{inputs}.
+If @var{name} could not be found, an exception is raised instead.
+Here, @var{inputs} is an association list like @var{inputs} and
+@var{native-inputs} as available to build phases.
+@end deffn
+
+Here is a (simplified) example of how @code{search-input-file} is used
+in a build phase of the @code{wireguard-tools} package:
+
+@lisp
+(add-after 'install 'wrap-wg-quick
+  (lambda* (#:key inputs outputs #:allow-other-keys)
+    (let ((coreutils (string-append (assoc-ref inputs "coreutils")
+                                    "/bin")))
+      (wrap-program (search-input-file outputs "bin/wg-quick")
+        #:sh (search-input-file inputs "bin/bash")
+        `("PATH" ":" prefix ,(list coreutils))))))
+@end lisp
+
 @subsection Build Phases
 
 @cindex build phases
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index c6731b37ae..2636da392f 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2015, 2018, 2021 Mark H Weaver <mhw@netris.org>
@@ -80,6 +80,10 @@
             search-path-as-string->list
             list->search-path-as-string
             which
+            search-input-file
+            search-error?
+            search-error-path
+            search-error-file
 
             every*
             alist-cons-before
@@ -614,6 +618,21 @@ PROGRAM could not be found."
   (search-path (search-path-as-string->list (getenv "PATH"))
                program))
 
+(define-condition-type &search-error &error
+  search-error?
+  (path         search-error-path)
+  (file         search-error-file))
+
+(define (search-input-file inputs file)
+  "Find a file named FILE among the INPUTS and return its absolute file name.
+
+FILE must be a string like \"bin/sh\". If FILE is not found, an exception is
+raised."
+  (match inputs
+    (((_ . directories) ...)
+     (or (search-path directories file)
+         (raise (condition (&search-error (path directories) (file file))))))))
+
 \f
 ;;;
 ;;; Phases.
diff --git a/tests/build-utils.scm b/tests/build-utils.scm
index 31be7ff80f..6b131c0af8 100644
--- a/tests/build-utils.scm
+++ b/tests/build-utils.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2012, 2015, 2016, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -263,4 +264,28 @@ print('hello world')"))
          (lambda _
            (get-string-all (current-input-port))))))))
 
+(test-equal "search-input-file: exception if not found"
+  `((path)
+    (file . "does-not-exist"))
+  (guard (e ((search-error? e)
+             `((path . ,(search-error-path e))
+               (file . ,(search-error-file e)))))
+    (search-input-file '() "does-not-exist")))
+
+(test-equal "search-input-file: can find if existent"
+  (which "guile")
+  (search-input-file
+    `(("guile/bin" . ,(dirname (which "guile"))))
+    "guile"))
+
+(test-equal "search-input-file: can search in multiple directories"
+  (which "guile")
+  (call-with-temporary-directory
+    (lambda (directory)
+      (search-input-file
+        `(("irrelevant" . ,directory)
+          ("guile/bin" . ,(dirname (which "guile"))))
+        "guile"))))
+
+
 (test-end)
-- 
2.31.1


[-- Attachment #1.4: 0003-glib-or-gtk-build-system-Look-up-the-interpreter-in-.patch --]
[-- Type: text/x-patch, Size: 3793 bytes --]

From 51aad468090519e063efcddb5aa2afdf19d8da1d Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Tue, 1 Jun 2021 21:47:01 +0200
Subject: [PATCH 03/18] glib-or-gtk-build-system: Look up the interpreter in
 'inputs'.

* guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Pass
  the shell interpreter from 'inputs' to 'wrap-program' using
  'search-input-file'.

Partially-Fixes: <https://issues.guix.gnu.org/47869>
---
 guix/build/glib-or-gtk-build-system.scm | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/guix/build/glib-or-gtk-build-system.scm b/guix/build/glib-or-gtk-build-system.scm
index ccb3138fe2..8d3c3684d3 100644
--- a/guix/build/glib-or-gtk-build-system.scm
+++ b/guix/build/glib-or-gtk-build-system.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
 ;;; Copyright © 2014, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -136,6 +137,11 @@ Wrapping is not applied to outputs whose name is listed in
 GLIB-OR-GTK-WRAP-EXCLUDED-OUTPUTS.  This is useful when an output is known not
 to contain any GLib or GTK+ binaries, and where wrapping would gratuitously
 add a dependency of that output on GLib and GTK+."
+  ;; Do not require bash to be present in the package inputs
+  ;; even when there is nothing to wrap.
+  ;; Also, calculate (sh) only once to prevent some I/O.
+  (define %sh (delay (search-input-file inputs "bin/bash")))
+  (define (sh) (force %sh))
   (define handle-output
     (match-lambda
      ((output . directory)
@@ -165,36 +171,36 @@ add a dependency of that output on GLib and GTK+."
                     #f)))
           (cond
            ((and data-env-var gtk-mod-env-var gio-mod-env-var)
-            (for-each (cut wrap-program <>
+            (for-each (cut wrap-program <> #:sh (sh)
                            data-env-var
                            gtk-mod-env-var
                            gio-mod-env-var)
                       bin-list))
            ((and data-env-var gtk-mod-env-var (not gio-mod-env-var))
-            (for-each (cut wrap-program <>
+            (for-each (cut wrap-program <> #:sh (sh)
                            data-env-var
                            gtk-mod-env-var)
                       bin-list))
            ((and data-env-var (not gtk-mod-env-var) gio-mod-env-var)
-            (for-each (cut wrap-program <>
+            (for-each (cut wrap-program <> #:sh (sh)
                            data-env-var
                            gio-mod-env-var)
                       bin-list))
            ((and (not data-env-var) gtk-mod-env-var gio-mod-env-var)
-            (for-each (cut wrap-program <>
+            (for-each (cut wrap-program <> #:sh (sh)
                            gio-mod-env-var
                            gtk-mod-env-var)
                       bin-list))
            ((and data-env-var (not gtk-mod-env-var) (not gio-mod-env-var))
-            (for-each (cut wrap-program <>
+            (for-each (cut wrap-program <> #:sh (sh)
                            data-env-var)
                       bin-list))
            ((and (not data-env-var) gtk-mod-env-var (not gio-mod-env-var))
-            (for-each (cut wrap-program <>
+            (for-each (cut wrap-program <> #:sh (sh)
                            gtk-mod-env-var)
                       bin-list))
            ((and (not data-env-var) (not gtk-mod-env-var) gio-mod-env-var)
-            (for-each (cut wrap-program <>
+            (for-each (cut wrap-program <> #:sh (sh)
                            gio-mod-env-var)
                       bin-list))))))))
 
-- 
2.31.1


[-- Attachment #1.5: 0004-python-build-system-Look-up-the-interpreter-in-input.patch --]
[-- Type: text/x-patch, Size: 1872 bytes --]

From 852d494e3b59f8ea0e7e4fd7ef5f4f4e8fff06c6 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Tue, 1 Jun 2021 21:48:44 +0200
Subject: [PATCH 04/18] python-build-system: Look up the interpreter in
 'inputs'.

* guix/build/python-build-system.scm (wrap): Pass the shell
  interpreter from 'inputs' to 'wrap-program' using 'search-input-file'.

Partially-Fixes: <https://issues.guix.gnu.org/47869>
---
 guix/build/python-build-system.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm
index 5b1339d14c..08871f60cd 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2021 Lars-Dominik Braun <lars@6xq.net>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -234,12 +235,18 @@ running checks after installing the package."
                          (string-append dir "/sbin"))))
                 outputs))
 
+  ;; Do not require "bash" to be present in the package inputs
+  ;; even when there is nothing to wrap.
+  ;; Also, calculate (sh) only once to prevent some I/O.
+  (define %sh (delay (search-input-file inputs "bin/bash")))
+  (define (sh) (force %sh))
+
   (let* ((var `("GUIX_PYTHONPATH" prefix
                 ,(search-path-as-string->list
                   (or (getenv "GUIX_PYTHONPATH") "")))))
     (for-each (lambda (dir)
                 (let ((files (list-of-files dir)))
-                  (for-each (cut wrap-program <> var)
+                  (for-each (cut wrap-program <> #:sh (sh) var)
                             files)))
               bindirs)))
 
-- 
2.31.1


[-- Attachment #1.6: 0005-qt-build-system-Look-up-the-interpreter-in-inputs.patch --]
[-- Type: text/x-patch, Size: 1919 bytes --]

From 0fd271eb0a955eb693ce86d4312f60b74f875908 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:20:12 +0200
Subject: [PATCH 05/18] qt-build-system: Look up the interpreter in 'inputs'.

* guix/build/qt-build-system.scm (wrap-all-programs): Pass
  the shell interpreter from 'inputs' to 'wrap-program' using
  'search-input-file'.

Partially-Fixes: <https://issues.guix.gnu.org/47869>
---
 guix/build/qt-build-system.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/guix/build/qt-build-system.scm b/guix/build/qt-build-system.scm
index 762fd8a2ee..ec7ceb38bd 100644
--- a/guix/build/qt-build-system.scm
+++ b/guix/build/qt-build-system.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2014, 2015, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2019, 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -126,6 +127,12 @@ add a dependency of that output on Qt."
            (((_ . dir) ...)
             dir)))
 
+  ;; Do not require bash to be present in the package inputs
+  ;; even when there is nothing to wrap.
+  ;; Also, calculate (sh) only once to prevent some I/O.
+  (define %sh (delay (search-input-file inputs "bin/bash")))
+  (define (sh) (force %sh))
+
   (define handle-output
     (match-lambda
      ((output . directory)
@@ -135,7 +142,7 @@ add a dependency of that output on Qt."
                              (append (list directory)
                                      input-directories))))
           (when (not (null? vars-to-wrap))
-            (for-each (cut apply wrap-program <> vars-to-wrap)
+            (for-each (cut apply wrap-program <> #:sh (sh) vars-to-wrap)
                       bin-list)))))))
 
   (for-each handle-output outputs)
-- 
2.31.1


[-- Attachment #1.7: 0006-rakudo-build-system-Look-up-the-interpreter-in-input.patch --]
[-- Type: text/x-patch, Size: 1846 bytes --]

From f7fb5c8a4e65965c7f7ce15a81782a89d1f3ec80 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:21:16 +0200
Subject: [PATCH 06/18] rakudo-build-system: Look up the interpreter in
 'inputs'.

* guix/build/rakudo-build-system.scm (wrap): Pass
  the shell interpreter from 'inputs' to 'wrap-program' using
  'search-input-file'.

Partially-Fixes: <https://issues.guix.gnu.org/47869>
---
 guix/build/rakudo-build-system.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/guix/build/rakudo-build-system.scm b/guix/build/rakudo-build-system.scm
index b2c090f946..5cf1cc55bc 100644
--- a/guix/build/rakudo-build-system.scm
+++ b/guix/build/rakudo-build-system.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -108,6 +109,12 @@
                         (string-append dir "/sbin"))))
                 outputs))
 
+  ;; Do not require bash to be present in the package inputs
+  ;; even when there is nothing to wrap.
+  ;; Also, calculate (sh) only once to prevent some I/O.
+  (define %sh (delay (search-input-file inputs "bin/bash")))
+  (define (sh) (force %sh))
+
   (let* ((out  (assoc-ref outputs "out"))
          (var `("PERL6LIB" "," prefix
                 ,(cons (string-append out "/share/perl6/lib,"
@@ -117,7 +124,7 @@
                         (or (getenv "PERL6LIB") "") #\,)))))
     (for-each (lambda (dir)
                 (let ((files (list-of-files dir)))
-                  (for-each (cut wrap-program <> var)
+                  (for-each (cut wrap-program <> #:sh (sh) var)
                             files)))
               bindirs)
     #t))
-- 
2.31.1


[-- Attachment #1.8: 0007-gnu-carla-Set-guile-argument-of-wrap-script.patch --]
[-- Type: text/x-patch, Size: 1331 bytes --]

From 45d3f442dbf855619f19d4d6591585279bf1e846 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:41:22 +0200
Subject: [PATCH 07/18] gnu: carla: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/audio.scm
  (carla)[arguments]<#:phases>{wrap-executables}:
  Set #:guile argument of ‘wrap-script’.
---
 gnu/packages/audio.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index f677d46a7f..930c111d5e 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -4711,9 +4711,10 @@ as is the case with audio plugins.")
                (chmod (string-append out "/share/carla/carla") #o555)
                #t)))
          (add-after 'install 'wrap-executables
-           (lambda* (#:key outputs #:allow-other-keys)
+           (lambda* (#:key inputs outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out")))
                (wrap-script (string-append out "/bin/carla")
+                            #:guile (search-input-file inputs "bin/guile")
                             `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))
                #t))))))
     (inputs
-- 
2.31.1


[-- Attachment #1.9: 0008-gnu-bats-Set-guile-argument-of-wrap-script.patch --]
[-- Type: text/x-patch, Size: 1068 bytes --]

From 045b440056a699f872cf258568612734b617cb36 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:42:58 +0200
Subject: [PATCH 08/18] gnu: bats: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bash.scm
  (bats)[arguments]<#:builder>: Set #:guile argument
  of ‘wrap-script’.
---
 gnu/packages/bash.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index 8dfbd7834e..7e98367bbb 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -402,6 +402,7 @@ capturing.")
          ;; Install phase
          (invoke "./install.sh" %output)
          (wrap-script (string-append %output "/bin/bats")
+                      #:guile (search-input-file %build-inputs "bin/guile")
                       (list "PATH" 'prefix (string-split (getenv "PATH")
                                                          #\:))))))
     (build-system trivial-build-system)
-- 
2.31.1


[-- Attachment #1.10: 0009-gnu-proteinortho-Set-guile-argument-of-wrap-script.patch --]
[-- Type: text/x-patch, Size: 1586 bytes --]

From 6d2cf56697d1bbced16a7ce4ef34304ddbbf73a7 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:46:22 +0200
Subject: [PATCH 09/18] gnu: proteinortho: Set #:guile argument of
 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bioinformatics.scm
  (proteinortho)[arguments]<#:phases>{wrap-programs}:
  Set #:guile argument of ‘wrap-script’.
---
 gnu/packages/bioinformatics.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 85f785955e..7d8496e692 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -5447,9 +5447,11 @@ predicts the locations of structural units in the sequences.")
          (add-after 'install 'wrap-programs
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let ((path (getenv "PATH"))
-                   (out (assoc-ref outputs "out")))
+                   (out (assoc-ref outputs "out"))
+                   (guile (search-input-file inputs "bin/guile")))
                (for-each (lambda (script)
-                           (wrap-script script `("PATH" ":" prefix (,path))))
+                           (wrap-script script #:guile guile
+                                        `("PATH" ":" prefix (,path))))
                          (cons (string-append out "/bin/proteinortho")
                                (find-files out "\\.(pl|py)$"))))
              #t)))))
-- 
2.31.1


[-- Attachment #1.11: 0010-gnu-prinseq-Set-guile-argument-of-wrap-script.patch --]
[-- Type: text/x-patch, Size: 1805 bytes --]

From 8363e0e350ee482cb4d14743371c933f5e9d8163 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:48:19 +0200
Subject: [PATCH 10/18] gnu: prinseq: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bioinformatics.scm
  (prinseq)[arguments]<#:phases>{install}:
  Set #:guile argument of ‘wrap-script’.
---
 gnu/packages/bioinformatics.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 7d8496e692..37483984ec 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -7557,7 +7557,8 @@ experience substantial biological insertions and deletions.")
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
                     (bin (string-append out "/bin"))
-                    (scripts (find-files "." "prinseq.*.pl")))
+                    (scripts (find-files "." "prinseq.*.pl"))
+                    (guile (search-input-file "bin/guile")))
                (substitute* scripts
                  (("\"perl -pe")
                   (string-append "\"" (which "perl") " -pe")))
@@ -7565,6 +7566,7 @@ experience substantial biological insertions and deletions.")
                            (chmod file #o555)
                            (install-file file bin)
                            (wrap-script (string-append bin "/" (basename file))
+                                        #:guile guile
                                         `("PERL5LIB" ":" prefix
                                           (,(getenv "PERL5LIB")))))
                          scripts)))))))
-- 
2.31.1


[-- Attachment #1.12: 0011-gnu-gess-Set-guile-argument-of-wrap-script.patch --]
[-- Type: text/x-patch, Size: 1607 bytes --]

From 398d1ef1a0d547b23a4972ecc619b2c70d908aa9 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:50:07 +0200
Subject: [PATCH 11/18] gnu: gess: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bioinformatics.scm
  (gess)[arguments]<#:phases>{install}
  Set #:guile argument of ‘wrap-script’.
---
 gnu/packages/bioinformatics.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 37483984ec..965e26b812 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -7554,7 +7554,7 @@ experience substantial biological insertions and deletions.")
          (delete 'configure)
          (delete 'build)
          (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
+           (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
                     (bin (string-append out "/bin"))
                     (scripts (find-files "." "prinseq.*.pl"))
@@ -10239,6 +10239,7 @@ matplotlib.use('Agg')
 " line)))
                ;; Make sure GESS has all modules in its path
                (wrap-script (string-append target "GESS.py")
+                 #:guile (search-input-file inputs "bin/guile")
                  `("GUIX_PYTHONPATH" ":" = (,target ,(getenv "GUIX_PYTHONPATH"))))
                (mkdir-p bin)
                (symlink (string-append target "GESS.py")
-- 
2.31.1


[-- Attachment #1.13: 0012-gnu-nanopolish-Set-guile-argument-of-wrap-script.patch --]
[-- Type: text/x-patch, Size: 2081 bytes --]

From afa806033297984b129a8c430a8e6f0e89693368 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:54:49 +0200
Subject: [PATCH 12/18] gnu: nanopolish: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/bioinformatics.scm
  (nanopolish)[arguments]<#:phases>{wrap-programs}:
  Set #:guile argument of ‘wrap-script’.
---
 gnu/packages/bioinformatics.scm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 965e26b812..fc2fc867ac 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -13583,16 +13583,18 @@ choosing which reads pass the filter.")
                            (find-files "scripts" ".*"))
                  #t)))
            (add-after 'install 'wrap-programs
-             (lambda* (#:key outputs #:allow-other-keys)
+             (lambda* (#:key inputs outputs #:allow-other-keys)
                (let ((pythonpath (getenv "GUIX_PYTHONPATH"))
                      (perl5lib (getenv "PERL5LIB"))
                      (scripts (string-append (assoc-ref outputs "out")
-                                             "/share/nanopolish/scripts")))
+                                             "/share/nanopolish/scripts"))
+                     (guile (search-input-file inputs "bin/guile")))
                  (for-each (lambda (file)
                              (wrap-program file `("GUIX_PYTHONPATH" ":" prefix (,pythonpath))))
                            (find-files scripts "\\.py"))
                  (for-each (lambda (file)
-                             (wrap-script file `("PERL5LIB" ":" prefix (,perl5lib))))
+                             (wrap-script file #:guile guile
+                                          `("PERL5LIB" ":" prefix (,perl5lib))))
                            (find-files scripts "\\.pl"))))))))
       (inputs
        `(("guile" ,guile-3.0) ; for wrappers
-- 
2.31.1


[-- Attachment #1.14: 0013-gnu-sieve-connect-Set-guile-argument-of-wrap-script.patch --]
[-- Type: text/x-patch, Size: 1043 bytes --]

From 12671858d0b145b7c40440621c628b624f2df7fd Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 19:58:53 +0200
Subject: [PATCH 13/18] gnu: sieve-connect: Set #:guile argument of
 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/mail.scm
  (sieve-connect)[arguments]<#:phases>{wrap-program}:
  Set #:guile argument of ‘wrap-script’.
---
 gnu/packages/mail.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index a885e2417c..7aed1aa5bd 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -2924,6 +2924,7 @@ transfer protocols.")
              (let ((out (assoc-ref outputs "out"))
                    (path (getenv "PERL5LIB")))
                (wrap-script (string-append out "/bin/sieve-connect")
+                 #:guile (search-input-file inputs "bin/guile")
                  `("PERL5LIB" ":" = (,path)))
                #t))))))
     (inputs
-- 
2.31.1


[-- Attachment #1.15: 0014-gnu-clipmenu-Set-guile-argument-of-wrap-script.patch --]
[-- Type: text/x-patch, Size: 1515 bytes --]

From 39d88a8d1cd801d119056efac7b93ca2883caf2c Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:04:30 +0200
Subject: [PATCH 14/18] gnu: clipmenu: Set #:guile argument of 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/xdisorg.scm
  (clipmenu)[arguments]<#:phases>{wrap-script}:
  Set #:guile argument of ‘wrap-script’.
---
 gnu/packages/xdisorg.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index de2cba8e57..d339851f51 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -2555,10 +2555,12 @@ tools to complement clipnotify.")
                       (gawk              (assoc-ref inputs "gawk"))
                       (util-linux        (assoc-ref inputs "util-linux"))
                       (xdotool           (assoc-ref inputs "xdotool"))
-                      (xsel              (assoc-ref inputs "xsel")))
+                      (xsel              (assoc-ref inputs "xsel"))
+                      (guile             (search-input-file inputs "bin/guile")))
                  (for-each
                   (lambda (prog)
                     (wrap-script (string-append out "/bin/" prog)
+                      #:guile guile
                       `("PATH" ":" prefix
                         ,(map (lambda (dir)
                                 (string-append dir "/bin"))
-- 
2.31.1


[-- Attachment #1.16: 0015-gnu-vpnc-scripts-Set-guile-argument-of-wrap-script.patch --]
[-- Type: text/x-patch, Size: 1522 bytes --]

From cc868239ba629f2046cdb0e27e294ac11bc8cb30 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:06:12 +0200
Subject: [PATCH 15/18] gnu: vpnc-scripts: Set #:guile argument of
 'wrap-script'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/vpn.scm
  (vpnc-scripts)[arguments]<#:phases>{wrap-scripts}:
  Set #:guile argument of ‘wrap-script’.
---
 gnu/packages/vpn.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index a952e3f0db..33ef87c52d 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -192,10 +192,12 @@ Only \"Universal TUN/TAP device driver support\" is needed in the kernel.")
              ;; Wrap scripts with paths to their common hard dependencies.
              ;; Optional dependencies will need to be installed by the user.
              (lambda* (#:key inputs outputs #:allow-other-keys)
-               (let ((out (assoc-ref outputs "out")))
+               (let ((out (assoc-ref outputs "out"))
+                     (guile (search-input-file inputs "bin/guile")))
                  (for-each
                   (lambda (script)
                     (wrap-script (string-append out "/etc/vpnc/" script)
+                      #:guile guile
                       `("PATH" ":" prefix
                         ,(map (lambda (name)
                                 (let ((input (assoc-ref inputs name)))
-- 
2.31.1


[-- Attachment #1.17: 0016-gnu-openconnect-sso-Set-sh-argument-of-wrap-program.patch --]
[-- Type: text/x-patch, Size: 1079 bytes --]

From 97746bc3bee9bf8c8a74c8d278567a819a14265c Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:09:45 +0200
Subject: [PATCH 16/18] gnu: openconnect-sso: Set #:sh argument of
 'wrap-program'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/vpn.scm
  (openconnect-sso)[arguments]<#:phases>{wrap-qt-process-path}
  Set #:sh argument of ‘wrap-program’.
---
 gnu/packages/vpn.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 33ef87c52d..584ff0ec84 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -326,6 +326,7 @@ and probably others.")
                                        (assoc-ref inputs "qtwebengine")
                                        "/lib/qt5/libexec/QtWebEngineProcess")))
                (wrap-program bin
+                 #:sh (search-input-file inputs "bin/bash")
                  `("QTWEBENGINEPROCESS_PATH" = (,qt-process-path)))
                #t))))))
     (inputs
-- 
2.31.1


[-- Attachment #1.18: 0017-gnu-protonvpn-cli-Set-sh-argument-of-wrap-program.patch --]
[-- Type: text/x-patch, Size: 1196 bytes --]

From 429de9acb1e79e621b6d4da18cde816eef63ada8 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:11:50 +0200
Subject: [PATCH 17/18] gnu: protonvpn-cli: Set #:sh argument of
 'wrap-program'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/vpn.scm
  (protonvpn-cli)[arguments]<#:phases>{wrap-wrapper}:
  Set #:sh argument of ‘wrap-program’.
---
 gnu/packages/vpn.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 584ff0ec84..66c103e75f 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -440,6 +440,7 @@ traversing network address translators (@dfn{NAT}s) and firewalls.")
              (let ((entrypoint (string-append (assoc-ref outputs "out")
                                               "/bin/.protonvpn-real")))
                (wrap-program entrypoint
+                            #:sh (search-input-file inputs "bin/bash")
                             `("PATH" ":" prefix
                               ,(map (lambda (name)
                                       (let ((input (assoc-ref inputs name)))
-- 
2.31.1


[-- Attachment #1.19: 0018-gnu-wireguard-tools-Set-sh-argument-of-wrap-program.patch --]
[-- Type: text/x-patch, Size: 1141 bytes --]

From 00a73e18e1b62ec525a44cbe890843f1c93b9d16 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 20:12:55 +0200
Subject: [PATCH 18/18] gnu: wireguard-tools: Set #:sh argument of
 'wrap-program'.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/vpn.scm
  (wireguard-tools)[arguments]<#:phases>{wrap-wg-quick}:
  Set #:sh argument of ‘wrap-program’.
---
 gnu/packages/vpn.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 66c103e75f..34715a4cc8 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -726,6 +726,7 @@ WireGuard was added to Linux 5.6.")
                    (coreutils (string-append (assoc-ref inputs "coreutils")
                                              "/bin")))
                (wrap-program (string-append out "/bin/wg-quick")
+                 #:sh (search-input-file inputs "bin/bash")
                  `("PATH" ":" prefix ,(append inputs-sbin
                                               (list coreutils))))
                #t))))))
-- 
2.31.1


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  parent reply	other threads:[~2021-06-02  7:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-18 11:20 [bug#47869] [PATCH core-updates] ‘which’ looks in PATH, incorrect when cross-compiling Maxime Devos
2021-04-19 19:04 ` [bug#47869] [PATCH v2 core-updates] various cross-compilation fixes in guix/build/utils.scm Maxime Devos
2021-05-18 20:51   ` [bug#47869] [PATCH core-updates] ‘which’ looks in PATH, incorrect when cross-compiling Ludovic Courtès
2021-05-18 21:25     ` Maxime Devos
2021-05-29 14:50       ` Ludovic Courtès
2021-06-01 19:53   ` [bug#47869] [PATCH v3 core-updates] various cross-compilation fixes in guix/build/utils.scm Maxime Devos
2021-06-01 21:01     ` [bug#47869] [PATCH core-updates] ‘which’ looks in PATH, incorrect when cross-compiling Ludovic Courtès
2021-06-02  7:56   ` Maxime Devos [this message]
2021-06-04 21:31     ` bug#47869: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c7e4fc629adaf7c44f618cfdb38c05d34cb5aec4.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=47869@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).