summaryrefslogtreecommitdiff
path: root/guix/derivations.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-08-26 22:11:04 +0200
committerLudovic Courtès <ludo@gnu.org>2013-08-26 22:20:27 +0200
commita987d2c02525efd1bf37b4bb5b5df405a06bd15c (patch)
tree65a4e9a5ec464cb3eb4ba2a08ce0656e00a59caa /guix/derivations.scm
parent3e9066fcfc1fb249eeeb2708d98ae258a38c5b2b (diff)
downloadguix-patches-a987d2c02525efd1bf37b4bb5b5df405a06bd15c.tar
guix-patches-a987d2c02525efd1bf37b4bb5b5df405a06bd15c.tar.gz
derivations: Move 3 positional parameters into keyword parameters.
* guix/derivations.scm (derivation): Turn `system', `env-vars', and `inputs' into keyword parameters. (build-expression->derivation): Adjust accordingly. * gnu/packages/bootstrap.scm (%bootstrap-guile): Likewise. * tests/derivations.scm, tests/store.scm: Likewise. * doc/guix.texi (Derivations): Likewise.
Diffstat (limited to 'guix/derivations.scm')
-rw-r--r--guix/derivations.scm36
1 files changed, 21 insertions, 15 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm
index 8ddef117d4..3d7a30aaa8 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -497,8 +497,11 @@ the derivation called NAME with hash HASH."
name
(string-append name "-" output))))
-(define* (derivation store name system builder args env-vars inputs
- #:key (outputs '("out")) hash hash-algo hash-mode)
+(define* (derivation store name builder args
+ #:key
+ (system (%current-system)) (env-vars '())
+ (inputs '()) (outputs '("out"))
+ hash hash-algo hash-mode)
"Build a derivation with the given arguments. Return the resulting
store path and <derivation> object. When HASH, HASH-ALGO, and HASH-MODE
are given, a fixed-output derivation is created---i.e., one whose result is
@@ -747,8 +750,8 @@ omitted or is #f, the value of the `%guile-for-build' fluid is used instead."
(define module-form?
(match-lambda
- (((or 'define-module 'use-modules) _ ...) #t)
- (_ #f)))
+ (((or 'define-module 'use-modules) _ ...) #t)
+ (_ #f)))
(define source-path
;; When passed an input that is a source, return its path; otherwise
@@ -833,22 +836,25 @@ omitted or is #f, the value of the `%guile-for-build' fluid is used instead."
#:system system)))
(go-dir (and go-drv
(derivation-path->output-path go-drv))))
- (derivation store name system guile
+ (derivation store name guile
`("--no-auto-compile"
,@(if mod-dir `("-L" ,mod-dir) '())
,builder)
+ #:system system
+
+ #:inputs `((,(or guile-for-build (%guile-for-build)))
+ (,builder)
+ ,@(map cdr inputs)
+ ,@(if mod-drv `((,mod-drv) (,go-drv)) '()))
+
;; When MODULES is non-empty, shamelessly clobber
;; $GUILE_LOAD_COMPILED_PATH.
- (if go-dir
- `(("GUILE_LOAD_COMPILED_PATH" . ,go-dir)
- ,@(alist-delete "GUILE_LOAD_COMPILED_PATH"
- env-vars))
- env-vars)
-
- `((,(or guile-for-build (%guile-for-build)))
- (,builder)
- ,@(map cdr inputs)
- ,@(if mod-drv `((,mod-drv) (,go-drv)) '()))
+ #:env-vars (if go-dir
+ `(("GUILE_LOAD_COMPILED_PATH" . ,go-dir)
+ ,@(alist-delete "GUILE_LOAD_COMPILED_PATH"
+ env-vars))
+ env-vars)
+
#:hash hash #:hash-algo hash-algo
#:outputs outputs)))