summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-10-09 18:52:37 +0200
committerLudovic Courtès <ludo@gnu.org>2018-10-09 18:54:12 +0200
commitb33e191c86b7638517ea838b63a54d031a033554 (patch)
tree46c73cb4a9c6f224de06278e02112ba68f6eb2b6 /guix
parent64965a068d82d1730097e61f6443a8812051934b (diff)
guix build: '-f' accepts file-like objects.
* guix/scripts/build.scm (options->things-to-build)[validate-type]: Check for 'file-like?'. (options->derivations): Accept 'file-like?'. * tests/guix-build.sh: Add a test with 'computed-file'. * doc/guix.texi (Additional Build Options): Mention file-like objects.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/build.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 5a6ba62bc3..f3aa5512d5 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -623,7 +623,7 @@ must be one of 'package', 'all', or 'transitive'~%")
"Read the arguments from OPTS and return a list of high-level objects to
build---packages, gexps, derivations, and so on."
(define (validate-type x)
- (unless (or (package? x) (derivation? x) (gexp? x) (procedure? x))
+ (unless (or (derivation? x) (file-like? x) (gexp? x) (procedure? x))
(leave (G_ "~s: not something we can build~%") x)))
(define (ensure-list x)
@@ -700,6 +700,10 @@ package '~a' has no source~%")
(set-guile-for-build (default-guile))
(proc))
#:system system)))
+ ((? file-like? obj)
+ (list (run-with-store store
+ (lower-object obj system
+ #:target (assoc-ref opts 'target)))))
((? gexp? gexp)
(list (run-with-store store
(mbegin %store-monad