all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#46725] [PATCH] gnu: guile-lib: Fix cross compilation.
@ 2021-02-23 20:07 Christopher Baines
  2021-02-24  7:58 ` Leo Prikler
  2021-02-24  8:37 ` Christopher Baines
  0 siblings, 2 replies; 9+ messages in thread
From: Christopher Baines @ 2021-02-23 20:07 UTC (permalink / raw)
  To: 46725

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.
---
 gnu/packages/guile-xyz.scm | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index ce5aad8ec7..e9dfc6cc8d 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -2194,6 +2194,20 @@ 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)"))
+             (invoke "autoreconf" "-vif")
+             #t))
          (add-before 'configure 'patch-module-dir
            (lambda _
              (substitute* "src/Makefile.in"
@@ -2204,7 +2218,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)))
-- 
2.30.0





^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-03-11 21:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23 20:07 [bug#46725] [PATCH] gnu: guile-lib: Fix cross compilation Christopher Baines
2021-02-24  7:58 ` Leo Prikler
2021-02-24  8:45   ` Christopher Baines
2021-02-24  8:37 ` Christopher Baines
2021-03-02 19:20   ` Ludovic Courtès
2021-03-04 13:16     ` Maxim Cournoyer
2021-03-08 14:22       ` Ludovic Courtès
2021-03-08 22:11         ` bug#46725: " Christopher Baines
2021-03-11 21:01           ` [bug#46725] " Maxim Cournoyer

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.