diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-04-22 15:24:47 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-04-22 19:23:57 +0200 |
commit | 34faf63ebc9221f5cac460bc54237ea8436d5046 (patch) | |
tree | 72fcf08ec92d539392f7713eb22eaf3a5d42dceb /guix/gexp.scm | |
parent | f916ac128a2c4f65f06f6a5148a4862855754d1a (diff) | |
download | patches-34faf63ebc9221f5cac460bc54237ea8436d5046.tar patches-34faf63ebc9221f5cac460bc54237ea8436d5046.tar.gz |
gexp: Add 'load-path?' field to <scheme-file>.
* guix/gexp.scm (<scheme-file>)[load-path?]: New field.
(scheme-file): Add #:set-load-path? and honor it.
(scheme-file-compiler): Pass #:set-load-path? to 'gexp->file'.
* doc/guix.texi (G-Expressions): Document it.
Diffstat (limited to 'guix/gexp.scm')
-rw-r--r-- | guix/gexp.scm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm index 4ac0411da1..c320065546 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -472,24 +472,26 @@ This is the declarative counterpart of 'gexp->script'." #:target target)))) (define-record-type <scheme-file> - (%scheme-file name gexp splice?) + (%scheme-file name gexp splice? load-path?) scheme-file? (name scheme-file-name) ;string (gexp scheme-file-gexp) ;gexp - (splice? scheme-file-splice?)) ;Boolean + (splice? scheme-file-splice?) ;Boolean + (load-path? scheme-file-set-load-path?)) ;Boolean -(define* (scheme-file name gexp #:key splice?) +(define* (scheme-file name gexp #:key splice? (set-load-path? #t)) "Return an object representing the Scheme file NAME that contains GEXP. This is the declarative counterpart of 'gexp->file'." - (%scheme-file name gexp splice?)) + (%scheme-file name gexp splice? set-load-path?)) (define-gexp-compiler (scheme-file-compiler (file <scheme-file>) system target) ;; Compile FILE by returning a derivation that builds the file. (match file - (($ <scheme-file> name gexp splice?) + (($ <scheme-file> name gexp splice? set-load-path?) (gexp->file name gexp + #:set-load-path? set-load-path? #:splice? splice? #:system system #:target target)))) |