diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2025-08-31 16:10:56 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-09-11 22:32:10 +0200 |
| commit | f543fe44e06a6b4ed1f107dbf87c71de0909f32a (patch) | |
| tree | 2649619c99c209ef169e8292a5e63b4e37a55d04 | |
| parent | 6a750fbfafaad115d9b6b4b99962dcc0bf4494fe (diff) | |
build-self: Remove 2018-era compatibility shim for ‘gexp->script’.
* build-aux/build-self.scm (load-path-expression, gexp->script): Remove.
Change-Id: I956e2b8461c1a3ab719f923aef857efc03ebb174
| -rw-r--r-- | build-aux/build-self.scm | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index ad2aeea6323..7dce08fed07 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm | |||
| @@ -135,55 +135,6 @@ | |||
| 135 | #+(and xz (file-append xz "/bin/xz"))))))) | 135 | #+(and xz (file-append xz "/bin/xz"))))))) |
| 136 | 136 | ||
| 137 | 137 | ||
| 138 | ;;; | ||
| 139 | ;;; 'gexp->script'. | ||
| 140 | ;;; | ||
| 141 | ;;; This is our own variant of 'gexp->script' with an extra #:module-path | ||
| 142 | ;;; parameter, which was unavailable in (guix gexp) until commit | ||
| 143 | ;;; 1ae16033f34cebe802023922436883867010850f (March 2018.) | ||
| 144 | ;;; | ||
| 145 | |||
| 146 | (define (load-path-expression modules path) | ||
| 147 | "Return as a monadic value a gexp that sets '%load-path' and | ||
| 148 | '%load-compiled-path' to point to MODULES, a list of module names. MODULES | ||
| 149 | are searched for in PATH." | ||
| 150 | (mlet %store-monad ((modules (imported-modules modules | ||
| 151 | #:module-path path)) | ||
| 152 | (compiled (compiled-modules modules | ||
| 153 | #:module-path path))) | ||
| 154 | (return (gexp (eval-when (expand load eval) | ||
| 155 | (set! %load-path | ||
| 156 | (cons (ungexp modules) %load-path)) | ||
| 157 | (set! %load-compiled-path | ||
| 158 | (cons (ungexp compiled) | ||
| 159 | %load-compiled-path))))))) | ||
| 160 | |||
| 161 | (define* (gexp->script name exp | ||
| 162 | #:key (guile (default-guile)) | ||
| 163 | (module-path %load-path)) | ||
| 164 | "Return an executable script NAME that runs EXP using GUILE, with EXP's | ||
| 165 | imported modules in its search path." | ||
| 166 | (mlet %store-monad ((set-load-path | ||
| 167 | (load-path-expression (gexp-modules exp) | ||
| 168 | module-path))) | ||
| 169 | (gexp->derivation name | ||
| 170 | (gexp | ||
| 171 | (call-with-output-file (ungexp output) | ||
| 172 | (lambda (port) | ||
| 173 | ;; Note: that makes a long shebang. When the store | ||
| 174 | ;; is /gnu/store, that fits within the 128-byte | ||
| 175 | ;; limit imposed by Linux, but that may go beyond | ||
| 176 | ;; when running tests. | ||
| 177 | (format port | ||
| 178 | "#!~a/bin/guile --no-auto-compile~%!#~%" | ||
| 179 | (ungexp guile)) | ||
| 180 | |||
| 181 | (write '(ungexp set-load-path) port) | ||
| 182 | (write '(ungexp exp) port) | ||
| 183 | (chmod port #o555)))) | ||
| 184 | #:module-path module-path))) | ||
| 185 | |||
| 186 | |||
| 187 | (define (date-version-string) | 138 | (define (date-version-string) |
| 188 | "Return the current date and hour in UTC timezone, for use as a poor | 139 | "Return the current date and hour in UTC timezone, for use as a poor |
| 189 | person's version identifier." | 140 | person's version identifier." |
