summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-09-01 11:33:20 +0200
committerLudovic Courtès <ludo@gnu.org>2012-09-01 11:33:20 +0200
commit4c1eddf766e5fa71dca032a191f415715cd2c169 (patch)
tree6902304e9cc01cd9ee02e3b03477573e193bc469 /guix
parentdc4e02572ec8726957402c1b0c2c6d37e2589af7 (diff)
downloadgnu-guix-4c1eddf766e5fa71dca032a191f415715cd2c169.tar
gnu-guix-4c1eddf766e5fa71dca032a191f415715cd2c169.tar.gz
Add an `env-vars' keyword parameter to `build-expression->derivation'.
* guix/derivations.scm (build-expression->derivation): New `env-vars' keyword parameter; default to '(). Use it.
Diffstat (limited to 'guix')
-rw-r--r--guix/derivations.scm11
1 files changed, 7 insertions, 4 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm
index 1013a78e7e..d7f1f3764c 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -508,15 +508,18 @@ search path."
(define* (build-expression->derivation store name system exp inputs
#:key (outputs '("out"))
hash hash-algo
+ (env-vars '())
(modules '()))
"Return a derivation that executes Scheme expression EXP as a builder for
derivation NAME. INPUTS must be a list of (NAME DRV-PATH SUB-DRV) tuples;
when SUB-DRV is omitted, \"out\" is assumed. EXP is evaluated in an
environment where %OUTPUT is bound to the main output path, %OUTPUTS is bound
to a list of output/path pairs, and where %BUILD-INPUTS is bound to an alist
-of string/output-path pairs made from INPUTS. The builder terminates by
-passing the result of EXP to `exit'; thus, when EXP returns #f, the build is
-considered to have failed."
+of string/output-path pairs made from INPUTS. Optionally, ENV-VARS is a list
+of string pairs specifying the name and value of environment variables
+visible to the builder. The builder terminates by passing the result of EXP
+to `exit'; thus, when EXP returns #f, the build is considered to have
+failed."
(define guile
(string-append (derivation-path->output-path (%guile-for-build))
"/bin/guile"))
@@ -575,7 +578,7 @@ considered to have failed."
`("--no-auto-compile"
,@(if mod-dir `("-L" ,mod-dir) '())
,builder)
- '(("HOME" . "/homeless"))
+ env-vars
`((,(%guile-for-build))
(,builder)
,@(map cdr inputs)