guix-commits
[Top][All Lists]
Advanced

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

13/16: mes-boot1: WIP -- works with subst


From: guix-commits
Subject: 13/16: mes-boot1: WIP -- works with subst
Date: Fri, 30 Nov 2018 13:21:51 -0500 (EST)

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

commit 8c834257f2e972251cc1b5d15833337cc8cfaa3d
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Fri Nov 30 11:41:19 2018 +0100

    mes-boot1: WIP -- works with subst
---
 gnu/packages/commencement.scm | 118 ++++++++++++++++++++++++++++--------------
 1 file changed, 78 insertions(+), 40 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 814110a..8e4489e 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -106,13 +106,14 @@
       (native-inputs '())
       (propagated-inputs '()))))
 
-(define mes-boot1
+(define mes-boot1-source
   (let ((version "0.19")
         (revision "0")
-        (commit "865b2f682a1934f2c75631d7b588600a1079a0ee"))
+        (commit #f ;;"865b2f682a1934f2c75631d7b588600a1079a0ee"
+                ))
     (package
       (inherit mes)
-      (name "mes-boot0")
+      (name "mes-boot1-source")
       (version (if commit (string-append version "-" revision "." (string-take 
commit 7))
                    (package-version mes)))
       (source (if commit
@@ -120,12 +121,19 @@
                     (method url-fetch)
                     (uri (string-append
                           "https://git.savannah.gnu.org/cgit/mes.git/snapshot/";
-                          name "-" commit
+                          "mes" "-" commit
                           ".tar.gz"))
                     (sha256
                      (base32
-                      "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")))
-                  (package-source mes)))
+                      "07lvmb13x3x4iqwdh9w4802ky7fv0n2rzp3hika85w79pm1wx6ay")))
+                  (origin
+                    (method url-fetch)
+                    (uri (string-append
+                          "http://lilypond.org/janneke/mes/";
+                          
"mes-865b2f682a1934f2c75631d7b588600a1079a0ee.tar.Z"))
+                    (sha256
+                        (base32
+                         
"0wd847xi0hnnx9q65f10yyi17a9ixyyl4z6a8hxm2qa50rk8dxzi")))))
       (native-inputs '())
       (propagated-inputs '()))))
 
@@ -152,6 +160,20 @@
                "0dlcqmchhl57nh7f0v6qb1kkbi7zbs3b185hcqv57fhb60b7rgcq")))
            (package-source nyacc))))))
 
+(define-public nyacc-boot1
+  (package
+    (inherit nyacc)
+    (name "nyacc-boot1")
+    (version "0.86.0")
+    (source (origin
+           (method url-fetch)
+           (uri (string-append
+                 "http://lilypond.org/janneke/mes/";
+                 "nyacc-" version ".tar"))
+           (sha256
+            (base32
+             "1912yx1vr9l97gr0wddm9j7f0p3wvfc410dmvdmg11jvjssvmdjp"))))))
+
 (define-public mes-boot
   (package-with-bootstrap-guile
    (package
@@ -261,22 +283,18 @@
   (package-with-bootstrap-guile
    (package
      (inherit mes)
-     (version (package-version mes-boot1))
-     (source (package-source mes-boot1))
+     (version (package-version mes-boot1-source))
+     (source (package-source mes-boot1-source))
      (name "mes-boot1")
      (inputs '())
      (propagated-inputs '())
      (native-inputs
       `(("mescc-tools" ,%bootstrap-mescc-tools)
-        ("nyacc-source" ,(package-source nyacc-boot))
+        ("nyacc-source" ,(package-source nyacc-boot1))
 
+        ("guile" ,%bootstrap-guile)
         ("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
-              '())))
+        ("bootstrap-mes" ,%bootstrap-mes)))
      (arguments
       `(#:implicit-inputs? #f
         #:tests? #f
@@ -284,61 +302,81 @@
         #:strip-binaries? #f   ; binutil's strip b0rkes MesCC/M1/hex2 binaries
         #:phases
         (modify-phases %standard-phases
+          (add-before 'unpack 'setenv
+            (lambda _
+              (let ((gash (assoc-ref %build-inputs "gash")))
+                (setenv "PATH" (string-append gash "/libexec/gash:" (getenv 
"PATH")))
+                #t)))
           (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"))
+              (let ((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)))))))
+                   (symlink (string-append bootstrap-mes "/lib") 
"mes-seed"))))))
           (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")
+              (let ((out (assoc-ref %outputs "out")))
+                ;;(symlink (string-append "../nyacc-source/module") "nyacc")
+                (symlink (string-append "../nyacc-source/nyacc-0.86.0/module") 
"nyacc")
                 (setenv "V" "1")
                 (setenv "GUILE_LOAD_PATH" "nyacc")
-                (setenv "GUILE_TOOLS" "true") ; no tools in bootstrap-guile
-                (invoke "bash" "configure.sh"
+                ;; (setenv "GUILE_LOAD_PATH"
+                ;;         (string-append "nyacc:"
+                ;;                        (getenv "GUILE_LOAD_PATH")))
+                (invoke "sh" "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")))
+                        (guile (assoc-ref %build-inputs "guile")))
                     (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")
+                            (string-append ;;(string-append dir 
"/nyacc-source/module")
+                                           (string-append dir 
"/nyacc-source/nyacc-0.86.0/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"))
+                                           guile "/share/guile/2.2/"))
                     ;; 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")))
+              (substitute* "bootstrap.sh"
+                (("guile build-aux/mes-snarf.scm (.*)" all cmd)
+                 (string-append "echo guile -e '(mes-snarf)' 
build-aux/mes-snarf.scm " cmd "\n"
+                                "guile -e '(mes-snarf)' 
build-aux/mes-snarf.scm " cmd "\n"
+                                "ls -l src\n"
+                                ))
+                (("guile --no-auto-compile (.*)" all cmd)
+                 (string-append "echo guile " cmd "\n"
+                                "guile " cmd "\n"
+                                "ls -l lib lib/x86-mes src\n"
+                                ))
+                )
+              (system* "guile" "-e" "(mes-snarf)" "build-aux/mes-snarf.scm" 
"--mes" "src/gc.c")
+              ;;(invoke "sh" "-x" "bootstrap.sh")
+              (system* "sh" "-x" "bootstrap.sh")
+
+              (system* "ls" "-l" "src")
+              (format #t "***************************************\n")
+              (system* "guile" "-e" "main" "-L" "module" "scripts/mescc.scm" 
"-c" "-D" "VERSION=\"0.18\"" "-D" 
"MODULEDIR=\"/gnu/store/x8xwcz1r9j3pcpg1f1szsmh6pbpjk1bb-mes-boot1-0.19-0.84ac0f1/share/mes/module\""
 "-D" 
"PREFIX=\"/gnu/store/x8xwcz1r9j3pcpg1f1szsmh6pbpjk1bb-mes-boot1-0.19-0.84ac0f1\""
 "-I" "." "-I" "lib" "-I" "include" "-v" "-g" "-L" "lib/linux/x86-mes" "-L" 
"lib/linux" "-L" "lib/x86-mes" "-L" "lib" "-L" "../mes-seed" "-o" 
"lib/libc+tcc.x86-mes-o" "lib/libc+tcc.c")
+              (system* "ls" "-l" "lib")
+              (system* "ls" "-l" "lib/x86-mes")
+              (system* "guile" "-e" "main" "-L" "module" "scripts/mescc.scm" 
"-c" "-D" "VERSION=\"0.18\"" "-D" 
"MODULEDIR=\"/gnu/store/82qc72947aqskaj223zpsv0aiizj9v4q-mes-boot1-0.19-0.84ac0f1/share/mes/module\""
 "-D" 
"PREFIX=\"/gnu/store/82qc72947aqskaj223zpsv0aiizj9v4q-mes-boot1-0.19-0.84ac0f1\""
 "-I" "." "-I" "lib" "-I" "include" "-v" "-g" "-L" "lib/linux/x86-mes" "-L" 
"lib/linux" "-L" "lib/x86-mes" "-L" "lib" "-L" "../mes-seed" "-o" 
"src/mes.x86-mes-o" "src/mes.c")
+              (system* "ls" "-l" "src")
+              #t))
           (replace 'install
             (lambda _
-              (invoke "sh" "-x" "install.sh"))))))
+              ;;(invoke "sh" "-x" "install.sh")
+              (throw 'barf)
+              )))))
      (native-search-paths
       ;; Use the language-specific variables rather than 'CPATH' because they
       ;; are equivalent to '-isystem' whereas 'CPATH' is equivalent to '-I'.



reply via email to

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