gnu: guix: Cross-build workaround: Run native guile for version.
authorJan (janneke) Nieuwenhuizen <janneke@gnu.org>
Fri, 24 Apr 2020 09:21:48 +0000 (11:21 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 26 Apr 2020 17:46:27 +0000 (19:46 +0200)
We need to take some care here, the native guile is not necessarily always the
same version as the host guile.

* gnu/packages/package-management.scm (guix)[arguments]: Do not attempt to run
host guile for getting effective-version; resort to native guile.

gnu/packages/package-management.scm

index 1b9697b..fdc570f 100644 (file)
@@ -245,11 +245,13 @@ $(prefix)/etc/init.d\n")))
                         (setenv "SHELL" (which "sh"))
                         #t))
                     (add-after 'install 'wrap-program
-                      (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
                         ;; Make sure the 'guix' command finds GnuTLS,
                         ;; Guile-JSON, and Guile-Git automatically.
                         (let* ((out    (assoc-ref outputs "out"))
-                               (guile  (assoc-ref inputs "guile"))
+                               (guile  ,@(if (%current-target-system)
+                                             '((assoc-ref native-inputs "guile"))
+                                             '((assoc-ref inputs "guile"))))
                                (gcrypt (assoc-ref inputs "guile-gcrypt"))
                                (json   (assoc-ref inputs "guile-json"))
                                (sqlite (assoc-ref inputs "guile-sqlite3"))