From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AHe/CtGN92CULQEAgWs5BA (envelope-from ) for ; Wed, 21 Jul 2021 05:00:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id cGRhBtGN92AfYAAA1q6Kng (envelope-from ) for ; Wed, 21 Jul 2021 03:00:33 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7FB9D1D1C6 for ; Wed, 21 Jul 2021 05:00:31 +0200 (CEST) Received: from localhost ([::1]:51130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m62TG-0008Pn-4k for larch@yhetil.org; Tue, 20 Jul 2021 23:00:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48408) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m62So-0008Pe-Ks for guix-patches@gnu.org; Tue, 20 Jul 2021 23:00:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52559) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m62So-0005GV-Cf for guix-patches@gnu.org; Tue, 20 Jul 2021 23:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m62So-0005Bl-66 for guix-patches@gnu.org; Tue, 20 Jul 2021 23:00:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49531] [PATCH core-updates v2] import: go: Emit new-style package inputs. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 21 Jul 2021 03:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49531 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49531@debbugs.gnu.org Received: via spool by 49531-submit@debbugs.gnu.org id=B49531.162683636619870 (code B ref 49531); Wed, 21 Jul 2021 03:00:02 +0000 Received: (at 49531) by debbugs.gnu.org; 21 Jul 2021 02:59:26 +0000 Received: from localhost ([127.0.0.1]:35872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m62SD-0005AQ-Sz for submit@debbugs.gnu.org; Tue, 20 Jul 2021 22:59:26 -0400 Received: from out0.migadu.com ([94.23.1.103]:10295) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m62SC-0005AG-0d for 49531@debbugs.gnu.org; Tue, 20 Jul 2021 22:59:24 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1626836363; 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=mgi+35eUW3nj7GAWadm97uw3eBJ/oBfgqCmxnZjGwaA=; b=jiEMUeLbvacClhv4AhjZkQ4T0eNRfEbEgy9D586bE+XKcCtzuvAyL95YgJs3kc9YK3Ped8 QhFk4yXEiuZaITfqfulqp+6r282KF56X+m4+tt/I2VqcJfKgjn4eQ9a1ksP+0XmLeXFYmm dFX9L/j2GVQz8RAlRyCa1v4CrvVhJNY= From: Sarah Morgensen Date: Tue, 20 Jul 2021 19:59:21 -0700 Message-Id: <21e16bafbc6af293e7916b92af8fa9ece38a7483.1626832035.git.iskarian@mgsn.dev> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Auth-User: iskarian@mgsn.dev X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626836431; h=from:from:sender:sender: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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=mgi+35eUW3nj7GAWadm97uw3eBJ/oBfgqCmxnZjGwaA=; b=f8IR4MFPT3CVaW/PTsrQHkuJcnMkAiIXNe9edny+0XOgAAUh13mI6mqxK91FmzfQeDzUPn XMHJoaM7pR96zwDQNTOvoKL8ESa1Jnr8WF95r41Agz8TlA8xCFsEdSPrNv/83wVeQ8hu3x qQ360yCcYi+4qdaqrcQHCj/KEliN1TqFrHA6EQYjo3FnrgxBS/3hFxiMoWNeSAYMWhXy4V +OYglfRxxXEwgLaQJ6TH5u5p+txtSk6baL7o4h6cLegwM+v4AdKtempEFZj7ng8sp2mkXj VzFr5OaiiNOy7AUk0Uvob1tcoLh+kFlKy6NX3B2nyDCtX/fT5C/P3ZA/DpROlw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626836431; a=rsa-sha256; cv=none; b=d/3iMqZOhDMklA8bhRVjRi4slnZCv2YCgpCWeZUrrJhiN/mdDhKb/A+Fys4YZ0kL+392PA IcfAaJp9lzqaTn3rCmFvZWSfU9dgJjHxKxqelfZR1HlFr78to/RuNaqZCefyDh1Zkfy73A zLWghcCcen0W2WVzPM8t22LNfJsAxO2S5Pk0w8/WKGFkeWTXN+U9WirYFTYM58PuqoP0pS QhT0UVIdKJJ2I/AZTLRfohU1PmACb8H9ATMoouuBce7p2khJoL/0t5Fi891o0aitoJIOjR 2bqFmQ2PBSOYfHkqj21QEuMo8wH1Gg0fUmNtq5ba4EeGwi7n+Qry6AghoLlNxg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=jiEMUeLb; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mgsn.dev (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -0.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=jiEMUeLb; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mgsn.dev (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 7FB9D1D1C6 X-Spam-Score: -0.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: ODPhhhk0gINS Since PACKAGE-NAMES->PACKAGE-INPUTS is used by both the go and crate importers, give the crate importer a copy of the original so it continues to use old-style inputs until it is updated. * guix/import/utils.scm (package-names->package-inputs)[make-input]: Return new-style package inputs. (maybe-inputs): Wrap PACKAGE-INPUTS in 'list' instead of 'quasiquote'. * guix/import/crate.scm (package-names->package-inputs): New variable. * tests/go.scm ("go-module->guix-package"): Adjust to new-style package inputs. --- This patch narrows the scope to just the go importer; the crate importer can be handled separately. guix/import/crate.scm | 18 ++++++++++++++++++ guix/import/utils.scm | 13 ++++++------- tests/go.scm | 2 +- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/guix/import/crate.scm b/guix/import/crate.scm index 287ffd2536..fa8f7bf096 100644 --- a/guix/import/crate.scm +++ b/guix/import/crate.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2019, 2020 Ludovic Courtès ;;; Copyright © 2019, 2020 Martin Becze ;;; Copyright © 2021 Nicolas Goaziou +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -132,6 +133,23 @@ record or #f if it was not found." ;;; Converting crates to Guix packages. ;;; +(define* (package-names->package-inputs names #:optional (output #f)) + "Given a list of PACKAGE-NAMES or (PACKAGE-NAME VERSION) pairs, and an +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)) + '()))) + + (map (match-lambda + ((input version) (make-input input version)) + (input (make-input input #f))) + names)) + (define (maybe-cargo-inputs package-names) (match (package-names->package-inputs package-names) (() diff --git a/guix/import/utils.scm b/guix/import/utils.scm index d817318a91..8fa017e18f 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2020 Helio Machado <0x2b3bfa0+guix@googlemail.com> ;;; Copyright © 2020 Martin Becze ;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2021 Sarah Morgensen ;;; ;;; This file is part of GNU Guix. ;;; @@ -237,12 +238,10 @@ into a proper sentence and by using two spaces between sentences." 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 ((name (if version (string-append input "-" version) input))) + (if output + (list (string->symbol name) output) + (string->symbol name)))) (map (match-lambda ((input version) (make-input input version)) @@ -263,7 +262,7 @@ snippet generated is for regular inputs." (() '()) ((package-inputs ...) - `((,field-name (,'quasiquote ,package-inputs))))))) + `((,field-name (list ,@package-inputs))))))) (define* (maybe-native-inputs package-names #:optional (output #f)) "Same as MAYBE-INPUTS, but for native inputs." diff --git a/tests/go.scm b/tests/go.scm index 6749f4585f..743cffb023 100644 --- a/tests/go.scm +++ b/tests/go.scm @@ -389,7 +389,7 @@ require github.com/kr/pretty v0.2.1 (arguments '(#: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 \ base-commit: b15c3dd9b0e9cf6858f730e1d46c35ed9ab6a758 -- 2.31.1