summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-12-10 16:35:41 +0100
committerLudovic Courtès <ludo@gnu.org>2017-12-18 17:52:58 +0100
commitab25eb7caaf5571cc9f8d6397a1eae127d7e29d1 (patch)
tree0656aa992f2f0bf5775076ac1ef5bd948c2b02ca
parent4e9dfe399b9f5bf3d90d3eeae2848973294cfa62 (diff)
downloadguix-ab25eb7caaf5571cc9f8d6397a1eae127d7e29d1.tar.gz
gexp: 'computed-file' has a new #:guile parameter.
* guix/gexp.scm (<computed-file>)[guile]: New field.
(computed-file): Add #:guile.
(computed-file-compiler): Honor 'guile'.
-rw-r--r--guix/gexp.scm16
1 files changed, 11 insertions, 5 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 1929947d95..f005c4d296 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -343,28 +343,34 @@ This is the declarative counterpart of 'text-file'."
      (text-file name content references))))
 
 (define-record-type <computed-file>
-  (%computed-file name gexp options)
+  (%computed-file name gexp guile options)
   computed-file?
   (name       computed-file-name)                 ;string
   (gexp       computed-file-gexp)                 ;gexp
+  (guile      computed-file-guile)                ;<package>
   (options    computed-file-options))             ;list of arguments
 
 (define* (computed-file name gexp
-                        #:key (options '(#:local-build? #t)))
+                        #:key guile (options '(#:local-build? #t)))
   "Return an object representing the store item NAME, a file or directory
 computed by GEXP.  OPTIONS is a list of additional arguments to pass
 to 'gexp->derivation'.
 
 This is the declarative counterpart of 'gexp->derivation'."
-  (%computed-file name gexp options))
+  (%computed-file name gexp guile options))
 
 (define-gexp-compiler (computed-file-compiler (file <computed-file>)
                                               system target)
   ;; Compile FILE by returning a derivation whose build expression is its
   ;; gexp.
   (match file
-    (($ <computed-file> name gexp options)
-     (apply gexp->derivation name gexp options))))
+    (($ <computed-file> name gexp guile options)
+     (if guile
+         (mlet %store-monad ((guile (lower-object guile system
+                                                  #:target target)))
+           (apply gexp->derivation name gexp #:guile-for-build guile
+                  options))
+         (apply gexp->derivation name gexp options)))))
 
 (define-record-type <program-file>
   (%program-file name gexp guile)