mirror of
https://github.com/termux-pacman/glibc-packages.git
synced 2024-11-27 07:18:59 +00:00
e9124d3de4
gpkg/clang gpkg/compiler-rt gpkg/libclc gpkg/lld gpkg/llvm
75 lines
2.4 KiB
Bash
75 lines
2.4 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/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=(11e166d0f291a53cfc6b9e58abd1d7954de32ebc37672987612d3b7075d88411
|
|
4c55aa6e77fc0e8b759bca2c79ee4fd0ea8c7fab06eeea09310ae1e954a0af5e
|
|
ec13c6c3466dc88e7b29b47347e2b88337d5b83c778d92e3c4c3acd17d3cc534)
|
|
TERMUX_PKG_DEPENDS="libllvm-glibc, perl-glibc"
|
|
TERMUX_PKG_BUILD_DEPENDS="binutils-libs-glibc, python-glibc"
|
|
TERMUX_PKG_PYTHON_COMMON_DEPS="setuptools"
|
|
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
|
|
}
|
|
|
|
termux_step_configure() {
|
|
termux_setup_cmake
|
|
termux_setup_ninja
|
|
|
|
CFLAGS=${CFLAGS/-g /-g1 }
|
|
CXXFLAGS=${CXXFLAGS/-g /-g1 }
|
|
|
|
local LLVM_TARGET_ARCH="X86"
|
|
if [ $TERMUX_ARCH = "arm" ]; then
|
|
LLVM_TARGET_ARCH="ARM"
|
|
elif [ $TERMUX_ARCH = "aarch64" ]; then
|
|
LLVM_TARGET_ARCH="AArch64"
|
|
fi
|
|
|
|
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_SKIP_RPATH=ON \
|
|
-DLLVM_BINUTILS_INCDIR=$TERMUX_PREFIX/include \
|
|
-DLLVM_BUILD_DOCS=ON \
|
|
-DLLVM_BUILD_LLVM_DYLIB=ON \
|
|
-DLLVM_BUILD_TESTS=ON \
|
|
-DLLVM_ENABLE_BINDINGS=OFF \
|
|
-DLLVM_ENABLE_FFI=ON \
|
|
-DLLVM_ENABLE_RTTI=ON \
|
|
-DLLVM_ENABLE_SPHINX=ON \
|
|
-DCMAKE_SYSTEM_NAME=Linux \
|
|
-DLLVM_HOST_TRIPLE=$TERMUX_HOST_PLATFORM \
|
|
-DCMAKE_LIBRARY_ARCHITECTURE=$TERMUX_HOST_PLATFORM \
|
|
-DCMAKE_SYSTEM_PROCESSOR=$LLVM_TARGET_ARCH \
|
|
-DCMAKE_C_COMPILER=$CC \
|
|
-DCMAKE_CXX_COMPILER=$CXX \
|
|
-DLLVM_INCLUDE_BENCHMARKS=OFF \
|
|
-DLLVM_INSTALL_UTILS=ON \
|
|
-DLLVM_LINK_LLVM_DYLIB=ON \
|
|
-DLLVM_USE_PERF=ON \
|
|
-DSPHINX_WARNINGS_AS_ERRORS=OFF
|
|
}
|
|
|
|
termux_step_post_make_install() {
|
|
(
|
|
cd ${TERMUX_PKG_SRCDIR}/utils/lit
|
|
python${TERMUX_PYTHON_VERSION} setup.py install --prefix=$TERMUX_PREFIX -O1
|
|
)
|
|
}
|