diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2019-11-03 17:59:28 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2019-11-04 23:35:31 +0100 |
| commit | 7e1a74da93319a3b413854a052af1e9ccca02bdc (patch) | |
| tree | f8dd692a43b5951c1c02452eef4d3bb30ccd8b98 /gnu | |
| parent | bf7b08c4fe7d14c25a83bde99f19eca1119d88ff (diff) | |
gnu: bootstrap: Memoize 'bootstrap-origin'.
* gnu/packages/bootstrap.scm (bootstrap-origin): Memoize with
'mlambdaq'. This improves memoization of origins in (gnu packages
commencement).
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/bootstrap.scm | 69 |
1 files changed, 35 insertions, 34 deletions
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index c6e3c697e68..d6995f104c1 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm | |||
| @@ -149,41 +149,42 @@ for system '~a'") | |||
| 149 | ;;; Helper procedures. | 149 | ;;; Helper procedures. |
| 150 | ;;; | 150 | ;;; |
| 151 | 151 | ||
| 152 | (define (bootstrap-origin source) | 152 | (define bootstrap-origin |
| 153 | "Return a variant of SOURCE, an <origin> instance, whose method uses | 153 | (mlambdaq (source) |
| 154 | "Return a variant of SOURCE, an <origin> instance, whose method uses | ||
| 154 | %BOOTSTRAP-GUILE to do its job." | 155 | %BOOTSTRAP-GUILE to do its job." |
| 155 | (define (boot fetch) | 156 | (define (boot fetch) |
| 156 | (lambda* (url hash-algo hash | 157 | (lambda* (url hash-algo hash |
| 157 | #:optional name #:key system) | 158 | #:optional name #:key system) |
| 158 | (fetch url hash-algo hash name | 159 | (fetch url hash-algo hash name |
| 159 | #:guile %bootstrap-guile | 160 | #:guile %bootstrap-guile |
| 160 | #:system system))) | 161 | #:system system))) |
| 161 | 162 | ||
| 162 | (define %bootstrap-patch-inputs | 163 | (define %bootstrap-patch-inputs |
| 163 | ;; Packages used when an <origin> has a non-empty 'patches' field. | 164 | ;; Packages used when an <origin> has a non-empty 'patches' field. |
| 164 | `(("tar" ,%bootstrap-coreutils&co) | 165 | `(("tar" ,%bootstrap-coreutils&co) |
| 165 | ("xz" ,%bootstrap-coreutils&co) | 166 | ("xz" ,%bootstrap-coreutils&co) |
| 166 | ("bzip2" ,%bootstrap-coreutils&co) | 167 | ("bzip2" ,%bootstrap-coreutils&co) |
| 167 | ("gzip" ,%bootstrap-coreutils&co) | 168 | ("gzip" ,%bootstrap-coreutils&co) |
| 168 | ("patch" ,%bootstrap-coreutils&co))) | 169 | ("patch" ,%bootstrap-coreutils&co))) |
| 169 | 170 | ||
| 170 | (let ((orig-method (origin-method source))) | 171 | (let ((orig-method (origin-method source))) |
| 171 | (if (or (not (null? (origin-patches source))) | 172 | (if (or (not (null? (origin-patches source))) |
| 172 | (origin-snippet source)) | 173 | (origin-snippet source)) |
| 173 | (origin (inherit source) | 174 | (origin (inherit source) |
| 174 | (method (if (eq? orig-method url-fetch) | 175 | (method (if (eq? orig-method url-fetch) |
| 175 | (boot url-fetch) | 176 | (boot url-fetch) |
| 176 | orig-method)) | 177 | orig-method)) |
| 177 | (patch-guile %bootstrap-guile) | 178 | (patch-guile %bootstrap-guile) |
| 178 | (patch-inputs %bootstrap-patch-inputs) | 179 | (patch-inputs %bootstrap-patch-inputs) |
| 179 | 180 | ||
| 180 | ;; Patches can be origins as well, so process them. | 181 | ;; Patches can be origins as well, so process them. |
| 181 | (patches (map (match-lambda | 182 | (patches (map (match-lambda |
| 182 | ((? origin? patch) | 183 | ((? origin? patch) |
| 183 | (bootstrap-origin patch)) | 184 | (bootstrap-origin patch)) |
| 184 | (patch patch)) | 185 | (patch patch)) |
| 185 | (origin-patches source)))) | 186 | (origin-patches source)))) |
| 186 | source))) | 187 | source)))) |
| 187 | 188 | ||
| 188 | (define* (package-from-tarball name source program-to-test description | 189 | (define* (package-from-tarball name source program-to-test description |
| 189 | #:key snippet) | 190 | #:key snippet) |
