From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id KFgcJ3QQNmDRJgAA0tVLHw (envelope-from ) for ; Wed, 24 Feb 2021 08:38:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 8JTfInQQNmAzWwAAbx9fmQ (envelope-from ) for ; Wed, 24 Feb 2021 08:38:12 +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 C2DC12BB61 for ; Wed, 24 Feb 2021 09:38:11 +0100 (CET) Received: from localhost ([::1]:51916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEpgQ-0004kN-7p for larch@yhetil.org; Wed, 24 Feb 2021 03:38:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEpgI-0004kD-53 for guix-patches@gnu.org; Wed, 24 Feb 2021 03:38:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49944) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lEpgH-0001dU-Tj for guix-patches@gnu.org; Wed, 24 Feb 2021 03:38:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lEpgH-0000ah-Lz for guix-patches@gnu.org; Wed, 24 Feb 2021 03:38:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46725] [PATCH] gnu: guile-lib: Fix cross compilation. References: <20210223200755.29532-1-mail@cbaines.net> In-Reply-To: <20210223200755.29532-1-mail@cbaines.net> Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 24 Feb 2021 08:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46725 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46725@debbugs.gnu.org Received: via spool by 46725-submit@debbugs.gnu.org id=B46725.16141558372209 (code B ref 46725); Wed, 24 Feb 2021 08:38:01 +0000 Received: (at 46725) by debbugs.gnu.org; 24 Feb 2021 08:37:17 +0000 Received: from localhost ([127.0.0.1]:33257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lEpfY-0000ZY-EV for submit@debbugs.gnu.org; Wed, 24 Feb 2021 03:37:17 -0500 Received: from mira.cbaines.net ([212.71.252.8]:37736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lEpfT-0000ZJ-SM for 46725@debbugs.gnu.org; Wed, 24 Feb 2021 03:37:15 -0500 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id C45DC27BC4A for <46725@debbugs.gnu.org>; Wed, 24 Feb 2021 08:37:10 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 457b148e for <46725@debbugs.gnu.org>; Wed, 24 Feb 2021 08:37:09 +0000 (UTC) From: Christopher Baines Date: Wed, 24 Feb 2021 08:37:09 +0000 Message-Id: <20210224083709.9342-1-mail@cbaines.net> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: C2DC12BB61 X-Spam-Score: 2.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: oL5h3sMAoDJm 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 ce5aad8ec7..07f81bcc1b 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))) @@ -2194,6 +2195,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" @@ -2204,7 +2220,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))) @@ -2225,15 +2244,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)) -- 2.30.0