guix-commits
[Top][All Lists]
Advanced

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

177/207: gnu: mes-boot: Cleanup.


From: Jan Nieuwenhuizen
Subject: 177/207: gnu: mes-boot: Cleanup.
Date: Sat, 8 Sep 2018 13:26:26 -0400 (EDT)

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

commit f976298c1cb3833c6d9c6870c588e285a1a3e052
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Mon Sep 3 10:58:44 2018 +0200

    gnu: mes-boot: Cleanup.
    
    * gnu/packages/commencement.scm (mes-boot): Cleanup.
---
 gnu/packages/commencement.scm | 211 ++++++++++++++++++++++--------------------
 1 file changed, 110 insertions(+), 101 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 486ede3..e0e43f0 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -173,7 +173,8 @@
                   (setenv "PREFIX" out)
                   (setenv "MES_PREFIX" "../mes-source")
                   (setenv "MESCC_TOOLS_SEED" "../mescc-tools-seed")
-                  (setenv "MES_SEED" "../mes-seed"))))
+                  (setenv "MES_SEED" "../mes-seed")
+                  #t)))
             (replace 'build
               (lambda _
                (invoke "sh" "build.sh")))
@@ -202,106 +203,114 @@
                   "0dlcqmchhl57nh7f0v6qb1kkbi7zbs3b185hcqv57fhb60b7rgcq")))))))
 
 (define-public mes-boot
-  (let ((version "0.17")
-        (revision "0")
-        (commit #f))
-    (package-with-bootstrap-guile
-     (package
-       (inherit mes)
-       (source (package-source mes-boot0))
-       (name "mes-boot")
-       (inputs '())
-       (propagated-inputs '())
-       (native-inputs
-        `(("mescc-tools" ,mescc-tools-boot)
-          ("nyacc-source" ,(package-source nyacc-boot))
-
-          ("coreutils" , %bootstrap-coreutils&co)
-          ("mes-seed" ,%mes-seed)
-          ,@(if %fake-bootstrap? ; cheat: fast non-bootstrap testing with Guile
-                `(("guile" ,%bootstrap-guile)
-                  ("srfi-43" ,%srfi-43)) ; guile-2.0.9 lacks srfi-43; 
cherry-pick
-                '())))
-       (arguments
-        `(#:implicit-inputs? #f
-          #:guile ,%bootstrap-guile
-          #: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")))))))))))
+  (package-with-bootstrap-guile
+   (package
+     (inherit mes)
+     (source (package-source mes-boot0))
+     (name "mes-boot")
+     (inputs '())
+     (propagated-inputs '())
+     (native-inputs
+      `(("mescc-tools" ,mescc-tools-boot)
+        ("nyacc-source" ,(package-source nyacc-boot))
+
+        ("coreutils" , %bootstrap-coreutils&co)
+        ("mes-seed" ,%mes-seed)
+        ,@(if %fake-bootstrap?  ; cheat: fast non-bootstrap testing with Guile
+              `(("guile" ,%bootstrap-guile)
+                ("srfi-43" ,%srfi-43)) ; guile-2.0.9 lacks srfi-43; cherry-pick
+              '())))
+     (arguments
+      `(#:implicit-inputs? #f
+        #:guile ,%bootstrap-guile
+        #: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")))
+                (with-directory-excursion ".."
+                  (and
+                   (mkdir-p "nyacc-source")
+                   (invoke "tar" "--strip=1" "-C" "nyacc-source" "-xvf" 
nyacc-source)
+                   (mkdir-p "mes-seed")
+                   (invoke "tar" "--strip=1" "-C" "mes-seed" "-xvf" mes-seed)
+                   (or (not srfi-43)
+                       (and (mkdir-p "srfi")
+                            (copy-file srfi-43 "srfi/srfi-43.scm")
+                            #t)))))))
+          (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" ".")
+                (invoke "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")
+                #t)))
+          (replace 'build
+            (lambda _
+              (invoke "sh" "build.sh")))
+          (replace 'check
+            (lambda _
+              (or ,%fake-bootstrap?     ; check takes ~15min, skip when faking
+                  (and
+                   (setenv "MES_ARENA" "100000000")
+                   (setenv "DIFF" "sh scripts/diff.scm")
+                   (invoke "sh" "-x" "build-aux/test.sh" "scaffold/tests/t")
+                   (invoke "sh" "-x" "build-aux/test.sh" 
"scaffold/tests/63-struct-cell")
+                   (invoke "sh" "-x" "check.sh")))))
+          (replace 'install
+            (lambda _
+              (invoke "sh" "install.sh"))))))
+     (native-search-paths
+      ;; Use the language-specific variables rather than 'CPATH' because they
+      ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'.
+      ;; The intent is to allow headers that are in the search path to be
+      ;; treated as "system headers" (headers exempt from warnings) just like
+      ;; the typical /usr/include headers on an FHS system.
+      (list (search-path-specification
+             (variable "C_INCLUDE_PATH")
+             (files '("share/mes/include")))
+            (search-path-specification
+             (variable "LIBRARY_PATH")
+             (files '("share/mes/lib"))))))))
 
 (define-public tcc-boot0
   (let ((version "0.9.26")



reply via email to

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