From patchwork Tue Sep 24 20:13: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: 31397 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 343D527BBE2; Tue, 24 Sep 2024 21:21:55 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 3656F27BBE9 for ; Tue, 24 Sep 2024 21:21:54 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stC2g-0000NM-5G; Tue, 24 Sep 2024 16:21:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stC2W-0000Ix-Fr for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:41 -0400 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 1stC2U-0003Ol-CZ for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:38 -0400 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=PLXxgB+Ns3CX0w+wN615sREAl/GGOCCzcIUFd9+skMA=; b=Kg08AaHUQm6He023Z3I9gc1XWBP/LirZpYRyJ1fJC64fd3vP7n9x5Vy4yo6axld4W9A44MtKIkoeJAjlh6z+Lyh4YFnnGk/BTSMAaA0sFKTrxkNsAt/Ny4mmGZDBIsExqu5O67dVLNufKxkEQ54H82wrnUQiI1OpI9VtkROCm2hC0Bx2kryVHgb7iIO130suTgPZTRT2YyS5lu5Ob1hi7wbCpJhn++ryJEd6qVQZYoq00Uvv6E4+nFP9AEMgFkMnh+TbZAcX/O9b2Avm5iLJln4g5NFTanvAbagthB/YC6KbWVARouBhfIEvt21Qbt9FLx8FkO+MrVy2/mRexU7lUQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC2t-00054G-4U; Tue, 24 Sep 2024 16:22:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v3 01/11] build-system: cargo: Accept unlabeled #:cargo-inputs. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, guix-patches@gnu.org Resent-Date: Tue, 24 Sep 2024 20:22: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: Efraim Flashner X-Debbugs-Original-Xcc: Efraim Flashner Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.172720928419297 (code B ref 70923); Tue, 24 Sep 2024 20:22:03 +0000 Received: (at 70923) by debbugs.gnu.org; 24 Sep 2024 20:21:24 +0000 Received: from localhost ([127.0.0.1]:38494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2F-000512-Ad for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:23 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:37373 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2A-00050F-B1 for 70923@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727208844; 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=PLXxgB+Ns3CX0w+wN615sREAl/GGOCCzcIUFd9+skMA=; b=diFaJysOgdryCF/LWFV5+wi7b7PZ1fsqM3X/T8jH/IKOsnrydD1HPgq1Arl63WNCnK6mF8 QDKPVkUVM9Rbl2q6eUJqF4x+m77YGaTBAQjw01X6RS+Ot1BgI7yp64Dwiza1+QG9i5550v TKyCvLR0ocepf8edfSPITWxNZMRspWWIGjcwdENBIxADVHZmh7lELeAvr5uclxXwCj3eZ7 4lEvMPcSc0NsiLthXNIOb+H5oQ20h0waB3w1PlNiQokFtNx7SjuNJQU78PfeZhhlsP8Mse 8YfEZD1T06AmmTPPgiGcqQipnPvlaAdDkv5nBU3WcopYF20V30y8uKt0mjG1Og== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id f9d71bc0 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Tue, 24 Sep 2024 20:14:04 +0000 (UTC) Date: Tue, 24 Sep 2024 22:13:07 +0200 Message-ID: <368720732ff9491a4ab81657c4691f79ee2c9d5b.1727207512.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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(-) 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 Tue Sep 24 20:13:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 31400 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 09F9127BBEA; Tue, 24 Sep 2024 21:22:10 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED 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 74EAA27BBE2 for ; Tue, 24 Sep 2024 21:22:09 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stC2w-0000g5-T0; Tue, 24 Sep 2024 16:22:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stC2X-0000JK-E6 for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:41 -0400 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 1stC2V-0003Or-Ho for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:39 -0400 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=afbMubt9LidZxOOyGfUEUMlVliWU5sOoy7FfjG+uatQ=; b=C2nQWvPdMhZ1DdIU7+XyVRYt/ZA92KIRR8JL2RaW7hfLG4KHY/wNj0LkJMI5zDiJcErZSXOhRs7NfV65ITktNelpYgXwGVPZ3cauIKRpD+82s9S7uWx6AnHI3pIL/JXrHDV0981pQLImpf8fz20bT+KH3g3pbru/TeG4CgT29of2LEkMSfhypeVxzvtnjfxGRC4DNRt/l9ixZHBFGzcg6cVyvfOxxA0e72YBS0rmCBh2NQL5uhkv4E/nEae6aj7437fYPSoI+b9y+fu7YxItaguHkMRdXERn+vNlcthvowMb+Zn8AD0N7PvVLhS8E1QcjonnXBtJWN9duO8FbQRJzA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC2u-00054X-8y for guix-patches@gnu.org; Tue, 24 Sep 2024 16:22:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v3 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: Tue, 24 Sep 2024 20:22: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 Cc: Sarah Morgensen Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.172720928719339 (code B ref 70923); Tue, 24 Sep 2024 20:22:04 +0000 Received: (at 70923) by debbugs.gnu.org; 24 Sep 2024 20:21:27 +0000 Received: from localhost ([127.0.0.1]:38501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2H-00051Z-Et for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:26 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:37373 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2C-00050F-VG for 70923@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727208845; 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=afbMubt9LidZxOOyGfUEUMlVliWU5sOoy7FfjG+uatQ=; b=guk9BEfRXSpGOrERsi/0lOAyRmXyc2lbs915ZyAZ2vqsLgEIGWspN/3HAPgSTx92GuE2+G R6OOS3UxI7RW7o4nBbtbCoRTALZ0m/amPSakCO5xHRx5NO1fiazpw5ZOqVMxqHEt88WDQT I3r2c94mOqexkHe4LQ7xxvkpA1q7waRTSsc2z7+mjkgGHf/tOUcid95szT5sqDu6ehhHYR c2t4t73a+ajhRMSqjguce7Gph5NDOSof6iVngkWLvYUhZR9lc+x/9xcMFE0BTv1AWw4S1z yU8HazauPHj9PCHbNtGF9fokiklfg8RUmLVAvjNymdlqBugn/iRyb7eXTVOhew== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id b16b5ee3 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 24 Sep 2024 20:14:05 +0000 (UTC) Date: Tue, 24 Sep 2024 22:13:08 +0200 Message-ID: <3776de27f3b8917f8d3272ba167ebfe5ce707a5c.1727207512.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 b7756fcc40..88a1db4a88 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 @@ -418,39 +421,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 Tue Sep 24 20:13: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: 31398 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 E8FE027BBEA; Tue, 24 Sep 2024 21:22:01 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED 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 16C6F27BBE2 for ; Tue, 24 Sep 2024 21:22:01 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stC2l-0000TV-Cq; Tue, 24 Sep 2024 16:21:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stC2X-0000J0-0Z for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:41 -0400 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 1stC2U-0003Om-US for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:39 -0400 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=e2rD280szrADz7Y/sQErNDxVRn/suHoq5qL7mSASXI4=; b=RfOuolw/zCvvhIQqPtmA8Do5ummECfXlz/dLOnZ1CD9df46L8QFQJl+6jpCfy5oXmwklkd6zIqg6tNi2OSlun1a8NY8fAU+PmSkvUr/aCWy2xxL69F6rAlVQ1Ti3ORVMg1E1CdRgDV9DqWgfCLSjMJ8QIUPy9FoKFnoKR82x/H1UNerR25uzhzc+ygKJkml/C3qbD/wFK4QSJdDbfK4FO1di4A94eLUIKlMVrQ0+UNbgftTELEnU2yShvZba39SUEiysyzZcYoacGNi/T1nkxCtxuNoW2yQYzor7AV1XNbaspCADD7ru1UhW8GnCiEJlribk23T/xnuGgvYx+zVX/A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC2t-00054O-MS; Tue, 24 Sep 2024 16:22:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v3 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: Tue, 24 Sep 2024 20:22: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 , Efraim Flashner X-Debbugs-Original-Xcc: Efraim Flashner Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.172720928519320 (code B ref 70923); Tue, 24 Sep 2024 20:22:03 +0000 Received: (at 70923) by debbugs.gnu.org; 24 Sep 2024 20:21:25 +0000 Received: from localhost ([127.0.0.1]:38496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2F-00051E-Sw for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:25 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:37373 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2B-00050F-Hx for 70923@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727208846; 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=e2rD280szrADz7Y/sQErNDxVRn/suHoq5qL7mSASXI4=; b=iGdj9AQcT7fbhgP9ChMfy8TA+/sbCNozJLPmF0HV1uWkVCdV8/hVXkHg08gXqbO4hOPzsR vAsa9e9WHnF57FOz7PRDMMAWjjODO66gvfFNqBFf1TquTlviAxTTOe+EHbUMpdBfzPdpKg YllhAr3oQcp757VhetdsXHlH+tlbZK6oF9l0DTqRIX8tSJrdeKnjmwP2wTCwqq0Vg5TpDS Ly0WfkN8U2Vl5E8sKu7vNzoeZGoamd+hKglw5nsh+yzJANXMljYM5hZ5WohQegUeuBe2Hd dwzTLoxmFkDL7pXKoMmm92+ZzF6j2qdRMnF1ZNlBS+LKB6lvIQKIZnjpoLWXEw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 00329269 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Tue, 24 Sep 2024 20:14:05 +0000 (UTC) Date: Tue, 24 Sep 2024 22:13:09 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 84c178ea3e..5110e6124f 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 Tue Sep 24 20:13: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: 31399 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 A252127BBEA; Tue, 24 Sep 2024 21:22:04 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED 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 6192227BBE2 for ; Tue, 24 Sep 2024 21:22:04 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stC2j-0000Sa-CT; Tue, 24 Sep 2024 16:21:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stC2Y-0000Jh-8q for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:43 -0400 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 1stC2W-0003Ou-0P for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:40 -0400 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=bwZ2NDv9IuCIBfNNduwNmOqVzTT1OA4PEArXn7ttrF8=; b=GTJG4Ua/v8/trHYkHH4Fq2drIHn7sx/wIi2bGXZMe7OBntePXWwiZwfGBGCdoq3SEhO+U7eESHPEZcYDXOY1aEuT9V5DmLUwiNrpQZlMeAdpHyEGTQW+s3Do6OiOBTtAyES+cosM7CjCdy3Yqe2t95kUrI1XO/ah0zuI39ZQrJQTeqhmEF6HhVtW91bzgW3EnOwWThLQf62niN8lckUXXMrpnKtndwvFn3wem1PTs1zCa3kmjQptBFfYXaS0EqkqY90pG44fjX08ExPDb9Gn2xt/3C19jhHtte6zJXEBUdT7bVuMi7s36CXs4cT5vLY2p2QY2AKc0MWNOe0Y4S1bWA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC2u-00054e-PY for guix-patches@gnu.org; Tue, 24 Sep 2024 16:22:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v3 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: Tue, 24 Sep 2024 20:22: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.172720929519376 (code B ref 70923); Tue, 24 Sep 2024 20:22:04 +0000 Received: (at 70923) by debbugs.gnu.org; 24 Sep 2024 20:21:35 +0000 Received: from localhost ([127.0.0.1]:38506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2Q-00052S-Qv for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:35 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:46027 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2E-00050O-RS for 70923@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727208846; 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=bwZ2NDv9IuCIBfNNduwNmOqVzTT1OA4PEArXn7ttrF8=; b=oILVroHZ6fRthPc7uoMzA0JTuQ/cOs9Cvj5ml6QIOjzmt3Mf6bENxrvwggzn4mfmOxLWFp QdnkkgpWxk5AVwPnzq/VwdQNmQxiGP67pqPxe0hRwJdBod4Wc3hp+1BGxiepxKdxR1CnmN Zb/dnURRKS3d/lkiUmzQ9DBLaRljBZnTnK6UmKxA3o5UV1fQh2lIvwNyA6xeOkAueVZ9IK DGZgNCpwsMtWYB43J470oEhaa0i4/RLXtSooDHatvJP9RvawDuoQIg85pdxq0+yz78G9ie VTEFJw/wiwJAkZ/VroqfvWq7ca7kNr4+Fe2Mqv+g/yyAvqPrIAdqgV8HDGufIQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 04374a2f (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Tue, 24 Sep 2024 20:14:06 +0000 (UTC) Date: Tue, 24 Sep 2024 22:13:10 +0200 Message-ID: <3e09ff0327c2cb53598bce0f94bd39b9cb7937f7.1727207512.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 88a1db4a88..6d62b64433 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 @@ -460,6 +462,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 Tue Sep 24 20:13: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: 31404 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 C5FB827BBEA; Tue, 24 Sep 2024 21:22:17 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED 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 833DA27BBE2 for ; Tue, 24 Sep 2024 21:22:17 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stC2t-0000ZC-KJ; Tue, 24 Sep 2024 16:22:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stC2j-0000Tk-Aa for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:54 -0400 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 1stC2h-0003QI-Ej; Tue, 24 Sep 2024 16:21:51 -0400 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=FRsk9kt5h746rQoxF2Bd7DatwiCQg3k4lBxRliWGprvYfmfPh2HYp0DHXqiV8NSHIzI5gPGWLnx2+CerJtK5BWZpO1C9zSFggHk9WJ4Yuy4XidxHhFCp34hbbM79UoZToSmE6t/lbhHi9ryw71XDcBbTJ/bmpMq4ipUSoKx3vjGzbQ9btdgxeLUjvRQEYoMP7nDE5TXYHh3dZ3GexQZK5G4+LEYiNtFa3lO4xy/myvngcCLGp58Ijn4oyNobnQcQmRkJcfZUyrRYk20Snji39kQP/S9g6NS1okbZoI+t3SAPdPpRM9WYcl3vZuDfheVQSIODadMeT/2UK2FfFyw2Rw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC2v-00054n-8S; Tue, 24 Sep 2024 16:22:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v3 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: Tue, 24 Sep 2024 20:22:05 +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.172720929919392 (code B ref 70923); Tue, 24 Sep 2024 20:22:05 +0000 Received: (at 70923) by debbugs.gnu.org; 24 Sep 2024 20:21:39 +0000 Received: from localhost ([127.0.0.1]:38508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2V-00052f-58 for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:39 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:37373 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2E-00050F-TW for 70923@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727208846; 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=bHI56Eoh1jshd4BKqOS7W/c4q6bpOIq0iNRPHXMO5uLHfGiv6ZB3MbDAx5h+uDr4nhhYk6 auTcMQgzQD6DDf72SU/V+MqB8xYK5L8mU+I74Iy+vnzVyKIHJY54gbwH9T0kK8lXizQSRL KUxDTky2EymsKiy8chXlLuSI4XpisNdVsUDD9Upxz08sB5zWIuh0cY9E5NLt7o4cfq1lyX E/wR02BG/Ndod2/X8QulrUlqr8ssGeFY7/wOYMBETrprrp+38SX9NSjHS//rcR38+aCip+ fPXWu0OUAI4kkFVvazZ2tkqFVyzax64OVGWlaxZ8Copuy6up/nOI1sv7/hmdCw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id b1f56cec (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Tue, 24 Sep 2024 20:14:06 +0000 (UTC) Date: Tue, 24 Sep 2024 22:13:11 +0200 Message-ID: <386fffa725214f9b75995caf3c4f9780f2ee2340.1727207512.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Tue Sep 24 20:13:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 31402 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 F387C27BBED; Tue, 24 Sep 2024 21:22:15 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED 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 0C0FC27BBEA for ; Tue, 24 Sep 2024 21:22:14 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stC2w-0000ex-5e; Tue, 24 Sep 2024 16:22:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stC2Z-0000KZ-NH for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:44 -0400 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 1stC2X-0003PC-Ah for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:41 -0400 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=M/czjycJgFFrXiRliH2YaoWxHvCDdsPWAtpBU+n3CYolToPELhT3ySxdc/cLLHXEhx6OemlO3AOd62jHZuQV5WDSw6qNloEJXHXzpSotqtPEJRPZlVQuN5zfAuUjuCl/7vZo/Xlnakn0PfIbYqEB47gWthAjVF3dE43VJ/S6FP2IbbpSOpGqGse/A1qxQA9/cDtoHqsPNtGlyQ2SOo6o641S2UljLfxGE8NZkKEhlyMU/GPc4dYOa554FxG1p0F44OFydZmqXbxQyeHPgtRfx0N0fOcjXVHLK2hLG0nW7lUQ290bYb/5aTi8aI6TX5x0Woesgi26vHFWOhAowb7uCw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC2v-00054t-Q4; Tue, 24 Sep 2024 16:22:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v3 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: Tue, 24 Sep 2024 20:22:05 +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.172720930019399 (code B ref 70923); Tue, 24 Sep 2024 20:22:05 +0000 Received: (at 70923) by debbugs.gnu.org; 24 Sep 2024 20:21:40 +0000 Received: from localhost ([127.0.0.1]:38510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2V-00052j-N6 for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:39 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:46027 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2F-00050O-MO for 70923@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727208847; 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=FKApJPubc8Q9xcT6M0xon8tipdDcuchxJ2dxRSxZSvA2fTp/DQUzh+XR0+RdrZUE9cvpqQ sgEWirJCwFEMsVbFKeAZj5jGCoW7J+WBKadEedsaR7LvNe7JJdI0BFzmDdDm8rKMupC0+H rUvN9kfjeb/ubsrPmg+10qh9r5fgpsI9w7sJTunvrtJbFDrmFMJvVrh1tnK7gfuYzGsqom 0s5rnrQFRxgtICr1L7fQk21us2IXrqLCuaPMYeu9TxK5KlR+vUOCGntHRt9LJQSDGaWAtc rvhuexmME1uUOMyiwiPVwRaux38alRHkd51SA4ingQy0bZ34q/KNB/RrSweajw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 7e5fa0c1 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Tue, 24 Sep 2024 20:14:07 +0000 (UTC) Date: Tue, 24 Sep 2024 22:13:12 +0200 Message-ID: <251731aef2570f6caa96044b760a77dd97a1f336.1727207512.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Tue Sep 24 20:13:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 31401 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 5273A27BBEC; Tue, 24 Sep 2024 21:22:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED 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 A530827BBE2 for ; Tue, 24 Sep 2024 21:22:13 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stC2x-0000hJ-Mz; Tue, 24 Sep 2024 16:22:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stC2a-0000La-Tg for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:45 -0400 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 1stC2Y-0003PH-1A for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:42 -0400 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=dlBIGYu7E2jdqyAbbokT6hcWccFWlrSC5x5u0LmTyp4=; b=iJ3KC9uy16/K0KP6TUm2J4v3ibukBIhKWFd6EiLqdaVaYwsWUYl7Iyx5ZjOcITiWEBk4zdeqQ0QcuKuDRnrsTh7Wprk1Me3RLvhBNmUji8CAxhXmWafPMHgmk6MIIzP0Dg4+HtNnxsTU4ZM6h+byEQtDhiK2OX5Kc9UNUrLKCAIUKzujpwFO9izzlO36XNb/Ib/91yr18zctwvuJS3f0C2DBkgEpVbG+1Z+Qk726gcLgdeUGyIwIB20p9jsEg33ovj4hki0Z2HTXf9sUZlDte+3cwvwn4E3Ax/vm4HuKhJbloqkESK9+6/MG9QA2/V/L17+AahYWUlyy9ZzonBpcCw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC2w-000559-Pf; Tue, 24 Sep 2024 16:22:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v3 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: Tue, 24 Sep 2024 20:22: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: Lars-Dominik Braun X-Debbugs-Original-Xcc: Lars-Dominik Braun Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.172720930119414 (code B ref 70923); Tue, 24 Sep 2024 20:22:06 +0000 Received: (at 70923) by debbugs.gnu.org; 24 Sep 2024 20:21:41 +0000 Received: from localhost ([127.0.0.1]:38514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2W-00052y-Jr for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:41 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:46027 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2G-00050O-Qs for 70923@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727208848; 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=dlBIGYu7E2jdqyAbbokT6hcWccFWlrSC5x5u0LmTyp4=; b=klnretGRuhrvtne6g4GxxeXD2aKItwitFTleL5qrKcwMbrXyTwmx/hsjLv3ZN+zs9yNSGm 0Y7ELrPyNji5H0ool+ZEaUZvdkPNBHC89RjklFnhvr/F3WLabC9ruKDJ9KuLQ0X/gqMvH+ 6j1cZBfDlK8/eu+zlIyXtCLkYmHLn7B1TJ8DAiQ/JaJD7FGbr8dyLnznOiyYXJH6IOu3w/ tu0Nl3obhVRpzRx6GdoeR5Hcva37nt4PC4VN2LtZthhTZkR61Ts/7M+uASBo+IjWZs1az2 0ORPipatAH6Bciuutcy4pDuTjv9V5HdnTWX3oot+QT9JNQoDb0tKtzgwqbazBw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id c97d0f43 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Tue, 24 Sep 2024 20:14:08 +0000 (UTC) Date: Tue, 24 Sep 2024 22:13:13 +0200 Message-ID: <1bc3fa4669d55efc9bf5c7fdf97efc39b03fab23.1727207512.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 79a51d3300..bd3bed146e 100644 --- a/guix/import/hackage.scm +++ b/guix/import/hackage.scm @@ -9,6 +9,7 @@ ;;; Copyright © 2019 Simon Tournier ;;; Copyright © 2022 Hartmut Goebel ;;; Copyright © 2023-2024 Ludovic Courtès +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -288,26 +289,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 @@ -324,13 +305,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 Tue Sep 24 20:13: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: 31406 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 AD7D227BBEA; Tue, 24 Sep 2024 21:22:25 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED 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 B411727BBE2 for ; Tue, 24 Sep 2024 21:22:24 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stC2x-0000hZ-RT; Tue, 24 Sep 2024 16:22:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stC2b-0000MF-AD for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:46 -0400 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 1stC2Y-0003PN-85 for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:43 -0400 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=wJ6dOQ9TXf0jcitHGpVL5Dy+F+nbHc5iyfWGbro6toY=; b=Zn4Mo1L1TliHQsjXyOz75tTgyZ+5rEduJUPyadmIKFhu5qVCdBcItqZMZJgXSIlS59CFjKuy0NKCxHI/c3o5sFBnBEu3vz9n3UQLVp1jhuKYkBMYRhkTf5ItRNolYTDw53tDqU9CQ2ZzN10O3aczETtJflEuB/fYpGY02GaHSuvlPhbRzaSewUEVMPJK/Ys31BO2ZIbYogBfVCYZb0GifyOQROrg4G8LkjE2bUXJIpXRXprwSEjJ1P3qnWtFwmsfDYMoEXHOu4xW1ODIeuTCexA5L+pj2AkWjBSCujqFCmUwojmcrDGsfL+WIxYUoFjBOtjgZRlwr4OpMPfY+52LUg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC2w-000553-8c; Tue, 24 Sep 2024 16:22:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v3 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: Tue, 24 Sep 2024 20:22: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: 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.172720930019407 (code B ref 70923); Tue, 24 Sep 2024 20:22:06 +0000 Received: (at 70923) by debbugs.gnu.org; 24 Sep 2024 20:21:40 +0000 Received: from localhost ([127.0.0.1]:38512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2W-00052q-1F for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:40 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:37373 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2G-00050F-2x for 70923@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727208848; 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=wJ6dOQ9TXf0jcitHGpVL5Dy+F+nbHc5iyfWGbro6toY=; b=IE3bJFShcdYCNvD35vZZxYsT8e/GEW5/sV6SzQFZizxUSwm3ejNUbPKDmBIV6QnxGTcOXv BKzylEXGR2YFk5CBzFF7uQ9jmquiBhSSz6iQZI6Ts9nPB9SDBYjjqzMyrqD2YuDdzm27o1 z9LfeMgm8KXdiQr9wZiafC4q4Y5OuggclbNclWaOz9o0ZszNxfHKKONlgmi91XCNJq+VAG PcA4zVzkyolaQH00yoO83WCR6lIAG6PcTSImYZywpULcNS0XBfoTB78qraq08zq8NkGlsD rZUX+kZO7Qc2XcYaTKc04zN75F6y+ezSu/9agX1KBknL0ojv5+tOXa4p6+PO+A== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 8bebb0f6 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Tue, 24 Sep 2024 20:14:08 +0000 (UTC) Date: Tue, 24 Sep 2024 22:13:14 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 6ae00cae96..bdac059053 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. ;;; @@ -85,21 +86,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 @@ -188,11 +174,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: 31405 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 BC1A927BBEA; Tue, 24 Sep 2024 21:22:20 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED 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 6D92027BBE2 for ; Tue, 24 Sep 2024 21:22:20 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stC2x-0000gj-C3; Tue, 24 Sep 2024 16:22:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stC2b-0000MH-Is for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:46 -0400 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 1stC2Y-0003PO-IC for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:43 -0400 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=B55v1uxYlYKoU4ZUaomkSGCoc+WRrqq9U3l4wmyQcXo=; b=qUjFqjzkOkvrKyVOb6+MTIpGgowWR1dcizU1rE2hWkXa5K3Wte8jAnV0r8Jfchp3GPcxRHyYjY3Rwqqt3Toib663HmQCwWHPapmK0a0/52Gp6pumWz6XNTFuFvi797ybs3EYiOHo7bHBnAB9St/YDBbKLnF3YtbA2f+sfcY4MWMa6jLiWc/Lfw09lhpMz8cERRsUj34fjsO2Z9TS7UfPd7epxChOCGvXrUrOwrMkzw5Q53FI2Fget72WAK0YtuTZU/XAmljIdMweo5/7FQHvJPTkaNlwmDIqwCYagEh9Aocwd4tUKtzJMrBupxdLLC917Q5+QL6YFxOqbEM6fAZmQg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC2x-00055M-A2 for guix-patches@gnu.org; Tue, 24 Sep 2024 16:22:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v3 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: Tue, 24 Sep 2024 20:22: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 Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.172720930119422 (code B ref 70923); Tue, 24 Sep 2024 20:22:07 +0000 Received: (at 70923) by debbugs.gnu.org; 24 Sep 2024 20:21:41 +0000 Received: from localhost ([127.0.0.1]:38516 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2X-000535-4Z for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:41 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:37373 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2H-00050F-8H for 70923@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727208849; 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=B55v1uxYlYKoU4ZUaomkSGCoc+WRrqq9U3l4wmyQcXo=; b=K7xG4Syj5StyzBvRBU40nMC2ui9eRcsEwKSqCiNm6v34OZkG0TS9R7vgWDE/lnoTOUaGXt jspVUOdor4Lbw0UW4ewNi6dNOGHScyz4eq9v+xNE3l0atJR6Uaaj/s69eveGAB4vp4RCvj CD8eyF/3ZGAruc2WhIw9D8PhCylEfOo7WHJmXW9YLMdWTJrctmu1eIQ6SGxQWWPGxKjT3o 3pjTP20RFOjd5IgjhNbsFRD2ufjA7hGUh5b+tdgxvSsq5qVLl9K5HurUvvE1aqIEjIZ0zD Jmm8zFrI79kp3kFxxfCB17Sa8LwmAPa2PWRXdBHJq/igAdfA+NKqYJyvYON2hg== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 576da104 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Tue, 24 Sep 2024 20:14:09 +0000 (UTC) Date: Tue, 24 Sep 2024 22:13:15 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm index b87736eef6..611ea63eba 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,7 +38,8 @@ (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)) + #:use-module ((guix import utils) #:select (factorize-uri + maybe-upstream-inputs)) #:use-module (guix import json) #:use-module (guix packages) #:use-module (guix upstream) @@ -275,15 +277,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))) @@ -297,12 +290,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 Tue Sep 24 20:13:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 31407 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 8B63827BBEA; Tue, 24 Sep 2024 21:22:27 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED 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 0B7B027BBE2 for ; Tue, 24 Sep 2024 21:22:27 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stC2u-0000bm-E9; Tue, 24 Sep 2024 16:22:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stC2b-0000MZ-SD for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:46 -0400 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 1stC2Z-0003PQ-5c for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:43 -0400 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=XgKaiBbrkegb86oywPNncySntyWL1aTaSE3fR+S3DnA=; b=XlWQWRZ7tUGeXg4ZMAnbX5FF1B3126/TpbY/JwW8Rq4qoJ6lxNa8m+WQ4qHzBXtKMPs9SRlup0YGOpnucMeoTBlJ69sevnys7ZrgBT7A7uk67jEF9rVVgsIUF1ozRWgBDto0wtnN83jnvh4m7aXoPOY20eOWUIymRETjh4JudEeDecZy3Jh1P02b/wXJrAXPPtH+49nAIVd5OpZyAsraGoqLvC65VwAN4uEMD1ICGnpPQRFTMuIjgTqKpm5VTN8sO/Cs824ZsxIpKHb7XF00Oj254ma+OJFdnys1/tQEkfATRLQFdQBqkr7etV3LDi6mdW9KPZILXyCoSuVD4CXrMg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC2x-00055V-Tm for guix-patches@gnu.org; Tue, 24 Sep 2024 16:22:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v3 10/11] import: egg: Use maybe-*inputs procedures. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 24 Sep 2024 20:22: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 Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.172720930219429 (code B ref 70923); Tue, 24 Sep 2024 20:22:07 +0000 Received: (at 70923) by debbugs.gnu.org; 24 Sep 2024 20:21:42 +0000 Received: from localhost ([127.0.0.1]:38518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2X-00053D-Pb for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:42 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:46027 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2I-00050O-2s for 70923@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727208849; 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=XgKaiBbrkegb86oywPNncySntyWL1aTaSE3fR+S3DnA=; b=UZj6L+a+/heVkrUQvqJ7rhrdMD9SWfykF3fqlaFgyJy1gDhuqUsW3970V5avQlsDx7W1UP f3jsoZWvsIq8rQSMgOJuOYbr5xS4iDabH77QCC12uiHUg3433xyKqUhINGALIsOdpA+UBZ HmaA09qqxjcjXFrWs0EsGpkYkk+Q93xb4uF5cozkjbzPovwkLtgR9H3oGq8hAmxTZxvoTI 6OmyfOAA/CVLAlS5No/bCZZXBWL7TU33nVYtjnNyFSzdtzgIGhhsY2S+4BQflJToQox6Im jo1jpEJE3p0j3IQUDDE/fEwJ9dojF/zyIysiiGxE90I4iZtOkPAcTf3UBcV/vg== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id df04a8e7 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Tue, 24 Sep 2024 20:14:09 +0000 (UTC) Date: Tue, 24 Sep 2024 22:13:16 +0200 Message-ID: <4bb46928e59df2b38889d6f82c60bd08419d9605.1727207512.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 e3bc158475..97d09a7c9d 100644 --- a/guix/import/egg.scm +++ b/guix/import/egg.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2021 Tobias Geerinckx-Rice ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2022 Hartmut Goebel +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -229,23 +230,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))) @@ -277,15 +269,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)) @@ -303,16 +286,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 Tue Sep 24 20:13:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 31403 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 9936827BBEA; Tue, 24 Sep 2024 21:22:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C8E3A27BBE2 for ; Tue, 24 Sep 2024 21:22:14 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stC2v-0000eA-O4; Tue, 24 Sep 2024 16:22:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stC2c-0000Mg-4Z for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:46 -0400 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 1stC2Z-0003PW-Lw for guix-patches@gnu.org; Tue, 24 Sep 2024 16:21:44 -0400 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=hpBA6hzA116yIRLGlqckkSZHqyI0LpYVLCUZ+EYxAtu44wE2GSlibAMo/MXlPScuY4EsLKSVd6OK4OAWRrmu4UEbxEvrD3Jcm/9PW5ivJAYtle0Xr/wh3eH+ZXa2UnosgdkuykBuSJGA2XAPFhBqCKQTtXbjolYIeoSwkKpbSDmzPyjsoUzh00NUqzw48FvYKbKAyqdUGGbek82qP+zM3AJKo5qP0hgwqpIsgl+SndwxpC+DHdfyPktcensHF86ANzWropi68NDg9pU/yGM9m6e7zLWIYlKqo6Fv3ikzPcUGOoMuWvpWFiV4Z/SRkcjiN5qYvmgXpwXC11N40quZPA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stC2y-00055e-D9 for guix-patches@gnu.org; Tue, 24 Sep 2024 16:22:08 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH v3 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: Tue, 24 Sep 2024 20:22: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 Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.172720930219436 (code B ref 70923); Tue, 24 Sep 2024 20:22:08 +0000 Received: (at 70923) by debbugs.gnu.org; 24 Sep 2024 20:21:42 +0000 Received: from localhost ([127.0.0.1]:38520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2Y-00053K-9L for submit@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:42 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:37373 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stC2I-00050F-I6 for 70923@debbugs.gnu.org; Tue, 24 Sep 2024 16:21:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1727208850; 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=opkMWHBmcXiTo9R2vdxzOgyWc+24uDbye1PNxPlv6U3yCDsRe6wDpxpeIwjRc1ws2vEFPx mLwzBUTw0/115AH43/FlJpqFa2wjONFAI3V58ZZOVy51m+SQan6GrIudx7ZUL2chqgspho 2/Ktc4H0faeLUcX3nUl8qU8VGDqDjW+XGt9hNiknE4oP99TjWjVH3PMMrZUtfxtLq9Fdyr 4Gmhog1lUPAjv0boijRgt5bqFSl1kf/mP6db2QWwLqjJQJ2iYbLCynAMBQZF17Qq4psM3r kxLocx6B4CXy34b2SmXJJXOhxSGQOXOKqHDTpElBCsqxqCe50x6hnbwujVc+ZQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id c24bfa08 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Tue, 24 Sep 2024 20:14:10 +0000 (UTC) Date: Tue, 24 Sep 2024 22:13:17 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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