Subject: [PATCH] gnu: tcc: Update to a83b28568596afd8792fd58d1a5bd157fc6b6634

From: Ekaitz Zarraga <[email-masked]>
Date: Tue, 12 Jul 2022 09:39:30 +0000

Hi,

With this patch the tcc build issue is fixed, the downside is that it's
set to an specific commit and not a release.

It also separates tcc-boot from the tcc source, so it does not interfere
in the bootstrapping process (the patch moves the source of tcc to git
and that produces a circular dependency).

I hope this is useful.

Best,
Ekaitz

From ed05cfb9356fb5b07be48c54b9ec33eab672de61 Mon Sep 17 00:00:00 2001
From: Ekaitz Zarraga <[email-masked]>
Date: Tue, 12 Jul 2022 11:05:15 +0200
Subject: [PATCH] gnu: tcc: Update to a83b28568596afd8792fd58d1a5bd157fc6b6634

* gnu/packages/c.scm (tcc): Update to a83b28568596afd8792fd58d1a5bd157fc6b6634

* gnu/packages/commencement.scm (tcc-boot)[source]: Remove dependency on
tcc.
---
 gnu/packages/c.scm            | 110 ++++++++++++++++++----------------
 gnu/packages/commencement.scm |   9 ++-
 2 files changed, 66 insertions(+), 53 deletions(-)

diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index b1f68c706b..c5afc2fc1c 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2021 Foo Chuan Wei <[email-masked]>
 ;;; Copyright © 2022 (unmatched parenthesis <[email-masked]>
 ;;; Copyright © 2022 Artyom V. Poptsov <[email-masked]>
+;;; Copyright © 2022 Ekaitz Zarraga <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -112,58 +113,63 @@ (define-public cproc
       (license license:expat))))
 
 (define-public tcc
-  (package
-    (name "tcc")                                  ;aka. "tinycc"
-    (version "0.9.27")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "mirror://savannah/tinycc/tcc-"
-                                  version ".tar.bz2"))
-              (sha256
-               (base32
-                "177bdhwzrnqgyrdv1dwvpd04fcxj68s5pm1dzwny6359ziway8yy"))))
-    (build-system gnu-build-system)
-    (native-inputs (list perl texinfo))
-    (arguments
-     `(#:configure-flags (list (string-append "--elfinterp="
-                                              (assoc-ref %build-inputs "libc")
-                                              ,(glibc-dynamic-linker))
-                               (string-append "--crtprefix="
-                                              (assoc-ref %build-inputs "libc")
-                                              "/lib")
-                               (string-append "--sysincludepaths="
-                                              (assoc-ref %build-inputs "libc")
-                                              "/include:"
-                                              (assoc-ref %build-inputs
-                                                         "kernel-headers")
-                                              "/include:{B}/include")
-                               (string-append "--libpaths="
-                                              (assoc-ref %build-inputs "libc")
-                                              "/lib")
-                               ,@(if (string-prefix? "armhf-linux"
-                                                     (or (%current-target-system)
-                                                         (%current-system)))
-                                     `("--triplet=arm-linux-gnueabihf")
-                                     '()))
-       #:test-target "test"))
-    (native-search-paths
-     (list (search-path-specification
-            (variable "CPATH")
-            (files '("include")))
-           (search-path-specification
-            (variable "LIBRARY_PATH")
-            (files '("lib" "lib64")))))
-    ;; Fails to build on MIPS: "Unsupported CPU"
-    (supported-systems (delete "mips64el-linux" %supported-systems))
-    (synopsis "Tiny and fast C compiler")
-    (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/")
-    ;; An attempt to re-licence tcc under the Expat licence is underway but not
-    ;; (if ever) complete.  See the RELICENSING file for more information.
-    (license license:lgpl2.1+)))
+  (let ((revision "1")
+        (commit  "a83b28568596afd8792fd58d1a5bd157fc6b6634"))
+    (package
+      (name "tcc")                                  ;aka. "tinycc"
+      (version (git-version "0.9.27" revision commit))
+      (source
+        (origin
+          (method git-fetch)
+          (uri (git-reference
+                 (url "git://repo.or.cz/tinycc.git")
+                 (commit commit)))
+          (file-name (git-file-name name version))
+          (sha256
+            (base32
+              "01znw86fg73x3k0clafica4b6glbhz69p588kvp766i0zgvs68dh"))))
+      (build-system gnu-build-system)
+      (native-inputs (list perl texinfo))
+      (arguments
+        `(#:configure-flags (list (string-append "--elfinterp="
+                                                 (assoc-ref %build-inputs "libc")
+                                                 ,(glibc-dynamic-linker))
+                                  (string-append "--crtprefix="
+                                                 (assoc-ref %build-inputs "libc")
+                                                 "/lib")
+                                  (string-append "--sysincludepaths="
+                                                 (assoc-ref %build-inputs "libc")
+                                                 "/include:"
+                                                 (assoc-ref %build-inputs
+                                                            "kernel-headers")
+                                                 "/include:{B}/include")
+                                  (string-append "--libpaths="
+                                                 (assoc-ref %build-inputs "libc")
+                                                 "/lib")
+                                  ,@(if (string-prefix? "armhf-linux"
+                                                        (or (%current-target-system)
+                                                            (%current-system)))
+                                      `("--triplet=arm-linux-gnueabihf")
+                                      '()))
+          #:test-target "test"))
+      (native-search-paths
+        (list (search-path-specification
+                (variable "CPATH")
+                (files '("include")))
+              (search-path-specification
+                (variable "LIBRARY_PATH")
+                (files '("lib" "lib64")))))
+      ;; Fails to build on MIPS: "Unsupported CPU"
+      (supported-systems (delete "mips64el-linux" %supported-systems))
+      (synopsis "Tiny and fast C compiler")
+      (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/")
+        ;; An attempt to re-licence tcc under the Expat licence is underway but not
+        ;; (if ever) complete.  See the RELICENSING file for more information.
+        (license license:lgpl2.1+))))
 
 (define-public pcc
   (package
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 820ff7281f..60b06c0901 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2021 Chris Marusich <[email-masked]>
 ;;; Copyright © 2021 Julien Lepiller <[email-masked]>
 ;;; Copyright © 2022 Ricardo Wurmus <[email-masked]>
+;;; Copyright © 2022 Ekaitz Zarraga <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -808,7 +809,13 @@ (define tcc-boot
     (inherit tcc-boot0)
     (name "tcc-boot")
     (version "0.9.27")
-    (source (package-source tcc))
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://savannah/tinycc/tcc-"
+                                  version ".tar.bz2"))
+              (sha256
+               (base32
+                "177bdhwzrnqgyrdv1dwvpd04fcxj68s5pm1dzwny6359ziway8yy"))))
     (build-system gnu-build-system)
     (inputs '())
     (propagated-inputs '())

base-commit: 6a6d9a858ef07571089f2f87466641f1374666b0
-- 
2.36.1