From patchwork Sat Aug 27 18:55:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 42010 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 889E827BBEA; Sat, 27 Aug 2022 19:59:09 +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 F22A827BBE9 for ; Sat, 27 Aug 2022 19:59:08 +0100 (BST) Received: from localhost ([::1]:42384 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oS11Q-0005jN-5c for patchwork@mira.cbaines.net; Sat, 27 Aug 2022 14:59:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oS10O-0004L7-Kx for guix-patches@gnu.org; Sat, 27 Aug 2022 14:58:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39108) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oS10O-0001iE-Bv for guix-patches@gnu.org; Sat, 27 Aug 2022 14:58:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oS10O-0008JO-8d for guix-patches@gnu.org; Sat, 27 Aug 2022 14:58:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v4 11/14] gnu: racket: Support cross-compiling the VM packages. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 27 Aug 2022 18:58: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: Philip McGrath , Thiago Jung Bauermann , "\(" , Maxime Devos , Liliana Marie Prikler , Efraim Flashner , Liliana Marie Prikler Received: via spool by 57050-submit@debbugs.gnu.org id=B57050.166162665431860 (code B ref 57050); Sat, 27 Aug 2022 18:58:04 +0000 Received: (at 57050) by debbugs.gnu.org; 27 Aug 2022 18:57:34 +0000 Received: from localhost ([127.0.0.1]:57079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oS0zu-0008Hh-1Z for submit@debbugs.gnu.org; Sat, 27 Aug 2022 14:57:34 -0400 Received: from mail-ua1-f54.google.com ([209.85.222.54]:34701) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oS0zW-0008GE-Tt for 57050@debbugs.gnu.org; Sat, 27 Aug 2022 14:57:11 -0400 Received: by mail-ua1-f54.google.com with SMTP id s5so1696662uar.1 for <57050@debbugs.gnu.org>; Sat, 27 Aug 2022 11:57:10 -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=/nM7qIywAt/bOJqIUq/dp6+Lul98wutFn3ncNxCKjWA=; b=W8r32dilOFuvOcYmS32awotJ0e0O3YBLPPs6bKWhX4Aur8gLpIpwspRTwEuGkDxGpd WwdPXu3/5bppoWZqZmku5H7tYDtrV3K+an/+7XM3Par6I60oT1x9EX1Hwsi420bltu/k ufd+ELEokULUJzGH5DCVh2b9qJ7xGkUYmrY/JvQypfjvEPemn1pyhe+XF3/pTX49Ya3A Z3D49lqlqmlaKfHZhF8ovTvuPf4x6fXCwj2MNPgKgSkaM44VgJE3y8ZuLIlp9rhWthmR judamQu9J/6OyIANMnlBx2cNWIwC889G6iZ7/+6omWDYF0o1MwUxbIE+Q39kzZZnExkk i0xA== 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=/nM7qIywAt/bOJqIUq/dp6+Lul98wutFn3ncNxCKjWA=; b=w7MS4cCCyZ3bDPOwVY8EfjiTO2iPOHxLWCHXOdnmZZjx+U5wrHfc7HTohXfdnuCmAB g+Ve3CXCk0J2oulY451PyyHO/e1Fk8+FVfd8HvnrmXTxsh5+G3iaytBk19nRaTRDJMKk laMiR7DlYQ/ouqTBl6JRpXVp9PsRMmcJT6If5B18ivMhFeXpiknPe4J6D/rLPA2CcyAD OzK6+w8zw+1fLmIgHgsr3IaDmatnlLRHrW8o//nnLUH89AGWVfU08PAvzXuFyNOTa/xz rou2dEqpBkJlSImB+C4oXAiBA+tytEEjQlxXCQlLgkB0d3kzQ7TfDTQHswpjcYFBh5lD B56Q== X-Gm-Message-State: ACgBeo3pl1wuKoqP8sCKsFLZeZqY0OE9RJcpWGXdGnhscFwE4qhfGeAc 7PaBiaLymnXB2yvh34+bt7PfXIBz7DGJfy30 X-Google-Smtp-Source: AA6agR6hQUq8w1+LP7yuQbrThtvfqvw2JEiXIVi4t0dZbeJBE1yP3iDivSZDT5TbGhxblKCnIO4MJQ== X-Received: by 2002:a9f:2f0c:0:b0:38c:6559:3c5d with SMTP id x12-20020a9f2f0c000000b0038c65593c5dmr1650877uaj.121.1661626625353; Sat, 27 Aug 2022 11:57:05 -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 v21-20020ab07055000000b0039f2ed540fbsm805388ual.15.2022.08.27.11.57.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 27 Aug 2022 11:57:05 -0700 (PDT) From: Philip McGrath Date: Sat, 27 Aug 2022 14:55:51 -0400 Message-Id: <2db8cb32ba8b8ca5edd3f76334b0bda0a91d6d15.1661626113.git.philip@philipmcgrath.com> 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 349cf38e07..4fcdd2f721 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -312,8 +312,11 @@ (define-public racket-vm-cgc (source %racket-origin) (inputs (list ncurses ;; <- common to all variants (for #%terminal) 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 @@ -401,8 +404,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 _ '()) @@ -432,11 +437,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) @@ -450,7 +461,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))))