aboutsummaryrefslogtreecommitdiff
path: root/guix/gexp.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-05-01 18:53:16 +0200
committerLudovic Courtès <ludo@gnu.org>2014-05-01 22:31:36 +0200
commit53e89b1732d2935d69a199c0213568ae1e66eb60 (patch)
treef234aeb5a1ac3067de933be69600063a8e608d22 /guix/gexp.scm
parent79c0c8cdf74cc0587187aa8f25af29b21fe91ba2 (diff)
downloadgnu-guix-53e89b1732d2935d69a199c0213568ae1e66eb60.tar
gnu-guix-53e89b1732d2935d69a199c0213568ae1e66eb60.tar.gz
monads, gexp: Remove unintended dependency on (gnu packages …).
* guix/gexp.scm (gexp->derivation, gexp->script): Use 'default-guile' instead of an explicit reference to 'guile-final'. (default-guile): New procedure. * guix/monads.scm (run-with-store)[default-guile]: New procedure. Use it.
Diffstat (limited to 'guix/gexp.scm')
-rw-r--r--guix/gexp.scm14
1 files changed, 9 insertions, 5 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm
index ff4fd3f289..a2ba50d957 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -129,9 +129,8 @@ The other arguments are as for 'derivation'."
(return #f)))
(guile (if guile-for-build
(return guile-for-build)
- (package->derivation
- (@ (gnu packages base) guile-final)
- system))))
+ (package->derivation (default-guile)
+ system))))
(raw-derivation name
(string-append (derivation->output-path guile)
"/bin/guile")
@@ -336,9 +335,14 @@ package/derivation references."
;;; Convenience procedures.
;;;
+(define (default-guile)
+ ;; Lazily resolve 'guile-final'. This module must not refer to (gnu …)
+ ;; modules directly, to avoid circular dependencies, hence this hack.
+ (module-ref (resolve-interface '(gnu packages base))
+ 'guile-final))
+
(define* (gexp->script name exp
- #:key (modules '())
- (guile (@ (gnu packages base) guile-final)))
+ #:key (modules '()) (guile (default-guile)))
"Return an executable script NAME that runs EXP using GUILE with MODULES in
its search path."
(mlet %store-monad ((modules (imported-modules modules))