GNU bug report logs - #48634
[PATCH] import: opam: Generate license for package.

Previous Next

Package: guix-patches;

Reported by: Xinglu Chen <public <at> yoctocell.xyz>

Date: Mon, 24 May 2021 21:25:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48634 in the body.
You can then email your comments to 48634 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#48634; Package guix-patches. (Mon, 24 May 2021 21:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Xinglu Chen <public <at> yoctocell.xyz>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 24 May 2021 21:25:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Xinglu Chen <public <at> yoctocell.xyz>
To: guix-patches <at> gnu.org
Subject: [PATCH] import: opam: Generate license for package.
Date: Mon, 24 May 2021 23:24:28 +0200
* 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 <at> lepiller.eu>
 ;;; Copyright © 2020 Martin Becze <mjbecze <at> riseup.net>
+;;; Copyright © 2021 Xinglu Chen <public <at> 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 <at> lepiller.eu>
+;;; Copyright © 2021 Xinglu Chen <public <at> 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




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 28 May 2021 09:24:02 GMT) Full text and rfc822 format available.

Notification sent to Xinglu Chen <public <at> yoctocell.xyz>:
bug acknowledged by developer. (Fri, 28 May 2021 09:24:02 GMT) Full text and rfc822 format available.

Message #10 received at 48634-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Xinglu Chen <public <at> yoctocell.xyz>
Cc: 48634-done <at> debbugs.gnu.org
Subject: Re: bug#48634: [PATCH] import: opam: Generate license for package.
Date: Fri, 28 May 2021 11:23:45 +0200
Hi,

Xinglu Chen <public <at> 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’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 25 Jun 2021 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 277 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.