2015-06-13 01:03:31 +02:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://developer.android.com/tools/sdk/ndk/index.html
|
|
|
|
TERMUX_PKG_DESCRIPTION="System header and library files from the Android NDK needed for compiling C programs"
|
2019-01-21 15:00:12 +01:00
|
|
|
TERMUX_PKG_LICENSE="NCSA"
|
2020-12-20 14:16:34 +01:00
|
|
|
TERMUX_PKG_MAINTAINER="@termux"
|
2015-06-13 01:03:31 +02:00
|
|
|
TERMUX_PKG_VERSION=$TERMUX_NDK_VERSION
|
2021-07-20 06:53:44 +02:00
|
|
|
TERMUX_PKG_REVISION=2
|
2019-08-14 13:27:16 +02:00
|
|
|
TERMUX_PKG_SKIP_SRC_EXTRACT=true
|
2019-01-27 12:08:07 +01:00
|
|
|
# This package has taken over <pty.h> from the previous libutil-dev
|
|
|
|
# and iconv.h from libandroid-support-dev:
|
|
|
|
TERMUX_PKG_CONFLICTS="libutil-dev, libgcc, libandroid-support-dev"
|
2019-02-17 01:34:52 +01:00
|
|
|
TERMUX_PKG_REPLACES="libutil-dev, libgcc, libandroid-support-dev, ndk-stl"
|
2019-08-12 17:28:41 +02:00
|
|
|
TERMUX_PKG_NO_STATICSPLIT=true
|
2015-06-13 01:03:31 +02:00
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_extract_into_massagedir() {
|
2019-04-14 14:20:28 +02:00
|
|
|
mkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib \
|
2017-12-03 13:44:09 +01:00
|
|
|
$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include
|
|
|
|
|
|
|
|
cp -Rf $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include/* \
|
|
|
|
$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include
|
|
|
|
|
2021-07-20 06:53:44 +02:00
|
|
|
# replace vulkan headers with upstream version
|
|
|
|
rm -rf $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include/vulkan
|
|
|
|
|
2019-03-24 01:40:04 +01:00
|
|
|
patch -d $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include/c++/v1 -p1 < $TERMUX_PKG_BUILDER_DIR/math-header.diff
|
2020-05-09 04:11:43 +02:00
|
|
|
# disable for now
|
|
|
|
# patch -d $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/ -p1 < $TERMUX_PKG_BUILDER_DIR/gcc_fixes.diff
|
2020-02-02 19:23:26 +01:00
|
|
|
|
2019-02-17 01:34:52 +01:00
|
|
|
cp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/*.o \
|
2017-12-03 13:44:09 +01:00
|
|
|
$TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib
|
2015-06-13 01:03:31 +02:00
|
|
|
|
2016-09-05 20:52:16 +02:00
|
|
|
local LIBATOMIC_PATH=$TERMUX_STANDALONE_TOOLCHAIN/$TERMUX_HOST_PLATFORM/lib
|
|
|
|
if [ $TERMUX_ARCH_BITS = 64 ]; then LIBATOMIC_PATH+="64"; fi
|
2018-02-15 00:20:24 +01:00
|
|
|
if [ $TERMUX_ARCH = "arm" ]; then LIBATOMIC_PATH+="/armv7-a"; fi
|
2016-09-05 20:52:16 +02:00
|
|
|
LIBATOMIC_PATH+="/libatomic.a"
|
2018-02-15 17:57:03 +01:00
|
|
|
cp $LIBATOMIC_PATH $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/
|
|
|
|
|
|
|
|
local LIBGCC_PATH=$TERMUX_STANDALONE_TOOLCHAIN/lib/gcc/$TERMUX_HOST_PLATFORM/4.9.x
|
2018-02-15 18:01:55 +01:00
|
|
|
if [ $TERMUX_ARCH = "arm" ]; then LIBGCC_PATH+="/armv7-a"; fi
|
2019-02-25 23:13:17 +01:00
|
|
|
cp $LIBGCC_PATH/* -r $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/
|
2019-02-17 01:34:52 +01:00
|
|
|
cp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/$TERMUX_PKG_API_LEVEL/libcompiler_rt-extras.a $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/
|
2016-08-19 15:25:48 +02:00
|
|
|
# librt and libpthread are built into libc on android, so setup them as symlinks
|
|
|
|
# to libc for compatibility with programs that users try to build:
|
|
|
|
local _SYSTEM_LIBDIR=/system/lib64
|
|
|
|
if [ $TERMUX_ARCH_BITS = 32 ]; then _SYSTEM_LIBDIR=/system/lib; fi
|
|
|
|
mkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib
|
|
|
|
cd $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib
|
2019-02-25 23:13:17 +01:00
|
|
|
if [ $TERMUX_ARCH = "arm" ]; then
|
|
|
|
rm thumb -rf
|
|
|
|
cp $TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib/$TERMUX_HOST_PLATFORM/libunwind.a .
|
2019-07-20 10:42:33 +02:00
|
|
|
fi
|
2019-09-23 12:05:08 +02:00
|
|
|
|
|
|
|
for lib in librt.so libpthread.so libutil.so; do
|
|
|
|
echo 'INPUT(-lc)' > $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/lib/$lib
|
|
|
|
done
|
|
|
|
unset lib
|
2015-06-13 01:03:31 +02:00
|
|
|
}
|