summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerman Rimm <herman@rimm.ee>2024-05-13 22:08:10 +0200
committerGuix Patches Tester <>2024-05-13 22:36:56 +0200
commit8e5173527f825a901eb3a51b3df7b50ffd391c9c (patch)
tree29e1ff7359d297217e38f02fdc21846dd266704e
parenta09048c39111d6b244fa1ac14524ade5ee6b9bf1 (diff)
downloadguix-patches-issue-70923.tar
guix-patches-issue-70923.tar.gz
import: hexpm: Use (guix import utils) 'maybe-inputs' procedure.issue-70923
* 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
-rw-r--r--guix/import/hexpm.scm20
1 files 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 @@ or #f if it was not found."
;;; 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-ci<?))))
+ (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 +182,7 @@ build-system, and DEPENDENCIES the inputs for the package."
(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