From patchwork Thu Aug 25 08:54:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 41942 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 D7E6527BBEA; Thu, 25 Aug 2022 09:58:31 +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 598F227BBE9 for ; Thu, 25 Aug 2022 09:58:31 +0100 (BST) Received: from localhost ([::1]:48274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oR8h4-00033F-HY for patchwork@mira.cbaines.net; Thu, 25 Aug 2022 04:58:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR8ff-00024s-Sf for guix-patches@gnu.org; Thu, 25 Aug 2022 04:57:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59160) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oR8ff-0003CP-Jv for guix-patches@gnu.org; Thu, 25 Aug 2022 04:57:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oR8ff-0002cb-GN for guix-patches@gnu.org; Thu, 25 Aug 2022 04:57:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57050] [PATCH v3 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: Thu, 25 Aug 2022 08:57:03 +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.166141780010006 (code B ref 57050); Thu, 25 Aug 2022 08:57:03 +0000 Received: (at 57050) by debbugs.gnu.org; 25 Aug 2022 08:56:40 +0000 Received: from localhost ([127.0.0.1]:48901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR8fH-0002bE-FA for submit@debbugs.gnu.org; Thu, 25 Aug 2022 04:56:39 -0400 Received: from mail-vs1-f44.google.com ([209.85.217.44]:43966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR8ei-0002Yg-3h for 57050@debbugs.gnu.org; Thu, 25 Aug 2022 04:56:04 -0400 Received: by mail-vs1-f44.google.com with SMTP id w188so12148056vsb.10 for <57050@debbugs.gnu.org>; Thu, 25 Aug 2022 01:56:04 -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=1veCoxHFoj5iPTmAArR9EFGJLAT1FoM0LJuQpEwFjoU=; b=aM/Z/A7WE8SZkAuWkxswJJdu2rFzKj6ICkaoHGG1fITVESCPI1XlSwWWCjb2bqSqU4 Mn0IRRVn1QADBZ+YC8M26rL8D9KHNfXkukxZa9OKQF0UB6ZzE5c1ozGk/KoUQG6xnYBN c9Sn4s3gaMDNEjJiLZ1q0sNKNhAa/l9nQa0J8bwz/X0Lv0oj5TpgeBPbz84ZejOdYmfy JmLICN0q/sfUMerCnaYaz8wcfDZ73JzyfB8NjOQluNAEvz/OXKKvGLzgMKhVFlG4C/N/ Pzmdzar3oO9M0kWnlhoAumX5NUC4FUH6lIm1B4CRhUfQh64sSKZdxpQHiIeFKCuUDVYq 0bFw== 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=1veCoxHFoj5iPTmAArR9EFGJLAT1FoM0LJuQpEwFjoU=; b=RMkNA3k0flYQj5ePkAw7Xskx7+74Y1afTZe1i6K3DLFUOjwmRWC/CMb+TZdeVWKDR2 iNNP2n9E6RkMmskOWClSDaPFtK+dHV4EI6ORprL/E0+Ltla71oBaszSBw30pv0QdqUdI pR4jJC+tvp4XmZrCTKhXUVlIY83MEJtWWYbKujCCJ5ESMmyynoO6mPoxIMobiZhykcGf GYxPnqnm1NZUsjZgKfFk3GtBwDCuds6be5gpVbn40i7OUSFPgSekHiKOrvDrObC7hHSq OxhIMc1AV+va7ABuqc7/AceryomO5BFs6ckw7E8OrVSnTHDqvd3HdmKt04ortPb8eSiu s+SA== X-Gm-Message-State: ACgBeo3hrmlGLu3LZu+rF0hF47SHeCJyuVo5dPsyc2LUVnMxPwgoNAYr ey8QlY8PmXS/hl9A0It6MpTWX5GmxIu68zQI X-Google-Smtp-Source: AA6agR4Zeag3n99hGw7PRV+k8tUFGqzdVXUwpjYGHEHGseE0Woe/a7vuK2ZwfgvkWqHcaD8y8BWkkw== X-Received: by 2002:a67:d905:0:b0:390:57db:659d with SMTP id t5-20020a67d905000000b0039057db659dmr1106638vsj.31.1661417758559; Thu, 25 Aug 2022 01:55:58 -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 x203-20020a1f31d4000000b00378ceed8f5bsm15658282vkx.53.2022.08.25.01.55.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Aug 2022 01:55:58 -0700 (PDT) From: Philip McGrath Date: Thu, 25 Aug 2022 04:54:13 -0400 Message-Id: <4b5de88c4a2cd08dd601b6adbbe7389a9c611785.1661416343.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 efabdd16f3..90e5e88be5 100644 --- a/gnu/packages/racket.scm +++ b/gnu/packages/racket.scm @@ -314,8 +314,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 @@ -403,8 +406,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 _ '()) @@ -434,11 +439,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) @@ -452,7 +463,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))))