all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#48634] [PATCH] import: opam: Generate license for package.
@ 2021-05-24 21:24 Xinglu Chen
  2021-05-28  9:23 ` bug#48634: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Xinglu Chen @ 2021-05-24 21:24 UTC (permalink / raw)
  To: 48634

* guix/import/opam.scm (opam->guix-package): Generate license for the
‘license’ field.
* tests/opam.scm (test-opam-file): Update accordingly.
("opam->guix-package"): Likewise.
---
It uses SPDX itentifiers.

   <https://opam.ocaml.org/doc/Manual.html#opamfield-license>
   
 guix/import/opam.scm | 4 +++-
 tests/opam.scm       | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index 670973b193..0201376457 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -335,7 +336,8 @@ or #f on failure."
                        (home-page ,(metadata-ref opam-content "homepage"))
                        (synopsis ,(metadata-ref opam-content "synopsis"))
                        (description ,(metadata-ref opam-content "description"))
-                       (license #f))
+                       (license ,(spdx-string->license
+                                  (metadata-ref opam-content "license"))))
                     (filter
                       (lambda (name)
                         (not (member name '("dune" "jbuilder"))))
diff --git a/tests/opam.scm b/tests/opam.scm
index 11984b56a6..f1e3b70cb0 100644
--- a/tests/opam.scm
+++ b/tests/opam.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
+;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -55,6 +56,7 @@ depends: [
 synopsis: \"Some example package\"
 description: \"\"\"
 This package is just an example.\"\"\"
+license: \"BSD-3-Clause\"
 url {
   src: \"https://example.org/foo-1.0.0.tar.gz\"
   checksum: \"md5=74c6e897658e820006106f45f736381f\"
@@ -109,7 +111,7 @@ url {
                    ('home-page "https://example.org/")
                    ('synopsis "Some example package")
                    ('description "This package is just an example.")
-                   ('license #f))
+                   ('license 'license:bsd-3))
                  (string=? (bytevector->nix-base32-string
                             test-source-hash)
                            hash))

base-commit: 488fc3d2e6e0a3d5fc4fe747587cf831989ece58
-- 
2.31.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#48634: [PATCH] import: opam: Generate license for package.
  2021-05-24 21:24 [bug#48634] [PATCH] import: opam: Generate license for package Xinglu Chen
@ 2021-05-28  9:23 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2021-05-28  9:23 UTC (permalink / raw)
  To: Xinglu Chen; +Cc: 48634-done

Hi,

Xinglu Chen <public@yoctocell.xyz> skribis:

> * guix/import/opam.scm (opam->guix-package): Generate license for the
> ‘license’ field.
> * tests/opam.scm (test-opam-file): Update accordingly.
> ("opam->guix-package"): Likewise.

Applied, thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-28  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-24 21:24 [bug#48634] [PATCH] import: opam: Generate license for package Xinglu Chen
2021-05-28  9:23 ` bug#48634: " Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.