diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index a7aeb04523..44ee252d1c 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -2120,6 +2120,9 @@ (define gcc-mesboot (native-inputs `(("gcc-wrapper" ,gcc-mesboot1-wrapper) ("headers" ,glibc-headers-mesboot) ,@(%boot-mesboot4-inputs))) + (inputs `(("gmp-source" ,(bootstrap-origin (package-source gmp-6.0))) + ("mpfr-source" ,(bootstrap-origin (package-source mpfr))) + ("mpc-source" ,(bootstrap-origin (package-source mpc))))) (arguments `(#:validate-runpath? #f ,@(substitute-keyword-arguments (package-arguments gcc-mesboot1) @@ -2167,31 +2170,44 @@ (define gcc-mesboot (delete 'apply-boot-patch) (delete 'unpack-g++) ; sadly, gcc-4.9.4 does not provide ; modular core/language downloads - (replace 'setenv + (add-after 'unpack 'unpack-gmp&co + (lambda* (#:key inputs #:allow-other-keys) + (let ((gmp (assoc-ref %build-inputs "gmp-source")) + (mpfr (assoc-ref %build-inputs "mpfr-source")) + (mpc (assoc-ref %build-inputs "mpc-source"))) + + ;; To reduce the set of pre-built bootstrap inputs, build + ;; GMP & co. from GCC. + (for-each (lambda (source) + (invoke "tar" "xvf" source)) + (list gmp mpfr mpc)) + + ;; Create symlinks like `gmp' -> `gmp-x.y.z'. + #$@(map (lambda (lib) + ;; Drop trailing letters, as gmp-6.0.0a unpacks + ;; into gmp-6.0.0. + #~(symlink #$(string-trim-right + (package-full-name lib "-") + char-set:letter) + #$(package-name lib))) + (list gmp-6.0 mpfr mpc))))) + (replace 'set-cplus-include-path (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (binutils (assoc-ref %build-inputs "binutils")) - (bash (assoc-ref %build-inputs "bash")) - (gcc (assoc-ref %build-inputs "gcc")) - (glibc (assoc-ref %build-inputs "libc")) - (kernel-headers (assoc-ref %build-inputs "kernel-headers"))) + (let* ((bash (assoc-ref %build-inputs "bash")) + (gcc (assoc-ref %build-inputs "gcc"))) (setenv "CONFIG_SHELL" (string-append bash "/bin/sh")) (setenv "C_INCLUDE_PATH" (string-append + (getenv "C_INCLUDE_PATH") ":" gcc "/lib/gcc-lib/" #$(commencement-build-target) "/4.6.4/include" - ":" kernel-headers "/include" - ":" glibc "/include" ":" (getcwd) "/mpfr/src")) (setenv "CPLUS_INCLUDE_PATH" (string-append + (getenv "CPLUS_INCLUDE_PATH") ":" gcc "/lib/gcc-lib/" #$(commencement-build-target) "/4.6.4/include" - ":" kernel-headers "/include" - ":" glibc "/include" ":" (getcwd) "/mpfr/src")) - (setenv "LIBRARY_PATH" (string-append glibc "/lib" - ":" gcc "/lib")) (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv "C_INCLUDE_PATH")) (format (current-error-port) "CPLUS_INCLUDE_PATH=~a\n" (getenv "CPLUS_INCLUDE_PATH")) (format (current-error-port) "LIBRARY_PATH=~a\n"