guix-commits
[Top][All Lists]
Advanced

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

186/192: gnu: gcc-mesboot0: Cleanup.


From: Jan Nieuwenhuizen
Subject: 186/192: gnu: gcc-mesboot0: Cleanup.
Date: Mon, 3 Sep 2018 16:25:24 -0400 (EDT)

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

commit a06fad88933d343e93479adf4b20167942f57a47
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Mon Sep 3 15:54:32 2018 +0200

    gnu: gcc-mesboot0: Cleanup.
    
    * gnu/packages/commencement.scm (gcc-mesboot0): Cleanup.
---
 gnu/packages/commencement.scm | 149 +++++++++++++++++-------------------------
 1 file changed, 59 insertions(+), 90 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 306ed33..88d31c4 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -956,107 +956,76 @@ ac_cv_c_float_format='IEEE (little-endian)'
    (package
      (inherit gcc-core-mesboot)
      (name "gcc-mesboot0")
-     (version "2.95.3")
-     (source (origin
-               (method url-fetch)
-               (uri (string-append "mirror://gnu/gcc/gcc-2.95.3/gcc-core-"
-                                   version
-                                   ".tar.gz"))
-               (patches (search-patches "gcc-boot-2.95.3.patch"))
-               (sha256
-                (base32
-                 "1xvfy4pqhrd5v2cv8lzf63iqg92k09g6z9n2ah6ndd4h17k1x0an"))))
-     (supported-systems '("i686-linux"))
-     (inputs '())
-     (propagated-inputs '())
+     (source (origin (inherit (package-source gcc-core-mesboot))
+                     (patches (search-patches "gcc-boot-2.95.3.patch"))))
      (native-inputs `(("binutils" ,binutils-mesboot0)
                       ("gcc" ,gcc-core-mesboot)
                       ("libc" ,glibc-mesboot0)
 
+                      ("bash" ,%bootstrap-coreutils&co)
                       ("coreutils" ,%bootstrap-coreutils&co)
                       ("diffutils" ,diffutils-mesboot)
                       ("kernel-headers" ,%bootstrap-linux-libre-headers)
                       ("make" ,make-mesboot0)))
-     (outputs '("out"))
      (arguments
-      `(#:implicit-inputs? #f
-        #:guile ,%bootstrap-guile
-        #:tests? #f                     ; runtest: command not found
-        #:parallel-build? #f
-        #:strip-binaries? #f
-        #:make-flags (list "RANLIB=true"
-                           (string-append "LIBGCC2_INCLUDES=-I "
-                                          (assoc-ref %build-inputs "gcc")
-                                          "/include")
-                           "LANGUAGES=c")
-        #:modules ((guix build gnu-build-system)
-                   (guix build utils)
-                   (srfi srfi-1))
-        #:phases
-        (modify-phases %standard-phases
-          (replace 'configure
-            (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")))
-                (when #t ;; no info
-                  (delete-file-recursively "texinfo")
-                  (system "touch gcc/cpp.info gcc/gcc.info"))
-
-                (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"))
-
-                (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 "/include" this is MES
-                                          ;;":/"
-                                          gcc 
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include"
-                                          ":" headers "/include"
-                                          ":" glibc "/include"))
-                (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"))
-
-                (setenv "CC" "gcc")
-                (setenv "LD" "gcc")
-                (setenv "CPP" "gcc -E")
-                (setenv "RANLIB" "true")
-
-                (with-output-to-file "config.cache"
-                  (lambda _
-                    (display "
+      `(,@(substitute-keyword-arguments (package-arguments gcc-core-mesboot)
+            ((#:phases phases)
+             `(modify-phases ,phases
+                (replace 'setenv
+                  (lambda* (#:key outputs #:allow-other-keys)
+                    (let ((out (assoc-ref outputs "out"))
+                          (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"))
+                      (format (current-error-port) "C_INCLUDE_PATH=~a\n" 
(getenv "C_INCLUDE_PATH"))
+                      ;; FIXME
+                      ;; (setenv "C_INCLUDE_PATH" (string-join
+                      ;;                           (list (string-append glibc 
"/include")
+                      ;;                                 (getenv 
"C_INCLUDE_PATH"))
+                      ;;                           ":"))
+                      (setenv "C_INCLUDE_PATH" (string-append
+                                                gcc 
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include"
+                                                ":" kernel-headers "/include"
+                                                ":" glibc "/include"))
+                      (format (current-error-port) "C_INCLUDE_PATH=~a\n" 
(getenv "C_INCLUDE_PATH"))
+                      (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv 
"LIBRARY_PATH"))
+                      ;; FIXME: add glibc dirs to paths manually
+                      (setenv "LIBRARY_PATH" (string-join
+                                              (list (string-append glibc 
"/lib")
+                                                    (getenv "LIBRARY_PATH"))
+                                              ":"))
+                      (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv 
"LIBRARY_PATH"))
+                      (with-output-to-file "config.cache"
+                        (lambda _
+                          (display "
 ac_cv_c_float_format='IEEE (little-endian)'
 ")))
-                (and
-                 (zero?
-                  (system* "./configure"
-                           "--build=i686-unknown-linux-gnu"
-                           "--host=i686-unknown-linux-gnu"
-                           "--disable-shared"
-                           (string-append "--prefix=" out)))))))
-          (add-after 'install 'install2
-            (lambda* (#:key outputs #:allow-other-keys)
-              (let* ((out (assoc-ref outputs "out"))
-                     (gcc-dir (string-append
-                               out 
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3")))
-                (and
-                 (mkdir-p "tmp")
-                 (zero? (system (string-append "set -x; cd tmp && ar x 
../gcc/libgcc2.a")))
-                 (zero? (system (string-append "set -x; cd tmp && ar r " 
gcc-dir "/libgcc.a *.o")))
-                 (copy-file "gcc/libgcc2.a" (string-append out 
"/lib/libgcc2.a"))))))))))))
+                      #t)))
+                (replace 'install2
+                  (lambda* (#:key outputs #:allow-other-keys)
+                    (let* ((out (assoc-ref outputs "out"))
+                           (gcc-dir (string-append
+                                     out 
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3")))
+                      (and
+                       (mkdir-p "tmp")
+                       (zero? (system (string-append "set -x; cd tmp && ar x 
../gcc/libgcc2.a")))
+                       (zero? (system (string-append "set -x; cd tmp && ar r " 
gcc-dir "/libgcc.a *.o")))
+                       (copy-file "gcc/libgcc2.a" (string-append out 
"/lib/libgcc2.a"))))))))
+            ((#:configure-flags configure-flags)
+             `(let ((out (assoc-ref %outputs "out")))
+                `( ;;"--enable-static"
+                  "--disable-shared"
+                  "--disable-werror"
+                  "--build=i686-unknown-linux-gnu"
+                  "--host=i686-unknown-linux-gnu"
+                  ,(string-append "--prefix=" out))))
+            ((#:make-flags make-flags)
+             `(let ((gcc (assoc-ref %build-inputs "gcc")))
+                `("RANLIB=true"
+                  ,(string-append "LIBGCC2_INCLUDES=-I " gcc "/include")
+                  "LANGUAGES=c")))))))))
 
 (define-public binutils-mesboot
   (package-with-bootstrap-guile



reply via email to

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