From patchwork Mon May 13 20:07:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 64410 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 3344A27BBE2; Mon, 13 May 2024 21:10: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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DC39527BBEA for ; Mon, 13 May 2024 21:09:56 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6byt-0004DV-Dd; Mon, 13 May 2024 16:09: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 1s6byo-0004Ct-TI for guix-patches@gnu.org; Mon, 13 May 2024 16:09:02 -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 1s6byo-0007nL-JO for guix-patches@gnu.org; Mon, 13 May 2024 16:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6byo-0000Hn-Ih; Mon, 13 May 2024 16:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH 01/13] 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: Mon, 13 May 2024 20:09: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.1715630916929 (code B ref 70923); Mon, 13 May 2024 20:09:02 +0000 Received: (at 70923) by debbugs.gnu.org; 13 May 2024 20:08:36 +0000 Received: from localhost ([127.0.0.1]:34578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byO-0000Ev-2t for submit@debbugs.gnu.org; Mon, 13 May 2024 16:08:36 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:47157 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byM-0000Ek-G3 for 70923@debbugs.gnu.org; Mon, 13 May 2024 16:08:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715630906; 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=fcE2ROuORKfj73PcGqko244Of/JWMOrJ8xzvj5mcJ/s=; b=JdnCYM4rNJZf2CgMI+ciozbIfqdl4L7P4M2K/mkTGNpucyiEZ4n2BkMMa8VcJ4vFhhxa9b Yv9gm8MIb4EUfH867yVsJnjeqnXx8QzWLua1N6L2Xq4AVuFFgM8vMrkOytzSyaRo2Wv8MY 1K1/i1ksBqyJ3upcVWx8MxcDvyQRnayObwrytnEYWuUlhTmKDjPHRmzCZKKWm3hdTMwwLv sbzeUi1RXKwJa3/eXnD/1nYPfA+dp+E4nzWP7EyeWBsrsAiZEeM/+cyHFAJVB5f/SL59CY /YdDIhUnxcVBpCwSop4G0ozsAFmmya8srehBRUpOZf67CdrwUIB3SpR8lR/lNA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 5f8fa723 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 13 May 2024 20:08:26 +0000 (UTC) Date: Mon, 13 May 2024 22:07:58 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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, 11 insertions(+), 1 deletion(-) diff --git a/guix/build-system/cargo.scm b/guix/build-system/cargo.scm index c029cc1dda..a918e25e7a 100644 --- a/guix/build-system/cargo.scm +++ b/guix/build-system/cargo.scm @@ -234,7 +234,17 @@ (define (crate-closure inputs) (if (null? propagated) (reverse result) (loop (reverse (concatenate propagated)) result '() #f seen))) - (((and input (label (? package? package))) rest ...) + (((? package? package) rest ...) + (if (and (not first?) (seen? seen package)) + (loop rest result propagated first? seen) + (loop rest + (cons (list (package-name package) package) result) + (cons (package-cargo-inputs package) + propagated) + first? + (vhash-consq package package seen)))) + ;; Match inputs with explicit labels for backward compatibility. + (((and input (_ (? package? package))) rest ...) (if (and (not first?) (seen? seen package)) (loop rest result propagated first? seen) (loop rest From patchwork Mon May 13 20:07:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 64400 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 57EDF27BBEA; Mon, 13 May 2024 21:09:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=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 ADC1627BBE2 for ; Mon, 13 May 2024 21:09:16 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6byu-0004Gz-T5; Mon, 13 May 2024 16:09:08 -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 1s6byp-0004D2-Ac for guix-patches@gnu.org; Mon, 13 May 2024 16:09:03 -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 1s6byp-0007nM-2e for guix-patches@gnu.org; Mon, 13 May 2024 16:09:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6byo-0000Ht-W8 for guix-patches@gnu.org; Mon, 13 May 2024 16:09:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH 02/13] import: utils: Emit new-style package inputs. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 May 2024 20:09: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: Sarah Morgensen Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.1715630921969 (code B ref 70923); Mon, 13 May 2024 20:09:02 +0000 Received: (at 70923) by debbugs.gnu.org; 13 May 2024 20:08:41 +0000 Received: from localhost ([127.0.0.1]:34585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byS-0000FP-DN for submit@debbugs.gnu.org; Mon, 13 May 2024 16:08:41 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:47157 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byN-0000Ek-P2 for 70923@debbugs.gnu.org; Mon, 13 May 2024 16:08:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715630906; 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=yBIH0mEJRPNdVKZJJwBRNVvl5c9JNVPD4W+ywOtMcXA=; b=I5H6Jo/JWrCAWYS5L7XH+nGsuCAXajKfB8ul4DrdultkP3QqggYqftw6O54jpXUEhNO8PE /oucDOEODHue/VD4gOTUqjyI/fLRz7+ATR9JBQsgtU+UkbgkdqQnN614Kah9dW+TYiaK4s iIE82x+YQRdNTNyaOwEP6mjXhfC51CmMc0OSA6Gs2RFHc8jQkVfH+LoDL+GjpabpbpM1JV QJXBdWQPMpPq4SB6o49hkB87iVZEXDCFnmH/Km6K1hnZmrqWXwPsqFRI0jebPF1ieImtkE Jb3fSkeHmF3LAw2uDmp4ZYl4txgj7Z/QXV1fc9/1MlYdrhJuPncXktWm9N63eQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 709cb417 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Mon, 13 May 2024 20:08:26 +0000 (UTC) Date: Mon, 13 May 2024 22:07:59 +0200 Message-ID: <691df95b12c7f51c2c8ed5e0d495cb96cf3c7aa5.1715627497.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 | 58 ++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 09a01cf315..1bbab916c4 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 @@ -409,41 +412,46 @@ (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) - (cons* input (list 'unquote (string->symbol - (if version - (string-append input "-" version) - input))) - (or (and output (list output)) - '()))) + (let ((symbol (string->symbol + (if version + (string-append input "-" version) + input)))) + (if output + (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 (,'quasiquote ,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 May 13 20:08:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 64401 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 A334927BBEA; Mon, 13 May 2024 21:09:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B80C327BBE9 for ; Mon, 13 May 2024 21:09:16 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6byv-0004Ht-CU; Mon, 13 May 2024 16:09:09 -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 1s6byp-0004Cv-1Z for guix-patches@gnu.org; Mon, 13 May 2024 16:09:03 -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 1s6byo-0007nU-PV for guix-patches@gnu.org; Mon, 13 May 2024 16:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6byp-0000I2-Cv; Mon, 13 May 2024 16:09:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH 03/13] tests: go: Adjust to new-style package inputs. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: cox.katherine.e+guix@gmail.com, sharlatanus@gmail.com, guix-patches@gnu.org Resent-Date: Mon, 13 May 2024 20:09: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 , Katherine Cox-Buday , Sharlatan Hellseher X-Debbugs-Original-Xcc: Katherine Cox-Buday , Sharlatan Hellseher Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.1715630922990 (code B ref 70923); Mon, 13 May 2024 20:09:03 +0000 Received: (at 70923) by debbugs.gnu.org; 13 May 2024 20:08:42 +0000 Received: from localhost ([127.0.0.1]:34588 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byT-0000FZ-3u for submit@debbugs.gnu.org; Mon, 13 May 2024 16:08:41 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:47157 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byP-0000Ek-Ck for 70923@debbugs.gnu.org; Mon, 13 May 2024 16:08:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715630907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B7OBHl2BUxzlmsCaUb+oxJwIiSx8hwswd6LQKpGYGtY=; b=T95eG1QsAunK/H9z8DeiAX2XymjFJHgJdqy06vDZWjl757UPQ2toGpflXnj3AtWv4VsUup CxrgbLw0pXqEpPO4ZjIR0LIouzV2afYpButxA7hGfYzhZE3LbLaTgt+U7nk6lehmhqCYYR XJlk4bwNpC5xlWAiV8J+wj/MLGsTjF3kaBZkf/cidD/IQq6jFiHcGutMsh3vjgh1tf1QYl lVb6RPcf7ArEgd7AFjz4C+kXrOAGw9WdEyDYOV2vT4eNEQPqLlE7NB7rRl602bF7Ao3WAZ 7AdT0S8SiGkAhOxnqT7efhnCsTlDf2Y3YDw3ZFEUEfHcJiVZQGAMCHGu1Q+L9A== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id b79c0a30 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Mon, 13 May 2024 20:08:26 +0000 (UTC) Date: Mon, 13 May 2024 22:08:00 +0200 Message-ID: <5e4fd3fd23307151ae51b1406a9554aa17ea1844.1715627497.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 * tests/go.scm ("go-module->guix-package"): Use new-style for propagated-inputs. Change-Id: Id6341bfb2d92c7f1d7fb85e46d38748584e5fabe --- tests/go.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/go.scm b/tests/go.scm index d2e8846b30..f925c485c1 100644 --- a/tests/go.scm +++ b/tests/go.scm @@ -389,7 +389,7 @@ (define (mock-http-get testcase) (arguments (list #:import-path "github.com/go-check/check")) (propagated-inputs - `(("go-github-com-kr-pretty" ,go-github-com-kr-pretty))) + (list go-github-com-kr-pretty)) (home-page "https://github.com/go-check/check") (synopsis "Instructions") (description "Package check is a rich testing extension for Go's testing \ From patchwork Mon May 13 20:08:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 64409 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 AE25027BBEC; Mon, 13 May 2024 21:09:59 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9257827BBE9 for ; Mon, 13 May 2024 21:09:56 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6byx-0004IM-9q; Mon, 13 May 2024 16:09:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s6byr-0004DX-Sf for guix-patches@gnu.org; Mon, 13 May 2024 16:09:07 -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 1s6byp-0007nc-73 for guix-patches@gnu.org; Mon, 13 May 2024 16:09:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6byp-0000IB-PF for guix-patches@gnu.org; Mon, 13 May 2024 16:09:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH 04/13] tests: elm: Adjust to new-style package inputs. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 May 2024 20:09: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 Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.1715630922999 (code B ref 70923); Mon, 13 May 2024 20:09:03 +0000 Received: (at 70923) by debbugs.gnu.org; 13 May 2024 20:08:42 +0000 Received: from localhost ([127.0.0.1]:34592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byT-0000Fv-UK for submit@debbugs.gnu.org; Mon, 13 May 2024 16:08:42 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:47157 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byQ-0000Ek-1h for 70923@debbugs.gnu.org; Mon, 13 May 2024 16:08:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715630907; 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=1VHukPkZyplAjDWr9oFR+gPVhDuw9REWtF9PuIn7/zY=; b=RzWK8Qw3eKLnqvujsRJw8h/xK6loJdh08xjbHF36QGpN2sVsrWVuTGY/ZD/Swc2lF1ns7o cpYPvXcOqCKzICW3pSsCQj7Lwsdod38oH62zMxYjKUytUPhV9TVbwSHUkoFW1xAzTRLl+w T60vxfefR9lsQ4+/1jHFHosqkzxK4iWs5jV4S0+BneJf4QUvooid5GEy4EQpF8T6NjvJrR Kt1dw0Fj3HKD1RZ6KbwZVVLmQoXJCX2Jf+mCjEtib6anZwyMT2AJAURon1ToGnW0w4DB1U UVB0fGWtuFnFiJh1TpQI7zRUdbt3LZIYYF+dGUItki/lkcq+EmUPJDuLRIAwyw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 46970706 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 13 May 2024 20:08:27 +0000 (UTC) Date: Mon, 13 May 2024 22:08:01 +0200 Message-ID: <6616ae10b267f38a3cfa8aaef9fc0bd0f913fd30.1715627497.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 * tests/elm.scm ("elm-recursive-import \"elm-guix/demo\""): Use the new-style for inputs and propagated-inputs. Change-Id: Iae05b5e9f9b6a73cb2d08bb3b0f73df9004f83ac --- tests/elm.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/elm.scm b/tests/elm.scm index c30623da03..2cdeab96fb 100644 --- a/tests/elm.scm +++ b/tests/elm.scm @@ -250,9 +250,9 @@ (define (directory-sha256 directory) (base32 ,(? string? hash)))) (build-system elm-build-system) (propagated-inputs - ,'`(("elm-core" ,elm-core))) + (list elm-core)) (inputs - ,'`(("elm-json" ,elm-json))) + (list elm-json)) (home-page "https://package.elm-lang.org/packages/elm-guix/demo/3.0.0") (synopsis "A test for `(guix import elm)`") From patchwork Mon May 13 20:08:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 64412 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 03FDB27BBE9; Mon, 13 May 2024 21:10:06 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=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 AD21127BBE2 for ; Mon, 13 May 2024 21:10:03 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6bz2-0004KG-Ow; Mon, 13 May 2024 16:09:16 -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 1s6byr-0004DY-Sh for guix-patches@gnu.org; Mon, 13 May 2024 16:09:07 -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 1s6byq-0007nn-7X for guix-patches@gnu.org; Mon, 13 May 2024 16:09:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6byq-0000IP-Nj; Mon, 13 May 2024 16:09:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH 05/13] 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, 13 May 2024 20:09: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 , Efraim Flashner X-Debbugs-Original-Xcc: Efraim Flashner Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17156309291041 (code B ref 70923); Mon, 13 May 2024 20:09:04 +0000 Received: (at 70923) by debbugs.gnu.org; 13 May 2024 20:08:49 +0000 Received: from localhost ([127.0.0.1]:34602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6bya-0000Gd-PM for submit@debbugs.gnu.org; Mon, 13 May 2024 16:08:49 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:47157 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byQ-0000Ek-TB for 70923@debbugs.gnu.org; Mon, 13 May 2024 16:08:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715630907; 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=Ff5xJe8LhMQnTeulI9egnKlKA9FKEEOZPQSdr1khMAQ=; b=bSmWVxam2WbXRNgNagb5aoztXi9g111ehphalA8/Js8kfVnzl5ZqpZqys+yR4khujt3yII adThBGtisc/ZWfRAQZaBBDQZgf2ZUQZKQukh+HVSjQOoCT3YoyVTn/9oGSMEABJkjHh13F gnXY5Eur7XaAv2f7BJhmZ+WrwTI46sLxXf/tdbShOxh/tYmdqEapEAq8C9GjmT5OXPY6By 28njUV1gIDTNvCVjyIRm75S2lM52TtPzPgOjR7ki90P5oBTGpRyA9bCdAXsdKVBkIOPYMI INOskC4tf2foZVbyBZG0iWieJN5J8b++qBW5oap2l36IMrSG4gBCRdDgrT8z7A== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id df555c22 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Mon, 13 May 2024 20:08:27 +0000 (UTC) Date: Mon, 13 May 2024 22:08:02 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 | 54 +++++++------------ tests/crate.scm | 119 +++++++++++++++++------------------------- 2 files changed, 68 insertions(+), 105 deletions(-) diff --git a/guix/import/crate.scm b/guix/import/crate.scm index 7a25b2243c..760c5f0de4 100644 --- a/guix/import/crate.scm +++ b/guix/import/crate.scm @@ -7,6 +7,8 @@ ;;; Copyright © 2023 Simon Tournier ;;; Copyright © 2023, 2024 Efraim Flashner ;;; Copyright © 2023, 2024 David Elsing +;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2024 Herman Rimm ;;; ;;; This file is part of GNU Guix. ;;; @@ -141,27 +143,6 @@ (define (crate-version-dependencies version) ;;; Converting crates to Guix packages. ;;; -(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 @@ -185,8 +166,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))) (pkg `(package (name ,guix-name) (version ,version) @@ -204,12 +191,12 @@ (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 ,synopsis) (description ,(beautify-description description)) @@ -218,11 +205,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 ce2f08aade..7651a5b5bb 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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "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 "summary") From patchwork Mon May 13 20:08:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 64411 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 78F7727BBEA; Mon, 13 May 2024 21:10:03 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=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 EC2DF27BBE2 for ; Mon, 13 May 2024 21:10:02 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6bz1-0004Jv-8J; Mon, 13 May 2024 16:09:15 -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 1s6byr-0004DZ-TW for guix-patches@gnu.org; Mon, 13 May 2024 16:09:07 -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 1s6byp-0007ng-Mo for guix-patches@gnu.org; Mon, 13 May 2024 16:09:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6byq-0000II-9V for guix-patches@gnu.org; Mon, 13 May 2024 16:09:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH 06/13] import: utils: Add 'maybe-upstream-inputs' procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 May 2024 20:09: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.17156309281034 (code B ref 70923); Mon, 13 May 2024 20:09:04 +0000 Received: (at 70923) by debbugs.gnu.org; 13 May 2024 20:08:48 +0000 Received: from localhost ([127.0.0.1]:34600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6bya-0000Gb-DG for submit@debbugs.gnu.org; Mon, 13 May 2024 16:08:48 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:40155 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byR-0000El-OK for 70923@debbugs.gnu.org; Mon, 13 May 2024 16:08:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715630908; 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=fb1CJEEtcRxSwB70WqNuwiVWepplRUzyPYeWO8oYJFg=; b=dTUWCo2wMXbwP/QyPxjiovDGN91n/Dggnix1bSPmBHu6LevfLgCqk9SamCvJ9vwHb4GuM0 KJWQLjEzY9l+1AV2Ob0S6NbQqft840PRyszoTqMoRRl3mczH2iZUA+0CfIadkTFxZOD+6S ZDCbgixLT65DOvNCiw5fN7dqgBJQ6UIcQHjHobV/ZKADIsr8VGjFRqHaJmpvBpdqLz9okR QmJqpTxbpMbvAG4/7725F/pUXxUQfqptSV0MMMUWChG+YQpuRgnQ7opbjBmxcmxRtliGae PaRIapMHuM2SFsp2D1t8LjfvMDoTZDW4ksr39N6EYU9rz+KvpJFs6cmoniqi5w== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 334a0344 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 13 May 2024 20:08:28 +0000 (UTC) Date: Mon, 13 May 2024 22:08:03 +0200 Message-ID: <162a6f222e11f72a5eaa8246c4f03c494f0440ca.1715627497.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 1bbab916c4..98080dd0a0 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 @@ -453,6 +455,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 May 13 20:08:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 64403 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 9157227BBE9; Mon, 13 May 2024 21:09:41 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DEC4A27BBE2 for ; Mon, 13 May 2024 21:09:40 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6bz2-0004KF-ME; Mon, 13 May 2024 16:09:16 -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 1s6byy-0004J7-G2 for guix-patches@gnu.org; Mon, 13 May 2024 16:09:12 -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 1s6byy-0007pR-7V; Mon, 13 May 2024 16:09:12 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6byr-0000IX-3f; Mon, 13 May 2024 16:09:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH 07/13] 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, 13 May 2024 20:09: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.17156309301048 (code B ref 70923); Mon, 13 May 2024 20:09:05 +0000 Received: (at 70923) by debbugs.gnu.org; 13 May 2024 20:08:50 +0000 Received: from localhost ([127.0.0.1]:34604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byb-0000Gk-Ik for submit@debbugs.gnu.org; Mon, 13 May 2024 16:08:49 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:40155 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byS-0000El-FQ for 70923@debbugs.gnu.org; Mon, 13 May 2024 16:08:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715630908; 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=pH3pRQt5rbzAbELGmuU6ZPWRrvwMLSQwgZ/NvpmyxDY=; b=I4PkSSXQyR65/ueXn3mj6wGJCRWp1DJ3uK6aRdpx8q4M04SiumJ+et2qnXBTfPlcAhO2gm rWBqRwkZNNk5Oe0ZAhgdjoTZ4OT8DFXLhOx6dhabUwa2XkaAzfuh8dra4Js/6Ca1O3KmRa +ML3lHx/vxpU80Yr8lTdiCNLn2/roZH6TRegjJHPW6sLADks6xN7JEPnl9r/SgITotGEhh oUPzvNrwu4nsScmn55b0a+aZnSruS9xS2Qxv6YBT/VIXd+CeTUpIoiKsHls7ZaOBs6e61Z xXtXexVMHbS6wuSJ7xhjxhHlaY+fcrE0PhMPpStT4w7UZSbyVBuVpe+k7RrIEQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id c83447e8 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 13 May 2024 20:08:28 +0000 (UTC) Date: Mon, 13 May 2024 22:08:04 +0200 Message-ID: <210d22fd9d577748a23093df1e162a36373688a6.1715627497.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index 6719fde330..c46f8897b9 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -201,18 +201,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 +526,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 ,(beautify-description From patchwork Mon May 13 20:08:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 64408 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 17A8D27BBE2; Mon, 13 May 2024 21:10:00 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=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 1EFCF27BBEB for ; Mon, 13 May 2024 21:09:59 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6byy-0004If-Vh; Mon, 13 May 2024 16:09:13 -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 1s6bys-0004Dc-Go for guix-patches@gnu.org; Mon, 13 May 2024 16:09:07 -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 1s6bys-0007oJ-7e for guix-patches@gnu.org; Mon, 13 May 2024 16:09:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6byr-0000Id-Ix; Mon, 13 May 2024 16:09:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH 08/13] 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, 13 May 2024 20:09: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.17156309301055 (code B ref 70923); Mon, 13 May 2024 20:09:05 +0000 Received: (at 70923) by debbugs.gnu.org; 13 May 2024 20:08:50 +0000 Received: from localhost ([127.0.0.1]:34606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byb-0000Gr-U6 for submit@debbugs.gnu.org; Mon, 13 May 2024 16:08:50 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:47157 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byT-0000Ek-2B for 70923@debbugs.gnu.org; Mon, 13 May 2024 16:08:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715630908; 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=e3J/lM7prB3MIu8Ixg3uXxBUOdkLtWQ3DSupBHJQ8nc=; b=PWAhFwyzQ9W03STALCLgsGS+stGXCA7/Ck/uM9axiNCtU6eRobE4nxyBc73pMeK9A42DRZ zqXwUZCQo4eiLI42gHOK8eRX/IbpgEWmtOoDbbjQ3gTq0GhbZHA+oJgXWr0kYlQczM4Dxk ORRljpuuaAY9h1t2QR9+1tGr8QmHIpOsWbrTA2zFXFICGIBukiEqjnjHjDr3PQvLyCTRkR NZ/0Dz/RvLgXvcj7mJ/fOGKBVjiqQ/qVwEPNegjsGMPDBCI4RtjmYHkqs9dqWvYtS6jVxa YkoltXk1h9TD+kUc+1BqgBMvYTjE5YTZ7MaGIcvHlP+NB8YbU94cha5Qkf8aPA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 22a02ee3 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 13 May 2024 20:08:28 +0000 (UTC) Date: Mon, 13 May 2024 22:08:05 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 d1855b3698..0072500155 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -358,13 +358,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)) @@ -385,7 +378,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 May 13 20:08:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 64407 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 964C127BBE2; Mon, 13 May 2024 21:09:59 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=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 E602A27BBEE for ; Mon, 13 May 2024 21:09:56 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6byy-0004J9-Rn; Mon, 13 May 2024 16:09:12 -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 1s6bys-0004Dd-Mt for guix-patches@gnu.org; Mon, 13 May 2024 16:09:07 -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 1s6bys-0007oR-EY for guix-patches@gnu.org; Mon, 13 May 2024 16:09:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6bys-0000Ip-Cb; Mon, 13 May 2024 16:09:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH 09/13] 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, 13 May 2024 20:09: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.17156309311068 (code B ref 70923); Mon, 13 May 2024 20:09:06 +0000 Received: (at 70923) by debbugs.gnu.org; 13 May 2024 20:08:51 +0000 Received: from localhost ([127.0.0.1]:34610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byc-0000H5-Mu for submit@debbugs.gnu.org; Mon, 13 May 2024 16:08:51 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:40155 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byT-0000El-Oh for 70923@debbugs.gnu.org; Mon, 13 May 2024 16:08:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715630909; 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=W1jjOVuFEqbOXqt6pNDpfdoVNmqoORyHmgzPO2+tA1g=; b=TOrdiOe+yzfmLaw3n/HhpOWdPCnV+fVl6vmxYO3nw57Kq/ixB3ielsaketBDmQt6X9CQ8V IjK5rUgvnzzQnaXLj4/OFk1L14Z7i1+N6EJUswObEd8T4B+b7SR3ovZWido+Z10epISSGz csB6gf62ZV7K1/yG55Tk5UQ/Mp0QzRJLhtQfeU99onJme0O/VlTB37KiQvp2F2DSjJkNYb 9W3WKpA5JiwiETzv6LZCAW/CqPdRUgWbnjYM5dTqP8HLeGjbPN9Z8odwdONaCpV4NLOwlj ZV8kDMJnIMT1hQcGklE8pGRLO154WWqgq20BJ0OryVTkR0aZc9xwXLUzEkWPXw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id fdc2625e (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 13 May 2024 20:08:29 +0000 (UTC) Date: Mon, 13 May 2024 22:08:06 +0200 Message-ID: <42bfac7c486b9dd94633eddb348cb97c3a47bd43.1715627497.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 | 38 +++++++++++--------------------------- tests/hackage.scm | 13 +++++++------ 2 files changed, 18 insertions(+), 33 deletions(-) diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm index 79a51d3300..e90f3c932f 100644 --- a/guix/import/hackage.scm +++ b/guix/import/hackage.scm @@ -288,26 +288,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 +304,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 May 13 20:08:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 64406 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 4BF4127BBF1; Mon, 13 May 2024 21:09:57 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=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 46C4327BBE2 for ; Mon, 13 May 2024 21:09:56 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6byx-0004Ia-Mi; Mon, 13 May 2024 16:09:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s6bys-0004De-Ng for guix-patches@gnu.org; Mon, 13 May 2024 16:09:07 -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 1s6bys-0007oV-Fx for guix-patches@gnu.org; Mon, 13 May 2024 16:09:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6byr-0000Ij-Vr; Mon, 13 May 2024 16:09:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH 10/13] import: cran: Use 'maybe-list-field' procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: rekado@elephly.net, guix-patches@gnu.org Resent-Date: Mon, 13 May 2024 20:09: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: Ricardo Wurmus X-Debbugs-Original-Xcc: Ricardo Wurmus Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17156309301062 (code B ref 70923); Mon, 13 May 2024 20:09:05 +0000 Received: (at 70923) by debbugs.gnu.org; 13 May 2024 20:08:50 +0000 Received: from localhost ([127.0.0.1]:34608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byc-0000Gy-AE for submit@debbugs.gnu.org; Mon, 13 May 2024 16:08:50 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:47157 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byT-0000Ek-VR for 70923@debbugs.gnu.org; Mon, 13 May 2024 16:08:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715630910; 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=wnNXWoqw8IXmozIC7cZTKfI2/v13ivYKrtK9YRoDSSM=; b=WF6q/JK609lRt15ZRHbtoMrx7eYBxU0Dl61wVp/OGMh+aguXl/NI1t29YuGozr4gvPdcca ia095ILB6SEClx8MdYIjoGcKXOJDM8ClFOTdfdWEl2CqWDw0XCO1ocLO3b0JHrjFjsgvVG ArZ80srvJh8Tyu7raa5BEvQ0i2aohkzvLA0IOl48wBZqvq78y+wyNFs6HNbRVqiSOKUv7+ P0hpg0TskbFZIgQ2s2EElREy+0avEwDQ47bRreSc2hrgRlvAHjmduzOa+EdH0f5Ed+VO9t phd6x0womG+5qPcuiAXqwMGBTqviPnMc2F0AyyJoPk6A1OVGjSW0w4DQzjS+yg== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 4f50ec2c (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 13 May 2024 20:08:30 +0000 (UTC) Date: Mon, 13 May 2024 22:08:07 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 6ae00cae96..70ee3eb9ec 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -85,21 +85,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 +173,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: 64404 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 69AA827BBE9; Mon, 13 May 2024 21:09:46 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 52B5627BBE2 for ; Mon, 13 May 2024 21:09:45 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6bz1-0004K8-EK; Mon, 13 May 2024 16:09:15 -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 1s6bys-0004Df-Ud for guix-patches@gnu.org; Mon, 13 May 2024 16:09:07 -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 1s6bys-0007oe-Mh for guix-patches@gnu.org; Mon, 13 May 2024 16:09:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6byt-0000JB-7c for guix-patches@gnu.org; Mon, 13 May 2024 16:09:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH 11/13] import: cpan: Use 'maybe-upstream-inputs' procedure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 May 2024 20:09: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.17156309321083 (code B ref 70923); Mon, 13 May 2024 20:09:07 +0000 Received: (at 70923) by debbugs.gnu.org; 13 May 2024 20:08:52 +0000 Received: from localhost ([127.0.0.1]:34614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byd-0000HJ-Iv for submit@debbugs.gnu.org; Mon, 13 May 2024 16:08:51 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:47157 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byV-0000Ek-1J for 70923@debbugs.gnu.org; Mon, 13 May 2024 16:08:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715630911; 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=awy7nNUIOA3lPBhPahfxqd1CYsW/hpOe8hVUr25QuSI=; b=iEdRfCXGmlSISvZzeSjoczRNeVF8ChPXLOlYfg9bNVQEIp4gdUqsU8bdG4t9DkvpQ9P4WB 0oWWyPibuOHwq+2F2hvJjYLBdqrD9ADsCg7VKBvTNeop21mUYTSoJIzJAbfUCqmkfa8Tos 83eJawaa0yJUSTOlAkKD38K8NAyFPFn9xzWwcdLsLMiPHmahRFoxmhBuRxaebQT6Dl3FfH ij8w+cDEUKzObnZQMCVfmI8BZ5DFka0axkbaD2FHwYFv9hPXdtQ3Ac4drQ3r5XqyxQRbht YB+qRp53tBHXhjelu5j4BySOhRhtbMTN3KhzF4rGvVZ1VTyksfG/aClIWOnNOQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 81689f89 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 13 May 2024 20:08:31 +0000 (UTC) Date: Mon, 13 May 2024 22:08:08 +0200 Message-ID: <40e6e376621412e26b576fc8aab96caa78274a52.1715627497.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm index b87736eef6..55c616314b 100644 --- a/guix/import/cpan.scm +++ b/guix/import/cpan.scm @@ -37,7 +37,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 +276,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 +289,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 May 13 20:08:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herman Rimm X-Patchwork-Id: 64405 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 B9FBB27BBEA; Mon, 13 May 2024 21:09:54 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=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 108EA27BBE9 for ; Mon, 13 May 2024 21:09:54 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6byy-0004JC-SU; Mon, 13 May 2024 16:09:12 -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 1s6bys-0004Db-Fg for guix-patches@gnu.org; Mon, 13 May 2024 16:09:07 -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 1s6bys-0007oI-77 for guix-patches@gnu.org; Mon, 13 May 2024 16:09:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6bys-0000Iv-Qk for guix-patches@gnu.org; Mon, 13 May 2024 16:09:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH 12/13] import: egg: Use maybe-*inputs procedures. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 May 2024 20:09: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 Received: via spool by 70923-submit@debbugs.gnu.org id=B70923.17156309311076 (code B ref 70923); Mon, 13 May 2024 20:09:06 +0000 Received: (at 70923) by debbugs.gnu.org; 13 May 2024 20:08:51 +0000 Received: from localhost ([127.0.0.1]:34612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byd-0000HG-6s for submit@debbugs.gnu.org; Mon, 13 May 2024 16:08:51 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:40155 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byV-0000El-2x for 70923@debbugs.gnu.org; Mon, 13 May 2024 16:08:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715630911; 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=Y20UxH4guLHcJDBhGNKEctif8qP5qD6WUna8b2wwO/o=; b=lQHIe26C2KaPsK/7EGpShc+Sq8PqpfjVVBl35qkDPY4OJ27gIt0jujy52DYBXc+RpiO40d RqThnVV3wyZG+nWZeUadvKHRAXtSm277FgNRAOtEGh+bJTd5Cd+MrOWcO+95j0OJ+iCh53 50FP3eMaw5HP28IgcDvEybnxxgJ+DKfLHj2V0qfZoo7XeRkE5ae+uPJnt6L6ttmh3wsT+m FE/v3qhWsUgPwQmx90vHCM35uJCFiqBWkcsPkPM6SLSEJFlX2MCe7HzR/SFbhkd5FmQQuw 9Kl8HeydK4FW44JY527Va+5fpwu1ba9z7JVBgsCiX7sPi98q0usSO6UCLMrezw== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 66963c72 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 13 May 2024 20:08:31 +0000 (UTC) Date: Mon, 13 May 2024 22:08:09 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/guix/import/egg.scm b/guix/import/egg.scm index e3bc158475..60e1eef156 100644 --- a/guix/import/egg.scm +++ b/guix/import/egg.scm @@ -229,23 +229,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 +268,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 +285,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 May 13 20:08: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: 64402 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 D93BD27BBEA; Mon, 13 May 2024 21:09:36 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=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 5628827BBE2 for ; Mon, 13 May 2024 21:09:36 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6byu-0004F1-6R; Mon, 13 May 2024 16:09:08 -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 1s6byt-0004Dh-By for guix-patches@gnu.org; Mon, 13 May 2024 16:09:07 -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 1s6byt-0007on-41 for guix-patches@gnu.org; Mon, 13 May 2024 16:09:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6byt-0000JI-OB for guix-patches@gnu.org; Mon, 13 May 2024 16:09:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70923] [PATCH 13/13] 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, 13 May 2024 20:09: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.17156309321089 (code B ref 70923); Mon, 13 May 2024 20:09:07 +0000 Received: (at 70923) by debbugs.gnu.org; 13 May 2024 20:08:52 +0000 Received: from localhost ([127.0.0.1]:34616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byd-0000HS-Uy for submit@debbugs.gnu.org; Mon, 13 May 2024 16:08:52 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:40155 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6byV-0000El-VA for 70923@debbugs.gnu.org; Mon, 13 May 2024 16:08:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1715630911; 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=HyR5PK2cfYqYmon0Hl6NRwSvAbm69M7OeUL35K8vuL4=; b=Gb+s+rxk+58AxRBr3wMbzkXAmJmqdfSZWftUyWiL5n89bW4NxLjnqdcUZ3762CaaAW8SSO xftsxgsvt/NOcCmUoS/ay0AJcKMT/EebqZoWsptIWX6vOJ8A2W2eg64zc/ukZlt2Sn5aCU jie2AJiiFe682dxlQ47ZPKHQCxwyLcKl+aQ9hirOELdjwsBUcRq8XITfN0VEbMvQ1Xe0sa mZ7Km2HJcqB5dIjYAYe+bpKLFL/RxPLE96y8vQBSdt0HLTppAKmyJ8as1YWKYFPMpBytza JRDvFzkiUWfWWoMCMDlVfDAWSr1lgAE1PG+zxZVxPkXip8gZP/1/FNVDnZGjJQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id c705f68a (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <70923@debbugs.gnu.org>; Mon, 13 May 2024 20:08:31 +0000 (UTC) Date: Mon, 13 May 2024 22:08:10 +0200 Message-ID: <65ea14e719d9219414bc635feee982b8e4857a5a.1715627497.git.herman@rimm.ee> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/guix/import/hexpm.scm b/guix/import/hexpm.scm index 71a54ba973..af7a96efb0 100644 --- a/guix/import/hexpm.scm +++ b/guix/import/hexpm.scm @@ -153,26 +153,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." + "Given a list of hexpm package NAMES, returns a list of guix package +names." ;; 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