[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#70923] [PATCH v2 12/12] import: hexpm: Use maybe-inputs.
From: |
Herman Rimm |
Subject: |
[bug#70923] [PATCH v2 12/12] import: hexpm: Use maybe-inputs. |
Date: |
Wed, 4 Sep 2024 22:33:06 +0200 |
* guix/import/hexpm.scm (maybe-inputs): Delete procedure.
(dependencies->package-names): Adjust description and return strings.
(make-hexpm-sexp): Use maybe-inputs procedure.
Change-Id: Ie7a8a630a3a9d4859453d49fdee42aa560e27f17
---
guix/import/hexpm.scm | 29 +++++++++--------------------
1 file changed, 9 insertions(+), 20 deletions(-)
diff --git a/guix/import/hexpm.scm b/guix/import/hexpm.scm
index 71a54ba973..aa857facbc 100644
--- a/guix/import/hexpm.scm
+++ b/guix/import/hexpm.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2019 Martin Becze <mjbecze@riseup.net>
;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2020-2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -153,26 +154,14 @@ (define (lookup-hexpm-release version*)
;;; Converting hex.pm packages to Guix packages.
;;;
-(define (maybe-inputs package-inputs input-type)
- "Given a list of PACKAGE-INPUTS, tries to generate the 'inputs' field of a
-package definition. INPUT-TYPE, a symbol, is used to populate the name of
-the input field."
- (match package-inputs
- (()
- '())
- ((package-inputs ...)
- `((,input-type (list ,@package-inputs))))))
-
(define (dependencies->package-names names)
- "Given a list of hexpm package NAMES, returns a list of guix package names
-as symbols."
- ;; TODO: Base name on language of dependency.
- ;; The language used for implementing the dependency is not know without
- ;; recursing the dependencies. So for now assume more packages are based on
- ;; Erlang and prefix all dependencies with "erlang-" (the default).
- (map string->symbol
- (map hexpm-name->package-name
- (sort names string-ci<?))))
+ "Given NAMES, a list of hexpm dependencies, return a list of guix
+package names."
+ ;; TODO: Base name on the programming language of the dependency.
+ ;; The language used for implementing the dependency can only be known
+ ;; by traversing the dependencies. So for now assume packages are
+ ;; based on Erlang, and prefix dependencies with "erlang-" by default.
+ (map hexpm-name->package-name (sort names string-ci<?)))
(define* (make-hexpm-sexp #:key name version tarball-url
home-page synopsis description license
@@ -194,7 +183,7 @@ (define* (make-hexpm-sexp #:key name version tarball-url
(uri (hexpm-uri ,name version))
(sha256 (base32 ,(guix-hash-url temp)))))
(build-system ,build-system)
- ,@(maybe-inputs (dependencies->package-names dependencies) 'inputs)
+ ,@(maybe-inputs (dependencies->package-names dependencies))
(synopsis ,synopsis)
(description ,(beautify-description description))
(home-page ,(match home-page
--
2.45.2
- [bug#70923] [PATCH v2 01/12] build-system: cargo: Accept unlabeled #:cargo-inputs., Herman Rimm, 2024/09/04
- [bug#70923] [PATCH v2 02/12] import: utils: Emit new-style inputs from maybe-*inputs procedures., Herman Rimm, 2024/09/04
- [bug#70923] [PATCH v2 04/12] import: crate: Use (guix import utils) procedures., Herman Rimm, 2024/09/04
- [bug#70923] [PATCH v2 06/12] import: pypi: Use maybe-upstream-inputs., Herman Rimm, 2024/09/04
- [bug#70923] [PATCH v2 11/12] import: egg: Use maybe-*inputs procedures., Herman Rimm, 2024/09/04
- [bug#70923] [PATCH v2 03/12] tests: elm: Adjust to new-style package inputs., Herman Rimm, 2024/09/04
- [bug#70923] [PATCH v2 08/12] import: hackage: Use maybe-list-field., Herman Rimm, 2024/09/04
- [bug#70923] [PATCH v2 05/12] import: utils: Add maybe-upstream-inputs., Herman Rimm, 2024/09/04
- [bug#70923] [PATCH v2 09/12] import: cran: Refactor format-inputs and use maybe-list-field., Herman Rimm, 2024/09/04
- [bug#70923] [PATCH v2 12/12] import: hexpm: Use maybe-inputs.,
Herman Rimm <=
- [bug#70923] [PATCH v2 07/12] import: elpa: Use maybe-propagated-inputse., Herman Rimm, 2024/09/04
- [bug#70923] [PATCH v2 10/12] import: cpan: Use maybe-upstream-inputs., Herman Rimm, 2024/09/04