Package: ccache
Version: 3.1.9-1
Followup-For: Bug #624589

Dear Maintainer,

The following patch makes the trigger script consider llvm-clang compilers
and adds appropriate symlinks to /usr/lib/ccache.

Please check the ccache.triggers.in use as I don't know if this will work
properly.

I did nothing wrt clang++-libc++ as this one is not versionned and I don't know
its status, it may be wise to check that with debian LLVM maintainers...

I only tested manually launching the script to check the symlinks creation...

Please advise if something needs to be done differently.

This patch is provided under whatever version of the GPL is required by debian

>From f22cd9021516ea4080624adafa4806eeeac7fcf8 Mon Sep 17 00:00:00 2001
From: Vincent Legoll <vincent.leg...@gmail.com>
Date: Mon, 11 Aug 2014 08:26:01 +0200
Subject: [PATCH] Updated to also consider llvm-clang for the /usr/lib/ccache
 compiler symlinks
To: vincent.leg...@gmail.com

---
 debian/ccache.triggers.in        |  1 +
 debian/update-ccache-symlinks.in | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/debian/ccache.triggers.in b/debian/ccache.triggers.in
index bd5b1ef..fe25a92 100644
--- a/debian/ccache.triggers.in
+++ b/debian/ccache.triggers.in
@@ -1,2 +1,3 @@
 interest /usr/lib/gcc
 interest /usr/lib/%DEB_HOST_MULTIARCH%/gcc
+interest /usr/lib/llvm*
diff --git a/debian/update-ccache-symlinks.in b/debian/update-ccache-
symlinks.in
index 0fbdecf..7662de2 100644
--- a/debian/update-ccache-symlinks.in
+++ b/debian/update-ccache-symlinks.in
@@ -23,6 +23,12 @@ sub consider_gcc {
     consider "${prefix}g++${suffix}";
 }

+sub consider_clang {
+    my ($suffix) = @_;
+    consider "clang${suffix}";
+    consider "clang++${suffix}";
+}
+
 # Find existing standard compiler names.
 foreach (@standard_names) {
     consider $_;
@@ -44,6 +50,15 @@ foreach my $dir (<$old_gcc_dir/*>, <$new_gcc_dir/*>) {
     }
 }

+# Find existing LLVM-clang variants.
+consider_clang "";
+foreach (</usr/lib/llvm-*>) {
+    if (! -l $_ and -d $_) {
+        s|.*/llvm-||;
+        consider_clang "-$_";
+    }
+}
+
 # Find existing symlinks.
 foreach (<$ccache_dir/*>) {
     if (-l) {
--
2.1.0.rc1



-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages ccache depends on:
ii  libc6   2.19-7
ii  zlib1g  1:1.2.8.dfsg-1

ccache recommends no packages.

Versions of packages ccache suggests:
pn  distcc  <none>

-- no debconf information
>From f22cd9021516ea4080624adafa4806eeeac7fcf8 Mon Sep 17 00:00:00 2001
From: Vincent Legoll <vincent.leg...@gmail.com>
Date: Mon, 11 Aug 2014 08:26:01 +0200
Subject: [PATCH] Updated to also consider llvm-clang for the /usr/lib/ccache
 compiler symlinks
To: vincent.leg...@gmail.com

---
 debian/ccache.triggers.in        |  1 +
 debian/update-ccache-symlinks.in | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/debian/ccache.triggers.in b/debian/ccache.triggers.in
index bd5b1ef..fe25a92 100644
--- a/debian/ccache.triggers.in
+++ b/debian/ccache.triggers.in
@@ -1,2 +1,3 @@
 interest /usr/lib/gcc
 interest /usr/lib/%DEB_HOST_MULTIARCH%/gcc
+interest /usr/lib/llvm*
diff --git a/debian/update-ccache-symlinks.in b/debian/update-ccache-symlinks.in
index 0fbdecf..7662de2 100644
--- a/debian/update-ccache-symlinks.in
+++ b/debian/update-ccache-symlinks.in
@@ -23,6 +23,12 @@ sub consider_gcc {
     consider "${prefix}g++${suffix}";
 }
 
+sub consider_clang {
+    my ($suffix) = @_;
+    consider "clang${suffix}";
+    consider "clang++${suffix}";
+}
+
 # Find existing standard compiler names.
 foreach (@standard_names) {
     consider $_;
@@ -44,6 +50,15 @@ foreach my $dir (<$old_gcc_dir/*>, <$new_gcc_dir/*>) {
     }
 }
 
+# Find existing LLVM-clang variants.
+consider_clang "";
+foreach (</usr/lib/llvm-*>) {
+    if (! -l $_ and -d $_) {
+        s|.*/llvm-||;
+        consider_clang "-$_";
+    }
+}
+
 # Find existing symlinks.
 foreach (<$ccache_dir/*>) {
     if (-l) {
-- 
2.1.0.rc1

Reply via email to