From patchwork Thu Aug 11 11:08:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41562 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0542827BBE9; Thu, 11 Aug 2022 12:11:24 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 3FD1827BBEA for ; Thu, 11 Aug 2022 12:11:23 +0100 (BST) Received: from localhost ([::1]:58444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oM65y-0002Bn-DV for patchwork@mira.cbaines.net; Thu, 11 Aug 2022 07:11:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oM64j-0000gp-9d for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33878) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oM64i-0005Vf-Vx for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oM64i-0006Z2-S0 for guix-patches@gnu.org; Thu, 11 Aug 2022 07:10:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v2 08/13] gnu: racket: Support cross-compiling the VM packages. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Aug 2022 11:10:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57050 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57050@debbugs.gnu.org Cc: Liliana Marie Prikler , Liliana Marie Prikler , Philip McGrath , Thiago Jung Bauermann Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166021616325072 (code B ref 57050); Thu, 11 Aug 2022 11:10:04 +0000 Received: (at 57050) by debbugs.gnu.org; 11 Aug 2022 11:09:23 +0000 Received: from localhost ([127.0.0.1]:51840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM643-0006WJ-5X for submit@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:23 -0400 Received: from mail-qv1-f47.google.com ([209.85.219.47]:34772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oM63z-0006Vp-Mz for 57050@debbugs.gnu.org; Thu, 11 Aug 2022 07:09:20 -0400 Received: by mail-qv1-f47.google.com with SMTP id u8so13075572qvv.1 for <57050@debbugs.gnu.org>; Thu, 11 Aug 2022 04:09:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=tN4aDTA3DHwgyJpiQzTQ+7Aqun8FzI4rNB2Y5gBAwLE=; b=dXuR+KBv0Uk1TSHCYIcBPbuqY2dYLXkZrKFpRFffn1usUWmSSRhsvNdoZSsob1TSOb Bax7Q5zrGSi6DDDvT+fLbcHit65/Sciv3mKlI/+QfW9Ed04ITPD8KWVatv5PFwMXugV+ u360CLX+BV3DsDM2NmK/oAbdyJOHAvpstBDSG5W1Ot5egJuwSfwqcygz7ewlQOmRH6OL WwyFnMxVMDv4UfZYHCYj4IUHMw1TP6BWKPN19YbEqiSduwRSEr/kpFlMVcvw7VZ/QEej ZerK4gus9HCcERdHaZ4rXZoXFKLb9bvQ6G6I+n9nPh8wWeU+pXB+7+jnNffhEfPmMgQF NfRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=tN4aDTA3DHwgyJpiQzTQ+7Aqun8FzI4rNB2Y5gBAwLE=; b=rn4Mpr2dyN1xqtgIkL5ThMLqKP9sSkvrFJ/RpySRXvZ8UxwAneJYNAr86WR3Glb4x8 L7XkgPP2g2mISM5HY1YjXQGc2eHTljI8Z7U0cs9DjSu3GDEkkpKOCKgd/AuvwB2KRZh1 7QiLclQ+7o8sPVYu5PNFmWOB5xKlHodJ/g4pDZ0KwepkbMH/tg1xyPya/5m4ussKa6hM vhTEQTGuJgGO1wOR8P+4PbI4COPe4xFjYjUT3pBCk3MqbpVMYAY1lXGUfIPyb8qA3bMu pp/XHT4lIj0tdNPDTNQAl9xtn+dD1rH9AhWWf4V3pISNWKE8+Ex6IFdKZmSdbs5S2Qx3 9uGw== X-Gm-Message-State: ACgBeo2IyKZykmcre16oSlt3HpsJ1FXWtxQHjs63eYeZeO8O6aVREB3V hFVWl6HXeJV23PpVFstTqYIOc/pNOx4bSsgg X-Google-Smtp-Source: AA6agR5nNGiGVf1xhLvSqFg8D/i6vkSo+/whoqNE9OSWfaaMsPdEmtPMHkH7l7lp9y4C27tJAmXIHQ== X-Received: by 2002:a05:6214:268c:b0:474:8351:5803 with SMTP id gm12-20020a056214268c00b0047483515803mr28150001qvb.23.1660216154236; Thu, 11 Aug 2022 04:09:14 -0700 (PDT) Received: from localhost (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with UTF8SMTPSA id fv14-20020a05622a4a0e00b00342fb07944fsm1505139qtb.82.2022.08.11.04.09.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 04:09:14 -0700 (PDT) From: Philip McGrath Date: Thu, 11 Aug 2022 07:08:18 -0400 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Cross-compilation works for 'racket-vm-cgc', 'racket-vm-bc', and 'racket-vm-cs'. These changes are not enough to cross-compile 'racket-minimal' or 'racket': that would require building and loading cross-compilation pluggins for 'racket-vm-cs', which will be much easier once we can build the package 'raco-cross'. * gnu/packages/racket.scm (racket-vm-cgc): Add 'this-package' when cross-compiling. (racket-vm-bc)[native-inputs]: Adjust accordingly. (racket-vm-cs)[native-inputs]: Use 'racket-vm-cs' instead of 'racket-vm-bc' when cross-compiling. Adapt to changes to 'racket-vm-cgc'. [arguments]<#:configure-flags>: Fix '--enable-scheme' for cross-compilation. --- gnu/packages/racket.scm | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/gnu/packages/racket.scm b/gnu/packages/racket.scm index 31f3394fa3..ef353103d6 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -332,8 +332,11 @@ (define-public racket-vm-cgc (inputs (list ncurses ;; <- common to all variants (for #%terminal) bash-minimal ;; <- common to all variants (for `system`) libffi)) ;; <- only for BC variants - (native-inputs (list zuo ;; <- for all variants - libtool)) ;; <- only for BC variants + (native-inputs (cons* zuo ;; <- for all variants + libtool ;; <- only for BC variants + (if (%current-target-system) + (list this-package) + '()))) (outputs '("out" "debug")) (build-system gnu-build-system) (arguments @@ -421,8 +424,10 @@ (define-public racket-vm-bc (inherit racket-vm-cgc) (name "racket-vm-bc") (native-inputs - (modify-inputs (package-native-inputs racket-vm-cgc) - (prepend racket-vm-cgc))) + (if (%current-target-system) + (package-native-inputs racket-vm-cgc) + (modify-inputs (package-native-inputs racket-vm-cgc) + (prepend racket-vm-cgc)))) (arguments (substitute-keyword-arguments (package-arguments racket-vm-cgc) ((#:configure-flags _ '()) @@ -452,11 +457,17 @@ (define-public racket-vm-cs (prepend zlib lz4) (delete "libffi"))) (native-inputs - (modify-inputs (package-native-inputs racket-vm-cgc) - (delete "libtool") - (prepend chez-scheme-for-racket - chez-nanopass-bootstrap - racket-vm-bc))) + (let ((native-inputs (package-native-inputs racket-vm-cgc))) + (modify-inputs (if (%current-target-system) + (modify-inputs native-inputs + (delete "racket-vm-cgc")) + native-inputs) + (delete "libtool") + (prepend chez-scheme-for-racket + chez-nanopass-bootstrap + (if (%current-target-system) + racket-vm-cs + racket-vm-bc))))) (arguments (substitute-keyword-arguments (package-arguments racket-vm-cgc) ((#:phases those-phases #~%standard-phases) @@ -470,7 +481,7 @@ (define-public racket-vm-cs "--enable-libz" "--enable-lz4" (string-append "--enable-scheme=" - #$(this-package-native-input + #+(this-package-native-input "chez-scheme-for-racket") "/bin/scheme") #$(racket-vm-common-configure-flags)))))