smlinux/base/llvm/llvm.SMBuild
PktSurf fd68de3553 Upgraded base/llvm to 17.0.6
Fixed base/mandoc build configuration file
Upgraded base/xmlto to 0.0.29
Added /usr as build prefix to above build files and also to base/nodejs
2024-10-21 14:59:42 +05:30

94 lines
2.9 KiB
Text
Executable file

# Maintainer: PktSurf <smlinux@pktsurf.in>
app=llvm
version=17.0.6
build=1sml
homepage="http://llvm.org/"
download="https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/llvm-$version.src.tar.xz"
desc="LLVM compiler toolkit"
requires="libffi libxml2 perl cmake"
# llvm loves to override any option that alters placement of binaries
ignoreusrbin=1
prepbuilddir() {
mkandenterbuilddir
rm -rf $app-$version.src
# In case the user decides to resume an incomplete build
[[ -d cmake ]] && rm -r cmake
tar xf $srcdir/$app-$version.src.tar.?z*
cd $app-$version.src
fixbuilddirpermissions
applypatch $srcdir/install-prefix.patch
buildtargets='X86;AMDGPU;BPF'
# cmake modules directory needs to one level up
(
cd ..
tar xf $srcdir/cmake-$version.src.tar.?z
mv cmake-$version.src cmake
)
(
cd tools
tar xf $srcdir/clang-$version.src.tar.?z
mv clang-$version.src clang
tar xf $srcdir/lld-$version.src.tar.?z
mv lld-$version.src lld
)
(
cd projects
tar xf $srcdir/libunwind-$version.src.tar.?z
mv libunwind-$version.src libunwind
)
(
mkdir -p smbuild && cd smbuild
mkdir -p include
cp -r ../projects/libunwind/include/mach-o include/
rm -r ../projects/libunwind
)
}
build() {
unset CFLAGS CXXFLAGS
cd smbuild
cmake .. -G Ninja -Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_BUILD_DOCS=OFF \
-DLLVM_BUILD_EXAMPLES=OFF \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_BUILD_TESTS=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_ENABLE_FFI=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_ENABLE_LIBEDIT=OFF \
-DLLVM_INSTALL_UTILS=ON \
-DLLVM_TARGETS_TO_BUILD="$buildtargets" \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DCLANG_RESOURCE_DIR="../lib/clang/$version"
ninja $MAKEFLAGS
DESTDIR="$pkg" ninja install
cp ../LICENSE.TXT $pkgdocs/
mkfinalpkg
}
sha512sums="
9dee9b2897f8bc9eeb86cd726df706d6451f223bfc612c2c722aca3b70495546688bb28f6d6753e177731cb041d6a78d407a00215317d6cb17e56671c09ead59 clang-17.0.6.src.tar.lz
4ea1adcd10729f73e84d00e5800cb2f40daf7c3c91d6717fc7572d2db95902c927daed0b403c660beae673973431aecf854eeafa966bd2145ee917a8b090f78a cmake-17.0.6.src.tar.lz
93313c449a58f8f81a13231fd1e3168267bd504689fb5c6e9a0d8a99e3dfe0be68968f5614e00836808bd7a730121bc94f459ada8cf6cf010d13178a8446ae7e libunwind-17.0.6.src.tar.lz
8c313ba8f40015c10f6826bad5d7553ec1fc6c634b4a384789611f541bf210fd69fdd77f13a6bb8ee8fb2283d5a2c08dbbccf8603c7a2cec9904eb18c5fcc403 lld-17.0.6.src.tar.lz
0eb60df337875c110dfac112f6bb4e7686919f09c8e007b77a9f6e0f723c31721f09902e7b8bed07acea00aa5c02e07e3aee756fdf0caf74f01c4f9488107bbf llvm-17.0.6.src.tar.lz
c2ca2124370ec43b9a2fa769aa5580f908453041450479d60458f03aa54e89604bd4225b5991cac0cb8c424cdb2e4e121b78e4175e591955f2fba2c3b0fd0851 install-prefix.patch
"