GNU bug report logs - #41428
[PATCH 0/5] Wrappers for c compilers

Previous Next

Package: guix-patches;

Reported by: Ryan Prior <rprior <at> protonmail.com>

Date: Thu, 21 May 2020 00:52:02 UTC

Severity: normal

Tags: patch, wontfix

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ryan Prior <rprior <at> protonmail.com>
To: 41428 <at> debbugs.gnu.org
Subject: [bug#41428] [PATCH 1/5] gnu: Add tcc-wrapper.
Date: Thu, 21 May 2020 00:57:20 +0000
* gnu/packages/c.scm (tcc-wrapper): New variable.
* gnu/packages/c.scm (wrap-cc): New variable.
---
 gnu/packages/c.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index 5718ec66ac..757cfa7fba 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019 Guillaume Le Vaillant <glv <at> posteo.net>
 ;;; Copyright © 2019 Andreas Enge <andreas <at> enge.fr>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
+;;; Copyright © 2020 Ryan Prior <rprior <at> protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -288,3 +289,33 @@ address space pointers point to, or what locks a function acquires or
 releases.")
     (home-page "https://sparse.wiki.kernel.org/index.php/Main_Page")
     (license license:expat)))
+
+(define-public wrap-cc
+  (lambda* (cc #:optional
+               (bin (package-name cc))
+               (name (string-append (package-name cc) "-wrapper")))
+    (package/inherit cc
+      (name name)
+      (source #f)
+      (build-system trivial-build-system)
+      (outputs '("out"))
+      (native-inputs '())
+      (inputs '())
+      (propagated-inputs `(("cc" ,cc)))
+      (arguments
+       `(#:modules ((guix build utils))
+         #:builder
+         (begin
+           (use-modules (guix build utils))
+           (let ((bin-dir (string-append (assoc-ref %build-inputs "cc") "/bin/"))
+                 (wrapper-dir (string-append (assoc-ref %outputs "out") "/bin/")))
+             (mkdir-p wrapper-dir)
+             (symlink (string-append bin-dir ,bin)
+                      (string-append wrapper-dir "cc"))))))
+      (synopsis (string-append "Wrapper for " bin))
+      (description
+       (string-append
+        "Wraps " (package-name cc) " such that @command{" bin "} can be invoked
+under the name @command{cc}.")))))
+
+(define-public tcc-wrapper (wrap-cc tcc))
-- 
2.26.2






This bug report was last modified 4 years and 348 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.