opt/compiler-rt/Pkgfile

40 lines
1.2 KiB
Plaintext
Raw Normal View History

# Description: Compiler runtime libraries for clang
2021-07-09 13:50:39 +02:00
# URL: https://compiler-rt.llvm.org/
# Maintainer: CRUX System Team, core-ports at crux dot nu
# Depends on: llvm
2024-03-09 09:28:37 +01:00
# Optional: clang
name=compiler-rt
2024-03-20 17:00:45 +01:00
version=18.1.2
release=2
2021-10-01 10:25:11 +02:00
source=(https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/compiler-rt-$version.src.tar.xz
https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/llvm-$version.src.tar.xz
2024-03-20 17:00:45 +01:00
https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/cmake-$version.src.tar.xz
libsanitizer-timebits.diff)
build() {
2021-10-01 10:25:11 +02:00
mv llvm-$version.src llvm
2023-05-21 10:16:22 +02:00
mv cmake-$version.src cmake
2024-03-09 09:28:37 +01:00
if prt-get isinst clang; then
2024-03-20 17:00:45 +01:00
if ! /usr/bin/ldd /usr/bin/clang | grep -q -E '.*not found'; then
export CC=clang
export CXX=clang++
fi
2024-03-09 09:28:37 +01:00
fi
2024-03-20 17:00:45 +01:00
patch -Np2 -d $name-$version.src -i $SRC/libsanitizer-timebits.diff
2020-07-22 13:53:35 +02:00
cmake -S $name-$version.src -B build -G Ninja \
2020-11-21 15:27:02 +01:00
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
2023-05-21 10:16:22 +02:00
-D COMPILER_RT_INSTALL_PATH=/usr/lib/clang/${version:0:2} \
2024-03-20 17:00:45 +01:00
-D Python3_EXECUTABLE=/usr/bin/python3 \
-D COMPILER_RT_INCLUDE_TESTS=OFF \
-Wno-dev
2024-03-20 17:00:45 +01:00
cmake --build build -j ${JOBS:-1}
2020-11-21 15:27:02 +01:00
DESTDIR=$PKG cmake --install build
}