guix-commits
[Top][All Lists]
Advanced

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

01/01: gnu: tcc: Add search paths and drop the wrapper.


From: guix-commits
Subject: 01/01: gnu: tcc: Add search paths and drop the wrapper.
Date: Tue, 3 Dec 2019 16:18:22 -0500 (EST)

andreas pushed a commit to branch master
in repository guix.

commit 4c16ffd383592854e2760004d2df354f85b32e57
Author: Andreas Enge <address@hidden>
Date:   Tue Dec 3 22:16:32 2019 +0100

    gnu: tcc: Add search paths and drop the wrapper.
    
    * gnu/packages/c.scm (tcc): Add native search paths.
    (tcc-wrapper): Remove variable.
---
 gnu/packages/c.scm | 68 +++++++-----------------------------------------------
 1 file changed, 8 insertions(+), 60 deletions(-)

diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index 6428e86..921d473 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2018, 2019 Pierre Neidhardt <address@hidden>
 ;;; Copyright © 2019 Efraim Flashner <address@hidden>
 ;;; Copyright © 2019 Guillaume Le Vaillant <address@hidden>
+;;; Copyright © 2019 Andreas Enge <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -79,6 +80,13 @@
                                      `("--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")
@@ -91,66 +99,6 @@ standard.")
     ;; (if ever) complete.  See the RELICENSING file for more information.
     (license license:lgpl2.1+)))
 
-(define-public tcc-wrapper
-  (package
-    (inherit tcc)
-    (name "tcc-wrapper")
-    (build-system trivial-build-system)
-    (native-inputs '())
-    (inputs `(("tcc" ,tcc)
-              ("guile" ,guile-2.2)))
-
-    ;; By default TCC does not honor any search path environment variable.
-    ;; This wrapper adds them.
-    ;;
-    ;; FIXME: TCC includes its own linker so our 'ld-wrapper' hack to set the
-    ;; RUNPATH is ineffective here.  We should modify TCC itself.
-    (native-search-paths
-     (list (search-path-specification
-            (variable "TCC_CPATH")
-            (files '("include")))
-           (search-path-specification
-            (variable "TCC_LIBRARY_PATH")
-            (files '("lib" "lib64")))))
-
-    (arguments
-     '(#:builder
-       (let* ((out   (assoc-ref %outputs "out"))
-              (bin   (string-append out "/bin"))
-              (tcc   (assoc-ref %build-inputs "tcc"))
-              (guile (assoc-ref %build-inputs "guile")))
-         (mkdir out)
-         (mkdir bin)
-         (call-with-output-file (string-append bin "/cc")
-           (lambda (port)
-             (format port "#!~a/bin/guile --no-auto-compile~%!#~%" guile)
-             (write
-              `(begin
-                 (use-modules (ice-9 match)
-                              (srfi srfi-26))
-
-                 (define (split path)
-                   (string-tokenize path (char-set-complement
-                                          (char-set #\:))))
-
-                 (apply execl ,(string-append tcc "/bin/tcc")
-                        ,(string-append tcc "/bin/tcc") ;argv[0]
-                        (append (cdr (command-line))
-                                (match (getenv "TCC_CPATH")
-                                  (#f '())
-                                  (str
-                                   (map (cut string-append "-I" <>)
-                                        (split str))))
-                                (match (getenv "TCC_LIBRARY_PATH")
-                                  (#f '())
-                                  (str
-                                   (map (cut string-append "-L" <>)
-                                        (split str)))))))
-              port)
-             (chmod port #o777)))
-         #t)))
-    (synopsis "Wrapper providing the 'cc' command for TCC")))
-
 (define-public pcc
   (package
     (name "pcc")



reply via email to

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