guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: guile-lib: Fix cross compilation.


From: guix-commits
Subject: branch master updated: gnu: guile-lib: Fix cross compilation.
Date: Mon, 08 Mar 2021 17:07:23 -0500

This is an automated email from the git hooks/post-receive script.

cbaines pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new a0b24d5  gnu: guile-lib: Fix cross compilation.
a0b24d5 is described below

commit a0b24d5f8c5813329986b1bd690ed50b5308cc78
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Tue Feb 23 20:02:14 2021 +0000

    gnu: guile-lib: Fix cross compilation.
    
    These changes were sent upstream as
    https://lists.gnu.org/archive/html/guile-devel/2021-02/msg00004.html
    
    Without this change, the .go files are built for the host architecture, 
rather
    than the target. I noticed this when cross building the
    guix-build-coordinator (for which guile-lib is an input) to the Hurd.
    
    * gnu/packages/guile-xyz.scm (guile-lib)[arguments]: Add
    'patch-for-cross-compilation phase.
    [native-inputs]: Add autoconf, automake and gettext.
    (guile2.0-lib): Adjust to use alist-replace.
    (guile2.2-lib): Adjust to use alist-replace.
---
 gnu/packages/guile-xyz.scm | 37 ++++++++++++++++++++++++++++++++-----
 1 file changed, 32 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 45b3a82..bd26010 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -116,6 +116,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system guile)
   #:use-module (guix utils)
+  #:use-module ((guix build utils) #:select (alist-replace))
   #:use-module (ice-9 match)
   #:use-module ((srfi srfi-1) #:select (alist-delete)))
 
@@ -2191,6 +2192,21 @@ library.")
        '("GUILE_AUTO_COMPILE=0")        ; to prevent guild errors
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'patch-for-cross-compilation
+           (lambda _
+             (substitute* "configure.ac"
+               (("GUILE_FLAGS")
+                "GUILE_FLAGS
+if test \"$cross_compiling\" != no; then
+   GUILE_TARGET=\"--target=$host_alias\"
+   AC_SUBST([GUILE_TARGET])
+fi
+"))
+             (substitute* "am/guile.mk"
+               (("guild compile") "guild compile $(GUILE_TARGET)"))
+             (delete-file "configure")  ; trigger the bootstrap phase to run
+                                        ; autoreconf
+             #t))
          (add-before 'configure 'patch-module-dir
            (lambda _
              (substitute* "src/Makefile.in"
@@ -2201,7 +2217,10 @@ library.")
 $(libdir)/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache\n"))
              #t)))))
     (native-inputs
-     `(("guile" ,guile-3.0)
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("gettext" ,gettext-minimal)
+       ("guile" ,guile-3.0)
        ("pkg-config" ,pkg-config)))
     (inputs
      `(("guile" ,guile-3.0)))
@@ -2222,15 +2241,23 @@ for Guile\".")
   (package
     (inherit guile-lib)
     (name "guile2.0-lib")
-    (native-inputs `(("pkg-config" ,pkg-config)))
-    (inputs `(("guile" ,guile-2.0)))))
+    (native-inputs
+     (alist-replace "guile" (list guile-2.0)
+                    (package-native-inputs guile-lib)))
+    (inputs
+     (alist-replace "guile" (list guile-2.0)
+                    (package-inputs guile-lib)))))
 
 (define-public guile2.2-lib
   (package
     (inherit guile-lib)
     (name "guile2.2-lib")
-    (native-inputs `(("pkg-config" ,pkg-config)))
-    (inputs `(("guile" ,guile-2.2)))))
+    (native-inputs
+     (alist-replace "guile" (list guile-2.2)
+                    (package-native-inputs guile-lib)))
+    (inputs
+     (alist-replace "guile" (list guile-2.2)
+                    (package-inputs guile-lib)))))
 
 (define-public guile3.0-lib
   (deprecated-package "guile3.0-lib" guile-lib))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]