From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0B0fFupgNWAHXwAA0tVLHw (envelope-from ) for ; Tue, 23 Feb 2021 20:09:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id UBwYEupgNWDFOQAA1q6Kng (envelope-from ) for ; Tue, 23 Feb 2021 20:09:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CC0B31838D for ; Tue, 23 Feb 2021 21:09:13 +0100 (CET) Received: from localhost ([::1]:48366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEdzd-00010F-07 for larch@yhetil.org; Tue, 23 Feb 2021 15:09:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEdzS-000100-Jl for guix-patches@gnu.org; Tue, 23 Feb 2021 15:09:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49069) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lEdzS-0002uA-Cm for guix-patches@gnu.org; Tue, 23 Feb 2021 15:09:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lEdzS-00059u-8W for guix-patches@gnu.org; Tue, 23 Feb 2021 15:09:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46725] [PATCH] gnu: guile-lib: Fix cross compilation. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Feb 2021 20:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46725 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46725@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161411090919790 (code B ref -1); Tue, 23 Feb 2021 20:09:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 Feb 2021 20:08:29 +0000 Received: from localhost ([127.0.0.1]:60615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lEdyu-000598-Ms for submit@debbugs.gnu.org; Tue, 23 Feb 2021 15:08:29 -0500 Received: from lists.gnu.org ([209.51.188.17]:49884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lEdyp-00058x-1M for submit@debbugs.gnu.org; Tue, 23 Feb 2021 15:08:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEdyf-0000tG-S1 for guix-patches@gnu.org; Tue, 23 Feb 2021 15:08:14 -0500 Received: from mira.cbaines.net ([2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27]:42835) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEdyS-0002Yx-9z for guix-patches@gnu.org; Tue, 23 Feb 2021 15:08:12 -0500 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id AE48327BC4A for ; Tue, 23 Feb 2021 20:07:55 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 94372b90 for ; Tue, 23 Feb 2021 20:07:55 +0000 (UTC) From: Christopher Baines Date: Tue, 23 Feb 2021 20:07:55 +0000 Message-Id: <20210223200755.29532-1-mail@cbaines.net> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 2.63 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: CC0B31838D X-Spam-Score: 2.63 X-Migadu-Scanner: scn1.migadu.com X-TUID: 4zb4wcGqZwz0 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