mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
import: print: Quasiquote properties
* guix/import/print.scm (package->code): Quasiquote properties. * tests/print.scm (pkg-with-properties, pkg-with-properties-source): New variables. ("package with properties"): New test Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
61bd7bf469
commit
8b2119a5e4
2 changed files with 25 additions and 1 deletions
|
@ -200,7 +200,8 @@ (define (inputs->code inputs)
|
|||
(source ,(source->code source version))
|
||||
,@(match properties
|
||||
(() '())
|
||||
(_ `((properties ,properties))))
|
||||
(_ `((properties
|
||||
,(list 'quasiquote (object->code properties #t))))))
|
||||
,@(if replacement
|
||||
`((replacement ,replacement))
|
||||
'())
|
||||
|
|
|
@ -139,6 +139,25 @@ (define-with-source pkg-with-arguments pkg-with-arguments-source
|
|||
(description "This is a dummy package.")
|
||||
(license license:gpl3+)))
|
||||
|
||||
(define-with-source pkg-with-properties pkg-with-properties-source
|
||||
(package
|
||||
(name "test")
|
||||
(version "1.2.3")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "file:///tmp/test-"
|
||||
version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah"))))
|
||||
(properties
|
||||
`((hidden? . #t) (upstream-name "test-upstream")))
|
||||
(build-system (@ (guix build-system gnu) gnu-build-system))
|
||||
(home-page "http://gnu.org")
|
||||
(synopsis "Dummy")
|
||||
(description "This is a dummy package.")
|
||||
(license license:gpl3+)))
|
||||
|
||||
(test-equal "simple package"
|
||||
`(define-public test ,pkg-source)
|
||||
(package->code pkg))
|
||||
|
@ -159,4 +178,8 @@ (define-with-source pkg-with-arguments pkg-with-arguments-source
|
|||
`(define-public test ,pkg-with-arguments-source)
|
||||
(package->code pkg-with-arguments))
|
||||
|
||||
(test-equal "package with properties"
|
||||
`(define-public test ,pkg-with-properties-source)
|
||||
(package->code pkg-with-properties))
|
||||
|
||||
(test-end "print")
|
||||
|
|
Loading…
Reference in a new issue