guix-commits
[Top][All Lists]
Advanced

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

01/01: gnu: tcc-boot: Use bootstrap Guile and simplify.


From: Ricardo Wurmus
Subject: 01/01: gnu: tcc-boot: Use bootstrap Guile and simplify.
Date: Sun, 26 Nov 2017 10:27:00 -0500 (EST)

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

commit 83f77bf73cef634ea43c754b04bbcb298e8ac98a
Author: Ricardo Wurmus <address@hidden>
Date:   Sun Nov 26 13:19:28 2017 +0100

    gnu: tcc-boot: Use bootstrap Guile and simplify.
    
    * gnu/packages/mes.scm (tcc-boot): Simplify; use %bootstrap-guile and
    package-with-bootstrap-guile.
---
 gnu/packages/mes.scm | 209 +++++++++++++++++++++++++--------------------------
 1 file changed, 102 insertions(+), 107 deletions(-)

diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm
index 23892f5..df27a19 100644
--- a/gnu/packages/mes.scm
+++ b/gnu/packages/mes.scm
@@ -327,119 +327,114 @@ extensive examples, including parsers for the 
Javascript and C99 languages.")
   (let ((version "0.9.26")
         (revision "0")
         (commit "8f495f27423acbf569459f517466a07ed2c96c45"))
-    (package
-      (name "tcc-boot")
-      (version (string-append version "-" revision "." (string-take commit 7)))
-      (synopsis "Tiny and fast C compiler")
-      (source (origin
-                (method url-fetch)
-                (uri (string-append "https://gitlab.com/janneke/tinycc";
-
-                                    "/repository/archive.tar.gz?ref="
-                                    commit))
-                (file-name (string-append name "-" version ".tar.xz"))
-                (sha256
-                 (base32
-                  "15kh9qpc12pph0yz1rz8v646kx9x62a1cqgy0g0y4vbj3sampdsy"))))
-      (build-system trivial-build-system)
-      (supported-systems '("i686-linux" "x86_64-linux"))
-      (native-inputs
-       `(("static-bash" ,@(assoc-ref %bootstrap-inputs "bash"))
-         ("bash" ,(search-bootstrap-binary "bash" (%current-system)))
-         ("guile" ,(origin (method url-fetch)
-                           (uri ((@@ (gnu packages package-management) 
boot-guile-uri) "x86_64"))
-                           (sha256
-                            (base32
-                             
"1w2p5zyrglzzniqgvyn1b55vprfzhgk8vzbzkkbdgl5248si0yq3"))))
-         ;; guile-2.0.9 does not have srfi-43; cherry-pick
-         ("srfi-43" ,(origin
-                       (method url-fetch)
-                       (uri 
"http://git.savannah.gnu.org/cgit/guile.git/plain/module/srfi/srfi-43.scm?h=stable-2.0";)
-                       (file-name "srfi-43.scm")
-                       (sha256
-                        (base32
-                         
"0rnkppwdkxbzkgp9s9ccmby9f7p3ijxjlmvj0pzqxwmrmpy7jwmb"))))
-         ("tar" ,(search-bootstrap-binary "tar" (%current-system)))
-         ("xz"  ,(search-bootstrap-binary "xz" (%current-system)))
-         ("mes" ,mes-boot)
-         ("mescc-tools" ,mescc-tools-boot)
-         ("nyacc-source" ,(package-source nyacc-boot))
-         ("tinycc-seed"
-          ,(origin
-             (method url-fetch)
-             (uri (string-append "https://gitlab.com/janneke/tinycc-seed";
-                                 "/repository/archive.tar.gz?ref="
-                                 "393a3117a91ec057494986bd75215e1a1786d69d"))
-             (file-name (string-append name "-seed" "-" version ".tar.xz"))
-             (sha256
-              (base32
-               "0ipb59my9hxkaybvj8bss5chqs2ypga3k765l93z374p57cqmllm"))))))
-      (arguments
-       `(#:modules ((guix build utils))
-         #:builder
-         (begin
-           (use-modules (guix build utils))
-           (let* ((bash (assoc-ref %build-inputs "static-bash"))
-                  (mes (assoc-ref %build-inputs "mes"))
-                  (guile (assoc-ref %build-inputs "guile"))
-                  (srfi-43 (assoc-ref %build-inputs "srfi-43"))
-                  (mescc-tools (assoc-ref %build-inputs "mescc-tools"))
-                  (tar (assoc-ref %build-inputs "tar"))
-                  (xz (assoc-ref %build-inputs "xz"))
-                  (source (assoc-ref %build-inputs "source"))
-                  (nyacc-source (assoc-ref %build-inputs "nyacc-source"))
-                  (tinycc-seed (assoc-ref %build-inputs "tinycc-seed"))
-                  (out (assoc-ref %outputs "out"))
-                  (out/bin (string-append out "/bin"))
-                  (interpreter "interpreter")
-                  (dir (getcwd)))
-             (setenv "PATH" (string-append bash "/bin:"
-                                           mes "/bin:"
-                                           "../guile/bin:"
-                                           mescc-tools "/bin:"
-                                           tar "/bin:"
-                                           xz "/bin"))
-             (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
-             (mkdir-p "source")
-             (system* "tar" "--strip=1" "-C" "source" "-xvf" source)
-             (mkdir-p "guile")
-             (system* "tar" "-C" "guile" "-xvf" guile)
-             (mkdir-p "nyacc-source")
-             (system* "tar" "--strip=1" "-C" "nyacc-source" "-xvf" 
nyacc-source)
-             (mkdir-p "tinycc-seed")
-             (system* "tar" "--strip=1" "-C" "tinycc-seed" "-xvf" tinycc-seed)
-             (mkdir-p "srfi")
-             (system* "cp" srfi-43 "srfi/srfi-43.scm")
-             (chdir "source")
-             (zero? (system (string-append
-"set -ex;"
+    (package-with-bootstrap-guile
+     (package
+       (name "tcc-boot")
+       (version (string-append version "-" revision "." (string-take commit 
7)))
+       (synopsis "Tiny and fast C compiler")
+       (source (origin
+                 (method url-fetch)
+                 (uri (string-append "https://gitlab.com/janneke/tinycc";
 
-;; configure
-"export PREFIX=" out ";"
-"export MESCC=" mes "/bin/mescc.scm;"
-"export GUILE_AUTO_COMPILE=1;"
-"export GUILE_LOAD_COMPILED_PATH=" dir "/guile/lib/guile/2.0/ccache;"
-"export GUILE_LOAD_PATH=" dir
-  ":" dir "/guile/share/guile/2.0/"
-  ":" dir "/nyacc-source/module"
-  ":" mes "/share/mes/guile;"
-
-"sh configure --prefix=$PREFIX --elfinterp=interpreter --crtprefix=. 
--tccdir=.;"
+                                     "/repository/archive.tar.gz?ref="
+                                     commit))
+                 (file-name (string-append name "-" version ".tar.xz"))
+                 (sha256
+                  (base32
+                   "15kh9qpc12pph0yz1rz8v646kx9x62a1cqgy0g0y4vbj3sampdsy"))))
+       (build-system trivial-build-system)
+       (supported-systems '("i686-linux" "x86_64-linux"))
+       (native-inputs
+        `(("static-bash" ,@(assoc-ref %bootstrap-inputs "bash"))
+          ("guile" ,%bootstrap-guile)
+          ;; guile-2.0.9 does not have srfi-43; cherry-pick
+          ("srfi-43" ,(origin
+                        (method url-fetch)
+                        (uri 
"http://git.savannah.gnu.org/cgit/guile.git/plain/module/srfi/srfi-43.scm?h=stable-2.0";)
+                        (file-name "srfi-43.scm")
+                        (sha256
+                         (base32
+                          
"0rnkppwdkxbzkgp9s9ccmby9f7p3ijxjlmvj0pzqxwmrmpy7jwmb"))))
+          ("tar" ,(search-bootstrap-binary "tar" (%current-system)))
+          ("xz"  ,(search-bootstrap-binary "xz" (%current-system)))
+          ("mes" ,mes-boot)
+          ("mescc-tools" ,mescc-tools-boot)
+          ("nyacc-source" ,(package-source nyacc-boot))
+          ("tinycc-seed"
+           ,(origin
+              (method url-fetch)
+              (uri (string-append "https://gitlab.com/janneke/tinycc-seed";
+                                  "/repository/archive.tar.gz?ref="
+                                  "393a3117a91ec057494986bd75215e1a1786d69d"))
+              (file-name (string-append name "-seed" "-" version ".tar.xz"))
+              (sha256
+               (base32
+                "0ipb59my9hxkaybvj8bss5chqs2ypga3k765l93z374p57cqmllm"))))))
+       (arguments
+        `(#:modules ((guix build utils))
+          #:builder
+          (begin
+            (use-modules (guix build utils))
+            (let* ((bash (assoc-ref %build-inputs "static-bash"))
+                   (mes (assoc-ref %build-inputs "mes"))
+                   (guile (assoc-ref %build-inputs "guile"))
+                   (srfi-43 (assoc-ref %build-inputs "srfi-43"))
+                   (mescc-tools (assoc-ref %build-inputs "mescc-tools"))
+                   (tar (assoc-ref %build-inputs "tar"))
+                   (xz (assoc-ref %build-inputs "xz"))
+                   (source (assoc-ref %build-inputs "source"))
+                   (nyacc-source (assoc-ref %build-inputs "nyacc-source"))
+                   (tinycc-seed (assoc-ref %build-inputs "tinycc-seed"))
+                   (out (assoc-ref %outputs "out"))
+                   (dir (getcwd)))
+              (setenv "PATH" (string-append bash "/bin:"
+                                            mes "/bin:"
+                                            guile "/bin:"
+                                            mescc-tools "/bin:"
+                                            tar "/bin:"
+                                            xz "/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 "tinycc-seed")
+              (system* "tar" "--strip=1" "-C" "tinycc-seed" "-xvf" tinycc-seed)
+              (mkdir-p "srfi")
+              (system* "cp" srfi-43 "srfi/srfi-43.scm")
+              (chdir "source")
+              (setenv "PREFIX" out)
+              (setenv "MESCC" (string-append mes "/bin/mescc.scm"))
+              (setenv "GUILE_AUTO_COMPILE" "1")
+              (setenv "GUILE_LOAD_COMPILED_PATH"
+                      (string-append guile "/lib/guile/2.0/ccache"))
+              (setenv "GUILE_LOAD_PATH"
+                      (string-append dir
+                                     ":" guile "/share/guile/2.0/"
+                                     ":" dir "/nyacc-source/module"
+                                     ":" mes "/share/mes/guile"))
+              (and
+               ;; configure
+               (zero? (system* "sh" "configure"
+                               "--prefix=$PREFIX"
+                               "--elfinterp=interpreter"
+                               "--crtprefix=."
+                               "--tccdir=."))
 
-;; build
-"sh build.sh;"
+               ;; build
+               (zero? (system* "sh" "build.sh"))
 
-;; check: 26/65 tests fail
-"sh check.sh || true;"
+               ;; check: 26/65 tests fail
+               (or (zero? (system* "sh" "check.sh")) #t)
 
-;; install
-"sh install.sh;"))))))) ; []
-      (description
-       "TCC, also referred to as \"TinyCC\", is a small and fast C compiler
+               ;; install
+               (zero? (system* "sh" "install.sh")))))))
+       (description
+        "TCC, also referred to as \"TinyCC\", is a small and fast C compiler
 written in C.  It supports ANSI C with GNU and extensions and most of the C99
 standard.")
-      (home-page "http://www.tinycc.org/";)
-      (license lgpl2.1+))))
+       (home-page "http://www.tinycc.org/";)
+       (license lgpl2.1+)))))
 
 ;; gcc-boot
 ;; <rain1> what I did was just this  [19:11]



reply via email to

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