diff options
author | Mathieu Othacehe <m.othacehe@gmail.com> | 2019-11-16 09:34:27 +0100 |
---|---|---|
committer | Mathieu Othacehe <m.othacehe@gmail.com> | 2019-11-16 09:34:27 +0100 |
commit | 154d97abdd16674fdebc763351f661bbcdc869a4 (patch) | |
tree | 0277a9380edd1390f16e432283d32499ffed36d1 /gnu/packages/bootstrap.scm | |
parent | e4696c69d75f4fcf54c42beeb928032726bdaf7d (diff) | |
parent | 87e7faa2ae641d8302efc8b90f1e45f43f67f6da (diff) | |
download | guix-154d97abdd16674fdebc763351f661bbcdc869a4.tar guix-154d97abdd16674fdebc763351f661bbcdc869a4.tar.gz |
Merge remote-tracking branch master into core-updates
Diffstat (limited to 'gnu/packages/bootstrap.scm')
-rw-r--r-- | gnu/packages/bootstrap.scm | 71 |
1 files changed, 38 insertions, 33 deletions
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm index ee713db0cf..d6995f104c 100644 --- a/gnu/packages/bootstrap.scm +++ b/gnu/packages/bootstrap.scm @@ -33,6 +33,7 @@ #:use-module ((guix derivations) #:select (derivation derivation-input derivation->output-path)) #:use-module ((guix utils) #:select (gnu-triplet->nix-system)) + #:use-module ((guix gexp) #:select (lower-object)) #:use-module (guix memoization) #:use-module (guix i18n) #:use-module (srfi srfi-1) @@ -148,38 +149,42 @@ for system '~a'") ;;; Helper procedures. ;;; -(define (bootstrap-origin source) - "Return a variant of SOURCE, an <origin> instance, whose method uses +(define bootstrap-origin + (mlambdaq (source) + "Return a variant of SOURCE, an <origin> instance, whose method uses %BOOTSTRAP-GUILE to do its job." - (define (boot fetch) - (lambda* (url hash-algo hash - #:optional name #:key system) - (fetch url hash-algo hash name - #:guile %bootstrap-guile - #:system system))) - - (define %bootstrap-patch-inputs - ;; Packages used when an <origin> has a non-empty 'patches' field. - `(("tar" ,%bootstrap-coreutils&co) - ("xz" ,%bootstrap-coreutils&co) - ("bzip2" ,%bootstrap-coreutils&co) - ("gzip" ,%bootstrap-coreutils&co) - ("patch" ,%bootstrap-coreutils&co))) - - (let ((orig-method (origin-method source))) - (origin (inherit source) - (method (cond ((eq? orig-method url-fetch) - (boot url-fetch)) - (else orig-method))) - (patch-guile %bootstrap-guile) - (patch-inputs %bootstrap-patch-inputs) - - ;; Patches can be origins as well, so process them. - (patches (map (match-lambda - ((? origin? patch) - (bootstrap-origin patch)) - (patch patch)) - (origin-patches source)))))) + (define (boot fetch) + (lambda* (url hash-algo hash + #:optional name #:key system) + (fetch url hash-algo hash name + #:guile %bootstrap-guile + #:system system))) + + (define %bootstrap-patch-inputs + ;; Packages used when an <origin> has a non-empty 'patches' field. + `(("tar" ,%bootstrap-coreutils&co) + ("xz" ,%bootstrap-coreutils&co) + ("bzip2" ,%bootstrap-coreutils&co) + ("gzip" ,%bootstrap-coreutils&co) + ("patch" ,%bootstrap-coreutils&co))) + + (let ((orig-method (origin-method source))) + (if (or (not (null? (origin-patches source))) + (origin-snippet source)) + (origin (inherit source) + (method (if (eq? orig-method url-fetch) + (boot url-fetch) + orig-method)) + (patch-guile %bootstrap-guile) + (patch-inputs %bootstrap-patch-inputs) + + ;; Patches can be origins as well, so process them. + (patches (map (match-lambda + ((? origin? patch) + (bootstrap-origin patch)) + (patch patch)) + (origin-patches source)))) + source)))) (define* (package-from-tarball name source program-to-test description #:key snippet) @@ -345,8 +350,8 @@ or false to signal an error." #:allow-other-keys) (define (->store file) (run-with-store store - (origin->derivation (bootstrap-executable file system) - system))) + (lower-object (bootstrap-executable file system) + system))) (let* ((tar (->store "tar")) (xz (->store "xz")) |