diff options
author | pingplug | 2018-09-25 11:00:23 +0800 |
---|---|---|
committer | pingplug | 2018-09-25 11:01:12 +0800 |
commit | 008763624631d8b765c9b70dbfb1d2208d1225ed (patch) | |
tree | 0b29f213a7ac38b6e42c9d54b88e55fa77af32ef | |
download | aur-008763624631d8b765c9b70dbfb1d2208d1225ed.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | .gitignore | 9 | ||||
-rw-r--r-- | PKGBUILD | 30 | ||||
-rw-r--r-- | nvcc-ccache.sh | 3 | ||||
-rw-r--r-- | update-ccache-links.hook | 36 | ||||
-rw-r--r-- | update-ccache-links.sh | 19 |
6 files changed, 113 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..e2e9d614711e --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,16 @@ +pkgbase = ccache-ext + pkgdesc = pacman hook for adding more compiler links to ccache + pkgver = 1 + pkgrel = 1 + arch = any + license = custom + depends = ccache + source = nvcc-ccache.sh + source = update-ccache-links.sh + source = update-ccache-links.hook + sha256sums = c6db8aaddb625d28050e67122d3b1bf50d1e1e8d6a04cdca3dc195521b53f3c4 + sha256sums = 8df3de20c1e58615354ae6fc35b3f27692060bd33f2f80229346a6acb19687bd + sha256sums = 0fc326f0225ba865394090309d27d41339113248462ee41fea2e3646d7e1eb59 + +pkgname = ccache-ext + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..6858ab6173c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +* +!.gitignore +!.SRCINFO +!PKGBUILD +!*.install +!*.patch +!*.diff +!*.sh +!*.hook diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..07050c045330 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,30 @@ +# Maintainer: pingplug <pingplug@foxmail.com> + +pkgname=ccache-ext +pkgver=1 +pkgrel=1 +pkgdesc='pacman hook for adding more compiler links to ccache' +arch=('any') +license=('custom') +depends=('ccache') +source=('nvcc-ccache.sh' + 'update-ccache-links.sh' + 'update-ccache-links.hook') +sha256sums=('c6db8aaddb625d28050e67122d3b1bf50d1e1e8d6a04cdca3dc195521b53f3c4' + '8df3de20c1e58615354ae6fc35b3f27692060bd33f2f80229346a6acb19687bd' + '0fc326f0225ba865394090309d27d41339113248462ee41fea2e3646d7e1eb59') + +package() { + install -d "${pkgdir}/usr/lib/ccache/bin" + # CUDA + if pacman -T "cuda" ; then + # /usr/lib/ccache/bin/nvcc cauese CMake failed to find CUDA + install -Dm755 nvcc-ccache.sh "${pkgdir}/usr/lib/ccache/bin/nvcc-ccache" + fi + install -d "${pkgdir}/usr/bin" + install -Dm755 update-ccache-links.sh "${pkgdir}/usr/bin/update-ccache-links" + install -d "${pkgdir}/usr/share/libalpm/hooks" + install -Dm644 update-ccache-links.hook "${pkgdir}/usr/share/libalpm/hooks/" +} + +# vim: ts=2 sw=2 et: diff --git a/nvcc-ccache.sh b/nvcc-ccache.sh new file mode 100644 index 000000000000..a4307e924d17 --- /dev/null +++ b/nvcc-ccache.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +/usr/bin/ccache nvcc "$@" diff --git a/update-ccache-links.hook b/update-ccache-links.hook new file mode 100644 index 000000000000..9d7c6c74fa1b --- /dev/null +++ b/update-ccache-links.hook @@ -0,0 +1,36 @@ +[Trigger] +Operation = Install +Operation = Upgrade +Operation = Remove +Type = File +Target = usr/bin/update-ccache-links +Target = usr/bin/c++ +Target = usr/bin/cc +Target = usr/bin/clang +Target = usr/bin/clang++ +Target = usr/bin/g++ +Target = usr/bin/gcc +Target = usr/bin/c++-[0-9]* +Target = usr/bin/cc-[0-9]* +Target = usr/bin/clang-[0-9]* +Target = usr/bin/clang++-[0-9]* +Target = usr/bin/g++-[0-9]* +Target = usr/bin/gcc-[0-9]* +Target = usr/bin/*-c++ +Target = usr/bin/*-cc +Target = usr/bin/*-clang +Target = usr/bin/*-clang++ +Target = usr/bin/*-g++ +Target = usr/bin/*-gcc +Target = usr/bin/*-c++-[0-9]* +Target = usr/bin/*-cc-[0-9]* +Target = usr/bin/*-clang-[0-9]* +Target = usr/bin/*-clang++-[0-9]* +Target = usr/bin/*-g++-[0-9]* +Target = usr/bin/*-gcc-[0-9]* + +[Action] +Description = Updating ccache links... +When = PostTransaction +Depends = ccache +Exec = /usr/bin/update-ccache-links diff --git a/update-ccache-links.sh b/update-ccache-links.sh new file mode 100644 index 000000000000..810375334042 --- /dev/null +++ b/update-ccache-links.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +cd /usr/lib/ccache/bin +for file in {c++,cc,clang,clang++,g++,gcc} {c++,cc,clang,clang++,g++,gcc}-[0-9]* *-{c++,cc,clang,clang++,g++,gcc} *-{c++,cc,clang,clang++,g++,gcc}-[0-9]* +do + if [[ -L $file ]] + then + rm "/usr/lib/ccache/bin/$file" + fi +done + +cd /usr/bin +for file in {c++,cc,clang,clang++,g++,gcc} {c++,cc,clang,clang++,g++,gcc}-[0-9]* *-{c++,cc,clang,clang++,g++,gcc} *-{c++,cc,clang,clang++,g++,gcc}-[0-9]* +do + if [[ -x $file ]] + then + ln -s /usr/bin/ccache "/usr/lib/ccache/bin/$file" + fi +done |