2014-05-22 13:56:51 +02:00
|
|
|
# Description: LLVM + clang compiler
|
|
|
|
# URL: http://llvm.org/
|
|
|
|
# Maintainer: Thomas Penteker, tek at serverop dot de
|
2017-07-09 13:34:18 +10:00
|
|
|
# Depends on: llvm
|
2014-05-22 13:56:51 +02:00
|
|
|
|
|
|
|
name=clang
|
2020-07-22 11:34:53 +02:00
|
|
|
version=10.0.1
|
2019-09-01 11:05:53 +02:00
|
|
|
release=1
|
2019-12-29 01:08:11 +11:00
|
|
|
source=(https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/{llvm,clang}-$version.src.tar.xz)
|
2014-05-22 13:56:51 +02:00
|
|
|
|
|
|
|
build() {
|
2019-12-29 01:08:11 +11:00
|
|
|
mv clang-$version.src llvm-$version.src/tools/clang
|
2014-05-22 13:56:51 +02:00
|
|
|
|
2020-07-22 11:34:53 +02:00
|
|
|
cmake -S llvm-$version.src -B build -G Ninja \
|
2018-07-28 14:45:15 +10:00
|
|
|
-DLLVM_PARALLEL_COMPILE_JOBS="${JOBS:-1}" \
|
2016-11-08 23:56:00 +01:00
|
|
|
-DLLVM_INCLUDE_EXAMPLES=0 \
|
|
|
|
-DLLVM_INCLUDE_TESTS=0 \
|
2017-07-09 13:34:18 +10:00
|
|
|
-DLLVM_ENABLE_FFI=1 \
|
2019-03-16 14:57:23 +01:00
|
|
|
-DLLVM_ENABLE_RTTI=1 \
|
2016-11-22 20:21:23 +01:00
|
|
|
-DLLVM_TARGETS_TO_BUILD='X86;AMDGPU;BPF' \
|
2016-11-08 23:56:00 +01:00
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
2017-07-09 13:34:18 +10:00
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
2017-11-18 12:20:37 +11:00
|
|
|
-DLLVM_APPEND_VC_REV=0 \
|
2018-07-28 14:45:15 +10:00
|
|
|
-Wno-dev
|
2014-05-22 13:56:51 +02:00
|
|
|
|
2020-07-22 11:34:53 +02:00
|
|
|
ninja -C build
|
|
|
|
DESTDIR=$PKG ninja -C build install
|
2014-05-22 13:56:51 +02:00
|
|
|
|
|
|
|
# only clang may be left, remove llvm
|
|
|
|
rm -r $PKG/usr/include/llvm{,-c}
|
2016-11-09 00:48:45 +01:00
|
|
|
rm -r $PKG/usr/lib/cmake/llvm
|
2017-11-18 12:20:37 +11:00
|
|
|
rm -r $PKG/usr/share/opt-viewer
|
2018-10-03 01:45:02 +02:00
|
|
|
rm $PKG/usr/bin/{bugpoint,ll*,opt,obj2yaml,sancov,sanstats,verify-uselistorder,yaml2obj,dsymutil}
|
2019-10-07 23:40:05 +02:00
|
|
|
rm $PKG/usr/lib/{libLTO.*,libRemarks*,libLLVM*}
|
2015-11-30 01:45:51 +01:00
|
|
|
|
2016-11-26 22:16:32 +01:00
|
|
|
mv $PKG/usr/libexec/{c++-analyzer,ccc-analyzer} $PKG/usr/lib/clang
|
2017-07-09 13:34:18 +10:00
|
|
|
rmdir $PKG/usr/libexec
|
2018-07-28 14:45:15 +10:00
|
|
|
sed -i 's|libexec|lib/clang|' $PKG/usr/bin/scan-build
|
2014-05-22 13:56:51 +02:00
|
|
|
}
|