guix-commits
[Top][All Lists]
Advanced

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

11/16: mes-boot1: build with gash


From: guix-commits
Subject: 11/16: mes-boot1: build with gash
Date: Fri, 30 Nov 2018 13:21:49 -0500 (EST)

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

commit 7aea4eb69a5fd6100e2275d45820600d5a4217b7
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Wed Nov 28 20:15:58 2018 +0100

    mes-boot1: build with gash
---
 gnu/packages/commencement.scm | 118 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 118 insertions(+)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index d773bf1..814110a 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -106,6 +106,29 @@
       (native-inputs '())
       (propagated-inputs '()))))
 
+(define mes-boot1
+  (let ((version "0.19")
+        (revision "0")
+        (commit "865b2f682a1934f2c75631d7b588600a1079a0ee"))
+    (package
+      (inherit mes)
+      (name "mes-boot0")
+      (version (if commit (string-append version "-" revision "." (string-take 
commit 7))
+                   (package-version mes)))
+      (source (if commit
+                  (origin
+                    (method url-fetch)
+                    (uri (string-append
+                          "https://git.savannah.gnu.org/cgit/mes.git/snapshot/";
+                          name "-" commit
+                          ".tar.gz"))
+                    (sha256
+                     (base32
+                      "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")))
+                  (package-source mes)))
+      (native-inputs '())
+      (propagated-inputs '()))))
+
 (define nyacc-boot
   (let ((version "0.86.0")
         (revision "0")
@@ -234,6 +257,101 @@
              (variable "LIBRARY_PATH")
              (files '("share/mes/lib"))))))))
 
+(define-public mes-boot1
+  (package-with-bootstrap-guile
+   (package
+     (inherit mes)
+     (version (package-version mes-boot1))
+     (source (package-source mes-boot1))
+     (name "mes-boot1")
+     (inputs '())
+     (propagated-inputs '())
+     (native-inputs
+      `(("mescc-tools" ,%bootstrap-mescc-tools)
+        ("nyacc-source" ,(package-source nyacc-boot))
+
+        ("gash" , %bootstrap-gash)
+        ("bootstrap-mes" ,%bootstrap-mes)
+        ,@(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
+        #:tests? #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"))
+                    (bootstrap-mes (assoc-ref %build-inputs "bootstrap-mes")))
+                (with-directory-excursion ".."
+                  (and
+                   (mkdir-p "nyacc-source")
+                   (invoke "tar" "--strip=1" "-C" "nyacc-source" "-xvf" 
nyacc-source)
+                   (symlink (string-append bootstrap-mes "/lib") "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"))
+                    (gash (assoc-ref %build-inputs "gash")))
+                (setenv "PATH" (string-append gash "/libexec/gash/bin:" 
(getenv PATH)))
+                (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
+                (symlink (string-append "../nyacc-source/module") "nyacc")
+                (setenv "V" "1")
+                (setenv "GUILE_LOAD_PATH" "nyacc")
+                (setenv "GUILE_TOOLS" "true") ; no tools in bootstrap-guile
+                (invoke "bash" "configure.sh"
+                        (string-append "--prefix=" out))
+                (setenv "MES" "src/mes")
+                (setenv "MESCC" "scripts/mescc")
+                (when ,%fake-bootstrap? ; Cheat using Guile+Nyacc+MesCC; ~30 
times faster
+                  (let ((dir (with-directory-excursion ".." (getcwd)))
+                        (guile (assoc-ref %build-inputs "guile"))
+                        (srfi-43 (assoc-ref %build-inputs "srfi-43")))
+                    (setenv "MES" "guile")
+                    (setenv "GUILE_AUTO_COMPILE" "1")
+                    (setenv "GUILE_LOAD_COMPILED_PATH"
+                            (string-append guile "/lib/guile/2.2/ccache"))
+                    (setenv "GUILE_LOAD_PATH"
+                            (string-append (string-append dir 
"/nyacc-source/module")
+                                           ":" dir
+                                           ":" guile "/share/guile/2.2/"))
+                    ;; 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")))
+                #t)))
+          (replace 'build
+            (lambda _
+              (invoke "sh" "-x" "build.sh")))
+          (replace 'install
+            (lambda _
+              (invoke "sh" "-x" "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 tcc-boot0
   ;; Pristine tcc cannot be built by MesCC, we are keeping a delta of 11
   ;; patches.  In a very early and rough form they were presented to the



reply via email to

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