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