diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-09-01 11:45:52 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-09-01 11:45:52 +0200 |
commit | 6dd7787c391884f978a11a6673fb934fdb0e6ef1 (patch) | |
tree | 0e22b27ee7419e90fc2f1eee6087fd0c7ddfe426 /guix | |
parent | 4c1eddf766e5fa71dca032a191f415715cd2c169 (diff) | |
download | gnu-guix-6dd7787c391884f978a11a6673fb934fdb0e6ef1.tar gnu-guix-6dd7787c391884f978a11a6673fb934fdb0e6ef1.tar.gz |
Add a `guile-for-build' parameter to `build-expression->derivation'.
* guix/derivations.scm (%guile-for-build): Use `nixpkgs-derivation*'
instead of `nixpkgs-derivation'.
(build-expression->derivation): New `guile-for-build' keyword
parameter. Use it.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/derivations.scm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm index d7f1f3764c..213d9d5586 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -440,7 +440,7 @@ known in advance, such as a file download." (define %guile-for-build ;; The derivation of the Guile to be used within the build environment, ;; when using `build-expression->derivation'. - (make-parameter (false-if-exception (nixpkgs-derivation "guile")))) + (make-parameter (false-if-exception (nixpkgs-derivation* "guile")))) (define* (imported-files store files #:key (name "file-import") (system (%current-system))) @@ -509,7 +509,8 @@ search path." #:key (outputs '("out")) hash hash-algo (env-vars '()) - (modules '())) + (modules '()) + guile-for-build) "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 @@ -519,9 +520,13 @@ 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." +failed. + +EXP is built using GUILE-FOR-BUILD (a derivation). When GUILE-FOR-BUILD is +omitted or is #f, the value of the `%guile-for-build' fluid is used instead." (define guile - (string-append (derivation-path->output-path (%guile-for-build)) + (string-append (derivation-path->output-path (or guile-for-build + (%guile-for-build))) "/bin/guile")) (define module-form? @@ -579,7 +584,7 @@ failed." ,@(if mod-dir `("-L" ,mod-dir) '()) ,builder) env-vars - `((,(%guile-for-build)) + `((,(or guile-for-build (%guile-for-build))) (,builder) ,@(map cdr inputs) ,@(if mod-drv `((,mod-drv)) '())) |