guix-commits
[Top][All Lists]
Advanced

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

12/20: commencement: Add tcc-boot0-next.


From: guix-commits
Subject: 12/20: commencement: Add tcc-boot0-next.
Date: Sun, 20 Dec 2020 04:03:17 -0500 (EST)

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

commit 704c5c41a93df214bd3f496043d8ee8b3e1f75f7
Author: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
AuthorDate: Sun Dec 13 14:59:35 2020 +0100

    commencement: Add tcc-boot0-next.
    
    * gnu/packages/commencement.scm (tcc-boot0-next): New variable.
---
 gnu/packages/commencement.scm | 90 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 90 insertions(+)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 2c06025..a0ec03e 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -715,6 +715,96 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
             (variable "LIBRARY_PATH")
             (files '("lib")))))))
 
+(define-public tcc-boot0-next
+  ;; Pristine tcc cannot be built by MesCC, we are keeping a delta of 30
+  ;; patches.  In a very early and rough form they were presented to the
+  ;; TinyCC developers, who at the time showed no interest in supporting the
+  ;; bootstrappable effort; we will try again later.  These patches have been
+  ;; ported to 0.9.27, alas the resulting tcc is buggy.  Once MesCC is more
+  ;; mature, this package should use the 0.9.27 sources (or later).
+  (package
+    (inherit tcc)
+    (name "tcc-boot0-next")
+    (version "0.9.26-1133-gb906ff86")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "http://lilypond.org/janneke/tcc/";
+                    "/tcc-" version ".tar.gz"))
+              (sha256
+               (base32
+                "133qix3xscgsj93z5a095z8mxkanm225ylpczw79m1s2gy19fb7q"))))
+    (build-system gnu-build-system)
+    (supported-systems '("armhf-linux" "aarch64-linux"
+                         "i686-linux" "x86_64-linux"))
+    (inputs '())
+    (propagated-inputs '())
+    (native-inputs
+     `(("mes" ,mes-boot-next)
+       ("nyacc-source" ,(origin (inherit (package-source nyacc-1.00.2))
+                                (snippet #f)))
+       ("mescc-tools" ,%bootstrap-mescc-tools)
+       ,@(%boot-gash-inputs)))
+    (arguments
+     `(#:implicit-inputs? #f
+       #:guile ,%bootstrap-guile
+       #:validate-runpath? #f           ; no dynamic executables
+       #:strip-binaries? #f             ; no strip yet
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'unpack-seeds
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((nyacc-source (assoc-ref %build-inputs "nyacc-source")))
+               (with-directory-excursion ".."
+                 (invoke "tar" "-xvf" nyacc-source)))))
+         (replace 'configure
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref %outputs "out"))
+                    (dir (with-directory-excursion ".." (getcwd)))
+                    (interpreter "/lib/mes-loader")
+                    (mes (assoc-ref inputs "mes"))
+                    (mescc (string-append mes "/bin/mescc")))
+               (substitute* "conftest.c"
+                 (("volatile") ""))
+               (setenv "prefix" out)
+               (invoke "sh" "configure"
+                       "--cc=mescc"
+                       (string-append "--prefix=" out)
+                       (string-append "--elfinterp=" interpreter)
+                       "--crtprefix=."
+                       "--tccdir=."))))
+         (replace 'build
+           (lambda _
+             (substitute* "bootstrap.sh" ; Show some progress
+               (("^( *)((cp|ls|mkdir|rm|[.]/tcc|[.]/[$][{program_prefix[}]tcc) 
[^\"]*[^\\])\n" all space cmd)
+                (string-append space "echo \"" cmd "\"\n"
+                               space cmd "\n")))
+             (invoke "sh" "bootstrap.sh")))
+         (replace 'check
+           (lambda _
+             ;; fail fast tests
+             (system* "./tcc" "--help") ; --help exits 1
+             ;; (invoke "sh" "test.sh" "mes/scaffold/tests/30-strlen")
+             ;; (invoke "sh" "-x" "test.sh" 
"mes/scaffold/tinycc/00_assignment")
+             ;; TODO: add sensible check target (without depending on make)
+             ;;(invoke "sh" "check.sh")
+             #t))
+         (replace 'install
+           (lambda _
+             (substitute* "install.sh"  ; Show some progress
+               (("^( *)((cp|ls|mkdir|rm|tar|./[$][{PROGRAM_PREFIX[}]tcc) 
[^\"]*[^\\])\n" all space cmd)
+                (string-append space "echo \"" cmd "\"\n"
+                               space cmd "\n")))
+
+             (invoke "sh" "install.sh"))))))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "C_INCLUDE_PATH")
+            (files '("include")))
+           (search-path-specification
+            (variable "LIBRARY_PATH")
+            (files '("lib")))))))
+
 (define gzip-mesboot
   ;; The initial gzip.  We keep this scripted gzip build before building make
   ;; to soften the dependency on Gash Core Utils gzip.



reply via email to

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