From 2143cf7a50968f71a5750ecc1e1e4f343914d863 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 6 Oct 2012 01:10:21 +0200 Subject: distro: Specify use of the bootstrap Guile for the initial derivations. * distro/packages/base.scm (%bootstrap-guile): New variable. (gnu-make-boot0, diffutils-boot0, findutils-boot0, binutils-boot0, gcc-boot0, linux-headers-boot0, glibc-final, gcc-boot0-wrapped, gcc-final, ld-wrapper-boot3, bash-final, guile-final): Add `#:guile %bootstrap-guile' to the builder's arguments. --- distro/packages/base.scm | 51 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 17 deletions(-) (limited to 'distro') diff --git a/distro/packages/base.scm b/distro/packages/base.scm index d16d9800f7..88fa1bb27c 100644 --- a/distro/packages/base.scm +++ b/distro/packages/base.scm @@ -813,6 +813,7 @@ (define-public gcc-4.7 (home-page "http://gcc.gnu.org/")))) (define-public ncurses + ;; FIXME: `ncurses-config' retains a ref on bash (let ((post-install-phase '(lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) @@ -1383,6 +1384,10 @@ (define %bootstrap-inputs "gawk" ; used by `config.status' "gcc" "binutils"))))) +(define %bootstrap-guile + ;; The Guile used to run the build scripts of the initial derivations. + (nixpkgs-derivation* "guile")) + (define-syntax substitute-keyword-arguments (syntax-rules () "Return a new list of arguments where the value for keyword arg KW is @@ -1404,7 +1409,8 @@ (define gnu-make-boot0 (package (inherit gnu-make) (name "make-boot0") (location (source-properties->location (current-source-location))) - (arguments `(#:implicit-inputs? #f + (arguments `(#:guile ,%bootstrap-guile + #:implicit-inputs? #f #:tests? #f ; cannot run "make check" #:phases (alist-replace @@ -1424,7 +1430,8 @@ (define gnu-make-boot0 (define diffutils-boot0 (let ((p (package-with-explicit-inputs diffutils `(("make" ,gnu-make-boot0) - ,@%bootstrap-inputs)))) + ,@%bootstrap-inputs) + #:guile %bootstrap-guile))) (package (inherit p) (location (source-properties->location (current-source-location))) (arguments `(#:tests? #f ; the test suite needs diffutils @@ -1435,7 +1442,8 @@ (define findutils-boot0 `(("make" ,gnu-make-boot0) ("diffutils" ,diffutils-boot0) ; for tests ,@%bootstrap-inputs) - (current-source-location))) + (current-source-location) + #:guile %bootstrap-guile)) (define %boot0-inputs @@ -1471,7 +1479,8 @@ (define binutils-boot0 (name "binutils-cross-boot0") (arguments (lambda (system) - `(#:implicit-inputs? #f + `(#:guile ,%bootstrap-guile + #:implicit-inputs? #f ,@(substitute-keyword-arguments (package-arguments binutils) ((#:configure-flags cf) `(list ,(string-append "--target=" (boot-triplet system)))))))) @@ -1482,7 +1491,8 @@ (define gcc-boot0 (name "gcc-cross-boot0") (arguments (lambda (system) - `(#:implicit-inputs? #f + `(#:guile ,%bootstrap-guile + #:implicit-inputs? #f #:modules ((guix build gnu-build-system) (guix build utils) (ice-9 regex) @@ -1569,12 +1579,14 @@ (define gcc-boot0 (define linux-headers-boot0 (package (inherit linux-headers) - (arguments `(#:implicit-inputs? #f + (arguments `(#:guile ,%bootstrap-guile + #:implicit-inputs? #f ,@(package-arguments linux-headers))) (native-inputs (let ((perl (package-with-explicit-inputs perl %boot0-inputs - (current-source-location)))) + (current-source-location) + #:guile %bootstrap-guile))) `(("perl" ,perl) ,@%boot0-inputs))))) @@ -1593,7 +1605,8 @@ (define-public glibc-final (package (inherit glibc) (arguments (lambda (system) - `(#:implicit-inputs? #f + `(#:guile ,%bootstrap-guile + #:implicit-inputs? #f ;; Leave /bin/sh as the interpreter for `ldd', `sotruss', etc. to ;; avoid keeping a reference to the bootstrap Bash. @@ -1624,7 +1637,8 @@ (define gcc-boot0-wrapped (build-system trivial-build-system) (arguments (lambda (system) - `(#:modules ((guix build utils)) + `(#:guile ,%bootstrap-guile + #:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils)) @@ -1670,7 +1684,8 @@ (define binutils-final (package (inherit binutils) (arguments (lambda (system) - `(#:implicit-inputs? #f + `(#:guile ,%bootstrap-guile + #:implicit-inputs? #f ,@(package-arguments binutils)))) (inputs %boot2-inputs))) @@ -1680,7 +1695,8 @@ (define-public gcc-final (name "gcc") (arguments (lambda (system) - `(#:implicit-inputs? #f + `(#:guile ,%bootstrap-guile + #:implicit-inputs? #f ;; Build again GMP & co. within GCC's build process, because it's hard ;; to do outside (because GCC-BOOT0 is a cross-compiler, and thus @@ -1710,11 +1726,12 @@ (define ld-wrapper-boot3 (source #f) (build-system trivial-build-system) (inputs `(("binutils" ,binutils-final) - ("guile" ,(nixpkgs-derivation* "guile")) + ("guile" ,%bootstrap-guile) ("wrapper" ,(search-path %load-path "distro/packages/ld-wrapper.scm")))) (arguments - `(#:modules ((guix build utils)) + `(#:guile ,%bootstrap-guile + #:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils) (system base compile)) @@ -1756,13 +1773,15 @@ (define %boot3-inputs (define-public bash-final (package-with-explicit-inputs bash %boot3-inputs - (current-source-location))) + (current-source-location) + #:guile %bootstrap-guile)) (define-public guile-final (package-with-explicit-inputs guile-2.0 `(("bash" ,bash-final) ,@(alist-delete "bash" %boot3-inputs)) - (current-source-location))) + (current-source-location) + #:guile %bootstrap-guile)) (define-public ld-wrapper ;; The final `ld' wrapper, which uses the final Guile. @@ -1773,8 +1792,6 @@ (define-public ld-wrapper (define-public %final-inputs ;; Final derivations used as implicit inputs by `gnu-build-system'. - ;; FIXME: Build bash before the others, otherwise patch-shebangs uses it in - ;; bzip2, for instance. (let ((finalize (cut package-with-explicit-inputs <> %boot3-inputs (current-source-location)))) `(,@(map (match-lambda -- cgit v1.2.3