0
0
mirror of https://github.com/termux-pacman/glibc-packages.git synced 2024-11-27 06:08:57 +00:00
glibc-packages/gpkg/clang/build.sh
Max Ivan e9124d3de4
update llvm packages (#304)
gpkg/clang
gpkg/compiler-rt
gpkg/libclc
gpkg/lld
gpkg/llvm
2024-11-08 09:04:55 +03:00

71 lines
2.6 KiB
Bash

TERMUX_PKG_HOMEPAGE=https://llvm.org/
TERMUX_PKG_DESCRIPTION="Compiler infrastructure"
TERMUX_PKG_LICENSE="Apache-2.0, NCSA"
TERMUX_PKG_LICENSE_FILE="LICENSE.TXT"
TERMUX_PKG_MAINTAINER="@termux-pacman"
TERMUX_PKG_VERSION=19.1.3
_SOURCE=https://github.com/llvm/llvm-project/releases/download/llvmorg-$TERMUX_PKG_VERSION
TERMUX_PKG_SRCURL=($_SOURCE/clang-$TERMUX_PKG_VERSION.src.tar.xz
$_SOURCE/clang-tools-extra-$TERMUX_PKG_VERSION.src.tar.xz
$_SOURCE/llvm-$TERMUX_PKG_VERSION.src.tar.xz
$_SOURCE/cmake-$TERMUX_PKG_VERSION.src.tar.xz
$_SOURCE/third-party-$TERMUX_PKG_VERSION.src.tar.xz)
TERMUX_PKG_SHA256=(0a0dd316931f2cac7090d2aa434b5d0c332fe19b801c6c94f109053b52b35cc1
6358ee4be9573fb025dad0a6fc9a5270fc2cb644a6504ff2970ca60abad7e345
11e166d0f291a53cfc6b9e58abd1d7954de32ebc37672987612d3b7075d88411
4c55aa6e77fc0e8b759bca2c79ee4fd0ea8c7fab06eeea09310ae1e954a0af5e
ec13c6c3466dc88e7b29b47347e2b88337d5b83c778d92e3c4c3acd17d3cc534)
TERMUX_PKG_DEPENDS="libllvm-glibc, gcc-glibc, compiler-rt-glibc, lld-glibc"
TERMUX_PKG_BUILD_DEPENDS="llvm-glibc, python-glibc"
TERMUX_PKG_NO_STATICSPLIT=true
termux_step_post_get_source() {
for i in cmake third-party; do
rm -fr $TERMUX_TOPDIR/$TERMUX_PKG_NAME/${i}
mv $TERMUX_PKG_SRCDIR/$i-$TERMUX_PKG_VERSION.src $TERMUX_TOPDIR/$TERMUX_PKG_NAME
mv $TERMUX_TOPDIR/$TERMUX_PKG_NAME/$i-$TERMUX_PKG_VERSION.src $TERMUX_TOPDIR/$TERMUX_PKG_NAME/$i
done
mv $TERMUX_PKG_SRCDIR/clang-tools-extra-$TERMUX_PKG_VERSION.src $TERMUX_PKG_SRCDIR/tools/extra
}
termux_step_configure() {
termux_setup_cmake
termux_setup_ninja
local LLVM_TARGET_ARCH="X86"
if [ $TERMUX_ARCH = "arm" ]; then
LLVM_TARGET_ARCH="ARM"
elif [ $TERMUX_ARCH = "aarch64" ]; then
LLVM_TARGET_ARCH="AArch64"
fi
export PATH=$TERMUX_PKG_BUILDDIR/bin:$PATH
cmake ${TERMUX_PKG_SRCDIR} \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH=$TERMUX_PREFIX \
-DCMAKE_INSTALL_DOCDIR=share/doc \
-DCMAKE_INSTALL_PREFIX=$TERMUX_PREFIX \
-DCMAKE_SYSTEM_NAME=Linux \
-DLLVM_HOST_TRIPLE=$TERMUX_HOST_PLATFORM \
-DCMAKE_LIBRARY_ARCHITECTURE=$TERMUX_HOST_PLATFORM \
-DCMAKE_SYSTEM_PROCESSOR=$LLVM_TARGET_ARCH \
-DLLVM_TARGETS_TO_BUILD=$LLVM_TARGET_ARCH \
-DCMAKE_SKIP_RPATH=ON \
-DCLANG_DEFAULT_PIE_ON_LINUX=ON \
-DCLANG_LINK_CLANG_DYLIB=ON \
-DENABLE_LINKER_BUILD_ID=ON \
-DLLVM_BUILD_DOCS=ON \
-DLLVM_BUILD_TESTS=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_ENABLE_SPHINX=ON \
-DLLVM_EXTERNAL_LIT=$TERMUX_PREFIX/bin/lit \
-DLLVM_INCLUDE_DOCS=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_MAIN_SRC_DIR=$TERMUX_PKG_SRCDIR/llvm-$TERMUX_PKG_VERSION.src \
-DSPHINX_WARNINGS_AS_ERRORS=OFF \
-DLLVM_INCLUDE_TESTS=OFF
}