From patchwork Mon Dec 9 19:58:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 34700 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 0E49927BBE2; Mon, 9 Dec 2024 20:00:49 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS 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 AAD1E27BBEC for ; Mon, 9 Dec 2024 20:00:46 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKjvK-0005AL-S8; Mon, 09 Dec 2024 15:00:06 -0500 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 1tKjvI-00059m-Mb for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:04 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKjvI-0007O1-Ck for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=0Di93yy8Gn0ccmgADGHtanVps1ZA9snHbZkD327+loc=; b=vII1Mk7D9IMN1/aYW3P8zVFKTi4azHQ3xVxc1GyRviKmaqASSs8F5BkC3tUvjFMrMrMqGWjzGwjqvJCEdJ3zAMXKaHrU2fsT7deuK4bE7Iw62VJYUorlE75pGC2QDdLHs2u/TchftLOHaVFPI6sKKUTOV5ej32NERJLlMP/SerSWDYXWiYMZ0AGygkfEKTCg6BXsnauJvQqIWMvJFLsJdxCoITYrzRE3h07MV+fuhKa4dviy1Ua9L0cs1prjNBoS/wtefTfBnHMGNYUwmQ+Q7Sl2UdDjihQhPfLV8V/kO4bIA8izlRHIu9P22WGPzdstaZrqv+07MC5wflaOh+21KA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKjvG-0002C7-Tk; Mon, 09 Dec 2024 15:00:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v4 01/11] build-system: cargo: Accept unlabeled #:cargo-inputs. References: In-Reply-To: Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, guix-patches@gnu.org Resent-Date: Mon, 09 Dec 2024 20:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70923 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70923@debbugs.gnu.org Cc: Efraim Flashner X-Debbugs-Original-Xcc: Efraim Flashner Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17337743678203 (code B ref 70923); Mon, 09 Dec 2024 20:00:02 +0000 Received: (at 70923) by debbugs.gnu.org; 9 Dec 2024 19:59:27 +0000 Received: from localhost ([127.0.0.1]:55726 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjuc-00027t-JY for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:26 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:59135 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjuX-00027N-NN for 70923@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1733774348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Di93yy8Gn0ccmgADGHtanVps1ZA9snHbZkD327+loc=; b=g6KRXvJ0gjyXau70Fp3hdfB+DEdu4nihS4yJBkm9L8zAoRKqmQSrz/d0NAwFTcrj5vAP87 41mRkA1Gy8VULvdadBoyhUDiVQxar8lTVCZe9u9c+bOFJdv53vi8eGvQyJf6fc8Mxemhzr n7bACcxYLSEaPHb4EtiM28ACGlco3AJ+ukKRHmhnZhH0A0kv5qyCOAJhEqyNqVe4hHMBex 8cybjVCx/rMfSYrKP6LEwsvrDKJuqQ4JElI/SQHwKaiRK3cyfi6O9mi/ySzIQJLuuDtFfa hzaA7nV/CfcAJhExbgTqGxpIzubbQVc5bAijjvJSPbUxM3sj+ep4nqRyCq2oJQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 64c933bf (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 9 Dec 2024 19:59:08 +0000 (UTC) Date: Mon, 9 Dec 2024 20:58:05 +0100 Message-ID: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/build-system/cargo.scm (crate-closure): Match unlabeled inputs. Change-Id: Iae421281fa08d09ddd1e5d2da2864f0093d97cd1 --- guix/build-system/cargo.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) base-commit: a5a540d71331fd43fd53e23eb49102c55462c28f diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm index 658a2e525e..2e3061c0e8 100644 --- a/guix/build-system/cargo.scm +++ b/guix/build-system/cargo.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2019 Ivan Petkov ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2021 Efraim Flashner +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -234,11 +235,14 @@ (define (crate-closure inputs) (if (null? propagated) (reverse result) (loop (reverse (concatenate propagated)) result '() #f seen))) - (((and input (label (? package? package))) rest ...) + ;; Match inputs with labels for backward compatibility. + (((or (_ (? package? package)) + (? package? package)) + rest ...) (if (and (not first?) (seen? seen package)) (loop rest result propagated first? seen) (loop rest - (cons input result) + (cons package result) (cons (package-cargo-inputs package) propagated) first? @@ -296,8 +300,8 @@ (define (expand-crate-sources cargo-inputs cargo-development-inputs) something that can always be extended or reworked in the future)." (filter-map (match-lambda - ((label (? package? p)) - (list label (package-source p))) + ((? package? p) + (list (package-name p) (package-source p))) ((label input) (list label input))) (crate-closure (append cargo-inputs cargo-development-inputs)))) From patchwork Mon Dec 9 19:58:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 34703 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 708E727BBE9; Mon, 9 Dec 2024 20:01:01 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS 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 8CDC227BBE2 for ; Mon, 9 Dec 2024 20:00:59 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKjvK-0005AF-IY; Mon, 09 Dec 2024 15:00:06 -0500 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 1tKjvI-00059k-KG for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:04 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKjvI-0007Vl-9v for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=8tA04GO47F3PXiip0PSkXsaT7TUZa/1VHE/4svheeoI=; b=OzEgRQobInXYNOjAviyBDH218be5DLOXGKYZD2C1qmMAmfhQqevSZPNygyL9IvC7YhbaPHrlawuxcW+xZ/J61QFpySm79jSnbJMGHDbChziO5JURarVA4a7JvYp49Q2j1ejIuSLnBB07ZFQHsOUp4CcX/+7WlSlK0EDMYkC9ljvGQG0p1Oi3XiDr8ETOGvjB/cVTVwQO7T0Q8Hjt2VEuS3VwrFIkchVRcFb15HL/4Tz0P7Ff6A+nH09wsqrL/SviEugDoOQZ4i/mB8nRgvLSIiPE5PqaUh0kgCffbpgK5dreAChfEgseaF5Afd5yF0b+/MHq7585cn7hOswwBYuaZg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKjvI-0002Ci-0t for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v4 02/11] import: utils: Emit new-style package inputs. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 Dec 2024 20:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70923 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70923@debbugs.gnu.org Cc: Sarah Morgensen Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17337743688221 (code B ref 70923); Mon, 09 Dec 2024 20:00:03 +0000 Received: (at 70923) by debbugs.gnu.org; 9 Dec 2024 19:59:28 +0000 Received: from localhost ([127.0.0.1]:55730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjug-00028G-LU for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:28 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:59135 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjub-00027N-TO for 70923@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1733774349; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=8tA04GO47F3PXiip0PSkXsaT7TUZa/1VHE/4svheeoI=; b=pBX2LkESErU5X8mYEfvmbLFXK1rYC21k7A6nCnsq2wjr2BROSDPyeRDNyRiSLg50jNvjUn Qao3H7nuywAoh9aohhsiJnQWrT7X50NtlBsackXgXP2IS/S7gPGjQ5xFt3vcIAMg5OJMV6 0C9KbeEV48//+sCKdw65j+49y/6tpcrd7aMKBkIO/2MvgRLprZ9MlwxY+/qahxxBr7BDJj 4cpcQmGxewpj4UVaVLLphVGn8X0TcNO428drih8t+2hXai/1RDO+h+Cqrw2m0DA80jY2qy fL/TNWRa0QEG75BtWZcseaRb0JxUsq+mJQBPbk1OE8FSfr+phdHbkdbI/Is+kg== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 20a99d11 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Mon, 9 Dec 2024 19:59:08 +0000 (UTC) Date: Mon, 9 Dec 2024 20:58:06 +0100 Message-ID: <9e86317f85773cce9744113feb6f96fa5c462b4e.1733774143.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> References: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Sarah Morgensen * guix/import/utils.scm (package-names->package-inputs)[make-input]: Return new-style package inputs. (maybe-list-field): Add procedure, which wraps BODY in 'list' instead of 'quasiquote'. (maybe-packages-field): Add procedure. (maybe-inputs): Use maybe-packages-field. (maybe-native-inputs): Use maybe-packages-field. (maybe-propagated-inputs): Use maybe-packages-field. Change-Id: I66588f4c822d507ddbaf465a268bfb71af8a7ecd --- guix/import/utils.scm | 52 +++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index ccf18a7bf9..4eab790645 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2022 Alice Brenon ;;; Copyright © 2022 Kyle Meyer ;;; Copyright © 2022 Philip McGrath +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -65,6 +66,8 @@ (define-module (guix import utils) guix-hash-url package-names->package-inputs + maybe-list-field + maybe-packages-field maybe-inputs maybe-native-inputs maybe-propagated-inputs @@ -425,39 +428,44 @@ (define* (package-names->package-inputs names #:optional (output #f)) optional OUTPUT, tries to generate a quoted list of inputs, as suitable to use in an 'inputs' field of a package definition." (define (make-input input version) - (let ((name (if version (string-append input "-" version) input))) + (let ((symbol (string->symbol + (if version + (string-append input "-" version) + input)))) (if output - (list (string->symbol name) output) - (string->symbol name)))) + (list symbol output) + symbol))) (map (match-lambda ((input version) (make-input input version)) (input (make-input input #f))) names)) -(define* (maybe-inputs package-names #:optional (output #f) - #:key (type #f)) - "Given a list of PACKAGE-NAMES, tries to generate the 'inputs' field of a -package definition. TYPE can be used to specify the type of the inputs; -either the 'native or 'propagated symbols are accepted. Left unspecified, the -snippet generated is for regular inputs." - (let ((field-name (match type - ('native 'native-inputs) - ('propagated 'propagated-inputs) - (_ 'inputs)))) - (match (package-names->package-inputs package-names output) - (() - '()) - ((package-inputs ...) - `((,field-name (list ,@package-inputs))))))) +(define* (maybe-list-field type body) + "Generates the TYPE field of a package definition if its value, BODY, +is a non-empty list." + (match body + (() '()) + ((? list?) (list (list type (cons 'list body)))))) + +(define* (maybe-packages-field type package-names + #:optional (output #f)) + "Given a list of PACKAGE-NAMES, tries to generate the TYPE field of a +package definition." + (maybe-list-field type + (package-names->package-inputs package-names output))) + +(define* (maybe-inputs package-names #:optional (output #f)) + "MAYBE-PACKAGES-FIELD for inputs." + (maybe-packages-field 'inputs package-names output)) (define* (maybe-native-inputs package-names #:optional (output #f)) - "Same as MAYBE-INPUTS, but for native inputs." - (maybe-inputs package-names output #:type 'native)) + "MAYBE-PACKAGES-FIELD for native inputs." + (maybe-packages-field 'native-inputs package-names output)) (define* (maybe-propagated-inputs package-names #:optional (output #f)) - "Same as MAYBE-INPUTS, but for propagated inputs." - (maybe-inputs package-names output #:type 'propagated)) + "MAYBE-PACKAGES-FIELD for propagated inputs." + (maybe-packages-field 'propagated-inputs package-names output)) (define* (package->definition guix-package #:optional append-version?/string) "If APPEND-VERSION?/STRING is #t, append the package's major+minor version. From patchwork Mon Dec 9 19:58:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 34706 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 BAA8827BBE2; Mon, 9 Dec 2024 20:01:12 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS autolearn=ham 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 D4EB327BBEA for ; Mon, 9 Dec 2024 20:01:11 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKjvM-0005BA-Ij; Mon, 09 Dec 2024 15:00:08 -0500 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 1tKjvL-0005Aa-2G for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:07 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKjvK-0007YB-PC for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=siEzEy2+sOm2s5tzCgbAlxWx4lbB2CU8F4juSsxsuTo=; b=fbpzLdGEk6Et1DFDfIMCx4JuG98OlVUc4INirq+dUSmP2ZS1ccUg30bsOzPe89p3Tul3NSqKw+L678kcQgDUc/sBSk3SueMEI8oZXA9ZWNYbiORv0VovDmvSU8SnN+4H6/HmcQo1qQOP5X2d+Tlc7SoslLghlKJ8MS3myDvao4CLPRa+3AG2jGy4tkSbZgpkDhGO86QuMA49zojBnvvmYr8AQIoIfDx7+Xv72+6pGQZ10yALCAH3J0Qq8RR6qMRhQndy0Isbtj/hmbSbil4nzR3x7V6E8zqXkZpAA1gU1CXFBU1FybOMdc2rZAlCx50Vg0dYpXWZwj0pwKSwUdyTCg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKjvK-0002Dl-Aa; Mon, 09 Dec 2024 15:00:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v4 03/11] import: crate: Emit new-style package inputs. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, guix-patches@gnu.org Resent-Date: Mon, 09 Dec 2024 20:00:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70923 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70923@debbugs.gnu.org Cc: Sarah Morgensen , Efraim Flashner X-Debbugs-Original-Xcc: Efraim Flashner Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17337743738278 (code B ref 70923); Mon, 09 Dec 2024 20:00:06 +0000 Received: (at 70923) by debbugs.gnu.org; 9 Dec 2024 19:59:33 +0000 Received: from localhost ([127.0.0.1]:55741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjul-00029H-QA for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:32 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:60445 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjuc-00027f-VO for 70923@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1733774350; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=siEzEy2+sOm2s5tzCgbAlxWx4lbB2CU8F4juSsxsuTo=; b=g5CbU97UsmVimCKX/r4E6gQjN99cM3fF54hVgUqu8V26fW8x3KCJ+uQfSek/zkSZ5olNOZ 2rCBu9ZWwPbpAU/e+Yyr1kXfQbt6TwzSr0ojUKooYYkoX0UR3GMYPHYDdmvjYHZnI3CcFB 8P4m/ZRjR0RZHUzjajgceTve2tDxugZm4h8eaSLg9hRjjqk4Y7zHPTKHfT7wS82Q2skL6x S0JIIiY5qHyjoRtzAw2slW715guuIUJuR1dcUhjpVSskj/cluf8jlcHiXQIZ8sxKMEEYTC yF98ieXuW38YwBzx7DVqLfsjhmHhsxjNFEHf1KhddTOMqmsRDuW0aMT3X/maaA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id c97487a3 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Mon, 9 Dec 2024 19:59:10 +0000 (UTC) Date: Mon, 9 Dec 2024 20:58:07 +0100 Message-ID: <019ad22bc42e58a41beb87b89237f8457874682d.1733774143.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> References: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Sarah Morgensen * guix/import/crate.scm (maybe-cargo-inputs, maybe-cargo-development-inputs, maybe-arguments): Delete procedures. (make-crate-sexp): Add 'unwrap' procedure, use with maybe-packages-field and fix indentation. * tests/crate.scm: Adjust accordingly. Change-Id: Ie8debd2553a338c3c623162b843e0a9827314074 --- guix/import/crate.scm | 51 ++++++------------ tests/crate.scm | 119 +++++++++++++++++------------------------- 2 files changed, 65 insertions(+), 105 deletions(-) diff --git a/guix/import/crate.scm b/guix/import/crate.scm index 5996571cda..962159f16e 100644 --- a/guix/import/crate.scm +++ b/guix/import/crate.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2023 Simon Tournier ;;; Copyright © 2023, 2024 Efraim Flashner ;;; Copyright © 2023, 2024 David Elsing +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -158,27 +159,6 @@ (define* (package-names->package-inputs names #:optional (output #f)) (input (make-input input #f))) names)) -(define (maybe-cargo-inputs package-names) - (match (package-names->package-inputs package-names) - (() - '()) - ((package-inputs ...) - `(#:cargo-inputs ,package-inputs)))) - -(define (maybe-cargo-development-inputs package-names) - (match (package-names->package-inputs package-names) - (() - '()) - ((package-inputs ...) - `(#:cargo-development-inputs ,package-inputs)))) - -(define (maybe-arguments arguments) - (match arguments - (() - '()) - ((args ...) - `((arguments (,'quasiquote ,args)))))) - (define (version->semver-prefix version) "Return the version up to and including the first non-zero part" (first @@ -202,8 +182,14 @@ (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inpu (let* ((port (http-fetch (crate-uri name version))) (guix-name (crate-name->package-name name)) - (cargo-inputs (format-inputs cargo-inputs)) - (cargo-development-inputs (format-inputs cargo-development-inputs)) + (unwrap (match-lambda + ((lst) lst) + (() '()))) + (cargo-inputs (maybe-packages-field '#:cargo-inputs + (format-inputs cargo-inputs))) + (cargo-development-inputs + (maybe-packages-field '#:cargo-development-inputs + (format-inputs cargo-development-inputs))) (description (beautify-description description)) (pkg `(package (name ,guix-name) @@ -222,12 +208,10 @@ (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inpu `((properties '((crate-version-yanked? . #t)))) '()) (build-system cargo-build-system) - ,@(maybe-arguments (append (if build? - '() - '(#:skip-build? #t)) - (maybe-cargo-inputs cargo-inputs) - (maybe-cargo-development-inputs - cargo-development-inputs))) + ,@(maybe-list-field 'arguments + (append (if build? '() '(#:skip-build? #t)) + (unwrap cargo-inputs) + (unwrap cargo-development-inputs))) (home-page ,home-page) (synopsis ,(beautify-synopsis synopsis)) (description ,(if (string-prefix? "This" description) @@ -239,11 +223,10 @@ (define* (make-crate-sexp #:key name version cargo-inputs cargo-development-inpu (#f #f) ((license) license) (_ `(list ,@license))))))) - (close-port port) - (package->definition pkg - (if yanked? - (string-append version "-yanked") - (version->semver-prefix version))))) + (close-port port) + (package->definition pkg (if yanked? + (string-append version "-yanked") + (version->semver-prefix version))))) (define (string->license string) (filter-map (lambda (license) diff --git a/tests/crate.scm b/tests/crate.scm index 5b4ad08c3c..8e3da2e72c 100644 --- a/tests/crate.scm +++ b/tests/crate.scm @@ -5,6 +5,8 @@ ;;; Copyright © 2020 Martin Becze ;;; Copyright © 2023 Efraim Flashner ;;; Copyright © 2023 David Elsing +;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -497,10 +499,10 @@ (define have-guile-semver? (? string? hash))))) (build-system 'cargo-build-system) (arguments - ('quasiquote - (#:skip-build? #t + (list + #:skip-build? #t #:cargo-inputs - (("rust-leaf-alice" ('unquote 'rust-leaf-alice-0.7)))))) + (list rust-leaf-alice-0.7))) (home-page "http://example.com") (synopsis "summary") (description "This package provides summary.") @@ -589,7 +591,7 @@ (define have-guile-semver? (? string? hash))))) (build-system cargo-build-system) (arguments - ('quasiquote (#:skip-build? #t))) + (list #:skip-build? #t)) (home-page "http://example.com") (synopsis "summary") (description "This package provides summary.") @@ -608,7 +610,7 @@ (define have-guile-semver? (base32 (? string? hash))))) (build-system cargo-build-system) - (arguments ('quasiquote (#:skip-build? #t))) + (arguments (list #:skip-build? #t)) (home-page "http://example.com") (synopsis "summary") (description "This package provides summary.") @@ -627,7 +629,7 @@ (define have-guile-semver? (base32 (? string? hash))))) (build-system cargo-build-system) - (arguments ('quasiquote (#:skip-build? #t))) + (arguments (list #:skip-build? #t)) (home-page "http://example.com") (synopsis "summary") (description "This package provides summary.") @@ -647,10 +649,9 @@ (define have-guile-semver? (? string? hash))))) (build-system cargo-build-system) (arguments - ('quasiquote (#:skip-build? #t - #:cargo-inputs - (("rust-leaf-bob" - ('unquote rust-leaf-bob-3)))))) + (list #:skip-build? #t + #:cargo-inputs + (list rust-leaf-bob-3))) (home-page "http://example.com") (synopsis "summary") (description "This package provides summary.") @@ -670,14 +671,11 @@ (define have-guile-semver? (? string? hash))))) (build-system cargo-build-system) (arguments - ('quasiquote (#:skip-build? #t - #:cargo-inputs - (("rust-intermediate-b" - ('unquote rust-intermediate-b-1)) - ("rust-leaf-alice" - ('unquote 'rust-leaf-alice-0.7)) - ("rust-leaf-bob" - ('unquote rust-leaf-bob-3)))))) + (list #:skip-build? #t + #:cargo-inputs + (list rust-intermediate-b-1 + rust-leaf-alice-0.7 + rust-leaf-bob-3))) (home-page "http://example.com") (synopsis "summary") (description "This package provides summary.") @@ -697,18 +695,13 @@ (define have-guile-semver? (? string? hash))))) (build-system cargo-build-system) (arguments - ('quasiquote (#:cargo-inputs - (("rust-intermediate-a" - ('unquote rust-intermediate-a-1)) - ("rust-intermediate-b" - ('unquote rust-intermediate-b-1)) - ("rust-leaf-alice" - ('unquote 'rust-leaf-alice-0.7)) - ("rust-leaf-bob" - ('unquote rust-leaf-bob-3))) - #:cargo-development-inputs - (("rust-intermediate-c" - ('unquote rust-intermediate-c-1)))))) + (list #:cargo-inputs + (list rust-intermediate-a-1 + rust-intermediate-b-1 + rust-leaf-alice-0.7 + rust-leaf-bob-3) + #:cargo-development-inputs + ((list rust-intermediate-c-1)))) (home-page "http://example.com") (synopsis "summary") (description "This package provides summary.") @@ -735,9 +728,8 @@ (define have-guile-semver? (? string? hash))))) (build-system cargo-build-system) (arguments - ('quasiquote (#:cargo-development-inputs - (("rust-leaf-alice" - ('unquote rust-leaf-alice-0.7)))))) + (list #:cargo-development-inputs + (list rust-leaf-alice-0.7))) (home-page "http://example.com") (synopsis "summary") (description "This package provides summary.") @@ -793,9 +785,8 @@ (define have-guile-semver? (? string? hash))))) (build-system cargo-build-system) (arguments - ('quasiquote (#:cargo-inputs - (("rust-leaf-bob" - ('unquote rust-leaf-bob-3)))))) + (list #:cargo-inputs + (list rust-leaf-bob-3))) (home-page "http://example.com") (synopsis "summary") (description "This package provides summary.") @@ -815,13 +806,10 @@ (define have-guile-semver? (? string? hash))))) (build-system cargo-build-system) (arguments - ('quasiquote (#:cargo-inputs - (("rust-intermediate-b" - ('unquote rust-intermediate-b-1)) - ("rust-leaf-alice" - ('unquote 'rust-leaf-alice-0.7)) - ("rust-leaf-bob" - ('unquote rust-leaf-bob-3)))))) + (list #:cargo-inputs + (list rust-intermediate-b-1 + rust-leaf-alice-0.7 + rust-leaf-bob-3))) (home-page "http://example.com") (synopsis "summary") (description "This package provides summary.") @@ -841,18 +829,13 @@ (define have-guile-semver? (? string? hash))))) (build-system cargo-build-system) (arguments - ('quasiquote (#:cargo-inputs - (("rust-intermediate-a" - ('unquote rust-intermediate-a-1)) - ("rust-intermediate-b" - ('unquote rust-intermediate-b-1)) - ("rust-leaf-alice" - ('unquote 'rust-leaf-alice-0.7)) - ("rust-leaf-bob" - ('unquote rust-leaf-bob-3))) - #:cargo-development-inputs - (("rust-intermediate-c" - ('unquote rust-intermediate-c-1)))))) + (list #:cargo-inputs + (list rust-intermediate-a-1 + rust-intermediate-b-1 + rust-leaf-alice-0.7 + rust-leaf-bob-3) + #:cargo-development-inputs + (list rust-intermediate-c-1))) (home-page "http://example.com") (synopsis "summary") (description "This package provides summary.") @@ -962,14 +945,11 @@ (define rust-leaf-bob-3.0.2-yanked (? string? hash))))) (build-system cargo-build-system) (arguments - ('quasiquote (#:cargo-inputs - (("rust-leaf-bob" - ('unquote 'rust-leaf-bob-3))) - #:cargo-development-inputs - (("rust-leaf-bob" - ('unquote 'rust-leaf-bob-3.0.2-yanked)) - ("rust-leaf-bob" - ('unquote 'rust-leaf-bob-4.0.0-yanked)))))) + (list #:cargo-inputs + (list rust-leaf-bob-3) + #:cargo-development-inputs + (list rust-leaf-bob-3.0.2-yanked + rust-leaf-bob-4.0.0-yanked))) (home-page "http://example.com") (synopsis "summary") (description "This package provides summary.") @@ -1093,14 +1073,11 @@ (define rust-leaf-bob-3.0.2-yanked (? string? hash))))) (build-system cargo-build-system) (arguments - ('quasiquote (#:cargo-inputs - (("rust-leaf-bob" - ('unquote 'rust-leaf-bob-3))) - #:cargo-development-inputs - (("rust-leaf-bob" - ('unquote 'rust-leaf-bob-3.0.2-yanked)) - ("rust-leaf-bob" - ('unquote 'rust-leaf-bob-4.0.0-yanked)))))) + (list #:cargo-inputs + (list rust-leaf-bob-3) + #:cargo-development-inputs + (list rust-leaf-bob-3.0.2-yanked + rust-leaf-bob-4.0.0-yanked))) (home-page "http://example.com") (synopsis "summary") (description "This package provides summary.") From patchwork Mon Dec 9 19:58:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 34698 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 715F727BBEB; Mon, 9 Dec 2024 20:00:48 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS 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 82AA327BBEA for ; Mon, 9 Dec 2024 20:00:46 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKjvN-0005BE-5O; Mon, 09 Dec 2024 15:00:09 -0500 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 1tKjvJ-0005A1-Nv for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKjvJ-0007Y3-ED for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=MygAlkEdwJyZ9EbltGmd2aEWfafC4P0ynchUAA1T3Mk=; b=Gg0CBukPKhxDxKdaDGsS0yPRKsrcxNJRzhBI/gcInje/FB/f/78uQjiM8peWN9lyOJH3IXxyq751i9aNpuI0hxPjAHuugRh29GB+Lfg6KoJs36lVc3pxgY3eAOyNB1H40F0cmOZ4zeRiGfIPo98e/xFpzXGKZm9p0qbtL3wPKWb9BfZcfyzI1VwTRK8qyGK6uc/NS9R0/1QWtcsv6PCYHUULsZs4Up4pgsKmMiyDi3sIO3HMA7e9mLlnZQ4fzzB1tFltz7NKZF8QR85AZuXndj0t15q5WQWQQhWu3sjjhpXXIJCx3E1HO1x/VOTKpYfehhXL7Yu7eOPPyswqi1TWlA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKjvJ-0002DC-3Y for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v4 04/11] import: utils: Add 'maybe-upstream-inputs' procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 Dec 2024 20:00:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70923 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70923@debbugs.gnu.org Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17337743718261 (code B ref 70923); Mon, 09 Dec 2024 20:00:04 +0000 Received: (at 70923) by debbugs.gnu.org; 9 Dec 2024 19:59:31 +0000 Received: from localhost ([127.0.0.1]:55739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjul-000299-9t for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:31 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:59135 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjud-00027N-Gd for 70923@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1733774352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MygAlkEdwJyZ9EbltGmd2aEWfafC4P0ynchUAA1T3Mk=; b=IYkZNK00uwtv8FypxTC6PrIctp6qz3hOnxG6zLgUsGrFDqPeny3pF5VOrgtqFWzl76QUIF U0bgNh9RQ+yCybini18/apBHJ9kuzzfKCzYZKQzkyjZG7SuNmRPxhI9lTLq6md5/Ax81AB rpBw0m7I2SwXDDoGeRk3MLyJa7XkB9NxCOrykyuM81wD5PNOWX893BSwMszWdpu4f5UtCY ooV6/YNyxt+hoQ26Uao5wjSVQ/+d9c89G69AmMb5gCeZciaKmS80TkxC56v57BmrtBWCxP qAhBdOdDK7CBPJlPZVXibGe1/B8zqb1HSZ9ER2yowhLvGwiBBDfmUvOXnOIxSg== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id e1e57fbe (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 9 Dec 2024 19:59:12 +0000 (UTC) Date: Mon, 9 Dec 2024 20:58:08 +0100 Message-ID: <7fd481409247d1124171d1f8a5a549f6e4d92f46.1733774143.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> References: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/import/utils.scm (maybe-upstream-inputs): Add procedure. Change-Id: Ib8a80216d512c0373e55e4f27e1ef2a7c1fb854a --- guix/import/utils.scm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 4eab790645..9544fbf00f 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -45,6 +45,7 @@ (define-module (guix import utils) #:use-module (guix download) #:use-module (guix sets) #:use-module ((guix ui) #:select (fill-paragraph)) + #:use-module (guix upstream) #:use-module (gnu packages) #:autoload (ice-9 control) (let/ec) #:use-module (ice-9 match) @@ -71,6 +72,7 @@ (define-module (guix import utils) maybe-inputs maybe-native-inputs maybe-propagated-inputs + maybe-upstream-inputs package->definition spdx-string->license @@ -467,6 +469,13 @@ (define* (maybe-propagated-inputs package-names #:optional (output #f)) "MAYBE-PACKAGES-FIELD for propagated inputs." (maybe-packages-field 'propagated-inputs package-names output)) +(define* (maybe-upstream-inputs type upstream-inputs) + "Given a list of UPSTREAM-NAMES, tries to generate the TYPE field of a +package definition." + (maybe-list-field type + (map (compose string->symbol upstream-input-downstream-name) + upstream-inputs))) + (define* (package->definition guix-package #:optional append-version?/string) "If APPEND-VERSION?/STRING is #t, append the package's major+minor version. If it is the symbol 'full, append the package's complete version. If From patchwork Mon Dec 9 19:58:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 34699 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 BBFE727BBEB; Mon, 9 Dec 2024 20:00:48 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS 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 255EF27BBE2 for ; Mon, 9 Dec 2024 20:00:44 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKjve-0005M9-Li; Mon, 09 Dec 2024 15:00:26 -0500 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 1tKjva-0005LE-Pv for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:22 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKjva-0007ZX-5u; Mon, 09 Dec 2024 15:00:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=4mDVhUQiS/kTiBFbsxiWrC3jCC+6QYxmfOifyMbMUio=; b=F5oLP7T5h5KNiM/t2zrXRfnFafdruZdG9mzNclm/73BR4tw0knSMUhMv6uHx7peO34J6zo7s8q2W795g5wt9mT+tlPCzTzO01CDekQp1NWoktDZQJ3lRlyrSFZEjB65O7SQqeN40DjebrCJk04Pjw7C5S7wNyZXRX0AEMajohNQJf1y/Btow2/jTd9iQZGPzZauO+bicTea0t+UgqygdNh1A8ZvII/XQ47AlQQxWyRwBHuK20Cbnq62qBuGfXIfdbUyVzJSl2oh6ma7ESH27LpyzYDbDtrpo3zdjeuS+mQAkqXDQ23hj6CeWWK1Am4BbbyqyyH/M4cuQrRNqAUvYuQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKjvQ-0002JI-JG; Mon, 09 Dec 2024 15:00:12 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v4 05/11] import: pypi: Use 'maybe-list-field' procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: lars@6xq.net, marius@gnu.org, me@bonfacemunyoki.com, sharlatanus@gmail.com, tanguy@bioneland.org, jgart@dismail.de, guix-patches@gnu.org Resent-Date: Mon, 09 Dec 2024 20:00:12 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70923 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70923@debbugs.gnu.org Cc: Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , Sharlatan Hellseher , Tanguy Le Carrour , jgart X-Debbugs-Original-Xcc: Lars-Dominik Braun , Marius Bakke , Munyoki Kilyungi , Sharlatan Hellseher , Tanguy Le Carrour , jgart Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17337743778345 (code B ref 70923); Mon, 09 Dec 2024 20:00:12 +0000 Received: (at 70923) by debbugs.gnu.org; 9 Dec 2024 19:59:37 +0000 Received: from localhost ([127.0.0.1]:55755 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjuq-0002AS-MR for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:37 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:57961 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjuh-00027s-Pt for 70923@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1733774352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4mDVhUQiS/kTiBFbsxiWrC3jCC+6QYxmfOifyMbMUio=; b=h9SFkDKIPrAHJzqvTr1ULhRPPiyvCciPNwdvz9VUKUbrOd/+Utx0HbS/1eTcrIIsai+Pow 3pt6EwartTHryfdzobrYsSmnADWdBL9mu5sfou/EwgG5w5sL3vi7TheKIsuPNU0kSvEekx hDbINfgedru1TRpwrPGYNozN0ambZ4YPh7XmyB67x88y9m0Kt241qGMbth5GoBZb8z+fQ5 tmL2n24vd6ffxGguQbGZ0sxWloodynVhkWzvvfgZpQq7SOhih7dvD7hmajBfAbH7qUG7eF gBsSVoAZWG3BqYsSQ0qmk+QO7BZhcF62wQhqJ1z2Zerhb9ZmGgB77e5ux7PvBg== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 8d064f23 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 9 Dec 2024 19:59:12 +0000 (UTC) Date: Mon, 9 Dec 2024 20:58:09 +0100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> References: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/import/pypi.scm (maybe-inputs): Delete procedure. (make-pypi-sexp): Use 'maybe-list-field' and 'maybe-upstream-inputs' procedures. --- guix/import/pypi.scm | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index 7b9f54a200..a98fdfa604 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2022 Vivien Kraus ;;; Copyright © 2021 Simon Tournier ;;; Copyright © 2022 Hartmut Goebel +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -201,18 +202,6 @@ (define (wheel-url->extracted-directory wheel-url) ((name version _ ...) (string-append name "-" version ".dist-info")))) -(define (maybe-inputs package-inputs input-type) - "Given a list of PACKAGE-INPUTS, tries to generate the 'inputs' field of a -package definition. INPUT-TYPE, a symbol, is used to populate the name of -the input field." - (match package-inputs - (() - '()) - ((package-inputs ...) - `((,input-type (list ,@(map (compose string->symbol - upstream-input-downstream-name) - package-inputs))))))) - (define %requirement-name-regexp ;; Regexp to match the requirement name in a requirement specification. @@ -538,10 +527,10 @@ (define* (make-pypi-sexp pypi-package bytevector->nix-base32-string))))) ,@(maybe-upstream-name name) (build-system pyproject-build-system) - ,@(maybe-inputs (upstream-source-propagated-inputs source) - 'propagated-inputs) - ,@(maybe-inputs (upstream-source-native-inputs source) - 'native-inputs) + ,@(maybe-upstream-inputs 'propagated-inputs + (upstream-source-propagated-inputs source)) + ,@(maybe-upstream-inputs 'native-inputs + (upstream-source-native-inputs source)) (home-page ,(project-info-home-page info)) (synopsis ,(project-info-summary info)) (description ,(and=> (non-empty-string-or-false From patchwork Mon Dec 9 19:58:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 34702 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 5C4C227BBE2; Mon, 9 Dec 2024 20:00:49 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS autolearn=ham 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 685C927BBE9 for ; Mon, 9 Dec 2024 20:00:47 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKjvQ-0005De-VI; Mon, 09 Dec 2024 15:00:12 -0500 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 1tKjvP-0005CA-4L for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:11 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKjvO-0007Yl-RS for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=UclAUoKx8KFBtJItdylumB2m7pEbRhbwnbdV7dy+JQo=; b=vkylNLcBQiH1GT3r/KQboSXh5/6li8tR9Xvwj0wB7OA9HQqYyNI5PBKsO8M+bhjMZaAKWAtPu5ZbvlmS3nxMrzofMDplTO1Ckgm4ePFpytqeZLai0lC/FGDVODd6ovkCjHMeNfLvKRypC/WD0WP++HEd+5HbAnT411YvBhG/MrvNPxg+maNjMvuXzTsTsSZI0j3SY7N2sg3XgJT6miz00BSWz61yqfpBakVzNKNSmDIsahL72hUqgWW+jnh4yLgnxYrzjJUmfgtuBxzWXR75GM7kx0g4oHWH53YdYAIwksyjH2sWU0cqfakiMaQflt45N2EA/vJdN3TTwpVd0oGL9g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKjvL-0002EV-As; Mon, 09 Dec 2024 15:00:07 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v4 06/11] import: elpa: Use maybe-propagated-inputs procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: andrew@trop.in, cox.katherine.e+guix@gmail.com, liliana.prikler@gmail.com, guix-patches@gnu.org Resent-Date: Mon, 09 Dec 2024 20:00:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70923 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70923@debbugs.gnu.org Cc: Andrew Tropin , Katherine Cox-Buday , Liliana Marie Prikler X-Debbugs-Original-Xcc: Andrew Tropin , Katherine Cox-Buday , Liliana Marie Prikler Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17337743738289 (code B ref 70923); Mon, 09 Dec 2024 20:00:07 +0000 Received: (at 70923) by debbugs.gnu.org; 9 Dec 2024 19:59:33 +0000 Received: from localhost ([127.0.0.1]:55743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjum-00029Y-V2 for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:33 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:59135 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjuh-00027N-Pt for 70923@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1733774353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UclAUoKx8KFBtJItdylumB2m7pEbRhbwnbdV7dy+JQo=; b=q4M+h2AeJn8UheFe9KCuSRC6ihYxEMM7Hb8WD0b4TITj71MumEjq7ffhxpZ860dVuGW4Aw dz2e2ZXS6/29G7+fLJwrwCxcdmTmUDu5dg7ZKSYobZihTdipIyIN8UKqYrjM6TOtUMRWXv 1WsLUXojPx2Gw4OvsMa8U6baVV5qwRtjeJ4UxoIDYLSkAiqLRi60ppFW6qYuvAmPmoC+Nk Khphs4DYI7NfWFbSpeCQQDSZB/R114NmEezoaJoZfVHBSuf5/IjKqo+IHuuyDuY6xI+q9j YJ6hyLyaoy/0lIqpvLjwdK1QksgH4M7QWk8HEa6Tu9Mdjg+c9rsNd0d5GW3kKA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 76e2644a (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 9 Dec 2024 19:59:13 +0000 (UTC) Date: Mon, 9 Dec 2024 20:58:10 +0100 Message-ID: <1aa9a745e91fbe39f93034965451562d429e9674.1733774143.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> References: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/import/elpa.scm (maybe-inputs): Delete procedure. (elpa-package->sexp): Use maybe-propagated-inputs procedure. Change-Id: I9b40e9d387311f5dbbb079938733bf945a1a6ee6 --- guix/import/elpa.scm | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index 46b6dc98a2..9ade189a8a 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -359,13 +359,6 @@ (define* (elpa-package->sexp pkg #:optional license repo) (map (compose string->symbol elpa-name->package-name) dependencies-names)) - (define (maybe-inputs input-type inputs) - (match inputs - (() - '()) - ((inputs ...) - (list (list input-type `(list ,@inputs)))))) - (define melpa-source (melpa-recipe->origin melpa-recipe)) @@ -386,7 +379,7 @@ (define* (elpa-package->sexp pkg #:optional license repo) (file-hash* tarball #:recursive? #false)) "failed to download package"))))))) (build-system emacs-build-system) - ,@(maybe-inputs 'propagated-inputs dependencies) + ,@(maybe-propagated-inputs dependencies) ,@(if melpa-source (melpa-recipe->maybe-arguments melpa-recipe) '()) From patchwork Mon Dec 9 19:58:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 34705 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 5B75C27BBEB; Mon, 9 Dec 2024 20:01:12 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS autolearn=ham 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 A8FA127BBE2 for ; Mon, 9 Dec 2024 20:01:11 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKjvO-0005Bl-Jh; Mon, 09 Dec 2024 15:00:10 -0500 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 1tKjvN-0005BD-3T for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:09 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKjvM-0007YV-Q5 for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=pnj1p+jLMJn0WKwS//Xpf8WBiWHD7UqsxX1NXy1pQk8=; b=IxpC6zYxilPcrTGAuyE3SQ6kwUQryF7y1mE13DqihffflWwLTIXZIxPXLQpAwsG+0KGG0Kso+5cY507FG26jJU+QobMzGQrp95BqQhvjjtUN/BDVajJafRrrwGKNjOkad38gsTKZbeIpV/WOvoqZBKS0FQj5EEQfr+C7JZ11m2YLnBfQX8CO3PoJlz4D3dlKeQWZWs/FTp4KVCcg7BY0OtqwWDUqe714k1wKEAg5PZVomSg7p5Fz3zkElI34Kkgj0Ouip5tmVJzLXhHsswkYL36SWXw6zV0E2gFHhSJwgAOl1pl7w/O+x6Emljoy9pc1LS9VJgsW5KH6gMo7wtx7ew==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKjvM-0002FH-43; Mon, 09 Dec 2024 15:00:08 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v4 07/11] import: hackage: Use 'maybe-list-field' procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: lars@6xq.net, guix-patches@gnu.org Resent-Date: Mon, 09 Dec 2024 20:00:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70923 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70923@debbugs.gnu.org Cc: Lars-Dominik Braun X-Debbugs-Original-Xcc: Lars-Dominik Braun Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17337743748303 (code B ref 70923); Mon, 09 Dec 2024 20:00:08 +0000 Received: (at 70923) by debbugs.gnu.org; 9 Dec 2024 19:59:34 +0000 Received: from localhost ([127.0.0.1]:55745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjun-00029e-Be for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:34 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:60445 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjui-00027f-AV for 70923@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1733774353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pnj1p+jLMJn0WKwS//Xpf8WBiWHD7UqsxX1NXy1pQk8=; b=P7aTjJpKM3MmctxBkBvUvbqvpbt+kr7KMOGTeNJFedN1Qrv1bYChT07b490/qfLkX/HBBf SzJxVwSKbslE6euuRM91ahSk9+cVZ7BdLcNL8TCpQYLHwDfUUaLyVGggJ/EifizsXpfDko 9aVnPflEK1/cc/s8b4uKcZ4J0twgno0oH6UnZxIuqlwt7/kNwkXLgn+/Io4HeAYzYtQ65d 6f+Ljty2y7ti0+oY0gzZa87zpqsgHiJguC5Hc2AGcsgdrOVPMwRLBg8qBDwPqPDn1mOZ98 0rtCxREcO8gl2jFZImm/SdmlheP5VsW42pNoKnH/JfJ37v4x5ZcUSdjGV+deOA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 5fd9c6b6 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 9 Dec 2024 19:59:13 +0000 (UTC) Date: Mon, 9 Dec 2024 20:58:11 +0100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> References: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/import/hackage.scm (maybe-inputs, maybe-arguments): Delete procedures. (hackage-module->sexp): Use 'maybe-list-field' and 'maybe-upstream-inputs' procedures. * tests/hackage.scm: Fix whitespace and replace 'quasiquote' with 'list'. Change-Id: I4fe39ff84c9f6a677f810d9e4fe751d762973757 --- guix/import/hackage.scm | 39 ++++++++++++--------------------------- tests/hackage.scm | 13 +++++++------ 2 files changed, 19 insertions(+), 33 deletions(-) diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm index 422887d435..99dfb84b7d 100644 --- a/guix/import/hackage.scm +++ b/guix/import/hackage.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2022 Hartmut Goebel ;;; Copyright © 2023-2024 Ludovic Courtès ;;; Copyright © 2024 Nicolas Graves +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -290,26 +291,6 @@ (define* (hackage-module->sexp cabal cabal-hash #:include-test-dependencies? include-test-dependencies?)) - (define (maybe-inputs input-type inputs) - (match inputs - (() - '()) - ((inputs ...) - (list (list input-type - `(list ,@(map (compose string->symbol - upstream-input-downstream-name) - inputs))))))) - - (define (maybe-arguments) - (match (append (if (not include-test-dependencies?) - '(#:tests? #f) - '()) - (if (not (string-null? revision)) - `(#:cabal-revision (,revision ,cabal-hash)) - '())) - (() '()) - (args `((arguments (,'quasiquote ,args)))))) - (let ((tarball (with-store store (download-to-store store source-url)))) (values @@ -326,13 +307,17 @@ (define* (hackage-module->sexp cabal cabal-hash "failed to download tar archive"))))) (build-system haskell-build-system) (properties '((upstream-name . ,name))) - ,@(maybe-inputs 'inputs - (filter (upstream-input-type-predicate 'regular) - inputs)) - ,@(maybe-inputs 'native-inputs - (filter (upstream-input-type-predicate 'native) - inputs)) - ,@(maybe-arguments) + ,@(maybe-upstream-inputs 'inputs + (filter (upstream-input-type-predicate 'regular) inputs)) + ,@(maybe-upstream-inputs 'native-inputs + (filter (upstream-input-type-predicate 'native) inputs)) + ,@(maybe-list-field 'arguments + (append (if (not include-test-dependencies?) + '(#:tests? #f) + '()) + (if (not (string-null? revision)) + `(#:cabal-revision '(,revision ,cabal-hash)) + '()))) (home-page ,(cabal-package-home-page cabal)) (synopsis ,(cabal-package-synopsis cabal)) (description ,(beautify-description (cabal-package-description cabal))) diff --git a/tests/hackage.scm b/tests/hackage.scm index 403f587c41..f6d91515e2 100644 --- a/tests/hackage.scm +++ b/tests/hackage.scm @@ -67,7 +67,7 @@ (define test-cabal-3 if impl(ghc>=7.2&&<7.6) Build-depends: ghc-b if impl(ghc == 7.8) - Build-depends: + Build-depends: HTTP >= 4000.2.5 && < 4000.3, mtl >= 2.0 && < 3 ") @@ -86,7 +86,7 @@ (define test-cabal-4 if impl(ghc>=7.2&&<7.6) Build-depends: ghc-b if impl(ghc == 7.8) - Build-depends: + Build-depends: HTTP >= 4000.2.5 && < 4000.3, mtl >= 2.0 && < 3 ") @@ -101,7 +101,7 @@ (define test-cabal-5 license: BSD3 library if impl(ghc == 7.8) - Build-depends: + Build-depends: HTTP >= 4000.2.5 && < 4000.3, if impl(ghc -any) Build-depends: mtl >= 2.0 && < 3 @@ -126,7 +126,7 @@ (define test-cabal-6 if impl(ghc>=7.2&&<7.6) Build-depends: ghc-b if impl(ghc == 7.8) - Build-depends: + Build-depends: HTTP >= 4000.2.5 && < 4000.3, mtl >= 2.0 && < 3 ") @@ -524,8 +524,9 @@ (define-package-matcher match-ghc-foo-revision ('properties '(quote ((upstream-name . "foo")))) ('inputs ('list 'ghc-http)) ('arguments - ('quasiquote - ('#:cabal-revision + ('list + '#:cabal-revision + ('quote ("2" "0xxd88fb659f0krljidbvvmkh9ppjnx83j0nqzx8whcg4n5qbyng")))) ('home-page "http://test.org") ('synopsis (? string?)) From patchwork Mon Dec 9 19:58:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 34707 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 A362727BBE2; Mon, 9 Dec 2024 20:01:18 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS 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 6D9FC27BBE9 for ; Mon, 9 Dec 2024 20:01:17 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKjvR-0005Dm-44; Mon, 09 Dec 2024 15:00:13 -0500 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 1tKjvP-0005C9-3h for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:11 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKjvO-0007Yf-Ll for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=ZytxbSK1TYQpLSbGcarDC0TjIBoZKLwRsW6sQQUuZ6E=; b=HDzhdQ8p6/SkbR8GbszBSc4CLxOyT0yZhCtFkvVpsjn+qOlyIpZm3fi41vT0+HVD/rPepXDAuxgkkqYUjXqnfhobfzyqelVSQN9pHbLeTV7ngrKNvd0dVt02hTafjSEuYBt+3ufpJw1Raov25O5bdfdzZ5So0IJLqsUCbE58rihGfVsW/08Hs0MzK9RUfiBefa7vlN2gPDwaHzi+Wy0PScfvunM+PVlR/3efpfWkbe7T4xaQvf/AnuU5uIiSNMenLDqaiwiOkje32ZWgNUWCTLappPRevBaZvHS2lUto9G8x2bubrDUIi8fGV1jop59p0IBdbuB1/NYVgAHlwpMTdw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKjvN-0002Fs-4J; Mon, 09 Dec 2024 15:00:09 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v4 08/11] import: cran: Use 'maybe-list-field' procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: laurent.gatto@gmail.com, rekado@elephly.net, zimon.toutoune@gmail.com, guix-patches@gnu.org Resent-Date: Mon, 09 Dec 2024 20:00:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70923 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70923@debbugs.gnu.org Cc: Laurent Gatto , Ricardo Wurmus , Simon Tournier X-Debbugs-Original-Xcc: Laurent Gatto , Ricardo Wurmus , Simon Tournier Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17337743748313 (code B ref 70923); Mon, 09 Dec 2024 20:00:09 +0000 Received: (at 70923) by debbugs.gnu.org; 9 Dec 2024 19:59:34 +0000 Received: from localhost ([127.0.0.1]:55747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjuo-00029q-7c for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:34 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:59135 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjuj-00027N-2j for 70923@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1733774354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZytxbSK1TYQpLSbGcarDC0TjIBoZKLwRsW6sQQUuZ6E=; b=TzVixyhia3sFmKIHtZts+puAmtZmpXEFn1kN2xrDLERWJm7NTEuQLFR9tbxa9yhTooOF1L RyjmHlqGE/43RoSgHRIHPtEfoYDqK/s7NBKfmr+I3Sk0+zFLDZLbS+MDfK0HHvRyksiSH6 FeuTA3Vch7uSp0KV5/bQR9ruQli79pDe6jQz3+hQbgwseDU9hr2ULhSuElBPaGwItPZzEV rAi2fKVkz1JlIBkcyYdVrBGVAg5A3we2fq8Q/gdziBYNWozpF1+r5HBcorr0vl+NRlPYSv 85ZDaQH961Wd5SWq5BWk1RFevh0tswXXh3zTMOvQmvmB5CmWTymAkXGcgySZWw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 429f0fb9 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 9 Dec 2024 19:59:14 +0000 (UTC) Date: Mon, 9 Dec 2024 20:58:12 +0100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> References: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/import/cran.scm (format-inputs): Delete procedure. (maybe-inputs): Use 'maybe-list-field' procedure. Change-Id: I5148afcebdac1f7fa0f8cce9e82e8cebb56c36c8 --- guix/import/cran.scm | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index fe69cb87f7..11843703ac 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2021 Simon Tournier ;;; Copyright © 2022 Hartmut Goebel +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -86,21 +87,6 @@ (define-module (guix import cran) (define %input-style (make-parameter 'variable)) ; or 'specification -(define (format-inputs inputs) - "Generate a sorted list of package inputs from a list of upstream inputs." - (map (lambda (input) - (case (%input-style) - ((specification) - `(specification->package ,(upstream-input-downstream-name input))) - (else - ((compose string->symbol - upstream-input-downstream-name) - input)))) - (sort inputs - (lambda (a b) - (string-cilicenses license-string license-prefix) (let ((licenses (map string-trim-both @@ -189,11 +175,21 @@ (define (description->alist description) (define* (maybe-inputs package-inputs #:optional (input-type 'inputs)) "Given a list of PACKAGE-INPUTS, tries to generate the TYPE field of a package definition." - (match package-inputs - (() - '()) - ((package-inputs ...) - `((,input-type (list ,@(format-inputs package-inputs))))))) + (define (format-input input) + (case (%input-style) + ((specification) + `(specification->package ,(upstream-input-downstream-name input))) + (else + ((compose string->symbol + upstream-input-downstream-name) + input)))) + + (define (upstream-input-name X-Patchwork-Id: 34701 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 0D8C927BBE2; Mon, 9 Dec 2024 20:00:50 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS autolearn=ham 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 CED2B27BBEE for ; Mon, 9 Dec 2024 20:00:47 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKjvU-0005Gp-2M; Mon, 09 Dec 2024 15:00:16 -0500 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 1tKjvO-0005Bw-PU for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:10 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKjvO-0007Yi-Gu for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=LKGXZOAZQm/HBzMrUMNTcnJ7X4/orZqyPz52qLi35gQ=; b=F/BqC0ZcgZbBXFG8RLruX2h/0uCpRz7oyfhZItaWErBUjKj+JK7S+VbllOKA2MoSwCqtC1nJ+HviAcu67a40umg9fTF5Uk5b+30OdpJuwSpZxIoBQunQHAMt+FfsyFYsQuqNU9vl38a8FqwPVbbsNnGnHWd3OKxBtPlFtISEYNNZRRi1CZEKTw6owAfSm91RJIw/hudKhfASdIx7aGpSmJfhd+5172F+MrXqoN5e1qqDr+bQQJjMzWjBfa4XbemUQVhqlUcM1nGy2pGHES0DTIQVFsDcbhmgpDliixGt0OsPVpDgM6rWiFmYYlHBPhzBS+FMHPnCvp5VcfYaCn90Hg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKjvN-0002GP-SD for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:10 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v4 09/11] import: cpan: Use 'maybe-upstream-inputs' procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 Dec 2024 20:00:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70923 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70923@debbugs.gnu.org Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17337743758322 (code B ref 70923); Mon, 09 Dec 2024 20:00:09 +0000 Received: (at 70923) by debbugs.gnu.org; 9 Dec 2024 19:59:35 +0000 Received: from localhost ([127.0.0.1]:55749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjuo-0002A1-Ov for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:35 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:60445 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjuj-00027f-Ma for 70923@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1733774354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LKGXZOAZQm/HBzMrUMNTcnJ7X4/orZqyPz52qLi35gQ=; b=r8UQL69laODd6Bd0KnhGr6D0c/bARDoTMhA/oPGox5UESH6X09z4aNmaaIVOznfLaZZ5e5 +sQJLmh0m+zc7PW7URZ7wTOGM5xF+irYQjD/K7ppwUPtB5Yb59+ExjYq1zrYknEGnDEByd LlSwSMOQILaHFGsbOsf58cYuVAFFE0ww/Oudv397X1o4/3+PJNaMnO75U5V5tvPdiMNn1P Xl8bQAgMUCcbg1HE3y2UJrmHb6qb8JLGjTkF8nIMmD+EPceCfyEMvkL0UEU5CoGWvzpqw4 6W3mK8YU6E2Yr1In6qAiqfW/o8CKTjW70NTPD8qpQhS1KehEw8ERpek8r7IXLA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 77e07663 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 9 Dec 2024 19:59:14 +0000 (UTC) Date: Mon, 9 Dec 2024 20:58:13 +0100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> References: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/import/cpan.scm (maybe-inputs): Delete procedure. (cpan-module->sexp): Use 'maybe-upstream-inputs' procedure. Change-Id: I4fa99da62d81f02c2998ad96f5ea81e27df071cd --- guix/import/cpan.scm | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm index 85e5e69098..e26cc85491 100644 --- a/guix/import/cpan.scm +++ b/guix/import/cpan.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice ;;; Copyright © 2020, 2021, 2023 Ludovic Courtès ;;; Copyright © 2022 Hartmut Goebel +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,8 +38,9 @@ (define-module (guix import cpan) #:use-module (guix utils) #:use-module (guix base32) #:use-module ((guix download) #:select (download-to-store url-fetch)) - #:use-module ((guix import utils) - #:select (factorize-uri recursive-import)) + #:use-module ((guix import utils) #:select (factorize-uri + maybe-upstream-inputs + recursive-import)) #:use-module (guix import json) #:use-module (guix packages) #:use-module (guix upstream) @@ -277,15 +279,6 @@ (define (cpan-module->sexp release) (define version (cpan-release-version release)) (define source-url (cpan-source-url release)) - (define (maybe-inputs input-type inputs) - (match inputs - (() - '()) - ((inputs ...) - `((,input-type (list ,@(map (compose string->symbol - upstream-input-downstream-name) - inputs))))))) - (let* ((tarball (with-store store (download-to-store store source-url))) (inputs (cpan-module-inputs release)) @@ -300,12 +293,10 @@ (define (cpan-module->sexp release) (base32 ,(bytevector->nix-base32-string (file-sha256 tarball)))))) (build-system perl-build-system) - ,@(maybe-inputs 'native-inputs - (filter (upstream-input-type-predicate 'native) - inputs)) - ,@(maybe-inputs 'propagated-inputs - (filter (upstream-input-type-predicate 'propagated) - inputs)) + ,@(maybe-upstream-inputs 'native-inputs + (filter (upstream-input-type-predicate 'native) inputs)) + ,@(maybe-upstream-inputs 'propagated-inputs + (filter (upstream-input-type-predicate 'propagated) inputs)) (home-page ,(cpan-home name)) (synopsis ,(cpan-release-abstract release)) (description fill-in-yourself!) From patchwork Mon Dec 9 19:58:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 34708 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 0EDA027BBEA; Mon, 9 Dec 2024 20:01:22 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS autolearn=ham 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 8D83327BBE2 for ; Mon, 9 Dec 2024 20:01:21 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKjvR-0005EY-G1; Mon, 09 Dec 2024 15:00:13 -0500 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 1tKjvP-0005CR-Ow for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:11 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKjvP-0007Z7-9H for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=vbd9YSMArsYiTOpR2bVjbynh1n769novSpr3gLT1zpo=; b=mCb4QQJpU2kS0hF9oWGOdWjLvzWq0xVvKbxk8MMdM7CCET7Z4qHZsxMCS+uxX0qmpeJw9Yu81gYAStgZ5v6QIIYyKpmE63Hwd+SoYhWer3QCgHsqncKVocLnIAWupIMkdFUdnG16eBUt+WZzmSNxZhFrRJmsMmqqu1L82FGXsHuCrhtqo4fTYEGG/IwZtnjnfP0hS9UJKRvu2vmSNL78/bpZiZ/kNCEGL2KwPtnWjTdBKGpIjK+ZFxattOApYmEYrAaOXJS1kXgz+meT8H41xNOWquMERLrxsqpDH+4l7Q54yVSo9Anajn2TXjV97Xn67DKNwMMhPYThvllUzrbkYg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKjvO-0002Hb-S1 for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:10 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v4 10/11] import: egg: Use maybe-*inputs procedures. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 Dec 2024 20:00:10 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70923 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70923@debbugs.gnu.org Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17337743768329 (code B ref 70923); Mon, 09 Dec 2024 20:00:10 +0000 Received: (at 70923) by debbugs.gnu.org; 9 Dec 2024 19:59:36 +0000 Received: from localhost ([127.0.0.1]:55751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjup-0002AD-E1 for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:35 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:59135 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjuk-00027N-6S for 70923@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1733774355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vbd9YSMArsYiTOpR2bVjbynh1n769novSpr3gLT1zpo=; b=ZxAazH3RHczTLZC1WAxBnHgSkJWX4Rr1XiLBOI4fJwEnKnzpyDpCfQaf63L+2ssaXQcei0 OPqIq0jkgX14a1ot+Jghg4M/1izSCYmCF5bYDLBrIFhv4AcinzJvtE6VFLJKi98zN1Gx5h RjDs4lQiKIBd7EHHJ5hdBfv4wRI2gsJxoFTV+jBs1M1PaDOLIFs2apP0BGzgxR53gYHo5W g3ntAl/QssXz17HZUEaFx7M4QJ/cWgAzzJcLYV1dzgu8G6Y/c8iPrOtINqRpLsWtuKSU6f IH01ZopjALafZGcBs4TkWa8npIKW5Kzgm19TXt7gyXt2uVA6FHXmjpPcFH9yZQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 492b301e (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 9 Dec 2024 19:59:15 +0000 (UTC) Date: Mon, 9 Dec 2024 20:58:14 +0100 Message-ID: <889b96cf8b0b08a11e116f67b836f9efd209b9e9.1733774143.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> References: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/import/egg.scm (maybe-inputs): Delete procedure. (egg-parse-dependency): Simplify procedure to return strings. (egg->guix-package): Use maybe-*inputs procedures. Change-Id: Ib0a3f5b6f02912c847defd02ba7675d80005279b --- guix/import/egg.scm | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/guix/import/egg.scm b/guix/import/egg.scm index a87de1453e..049c45257e 100644 --- a/guix/import/egg.scm +++ b/guix/import/egg.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2022 Hartmut Goebel ;;; Copyright © 2024 Ekaitz Zarraga +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -230,23 +231,14 @@ (define* (egg->guix-package name version #:key (file #f) (source #f) (else char))) (maybe-symbol->string name))) - (define* (egg-parse-dependency name #:key (system? #f)) - (define extract-name - (match-lambda - ((name version) name) - (name name))) - - (define (prettify-name name) + (define* (egg-parse-dependency dependency #:key (system? #f)) + (let ((name (match dependency + ((name version) name) + (name name)))) (if system? (prettify-system-dependency name) - (maybe-symbol->string name))) - - (let ((name (prettify-name (extract-name name)))) - ;; Dependencies are sometimes specified as symbols and sometimes - ;; as strings - (string->symbol (string-append - (if system? "" package-name-prefix) - name)))) + (string-append package-name-prefix + (maybe-symbol->string name))))) (define egg-propagated-inputs (let ((dependencies (assoc-ref egg-content 'dependencies))) @@ -278,15 +270,6 @@ (define* (egg->guix-package name version #:key (file #f) (source #f) test+build-dependencies)) (() '())))) - ;; Copied from (guix import hackage). - (define (maybe-inputs input-type inputs) - (match inputs - (() - '()) - ((inputs ...) - (list (list input-type - `(list ,@inputs)))))) - (values `(package (name ,(egg-name->guix-name name)) @@ -304,16 +287,16 @@ (define* (egg->guix-package name version #:key (file #f) (source #f) "failed to download tar archive")))))) (build-system chicken-build-system) (arguments ,(list 'quasiquote (list #:egg-name name))) - ,@(maybe-inputs 'native-inputs egg-native-inputs) - ,@(maybe-inputs 'inputs egg-inputs) - ,@(maybe-inputs 'propagated-inputs egg-propagated-inputs) + ,@(maybe-native-inputs egg-native-inputs) + ,@(maybe-inputs egg-inputs) + ,@(maybe-propagated-inputs egg-propagated-inputs) (home-page ,egg-home-page) (synopsis ,egg-synopsis) (description #f) (license ,egg-licenses)) (filter (lambda (name) (not (member name '("srfi-4")))) - (map (compose guix-name->egg-name symbol->string) + (map guix-name->egg-name (append egg-propagated-inputs egg-native-inputs))))))) From patchwork Mon Dec 9 19:58:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 34704 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 7F3B727BBEA; Mon, 9 Dec 2024 20:01:07 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS autolearn=ham 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 C39B827BBE2 for ; Mon, 9 Dec 2024 20:01:06 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKjvS-0005GB-Qr; Mon, 09 Dec 2024 15:00:14 -0500 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 1tKjvQ-0005DW-Tr for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:12 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKjvQ-0007ZE-FR for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=G02zETCO6gOJfw16zyqQcrRjpzZ0CeiIi9EudVkPeAw=; b=BINe9Mte0GMCwSzApQAf3PXBSRGcpfXT6dRI40ztjOCFjrO7pu9Vf33qX45Gdbg9BaPdaCDgj0+2hViAjo92qLrGgrGA0biBY0LXNaMKotSyomKJZiSS9YviNYtShDLO9oLYP/MuRlYcdnIXkXE1hpppOFZH/iTlKWGVYCI2bUVSXhvH4qh6gghBILRDZoQ1HGN+lTmg5eNsFLz7mahzGAbfAoI0HtSrefVTWRy8yfeFvG5Ol1onnvU3b2ojpFHG8X0TqAwVnp60XsN4XTwIgnvtPmXsAGjdCJEBuSThW04ri4eWtpTXKxnDrE2Ca29W3lqckI4gEkZI3maPoIaDaw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tKjvP-0002Id-Kh for guix-patches@gnu.org; Mon, 09 Dec 2024 15:00:11 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v4 11/11] import: hexpm: Use (guix import utils) 'maybe-inputs' procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 Dec 2024 20:00:11 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70923 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70923@debbugs.gnu.org Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17337743768339 (code B ref 70923); Mon, 09 Dec 2024 20:00:11 +0000 Received: (at 70923) by debbugs.gnu.org; 9 Dec 2024 19:59:36 +0000 Received: from localhost ([127.0.0.1]:55753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjup-0002AK-Vw for submit@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:36 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:60445 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKjuk-00027f-Rm for 70923@debbugs.gnu.org; Mon, 09 Dec 2024 14:59:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1733774357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G02zETCO6gOJfw16zyqQcrRjpzZ0CeiIi9EudVkPeAw=; b=KyQx2SOXwguMe2ibmYGNoCjKCfhKfNm+TC7189AuM78oR+9u6AzSl6/2ehTcmwISpVvh5y FTpSHzRhv7Dl7Z7uUnvzJXLskWNcOGp0zjP+zBNlE/01EsHpzfegwAZLzOyYvBrUdPT0Nt lEaNVVA42FZL0YpC486DcPEdmzKP9pFbY0VZTCUWfzIffZYq+CQnVmi8iiCls/Vef+h2oW Qf5jNUPwUgyUIOWifrO3kiDuXTN91BTnMDckf0YQhjvZTnwk6Na/e27HcXAKE2lnv+A+DS hM6Z2kJCiF2r7yCZbLpPLRl5MkM4xD5Z2Tq2dULfmgz5NoZTHRXTT4rLrb+Amw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 9b7d8033 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 9 Dec 2024 19:59:17 +0000 (UTC) Date: Mon, 9 Dec 2024 20:58:15 +0100 Message-ID: <5cee288aa6676f609297e7599a9f121886d8d6a7.1733774143.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> References: <4b8cde409e17e4b9ab7ef591eff605b88235fb0a.1733774143.git.herman@rimm.ee> 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches X-Patchwork-Original-From: Herman Rimm via Guix-patches via From: Herman Rimm Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/import/hexpm.scm (maybe-inputs): Delete procedure. (dependencies->package-names): Return strings instead of symbols. (make-hexpm-sexp): Use 'maybe-inputs' from (guix import utils). Change-Id: Ie7a8a630a3a9d4859453d49fdee42aa560e27f17 --- guix/import/hexpm.scm | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/guix/import/hexpm.scm b/guix/import/hexpm.scm index 71a54ba973..a7d74e24c3 100644 --- a/guix/import/hexpm.scm +++ b/guix/import/hexpm.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2019 Martin Becze ;;; Copyright © 2019 Maxim Cournoyer ;;; Copyright © 2020-2022 Hartmut Goebel +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -153,26 +154,14 @@ (define (lookup-hexpm-release version*) ;;; Converting hex.pm packages to Guix packages. ;;; -(define (maybe-inputs package-inputs input-type) - "Given a list of PACKAGE-INPUTS, tries to generate the 'inputs' field of a -package definition. INPUT-TYPE, a symbol, is used to populate the name of -the input field." - (match package-inputs - (() - '()) - ((package-inputs ...) - `((,input-type (list ,@package-inputs)))))) - (define (dependencies->package-names names) - "Given a list of hexpm package NAMES, returns a list of guix package names -as symbols." - ;; TODO: Base name on language of dependency. - ;; The language used for implementing the dependency is not know without - ;; recursing the dependencies. So for now assume more packages are based on - ;; Erlang and prefix all dependencies with "erlang-" (the default). - (map string->symbol - (map hexpm-name->package-name - (sort names string-cipackage-name (sort names string-cipackage-names dependencies) 'inputs) + ,@(maybe-inputs (dependencies->package-names dependencies)) (synopsis ,synopsis) (description ,(beautify-description description)) (home-page ,(match home-page