From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id uHm3FkP6ImSNawEASxT56A (envelope-from ) for ; Tue, 28 Mar 2023 16:31:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id +L2cFkP6ImR6rgAA9RJhRA (envelope-from ) for ; Tue, 28 Mar 2023 16:31:31 +0200 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 0DC0E3830 for ; Tue, 28 Mar 2023 16:31:31 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=lLqC4D+v; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680013891; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=t220S3xIvoj0FbvWJpJ+BKBT9K0Y2f9MWCL5zO9BNQA=; b=r4vYkS7UY+PL26gM0S90uYhjrU7yPmDddxCgAX2nfXbgxZubakYYqXiJ/u+4+G4lJXJWNV ThYwQhUzFhG+bxb9kj12u+9ChYLT/uzk23+aE7ysATCJi2gvAeZH8KXolMetHvRVhQuDYi 29hbX7MsfhHSdXF+8xn2Do8SzO2WWOn/MPDRu/PU4aW2wsSsihVgkvwFht7wkGGZ/J0mLq lhZ0ysZvB7I9Osr63PkgAqH4SE3HRDKvvCVA7kchEt0O3L+frG5NDY/ZmYG1lfs7YJVNFV QjORtTh8a8iBIoHPwqv3kUPVYgojCqWnCEcOAcgze/xpaB7D8cm+xv9gmupGxg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680013891; a=rsa-sha256; cv=none; b=owjQd+W6x2eRiRnACtEQ1Siid00Kdhtoc/sqW5qjiyeCTCksJoT0PgUx8S202FfnUPkB6Z cNNp89nbrkhE3Nw202UkpswgfTFzbjkYct6Tlu5rRbpa7NRGqLWkWLI8bs3MVONmil/kJn pVMmXpyy7+MvcIBxDo/jaz3oGkpy1ht51Cpuk13TVbBlcC9tid+lL+DB9nSzdO1sF68UCG Q6MlOoSxxhtsr+iiAs4pWwm3/lfOH1HSXJ9Q6Q4tJ+LEmW5ljzOQjcs2O5+VOxmSkCagHE UOuBbaDfBdkvOtok120OJFjQRMowWFk70i55xw7pW1PLVezt73TSDGQdqQDEEA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=lLqC4D+v; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phAKx-0004hw-KX; Tue, 28 Mar 2023 10:30:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phAKs-0004dQ-6n for guix-patches@gnu.org; Tue, 28 Mar 2023 10:30:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phAKr-0006qW-Un for guix-patches@gnu.org; Tue, 28 Mar 2023 10:30:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1phAKr-0002aj-PD for guix-patches@gnu.org; Tue, 28 Mar 2023 10:30:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62307] [PATCH core-updates v2 04/20] gnu: cross-base: Factor out cross-mig. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 28 Mar 2023 14:30:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62307 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62307@debbugs.gnu.org Cc: Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 62307-submit@debbugs.gnu.org id=B62307.16800137809756 (code B ref 62307); Tue, 28 Mar 2023 14:30:05 +0000 Received: (at 62307) by debbugs.gnu.org; 28 Mar 2023 14:29:40 +0000 Received: from localhost ([127.0.0.1]:50410 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phAKS-0002XH-6s for submit@debbugs.gnu.org; Tue, 28 Mar 2023 10:29:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phAK8-0002UP-Bg for 62307@debbugs.gnu.org; Tue, 28 Mar 2023 10:29:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phAK3-0006ON-4c; Tue, 28 Mar 2023 10:29:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=t220S3xIvoj0FbvWJpJ+BKBT9K0Y2f9MWCL5zO9BNQA=; b=lLqC4D+vcIv9/+h8NgXk EbgI4raGYvdiwEdZhn9OjR8v5jxJ+irW+dzbFuGRKXdimO8mh9i+PvGAYV2u289srZ6ZmLGQMlJRn RxWkeUjzVsmo5/PkT+wTuYVEVW6G6g4/bSEGsuAu/RhwggBqlLolNvjQHt2AZXWFBz9iKWolUx1ri Em23qyUdeT84+5/fy/n3Q8RpFTG4uh/E7wFkPUSmYzSuYOXq+Mky42dmH6cge+kEi4UgoxsUD0MCN VU9Pk0Xg7MAl3cDlmmhb+PB39X2wrAlsTQsPN0R0VlEawzdXG/HtVfKRQniUgRESDaxsDbjrTIV7y YSb75Mu5NP56wg==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phAK2-00026Y-Ng; Tue, 28 Mar 2023 10:29:14 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Tue, 28 Mar 2023 16:28:36 +0200 Message-Id: <20230328142852.26635-5-ludo@gnu.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230328142852.26635-1-ludo@gnu.org> References: <87pm90bzva.fsf_-_@gnu.org> <20230328142852.26635-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: X-Migadu-Queue-Id: 0DC0E3830 X-Spam-Score: -2.53 X-Migadu-Spam-Score: -2.53 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-TUID: sM83Tv+fxwef From: Josselin Poiret * gnu/packages/cross-base.scm (cross-mig): New exported procedure. (cross-gnumach-headers): New procedure. (cross-kernel-headers*): Factor them out. (cross-libc*): Use them there. Signed-off-by: Ludovic Courtès --- gnu/packages/cross-base.scm | 89 ++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 35 deletions(-) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index adead3206a..2a7c4d8011 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -46,6 +46,7 @@ (define-module (gnu packages cross-base) #:export (cross-binutils cross-libc cross-gcc + cross-mig cross-kernel-headers)) (define-syntax %xgcc @@ -365,6 +366,52 @@ (define* (cross-kernel-headers/deprecated target #:xgcc xgcc #:xbinutils xbinutils)) +(define* (cross-gnumach-headers target + #:key + (xgcc (cross-gcc target)) + (xbinutils (cross-binutils target))) + (package + (inherit gnumach-headers) + (name (string-append (package-name gnumach-headers) + "-cross-" target)) + (native-inputs + (modify-inputs (package-native-inputs gnumach-headers) + (prepend xgcc xbinutils))))) + +(define* (cross-mig target + #:key + (xgcc (cross-gcc target)) + (xbinutils (cross-binutils target))) + "Return a cross-mig for TARGET, where TARGET is a GNU triplet. Use XGCC as +the base compiler. Use XBINUTILS as the associated cross-Binutils." + (define xgnumach-headers + (cross-gnumach-headers target + #:xgcc xgcc + #:xbinutils xbinutils)) + (package + (inherit mig) + (name (string-append "mig-cross")) + (arguments + (substitute-keyword-arguments (package-arguments mig) + ((#:configure-flags flags #~'()) + #~(list #$(string-append "--target=" target))) + ((#:tests? _ #f) + #f) + ((#:phases phases #~%standard-phases) + #~(modify-phases #$phases + (add-before 'configure 'set-cross-headers-path + (lambda* (#:key inputs #:allow-other-keys) + (let* ((mach #+xgnumach-headers) + (cpath (string-append mach "/include"))) + (for-each (lambda (variable) + (setenv variable cpath)) + '#$%gcc-cross-include-paths)))))))) + (propagated-inputs + (list xgnumach-headers)) + (native-inputs + (modify-inputs (package-native-inputs mig) + (prepend xgcc xbinutils))))) + (define* (cross-kernel-headers* target #:key (linux-headers linux-libre-headers) @@ -399,40 +446,11 @@ (define xlinux-headers ("cross-binutils" ,xbinutils) ,@(package-native-inputs linux-headers))))) - (define xgnumach-headers-name - (string-append (package-name gnumach-headers) "-cross-" target)) - - (define xgnumach-headers - (package - (inherit gnumach-headers) - (name xgnumach-headers-name) - (native-inputs - (modify-inputs (package-native-inputs gnumach-headers) - (prepend xgcc xbinutils))))) - (define xmig - (package - (inherit mig) - (name (string-append "mig-cross")) - (arguments - (substitute-keyword-arguments (package-arguments mig) - ((#:configure-flags flags #~'()) - #~(list #$(string-append "--target=" target))) - ((#:tests? _ #f) - #f) - ((#:phases phases #~%standard-phases) - #~(modify-phases #$phases - (add-before 'configure 'set-cross-headers-path - (lambda* (#:key inputs #:allow-other-keys) - (let* ((mach #+(this-package-input xgnumach-headers-name)) - (cpath (string-append mach "/include"))) - (for-each (lambda (variable) - (setenv variable cpath)) - '#$%gcc-cross-include-paths)))))))) - (propagated-inputs (list xgnumach-headers)) - (native-inputs - (modify-inputs (package-native-inputs mig) - (prepend xgcc xbinutils))))) + (cross-mig target #:xgcc xgcc #:xbinutils xbinutils)) + + (define xgnumach-headers + (cross-gnumach-headers target #:xgcc xgcc #:xbinutils xbinutils)) (define xhurd-headers (package @@ -611,8 +629,9 @@ (define* (cross-libc* target ("cross-binutils" ,xbinutils) ,@(if (target-hurd? target) `(("cross-mig" - ,@(assoc-ref (package-native-inputs xheaders) - "cross-mig"))) + ,(cross-mig target + #:xgcc xgcc + #:xbinutils xbinutils))) '()) ,@(package-inputs libc) ;FIXME: static-bash ,@(package-native-inputs libc)))))) -- 2.39.2