guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

190/210: gnu: gcc-mesboot: Cleanup.


From: Jan Nieuwenhuizen
Subject: 190/210: gnu: gcc-mesboot: Cleanup.
Date: Sat, 8 Sep 2018 10:36:33 -0400 (EDT)

janneke pushed a commit to branch wip-bootstrap
in repository guix.

commit c2ed99ee431e7386e914605224d58edea641d997
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Mon Sep 3 16:26:11 2018 +0200

    gnu: gcc-mesboot: Cleanup.
    
    * gnu/packages/commencement.scm (gcc-mesboot): Cleanup.
---
 gnu/packages/commencement.scm | 212 ++++++++++++++++++------------------------
 1 file changed, 92 insertions(+), 120 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index eac65a3..5cfdcf1 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -1137,137 +1137,109 @@ ac_cv_c_float_format='IEEE (little-endian)'
      (inputs `(("gmp-source" ,(package-source gmp-boot))
                ("mpfr-source" ,(package-source mpfr-boot))
                ("mpc-source" ,(package-source mpc-boot))))
-     (propagated-inputs '())
      (native-inputs `(("binutils" ,binutils-mesboot)
                       ("gcc" ,gcc-mesboot0)
                       ("libc" ,glibc-mesboot0)
 
+                      ("bash" ,%bootstrap-coreutils&co)
                       ("coreutils" ,%bootstrap-coreutils&co)
                       ("diffutils" ,diffutils-mesboot)
                       ("kernel-headers" ,%bootstrap-linux-libre-headers)
                       ("make" ,make-mesboot)))
      (arguments
-      `(#:implicit-inputs? #f
-        #:guile ,%bootstrap-guile
-        #:tests? #f
-        #:parallel-build? #f
-        #:strip-binaries? #f
-        #:configure-flags
-        (let ((out (assoc-ref %outputs "out"))
-              (glibc (assoc-ref %build-inputs "libc")))
-          (list "--build=i686-unknown-linux-gnu"
-                "--host=i686-unknown-linux-gnu"
-
-                (string-append "--with-native-system-header-dir=" glibc 
"/include")
-                (string-append "--with-build-sysroot=" glibc "/include")
-                (string-append "--prefix=" out)
-
-                "--disable-bootstrap"
-                "--disable-decimal-float"
-                "--disable-libatomic"
-                "--disable-libcilkrts"
-                "--disable-libgomp"
-                "--disable-libitm"
-                "--disable-libmudflap"
-                "--disable-libquadmath"
-                "--disable-libsanitizer"
-                "--disable-libssp"
-                "--disable-libvtv"
-                "--disable-lto"
-                "--disable-lto-plugin"
-                "--disable-multilib"
-                "--disable-plugin"
-                "--disable-shared"
-                "--disable-threads"
-                "--enable-languages=c,c++"
-
-                "--enable-static"
-                "--enable-threads=single"
-
-                ;; libstdc++ cannot be built at this stage
-                ;; ("Link tests are not allowed after
-                ;; GCC_NO_EXECUTABLES.").
-                '"--disable-libstdc__-v3"
-
-                ;; No pre-compiled libstdc++ headers, to save space.
-                "--disable-libstdcxx-pch"
-
-                ;; for libcpp ...
-                "--disable-build-with-cxx"))
-
-        #:phases
-        (modify-phases %standard-phases
-
-          ;; c&p from commencement.scm:gcc-boot0
-          (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)
-                            (or (zero? (system* "tar" "xvf" source))
-                                (error "failed to unpack tarball"
-                                       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-boot mpfr-boot mpc-boot))
-                #t)))
-
-          (add-before 'configure 'setenv
-            (lambda* (#:key outputs #:allow-other-keys)
-              (let* ((out (assoc-ref outputs "out"))
-                     (binutils (assoc-ref %build-inputs "binutils"))
-                     (gcc (assoc-ref %build-inputs "gcc"))
-                     (glibc (assoc-ref %build-inputs "libc"))
-                     (headers (assoc-ref %build-inputs "kernel-headers")))
-
-                (setenv "CPP" (string-append "gcc -E"))
-                (setenv "AR" "ar")
-                (setenv "RANLIB" "true")
-                (setenv "PATH"
-                        (string-append
-                         (assoc-ref %build-inputs "binutils") "/bin"
-                         ":" (assoc-ref %build-inputs "gcc") "/bin"
-
-                         ;; more bootstrap cheats
-                         ":" (assoc-ref %build-inputs "coreutils") "/bin"
-                         ":" (assoc-ref %build-inputs "diffutils") "/bin"
-                         ":" (assoc-ref %build-inputs "make") "/bin"))
+      `(,@(substitute-keyword-arguments (package-arguments gcc-core-mesboot)
+            ((#:phases phases)
+             `(modify-phases ,phases
+                ;; c&p from commencement.scm:gcc-boot0
+                (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")))
 
-                (format (current-error-port) "PATH=~a\n" (getenv "PATH"))
-                (setenv "CONFIG_SHELL" (string-append
-                                        (assoc-ref %build-inputs "coreutils")
-                                        "/bin/sh"))
-                (setenv "C_INCLUDE_PATH" (string-append
-                                          gcc 
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include"
-                                          ":" 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) "LIBRARY_PATH=~a\n" (getenv 
"LIBRARY_PATH")))))
+                      ;; To reduce the set of pre-built bootstrap inputs, build
+                      ;; GMP & co. from GCC.
+                      (for-each (lambda (source)
+                                  (or (zero? (system* "tar" "xvf" source))
+                                      (error "failed to unpack tarball"
+                                             source)))
+                                (list gmp mpfr mpc))
 
-          (replace 'configure
-            (lambda* (#:key configure-flags #:allow-other-keys)
-              (mkdir-p "build")
-              (chdir "build")
-              (format (current-error-port) "running: ../build/configure ~a\n" 
(string-join configure-flags))
-              (zero?
-               (apply system* "../configure" configure-flags))))))))))
+                      ;; 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-boot mpfr-boot mpc-boot))
+                      #t)))
+                (delete 'remove-info)
+                (replace 'setenv
+                  (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")))
+                      (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
+                      (setenv "C_INCLUDE_PATH" (string-append
+                                                gcc 
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/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) "LIBRARY_PATH=~a\n" (getenv 
"LIBRARY_PATH"))
+                      #t)))
+                (delete 'install2)))
+            ((#:configure-flags configure-flags)
+             `(let ((out (assoc-ref %outputs "out"))
+                    (glibc (assoc-ref %build-inputs "libc")))
+                (list (string-append "--prefix=" out)
+                      "--build=i686-unknown-linux-gnu"
+                      "--host=i686-unknown-linux-gnu"
+
+                      (string-append "--with-native-system-header-dir=" glibc 
"/include")
+                      (string-append "--with-build-sysroot=" glibc "/include")
+
+                      "--disable-bootstrap"
+                      "--disable-decimal-float"
+                      "--disable-libatomic"
+                      "--disable-libcilkrts"
+                      "--disable-libgomp"
+                      "--disable-libitm"
+                      "--disable-libmudflap"
+                      "--disable-libquadmath"
+                      "--disable-libsanitizer"
+                      "--disable-libssp"
+                      "--disable-libvtv"
+                      "--disable-lto"
+                      "--disable-lto-plugin"
+                      "--disable-multilib"
+                      "--disable-plugin"
+                      "--disable-shared"
+                      "--disable-threads"
+                      "--enable-languages=c,c++"
+
+                      "--enable-static"
+                      "--enable-threads=single"
+
+                      ;; libstdc++ cannot be built at this stage
+                      ;; ("Link tests are not allowed after
+                      ;; GCC_NO_EXECUTABLES.").
+                      '"--disable-libstdc__-v3"
+
+                      ;; No pre-compiled libstdc++ headers, to save space.
+                      "--disable-libstdcxx-pch"
+
+                      ;; for libcpp ...
+                      "--disable-build-with-cxx")))
+            ((#:make-flags make-flags)
+             ''())))))))
 
 (define-public gcc-mesboot-wrapper
   (package-with-bootstrap-guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]