34 lines
1.2 KiB
Plaintext
34 lines
1.2 KiB
Plaintext
# Description: clang compiler
|
|
# URL: https://clang.llvm.org/
|
|
# Maintainer: Thomas Penteker, tek at serverop dot de
|
|
# Depends on: compiler-rt llvm
|
|
|
|
name=clang
|
|
version=10.0.0
|
|
release=1
|
|
source=(https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/$name-$version.src.tar.xz
|
|
https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/$name-tools-extra-$version.src.tar.xz)
|
|
|
|
build() {
|
|
mv $name-tools-extra-$version.src $name-$version.src/tools/extra
|
|
|
|
cmake -S$name-$version.src -Bbuild -GNinja \
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DLLVM_INCLUDE_TESTS=0 \
|
|
-DLLVM_PARALLEL_COMPILE_JOBS="${JOBS:-1}" \
|
|
-Wno-dev
|
|
cmake --build build
|
|
DESTDIR=$PKG cmake --install build
|
|
|
|
# -DCMAKE_INSTALL_LIBEXECDIR is hardcoded..
|
|
mv $PKG/usr/libexec/{c++-analyzer,ccc-analyzer} $PKG/usr/lib/clang
|
|
rmdir $PKG/usr/libexec
|
|
sed -i 's|libexec|lib/clang|' $PKG/usr/bin/scan-build
|
|
|
|
# prepare compiler-rt
|
|
local txtfiles="asan_blacklist.txt cfi_blacklist.txt dfsan_abilist.txt hwasan_blacklist.txt msan_blacklist.txt"
|
|
mkdir -p $PKG/usr/lib/clang/$version/share
|
|
for i in $txtfiles; do ln -s /usr/share/$i $PKG/usr/lib/clang/$version/share/$i; done
|
|
}
|