diff options
author | Andre Schröder | 2020-10-27 22:05:19 +0100 |
---|---|---|
committer | Andre Schröder | 2020-10-27 22:05:19 +0100 |
commit | c1a2319a52c0ea133dd0ed6cf722f97004c7a884 (patch) | |
tree | fa5cb2e273958c2d8ede6f72bf283a4ef9694182 | |
parent | d8eeede7dcd63a8c0b84511158e644eeff507d32 (diff) | |
download | aur-c1a2319a52c0ea133dd0ed6cf722f97004c7a884.tar.gz |
Fix cgrep for clang 10
See https://www.archlinux.org/todo/llvm-10/:
> All of clang's C++ API is now shipped as `libclang-cpp.so` instead of
> the numerous component libraries we had before. This change will
> require patching in most packages to use the new library name. Look
> for upstream commits that support the new library; if that fails,
> Fedora and/or Gentoo should have patches for this.
upgpkg: cgrep-clang-git r154.f7e9ac8-1
upgpkg: cgrep-clang 1.1-2
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 19 | ||||
-rw-r--r-- | adjust-libclang-lib-names.patch | 18 |
3 files changed, 37 insertions, 4 deletions
@@ -1,7 +1,7 @@ pkgbase = cgrep-clang pkgdesc = grep for C/C++ source files pkgver = 1.1 - pkgrel = 1 + pkgrel = 2 url = https://github.com/bloodstalker/cgrep arch = any license = GPL3 @@ -10,8 +10,10 @@ pkgbase = cgrep-clang depends = clang source = cgrep-clang-1.1.tar.gz::https://github.com/bloodstalker/cgrep/archive/1.1.tar.gz source = git+https://github.com/bloodstalker/cfe-extra#commit=0d705a3 + source = adjust-libclang-lib-names.patch sha256sums = 68e7e66029f643a3a7e745a88bf95516c517aec1739c81ba1f1d3978833c7d80 sha256sums = SKIP + sha256sums = c726ccfdc45f9ad434647cfcab95ac536700ab87978f05f3a341a555642eb8c4 pkgname = cgrep-clang @@ -6,26 +6,39 @@ _name=cgrep-clang pkgname=$_name pkgver=1.1 _mainfolder=cgrep-$pkgver -pkgrel=1 +pkgrel=2 pkgdesc='grep for C/C++ source files' arch=(any) url=https://github.com/bloodstalker/cgrep license=(GPL3) depends=(llvm clang) makedepends=(git) -source=($pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz git+https://github.com/bloodstalker/cfe-extra#commit=0d705a3) +source=($pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz + git+https://github.com/bloodstalker/cfe-extra#commit=0d705a3 + adjust-libclang-lib-names.patch) sha256sums=('68e7e66029f643a3a7e745a88bf95516c517aec1739c81ba1f1d3978833c7d80' - 'SKIP') + 'SKIP' + 'c726ccfdc45f9ad434647cfcab95ac536700ab87978f05f3a341a555642eb8c4') prepare() { cd "$srcdir/$_mainfolder" + # if the repo we are going to clone already exists, delete it + if [ -d "$srcdir"/$_mainfolder/cfe-extra ]; then + rm -R "$srcdir"/$_mainfolder/cfe-extra + fi + + # we can't use "git config submodule" here like in cgrep-clang-git because in + # cgrep-clang we download an archive and do not clone a repo git clone "$srcdir"/cfe-extra } package() { cd "$srcdir/$_mainfolder" + # see https://www.archlinux.org/todo/llvm-10/ + patch -p1 -i "$srcdir/adjust-libclang-lib-names.patch" + make # `make install` isn't provided, so we have to manually copy the files diff --git a/adjust-libclang-lib-names.patch b/adjust-libclang-lib-names.patch new file mode 100644 index 000000000000..358f5b361973 --- /dev/null +++ b/adjust-libclang-lib-names.patch @@ -0,0 +1,18 @@ +diff --git a/makefile b/makefile +index 94fd556..35483c2 100644 +--- a/makefile ++++ b/makefile +@@ -38,12 +38,7 @@ LLVM_CXX_FLAGS=$(shell $(LLVM_CONF) --cxxflags) + LLVM_CXX_FLAGS+=-I$(shell $(LLVM_CONF) --src-root)/tools/clang/include\ + -I$(shell $(LLVM_CONF) --obj-root)/tools/clang/include\ + -std=c++17 -fexceptions +-LLVM_LD_FLAGS=-Wl,--start-group -lclangAST -lclangAnalysis -lclangBasic\ +- -lclangDriver -lclangEdit -lclangFrontend -lclangFrontendTool\ +- -lclangLex -lclangParse -lclangSema -lclangEdit -lclangASTMatchers\ +- -lclangRewrite -lclangRewriteFrontend -lclangStaticAnalyzerFrontend\ +- -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore\ +- -lclangSerialization -lclangToolingCore -lclangTooling -lstdc++\ ++LLVM_LD_FLAGS=-Wl,--start-group -lclang-cpp -lstdc++\ + -lLLVMRuntimeDyld -lm -Wl,--end-group + LLVM_LD_FLAGS+=$(shell $(LLVM_CONF) --ldflags --libs --system-libs) + |