summaryrefslogtreecommitdiff
path: root/guix/derivations.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-02-20 21:08:09 +0100
committerLudovic Courtès <ludo@gnu.org>2013-02-20 21:08:09 +0100
commit8dcb0c55ab90c5e994f5adf1dfc68180197489bc (patch)
tree68f70516d7fdcb06959f6c101e24cf7c1379b320 /guix/derivations.scm
parentf6d7be1e47961d78b7b94f9368bae3a716f73b74 (diff)
derivations: Add a search path parameter for module derivations.
* guix/derivations.scm (imported-modules, compiled-modules): Add a `module-path' parameter. Use it instead of %LOAD-PATH.
Diffstat (limited to 'guix/derivations.scm')
-rw-r--r--guix/derivations.scm13
1 files changed, 8 insertions, 5 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm
index 60d57afa12..18a637ae5a 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -558,9 +558,10 @@ system, imported, and appears under FINAL-PATH in the resulting store path."
(define* (imported-modules store modules
#:key (name "module-import")
(system (%current-system))
- (guile (%guile-for-build)))
+ (guile (%guile-for-build))
+ (module-path %load-path))
"Return a derivation that contains the source files of MODULES, a list of
-module names such as `(ice-9 q)'. All of MODULES must be in the current
+module names such as `(ice-9 q)'. All of MODULES must be in the MODULE-PATH
search path."
;; TODO: Determine the closure of MODULES, build the `.go' files,
;; canonicalize the source files through read/write, etc.
@@ -568,7 +569,7 @@ search path."
(let ((f (string-append
(string-join (map symbol->string m) "/")
".scm")))
- (cons f (search-path %load-path f))))
+ (cons f (search-path module-path f))))
modules)))
(imported-files store files #:name name #:system system
#:guile guile)))
@@ -576,13 +577,15 @@ search path."
(define* (compiled-modules store modules
#:key (name "module-import-compiled")
(system (%current-system))
- (guile (%guile-for-build)))
+ (guile (%guile-for-build))
+ (module-path %load-path))
"Return a derivation that builds a tree containing the `.go' files
corresponding to MODULES. All the MODULES are built in a context where
they can refer to each other."
(let* ((module-drv (imported-modules store modules
#:system system
- #:guile guile))
+ #:guile guile
+ #:module-path module-path))
(module-dir (derivation-path->output-path module-drv))
(files (map (lambda (m)
(let ((f (string-join (map symbol->string m)