~ruther/guix-local

4a4cbd0bdd2ad8c4f37c3ffdd69596ef1ef41d91 — Ludovic Courtès 11 years ago 84da4ad
gexp: 'gexp->script' returns a script that can easily be compiled.

* guix/gexp.scm (gexp->script): Produce an 'eval-when' form around
  assignments of %load-path and %load-compiled-path.
1 files changed, 9 insertions(+), 7 deletions(-)

M guix/gexp.scm
M guix/gexp.scm => guix/gexp.scm +9 -7
@@ 496,14 496,16 @@ its search path."
                           (format port
                                   "#!~a/bin/guile --no-auto-compile~%!#~%"
                                   (ungexp guile))

                           ;; Write the 'eval-when' form so that it can be
                           ;; compiled.
                           (write
                            '(set! %load-path
                                   (cons (ungexp modules) %load-path))
                            port)
                           (write
                            '(set! %load-compiled-path
                                   (cons (ungexp compiled)
                                         %load-compiled-path))
                            '(eval-when (expand load eval)
                               (set! %load-path
                                    (cons (ungexp modules) %load-path))
                               (set! %load-compiled-path
                                     (cons (ungexp compiled)
                                           %load-compiled-path)))
                            port)
                           (write '(ungexp exp) port)
                           (chmod port #o555)))))))