import: print: Honor the outputs of inputs (!).
Fixes <http://bugs.gnu.org/35893>. Reported by Jesse Gibbons <jgibbons2357@gmail.com>. * guix/import/print.scm (package->code)[package-lists->code]: Preserve OUT in the result. * tests/print.scm (define-with-source): New macro. (pkg): Use it. (pkg-source): New variable. (pkg-with-inputs, pkg-with-inputs-source): New variables. ("simple package"): Refer to 'pkg-source'. ("package with inputs"): New test.
This commit is contained in:
parent
d998902214
commit
c0a4db6697
|
@ -94,12 +94,13 @@ when evaluated."
|
||||||
(map (match-lambda
|
(map (match-lambda
|
||||||
((label pkg . out)
|
((label pkg . out)
|
||||||
(let ((mod (package-module-name pkg)))
|
(let ((mod (package-module-name pkg)))
|
||||||
(list label
|
(cons* label
|
||||||
;; FIXME: using '@ certainly isn't pretty, but it
|
;; FIXME: using '@ certainly isn't pretty, but it
|
||||||
;; avoids having to import the individual package
|
;; avoids having to import the individual package
|
||||||
;; modules.
|
;; modules.
|
||||||
(list 'unquote
|
(list 'unquote
|
||||||
(list '@ mod (variable-name pkg mod)))))))
|
(list '@ mod (variable-name pkg mod)))
|
||||||
|
out))))
|
||||||
lsts)))
|
lsts)))
|
||||||
|
|
||||||
(let ((name (package-name package))
|
(let ((name (package-name package))
|
||||||
|
|
|
@ -24,9 +24,14 @@
|
||||||
#:use-module (guix licenses)
|
#:use-module (guix licenses)
|
||||||
#:use-module (srfi srfi-64))
|
#:use-module (srfi srfi-64))
|
||||||
|
|
||||||
|
(define-syntax-rule (define-with-source object source expr)
|
||||||
|
(begin
|
||||||
|
(define object expr)
|
||||||
|
(define source 'expr)))
|
||||||
|
|
||||||
(test-begin "print")
|
(test-begin "print")
|
||||||
|
|
||||||
(define pkg
|
(define-with-source pkg pkg-source
|
||||||
(package
|
(package
|
||||||
(name "test")
|
(name "test")
|
||||||
(version "1.2.3")
|
(version "1.2.3")
|
||||||
|
@ -43,9 +48,8 @@
|
||||||
(description "This is a dummy package.")
|
(description "This is a dummy package.")
|
||||||
(license gpl3+)))
|
(license gpl3+)))
|
||||||
|
|
||||||
(test-equal "simple package"
|
(define-with-source pkg-with-inputs pkg-with-inputs-source
|
||||||
(package->code pkg)
|
(package
|
||||||
'(package
|
|
||||||
(name "test")
|
(name "test")
|
||||||
(version "1.2.3")
|
(version "1.2.3")
|
||||||
(source (origin
|
(source (origin
|
||||||
|
@ -56,9 +60,19 @@
|
||||||
(base32
|
(base32
|
||||||
"070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah"))))
|
"070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah"))))
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
|
(inputs `(("coreutils" ,(@ (gnu packages base) coreutils))
|
||||||
|
("glibc" ,(@ (gnu packages base) glibc) "debug")))
|
||||||
(home-page "http://gnu.org")
|
(home-page "http://gnu.org")
|
||||||
(synopsis "Dummy")
|
(synopsis "Dummy")
|
||||||
(description "This is a dummy package.")
|
(description "This is a dummy package.")
|
||||||
(license gpl3+)))
|
(license gpl3+)))
|
||||||
|
|
||||||
|
(test-equal "simple package"
|
||||||
|
pkg-source
|
||||||
|
(package->code pkg))
|
||||||
|
|
||||||
|
(test-equal "package with inputs"
|
||||||
|
pkg-with-inputs-source
|
||||||
|
(package->code pkg-with-inputs))
|
||||||
|
|
||||||
(test-end "print")
|
(test-end "print")
|
||||||
|
|
Loading…
Reference in New Issue