gexp: 'program-file' and 'gexp->script' no longer have #:modules.
* guix/gexp.scm (<program-file>)[modules]: Remove. (program-file): Remove #:modules and adjust accordingly. (program-file-compiler): Likewise. (gexp->script): Likewise.
This commit is contained in:
parent
a769bffb65
commit
9c14a487bb
|
@ -3908,7 +3908,7 @@ This is the declarative counterpart of @code{gexp->derivation}.
|
||||||
|
|
||||||
@deffn {Monadic Procedure} gexp->script @var{name} @var{exp}
|
@deffn {Monadic Procedure} gexp->script @var{name} @var{exp}
|
||||||
Return an executable script @var{name} that runs @var{exp} using
|
Return an executable script @var{name} that runs @var{exp} using
|
||||||
@var{guile} with @var{modules} in its search path.
|
@var{guile}, with @var{exp}'s imported modules in its search path.
|
||||||
|
|
||||||
The example below builds a script that simply invokes the @command{ls}
|
The example below builds a script that simply invokes the @command{ls}
|
||||||
command:
|
command:
|
||||||
|
@ -3934,10 +3934,10 @@ executable file @file{/gnu/store/@dots{}-list-files} along these lines:
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Scheme Procedure} program-file @var{name} @var{exp} @
|
@deffn {Scheme Procedure} program-file @var{name} @var{exp} @
|
||||||
[#:modules '()] [#:guile #f]
|
[#:guile #f]
|
||||||
Return an object representing the executable store item @var{name} that
|
Return an object representing the executable store item @var{name} that
|
||||||
runs @var{gexp}. @var{guile} is the Guile package used to execute that
|
runs @var{gexp}. @var{guile} is the Guile package used to execute that
|
||||||
script, and @var{modules} is the list of modules visible to that script.
|
script.
|
||||||
|
|
||||||
This is the declarative counterpart of @code{gexp->script}.
|
This is the declarative counterpart of @code{gexp->script}.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
|
@ -56,7 +56,6 @@
|
||||||
program-file?
|
program-file?
|
||||||
program-file-name
|
program-file-name
|
||||||
program-file-gexp
|
program-file-gexp
|
||||||
program-file-modules
|
|
||||||
program-file-guile
|
program-file-guile
|
||||||
|
|
||||||
scheme-file
|
scheme-file
|
||||||
|
@ -296,29 +295,25 @@ This is the declarative counterpart of 'gexp->derivation'."
|
||||||
(apply gexp->derivation name gexp options))))
|
(apply gexp->derivation name gexp options))))
|
||||||
|
|
||||||
(define-record-type <program-file>
|
(define-record-type <program-file>
|
||||||
(%program-file name gexp modules guile)
|
(%program-file name gexp guile)
|
||||||
program-file?
|
program-file?
|
||||||
(name program-file-name) ;string
|
(name program-file-name) ;string
|
||||||
(gexp program-file-gexp) ;gexp
|
(gexp program-file-gexp) ;gexp
|
||||||
(modules program-file-modules) ;list of module names
|
|
||||||
(guile program-file-guile)) ;package
|
(guile program-file-guile)) ;package
|
||||||
|
|
||||||
(define* (program-file name gexp
|
(define* (program-file name gexp #:key (guile #f))
|
||||||
#:key (modules '()) (guile #f))
|
|
||||||
"Return an object representing the executable store item NAME that runs
|
"Return an object representing the executable store item NAME that runs
|
||||||
GEXP. GUILE is the Guile package used to execute that script, and MODULES is
|
GEXP. GUILE is the Guile package used to execute that script.
|
||||||
the list of modules visible to that script.
|
|
||||||
|
|
||||||
This is the declarative counterpart of 'gexp->script'."
|
This is the declarative counterpart of 'gexp->script'."
|
||||||
(%program-file name gexp modules guile))
|
(%program-file name gexp guile))
|
||||||
|
|
||||||
(define-gexp-compiler (program-file-compiler (file program-file?)
|
(define-gexp-compiler (program-file-compiler (file program-file?)
|
||||||
system target)
|
system target)
|
||||||
;; Compile FILE by returning a derivation that builds the script.
|
;; Compile FILE by returning a derivation that builds the script.
|
||||||
(match file
|
(match file
|
||||||
(($ <program-file> name gexp modules guile)
|
(($ <program-file> name gexp guile)
|
||||||
(gexp->script name gexp
|
(gexp->script name gexp
|
||||||
#:modules modules
|
|
||||||
#:guile (or guile (default-guile))))))
|
#:guile (or guile (default-guile))))))
|
||||||
|
|
||||||
(define-record-type <scheme-file>
|
(define-record-type <scheme-file>
|
||||||
|
@ -1000,13 +995,11 @@ they can refer to each other."
|
||||||
%load-compiled-path)))))))
|
%load-compiled-path)))))))
|
||||||
|
|
||||||
(define* (gexp->script name exp
|
(define* (gexp->script name exp
|
||||||
#:key (modules '()) (guile (default-guile)))
|
#:key (guile (default-guile)))
|
||||||
"Return an executable script NAME that runs EXP using GUILE with MODULES in
|
"Return an executable script NAME that runs EXP using GUILE, with EXP's
|
||||||
its search path."
|
imported modules in its search path."
|
||||||
(define %modules
|
(mlet %store-monad ((set-load-path
|
||||||
(append (gexp-modules exp) modules))
|
(load-path-expression (gexp-modules exp))))
|
||||||
|
|
||||||
(mlet %store-monad ((set-load-path (load-path-expression %modules)))
|
|
||||||
(gexp->derivation name
|
(gexp->derivation name
|
||||||
(gexp
|
(gexp
|
||||||
(call-with-output-file (ungexp output)
|
(call-with-output-file (ungexp output)
|
||||||
|
|
Loading…
Reference in New Issue