summaryrefslogtreecommitdiff
path: root/guix/gexp.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-05-01 16:15:00 +0200
committerLudovic Courtès <ludo@gnu.org>2014-05-01 22:31:36 +0200
commit79c0c8cdf74cc0587187aa8f25af29b21fe91ba2 (patch)
treecc9f5e66672c7e1b35f0a6804e1420277549813b /guix/gexp.scm
parent696893801c9d4b83adc9a15ce60103142e7c1a79 (diff)
gexp: Add support for 'origin?' objects in 'ungexp' forms.
* guix/gexp.scm (lower-inputs, gexp-inputs, gexp->sexp, canonicalize-reference): Add 'origin?' case. * guix/monads.scm (origin->derivation): New procedure. * tests/gexp.scm ("one input origin"): New test.
Diffstat (limited to 'guix/gexp.scm')
-rw-r--r--guix/gexp.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 79b6ec7085..ff4fd3f289 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -85,6 +85,9 @@ input list as a monadic value."
(((? package? package) sub-drv ...)
(mlet %store-monad ((drv (package->derivation package)))
(return `(,drv ,@sub-drv))))
+ (((? origin? origin) sub-drv ...)
+ (mlet %store-monad ((drv (origin->derivation origin)))
+ (return `(,drv ,@sub-drv))))
(input
(return input)))
inputs))))
@@ -158,6 +161,8 @@ The other arguments are as for 'derivation'."
(cons ref result))
(((? package?) (? string?))
(cons ref result))
+ (((? origin?) (? string?))
+ (cons ref result))
((? gexp? exp)
(append (gexp-inputs exp) result))
(((? string? file))
@@ -199,6 +204,9 @@ and in the current monad setting (system type, etc.)"
(return (derivation->output-path drv output)))
(((? package? p) (? string? output))
(package-file p #:output output))
+ (((? origin? o) (? string? output))
+ (mlet %store-monad ((drv (origin->derivation o)))
+ (return (derivation->output-path drv output))))
(($ <output-ref> output)
;; Output file names are not known in advance but the daemon defines
;; an environment variable for each of them at build time, so use
@@ -224,10 +232,14 @@ package/derivation references."
(match ref
((? package? p)
`(,p "out"))
+ ((? origin? o)
+ `(,o "out"))
((? derivation? d)
`(,d "out"))
(((? package?) (? string?))
ref)
+ (((? origin?) (? string?))
+ ref)
(((? derivation?) (? string?))
ref)
((? string? s)