mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
import: npm-binary: Handle vector of licenses.
* guix/import/npm-binary.scm (<package-revision>)[license]: Handle the case where a vector of licenses is used. * tests/npm-binary.scm (foo-json): Redefine as a procedure with license keyword. (test-source-hash): Redefine with direct reference to test-source. (foo-sexp): Redefine as a procedure with license keyword. (npm-binary->guix-package test): Use foo-json and foo-sexp. (npm-binary->guix-package with multiple licenses): Add test. Change-Id: I9d6adb2ae2820678260fed1a67e91e22feb448b8 Signed-off-by: Jelle Licht <jlicht@fsfe.org>
This commit is contained in:
parent
8aca24f41e
commit
d3086f85e0
2 changed files with 102 additions and 72 deletions
|
@ -105,7 +105,17 @@
|
|||
(match (assoc "type" alist)
|
||||
((_ . (? string? type))
|
||||
(spdx-string->license type))
|
||||
(_ #f)))))
|
||||
(_ #f)))
|
||||
((? vector? vector)
|
||||
(match (filter-map
|
||||
(match-lambda
|
||||
((? string? str) (spdx-string->license str))
|
||||
(_ #f))
|
||||
(vector->list vector))
|
||||
((license rest ...)
|
||||
(cons* license rest))
|
||||
((license)
|
||||
license)))))
|
||||
(description package-revision-description ;string
|
||||
"description" empty-or-string)
|
||||
(dist package-revision-dist "dist" json->dist)) ;dist
|
||||
|
@ -250,7 +260,9 @@
|
|||
(home-page ,home-page)
|
||||
(synopsis ,synopsis)
|
||||
(description ,description)
|
||||
(license ,license))
|
||||
(license ,(if (list? license)
|
||||
`(list ,@license)
|
||||
license)))
|
||||
(map (match-lambda (($ <package-revision> name version)
|
||||
(list name (semver->string version))))
|
||||
resolved-deps))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue