Subject: [PATCH] import/print: package->code: Fix license object.

From: itd <[email-masked]>
Date: Sun, 18 Jul 2021 22:01:00 +0200

* 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(-)

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
-- 
2.30.2