diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-03-23 18:35:32 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-03-23 18:41:07 +0100 |
commit | 427ec19e8887b8036690734564a86496000e12a6 (patch) | |
tree | ce9262cc6a68c9e1a3f23cc3024b32fe9a8d585f /guix | |
parent | 1ae16033f34cebe802023922436883867010850f (diff) | |
download | gnu-guix-427ec19e8887b8036690734564a86496000e12a6.tar gnu-guix-427ec19e8887b8036690734564a86496000e12a6.tar.gz |
gexp: 'program-file' has a new #:module-path parameter.
* guix/gexp.scm (<program-file>): Add 'path' field.
(program-file): Add #:module-path parameter and honor it.
(program-file-compiler): Honor the 'path' field.
* tests/gexp.scm ("program-file #:module-path"): New test.
* doc/guix.texi (G-Expressions): Update.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/gexp.scm | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm index 4a2e5a682e..b47965d9eb 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -60,6 +60,7 @@ program-file-name program-file-gexp program-file-guile + program-file-module-path scheme-file scheme-file? @@ -380,25 +381,28 @@ This is the declarative counterpart of 'gexp->derivation'." (apply gexp->derivation name gexp options))))) (define-record-type <program-file> - (%program-file name gexp guile) + (%program-file name gexp guile path) program-file? (name program-file-name) ;string (gexp program-file-gexp) ;gexp - (guile program-file-guile)) ;package + (guile program-file-guile) ;package + (path program-file-module-path)) ;list of strings -(define* (program-file name gexp #:key (guile #f)) +(define* (program-file name gexp #:key (guile #f) (module-path %load-path)) "Return an object representing the executable store item NAME that runs -GEXP. GUILE is the Guile package used to execute that script. +GEXP. GUILE is the Guile package used to execute that script. Imported +modules of GEXP are looked up in MODULE-PATH. This is the declarative counterpart of 'gexp->script'." - (%program-file name gexp guile)) + (%program-file name gexp guile module-path)) (define-gexp-compiler (program-file-compiler (file <program-file>) system target) ;; Compile FILE by returning a derivation that builds the script. (match file - (($ <program-file> name gexp guile) + (($ <program-file> name gexp guile module-path) (gexp->script name gexp + #:module-path module-path #:guile (or guile (default-guile)))))) (define-record-type <scheme-file> |