unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#49627] [PATCH] import/print: package->code: Fix license object.
@ 2021-07-18 20:01 itd
  2021-07-19 14:57 ` bug#49627: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: itd @ 2021-07-18 20:01 UTC (permalink / raw)
  To: 49627

* 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





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

* bug#49627: [PATCH] import/print: package->code: Fix license object.
  2021-07-18 20:01 [bug#49627] [PATCH] import/print: package->code: Fix license object itd
@ 2021-07-19 14:57 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2021-07-19 14:57 UTC (permalink / raw)
  To: itd; +Cc: 49627-done

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’.




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

end of thread, other threads:[~2021-07-19 15:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-18 20:01 [bug#49627] [PATCH] import/print: package->code: Fix license object itd
2021-07-19 14:57 ` bug#49627: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).