From patchwork Mon Jul 19 09:40:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 31496 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 C51D027BC78; Mon, 19 Jul 2021 10:41:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 503C227BC6B for ; Mon, 19 Jul 2021 10:41:11 +0100 (BST) Received: from localhost ([::1]:35154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5Plu-0008Kg-8b for patchwork@mira.cbaines.net; Mon, 19 Jul 2021 05:41:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Plm-0008KX-DO for guix-patches@gnu.org; Mon, 19 Jul 2021 05:41:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5Plm-0000Vs-0b for guix-patches@gnu.org; Mon, 19 Jul 2021 05:41:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m5Pll-0003s4-Vf for guix-patches@gnu.org; Mon, 19 Jul 2021 05:41:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH core-updates 00/37] Support cross-compilation with meson Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Jul 2021 09:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: Mathieu Othacehe , 49025@debbugs.gnu.org Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.162668765914863 (code B ref 49025); Mon, 19 Jul 2021 09:41:01 +0000 Received: (at 49025) by debbugs.gnu.org; 19 Jul 2021 09:40:59 +0000 Received: from localhost ([127.0.0.1]:58085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5Plj-0003rd-1R for submit@debbugs.gnu.org; Mon, 19 Jul 2021 05:40:59 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:34070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5Plh-0003rV-Be for 49025@debbugs.gnu.org; Mon, 19 Jul 2021 05:40:58 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by baptiste.telenet-ops.be with bizsmtp id Wxgv2500P0mfAB401xgvn8; Mon, 19 Jul 2021 11:40:56 +0200 Message-ID: <474342a545267f124f9a783415fe466ed048ada1.camel@telenet.be> From: Maxime Devos Date: Mon, 19 Jul 2021 11:40:41 +0200 In-Reply-To: <871r7v5xiq.fsf_-_@gnu.org> References: <20210714111307.19324-1-maximedevos@telenet.be> <20210714111307.19324-6-maximedevos@telenet.be> <871r7v5xiq.fsf_-_@gnu.org> User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626687656; bh=wvjJ5LGuvWLByqcmgr+fWKsQjTQm/0/ctVz4+fyQlFw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=hmhrXKn5M/tgjFuXxTHwW/ZRfXUs7bICLmgZD+PBSWTgDl2adl46P598ETJTGYmwk MOsjyz8LPwy2f/JdPoX5vgJ7Z9SF4JW8qyOq4HsC7+njGPr04OkOfHDp7pQUj8RqGr JbPrgoRigHjy6hZc39fdT36ISvVTY41+MakAQEGt6h/BNd3oJa7SrQM/DsaQt3NFwF GSoskGjxzXXJn04W8WGDDjRgH3V5/WlwCYQxd8dFESdXFoQIgMXuOP0Cl+cUvPlnOh cOJU8v1Lp6EsghoCLKFLJTb+wlmfZLGQDnAGpqBLduFiv63bVrzh8IrfIn/4UBStyJ O4N98FPGAUTDg== 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 Ludovic Courtès schreef op zo 18-07-2021 om 19:42 [+0200]: > As discussed some time ago on IRC, I think it would be good to > homogenize this with ‘lookup-package-input’ and related procedures > introduced in ba32f6363878165b3ca53113f6c95b8677b8537b (we both had the > same idea :-)). > > What about keeping the ‘this-’ macros above, rewriting them in terms of > ‘lookup-’, and removing ‘package-input’ and ‘package-native-input’? I've written a patch (see attachement) to do this. Greetings, MMaxime. From f9803aa77f348214b6295d363585282a2b2f35e6 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Mon, 19 Jul 2021 11:08:40 +0200 Subject: [PATCH] packages: Use 'lookup-package-input' and friends instead of 'package-input'. * guix/packages.scm (package-input, package-native-input): Remove. (this-package-input): Use 'lookup-package-input' and 'lookup-package-propagated-input' instead of 'package-input'. (this-package-native-input): Use 'lookup-package-native-input' instead of 'package-input'. --- guix/packages.scm | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/guix/packages.scm b/guix/packages.scm index d3fa72fd09..2349bb4340 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -550,32 +550,18 @@ object." #f))) (_ #f))) -(define (package-input package name) - "Return the package input NAME of PACKAGE--i.e., an input -from the ‘inputs’ or ‘propagated-inputs’ field. Native inputs are not -considered. If this input does not exist, return #f instead." - (and=> (or (assoc-ref (package-inputs package) name) - (assoc-ref (package-propagated-inputs package) name)) - car)) - -(define (package-native-input package name) - "Return the native package input NAME of PACKAGE--i.e., an input -from the ‘native-inputs’ field. If this native input does not exist, -return #f instead." - (and=> (assoc-ref (package-native-inputs package) name) - car)) - (define-syntax-rule (this-package-input name) "Return the input NAME of the package being defined--i.e., an input from the ‘inputs’ or ‘propagated-inputs’ field. Native inputs are not considered. If this input does not exist, return #f instead." - (package-input this-package name)) + (or (lookup-package-input this-package name) + (lookup-package-propagated-input this-package name))) (define-syntax-rule (this-package-native-input name) "Return the native package input NAME of the package being defined--i.e., an input from the ‘native-inputs’ field. If this native input does not exist, return #f instead." - (package-native-input this-package name)) + (lookup-package-native-input this-package name)) ;; Error conditions. -- 2.32.0