diff mbox series

[bug#49627] import/print: package->code: Fix license object.

Message ID 87h7gr5r43.fsf@localhost
State Accepted
Headers show
Series [bug#49627] import/print: package->code: Fix license object. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

itd July 18, 2021, 8:01 p.m. UTC
* guix/import/print.scm (package->code)<license->code>: Update generated
licence object to match record constructor.
---

Hi,

given the following example (please note the fake license):
```bash
(
printf '%s\n'\
	"(define-module (out) #:use-module (guix packages) #:use-module (guix download))"\
	"(define license (@@ (guix licenses) license))"  # see commit 1597613488
guix import json /dev/stdin <<EOF
{
  "name": "hello",
  "version": "2.10",
  "source": "mirror://gnu/hello/hello-2.10.tar.gz",
  "build-system": "gnu",
  "home-page": "https://www.gnu.org/software/hello/",
  "synopsis": "Hello, GNU world: An example GNU package",
  "description": "GNU Hello prints a greeting.",
  "license": "a-license",
  "native-inputs": ["gettext"]
}
EOF
) > out.scm
guix build -L . hello
```

This example fails to build for me with error:
```bash
guix build: warning: failed to load '(out)':
Wrong type to apply: "hello"
```

I suspect this to be caused by the generated license definition:
```guile
    (license
      (license
        (name "FSDG-compatible")
        (uri "a-license")
        (comment "")))))
```

After patching, the package builds successfully with the following
license definition:
```guile
    (license
      (license "FSDG-compatible" "a-license" ""))))
```

Regards
itd

 guix/import/print.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Ludovic Courtès July 19, 2021, 2:57 p.m. UTC | #1
Hi,

itd <itd@net.in.tum.de> skribis:

> * guix/import/print.scm (package->code)<license->code>: Update generated
> licence object to match record constructor.

Applied, thanks!

Ludo’.
diff mbox series

Patch

diff --git a/guix/import/print.scm b/guix/import/print.scm
index dcc38abc70..0310739b3a 100644
--- a/guix/import/print.scm
+++ b/guix/import/print.scm
@@ -60,9 +60,9 @@  when evaluated."
       (if var
           (symbol-append 'license: var)
           `(license
-            (name ,(license-name lic))
-            (uri ,(license-uri lic))
-            (comment ,(license-comment lic))))))
+            ,(license-name lic)
+            ,(license-uri lic)
+            ,(license-comment lic)))))
 
   (define (search-path-specification->code spec)
     `(search-path-specification