guix-commits
[Top][All Lists]
Advanced

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

135/176: gnu: mes-boot: Use gnu-build-system.


From: Jan Nieuwenhuizen
Subject: 135/176: gnu: mes-boot: Use gnu-build-system.
Date: Fri, 31 Aug 2018 11:20:28 -0400 (EDT)

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

commit 2309ad8cd0d59c580a83c60d353a67d7713d0ae9
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Thu Aug 23 17:53:35 2018 +0200

    gnu: mes-boot: Use gnu-build-system.
    
    * gnu/packages/mes.scm (mes-boot): Use gnu-build-system.
---
 gnu/packages/mes.scm | 157 +++++++++++++++++++++++++--------------------------
 1 file changed, 78 insertions(+), 79 deletions(-)

diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm
index f467667..5ca693b 100644
--- a/gnu/packages/mes.scm
+++ b/gnu/packages/mes.scm
@@ -220,7 +220,7 @@ hex2 linker.")
                      (sha256
                       (base32
                        
"1j32x4zqy2cqjlg9m35f2411mwac2b0p5ch4hm99gddmfbxzgyhg")))))
-       (build-system trivial-build-system)
+       (build-system gnu-build-system)
        (supported-systems '("i686-linux" "x86_64-linux"))
        (native-inputs
         `(("coreutils" , %bootstrap-coreutils&co)
@@ -232,84 +232,83 @@ hex2 linker.")
                   ("srfi-43" ,%srfi-43)) ; guile-2.0.9 lacks srfi-43; 
cherry-pick
                 '())))
        (arguments
-        `(#:modules ((guix build utils))
-          #:builder
-          (begin
-            (use-modules (guix build utils))
-            (let* ((coreutils (assoc-ref %build-inputs "coreutils"))
-                   (guile (assoc-ref %build-inputs "guile"))
-                   (srfi-43 (assoc-ref %build-inputs "srfi-43"))
-                   (mescc-tools (assoc-ref %build-inputs "mescc-tools"))
-                   (source (assoc-ref %build-inputs "source"))
-                   (nyacc-source (assoc-ref %build-inputs "nyacc-source"))
-                   (mes-seed (assoc-ref %build-inputs "mes-seed"))
-                   (out (assoc-ref %outputs "out"))
-                   (dir (getcwd)))
-
-              ;; unpack
-              (setenv "PATH" (string-append
-                              coreutils "/bin"
-                              (if guile (string-append ":" guile "/bin") "")
-                              ":" mescc-tools "/bin"))
-              (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
-              (mkdir-p "source")
-              (system* "tar" "--strip=1" "-C" "source" "-xvf" source)
-              (mkdir-p "nyacc-source")
-              (system* "tar" "--strip=1" "-C" "nyacc-source" "-xvf" 
nyacc-source)
-              (mkdir-p "mes-seed")
-              (system* "tar" "--strip=1" "-C" "mes-seed" "-xvf" mes-seed)
-              (when srfi-43
-                (mkdir-p "srfi")
-                (system* "cp" srfi-43 "srfi/srfi-43.scm"))
-              (chdir "source")
-
-              ;; configure
-              (setenv "prefix" out)
-              ;; (setenv "V" "2")
-              (system* "bash" "-x" "configure.sh")
-
-              (if ,%fake-bootstrap?
-                  (begin     ; Cheat using Guile+Nyacc+MesCC; ~30 times faster
-                    (setenv "MES" "guile")
-                    (setenv "GUILE_AUTO_COMPILE" "1")
-                    (setenv "GUILE_LOAD_COMPILED_PATH"
-                            (string-append guile "/lib/guile/2.0/ccache"))
-                    (setenv "GUILE_LOAD_PATH"
-                            (string-append (string-append dir 
"/nyacc-source/module")
-                                           ":" dir
-                                           ":" guile "/share/guile/2.0/"))
-                    ;; these fail with guile-2.0
-                    (when srfi-43
-                      (delete-file "tests/srfi-9.test")
-                      (delete-file "tests/srfi-43.test"))
-
-                    ;; give auto-compile a home -- massive speed-up
-                    (mkdir-p "/tmp/home")
-                    (setenv "HOME" "/tmp/home"))
-
-                  (begin                ; True bootstrap build Mes+Nyacc+MesCC
-                    (symlink (string-append "../nyacc-source/module") "nyacc")
-                    (setenv "GUILE_LOAD_PATH" "nyacc")
-                    (setenv "MES" "src/mes")))
-
-              (setenv "GUILE_TOOLS" "true") ; no tools in bootstrap-guile
-              (setenv "MESCC" "scripts/mescc")
-              (setenv "MES_MODULEDIR" "module")
-
-              (and
-               ;; build
-               (zero? (system* "sh" "build.sh"))
-
-               ;; check
-               (unless ,%fake-bootstrap? ; check takes ~15min, skip when faking
-                 (setenv "MES_ARENA" "100000000")
-                 (zero? (system* "sh" "build-aux/test.sh"))
-                 (zero? (system* "sh" "build-aux/test.sh" 
"scaffold/tests/63-struct-cell"))
-                 (zero? (system* "sh" "check.sh")))
-
-               ;; install
-               (setenv "SHELL" (string-append coreutils "/bin/bash"))
-               (zero? (system* "sh" "install.sh")))))))
+        `(#:strip-binaries? #f ; binutil's strip b0rkes MesCC/M1/hex2 binaries
+          #:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'unpack-seeds
+              (lambda* (#:key outputs #:allow-other-keys)
+                (let ((coreutils (assoc-ref %build-inputs "coreutils"))
+                      (srfi-43 (assoc-ref %build-inputs "srfi-43"))
+                      (nyacc-source (assoc-ref %build-inputs "nyacc-source"))
+                      (mes-seed (assoc-ref %build-inputs "mes-seed")))
+                  (setenv "PATH" (string-append
+                                  coreutils "/bin"))
+                  (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
+                  (with-directory-excursion ".."
+                    (and
+                     (mkdir-p "nyacc-source")
+                     (zero? (system* "tar" "--strip=1" "-C" "nyacc-source" 
"-xvf" nyacc-source))
+                     (mkdir-p "mes-seed")
+                     (zero? (system* "tar" "--strip=1" "-C" "mes-seed" "-xvf" 
mes-seed))
+                     (or (not srfi-43)
+                         (and (mkdir-p "srfi")
+                              (zero? (system* "cp" srfi-43 
"srfi/srfi-43.scm")))))))))
+            (replace 'configure
+              (lambda* (#:key outputs #:allow-other-keys)
+                (let ((out (assoc-ref %outputs "out"))
+                      (dir (with-directory-excursion ".." (getcwd)))
+                      (coreutils (assoc-ref %build-inputs "coreutils"))
+                      (guile (assoc-ref %build-inputs "guile"))
+                      (mescc-tools (assoc-ref %build-inputs "mescc-tools"))
+                      (srfi-43 (assoc-ref %build-inputs "srfi-43")))
+                  (setenv "PATH" (string-append
+                                  coreutils "/bin"
+                                  (if guile (string-append ":" guile "/bin") 
"")
+                                  ":" mescc-tools "/bin"))
+                  (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
+                  (setenv "SHELL" (string-append coreutils "/bin/bash"))
+                  (setenv "srcdir" ".")
+                  (zero? (system* "bash" "-x" "configure.sh"
+                                  (string-append "--prefix=" out)))
+                  (if ,%fake-bootstrap?
+                      (begin ; Cheat using Guile+Nyacc+MesCC; ~30 times faster
+                        (setenv "MES" "guile")
+                        (setenv "GUILE_AUTO_COMPILE" "1")
+                        (setenv "GUILE_LOAD_COMPILED_PATH"
+                                (string-append guile "/lib/guile/2.0/ccache"))
+                        (setenv "GUILE_LOAD_PATH"
+                                (string-append (string-append dir 
"/nyacc-source/module")
+                                               ":" dir
+                                               ":" guile "/share/guile/2.0/"))
+                        ;; these fail with guile-2.0
+                        (when srfi-43
+                          (delete-file "tests/srfi-9.test")
+                          (delete-file "tests/srfi-43.test"))
+                        ;; give auto-compile a home -- massive speed-up
+                        (mkdir-p "/tmp/home")
+                        (setenv "HOME" "/tmp/home"))
+                      (begin            ; True bootstrap build Mes+Nyacc+MesCC
+                        (symlink (string-append "../nyacc-source/module") 
"nyacc")
+                        (setenv "GUILE_LOAD_PATH" "nyacc")
+                        (setenv "MES" "src/mes")))
+                  (setenv "GUILE_TOOLS" "true") ; no tools in bootstrap-guile
+                  (setenv "MESCC" "scripts/mescc")
+                  (setenv "MES_MODULEDIR" "module"))))
+            (replace 'build
+              (lambda* (#:key outputs #:allow-other-keys)
+                (zero? (system* "sh" "build.sh"))))
+            (replace 'check
+              (lambda* (#:key outputs #:allow-other-keys)
+                (or ,%fake-bootstrap?   ; check takes ~15min, skip when faking
+                    (and
+                     (setenv "MES_ARENA" "100000000")
+                     (setenv "DIFF" "sh scripts/diff.scm")
+                     (zero? (system* "sh" "-x" "build-aux/test.sh" 
"scaffold/tests/t"))
+                     (zero? (system* "sh" "-x" "build-aux/test.sh" 
"scaffold/tests/63-struct-cell"))
+                     (zero? (system* "sh" "-x" "check.sh"))))))
+            (replace 'install
+              (lambda* (#:key outputs #:allow-other-keys)
+                (zero? (system* "sh" "install.sh")))))))
        (description
         "GNU Mes [Maxwell Equations of Software] aims to create full source
 bootstrapping for GuixSD.  It consists of a mutual self-hosting [close to



reply via email to

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