From: itd <itd@net.in.tum.de>
To: 49627@debbugs.gnu.org
Subject: [bug#49627] [PATCH] import/print: package->code: Fix license object.
Date: Sun, 18 Jul 2021 22:01:00 +0200 [thread overview]
Message-ID: <87h7gr5r43.fsf@localhost> (raw)
* 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
next reply other threads:[~2021-07-18 23:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-18 20:01 itd [this message]
2021-07-19 14:57 ` bug#49627: [PATCH] import/print: package->code: Fix license object Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h7gr5r43.fsf@localhost \
--to=itd@net.in.tum.de \
--cc=49627@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.