guix: import: opam: Handle list of licenses.

Fixes <https://issues.guix.gnu.org/issue/66461>.
Reported by Simon Tournier <zimon.toutoune@gmail.com>.

* guix/import/opam.scm (opam->guix-package): Handle lists of licenses.

Signed-off-by: Simon Tournier <zimon.toutoune@gmail.com>
This commit is contained in:
Josselin Poiret 2023-10-15 11:38:18 +02:00 committed by Simon Tournier
parent daaebc6457
commit dcc5c34504
No known key found for this signature in database
GPG key ID: 92F1D22C608EE7E5

View file

@ -379,8 +379,10 @@ (define* (opam->guix-package name #:key (repo '("opam")) version #:allow-other-k
(synopsis ,(metadata-ref opam-content "synopsis"))
(description ,(and=> (metadata-ref opam-content "description")
beautify-description))
(license ,(spdx-string->license
(metadata-ref opam-content "license"))))
(license ,(match (metadata-ref opam-content "license")
((('string-pat strs) ...)
`(list ,@(map spdx-string->license strs)))
((? string? str) (spdx-string->license str)))))
(filter
(lambda (name)
(not (member name '("dune" "jbuilder"))))