35 lines
1.2 KiB
Plaintext
35 lines
1.2 KiB
Plaintext
# Description: clang compiler
|
|
# URL: https://clang.llvm.org/
|
|
# Maintainer: CRUX System Team, core-ports at crux dot nu
|
|
# Depends on: compiler-rt
|
|
|
|
name=clang
|
|
version=13.0.0
|
|
release=2
|
|
source=(https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/clang-$version.src.tar.xz
|
|
https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/clang-tools-extra-$version.src.tar.xz)
|
|
|
|
build() {
|
|
mv clang-tools-extra-$version.src clang-$version.src/tools/extra
|
|
|
|
cmake -S $name-$version.src -B build -G Ninja \
|
|
-D CMAKE_INSTALL_PREFIX=/usr \
|
|
-D CMAKE_INSTALL_LIBEXECDIR=lib/clang \
|
|
-D CMAKE_BUILD_TYPE=Release \
|
|
-D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
|
|
-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
|
|
-D LLVM_EXTERNAL_LIT=/usr/bin/lit \
|
|
-D LLVM_TARGETS_TO_BUILD="X86;AMDGPU;BPF;NVPTX;WebAssembly" \
|
|
-D LLVM_PARALLEL_COMPILE_JOBS="${JOBS:-1}" \
|
|
-Wno-dev
|
|
cmake --build build
|
|
DESTDIR=$PKG cmake --install build
|
|
|
|
# -DCMAKE_INSTALL_LIBEXECDIR is still hardcoded..
|
|
mv $PKG/usr/libexec/analyze-{c++,cc} $PKG/usr/lib/clang
|
|
mv $PKG/usr/libexec/{c++,ccc}-analyzer $PKG/usr/lib/clang
|
|
mv $PKG/usr/libexec/intercept-{c++,cc} $PKG/usr/lib/clang
|
|
rmdir $PKG/usr/libexec
|
|
sed -i 's|libexec|lib/clang|' $PKG/usr/bin/scan-build
|
|
}
|