From patchwork Sat Jul 10 04:53:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sarah Morgensen X-Patchwork-Id: 31274 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 0E07827BC81; Sat, 10 Jul 2021 05:54:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C6FE127BC78 for ; Sat, 10 Jul 2021 05:54:08 +0100 (BST) Received: from localhost ([::1]:54152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m250B-0006KG-OF for patchwork@mira.cbaines.net; Sat, 10 Jul 2021 00:54:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2506-0006Jh-Nb for guix-patches@gnu.org; Sat, 10 Jul 2021 00:54:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48558) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2506-00020y-EF for guix-patches@gnu.org; Sat, 10 Jul 2021 00:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2506-0005OD-C9 for guix-patches@gnu.org; Sat, 10 Jul 2021 00:54:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49169] [PATCH 00/11] Removing input labels from package definitions Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 10 Jul 2021 04:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49169 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: 49169@debbugs.gnu.org Received: via spool by 49169-submit@debbugs.gnu.org id=B49169.162589282120689 (code B ref 49169); Sat, 10 Jul 2021 04:54:02 +0000 Received: (at 49169) by debbugs.gnu.org; 10 Jul 2021 04:53:41 +0000 Received: from localhost ([127.0.0.1]:60104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m24zk-0005Nd-TR for submit@debbugs.gnu.org; Sat, 10 Jul 2021 00:53:41 -0400 Received: from out2.migadu.com ([188.165.223.204]:38915) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m24zf-0005NQ-BG for 49169@debbugs.gnu.org; Sat, 10 Jul 2021 00:53:39 -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=1625892813; 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: in-reply-to:in-reply-to:references:references; bh=Z8Bwd+UAcldGdgpMmtftx6Mfn80I/cKDObp3CE4N9cM=; b=ZtXIv1KermSmtqswAw1+EmpSqP0lArd1wglo5H8+EfBayeYDbIL1wpeBngEsgVAT//EkJJ cpy09cnhRMb1bKtVxTxzL+LFRnYiSYJbYdhS1T7QYO6VcmmjOTTWA7oPKA4AOvOUV49zec JNsizHEb1gMcxz7fxvMrWN50CSb3Vew= References: <20210622090221.15182-1-ludo@gnu.org> <20210630204832.25753-1-ludo@gnu.org> Date: Fri, 09 Jul 2021 21:53:30 -0700 In-Reply-To: <20210630204832.25753-1-ludo@gnu.org> ("Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= "'s message of "Wed, 30 Jun 2021 22:48:16 +0200") Message-ID: <868s2ekbw5.fsf_-_@mgsn.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Sarah Morgensen X-ACL-Warn: , Sarah Morgensen via Guix-patches X-Patchwork-Original-From: Sarah Morgensen via Guix-patches via From: Sarah Morgensen X-getmail-retrieved-from-mailbox: Patches Hello :) This is a wonderful direction! I am always happy to see boilerplate evaporate. Ludovic Courtès writes: > • I changed a few importers to emit simplified package inputs. > We’ll have to take care of the other importers eventually. I found one more easy change to make in the importers. I just gave it a quick smoke test with the Go importer, nothing exhaustive; and I'm not sure which other importers use it. I've attached the patch below. > doc/guix.texi | 208 ++++++++++++++-- In the manual, you added: > Each element of these lists is either a package, origin, or other > ``file-like object'' [...] How should a file input like this be handled? ("some.patch" (search-patch "some.patch")) If I had to guess, I'd try some gexp like... #$(local-file (search-patch "some.patch")) But I really have no idea! > guix/scripts/style.scm | 527 +++++++++++++++++++++++++++++++++++++++++ > tests/style.scm | 366 ++++++++++++++++++++++++++++ > 23 files changed, 1643 insertions(+), 298 deletions(-) The style script makes up fully half of the patch! Wow. --- Sarah diff --git a/guix/import/utils.scm b/guix/import/utils.scm index d817318a91..5075e5c491 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -237,12 +237,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 +261,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."