2017-08-26 22:56:25 +02:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://developer.android.com/tools/sdk/ndk/index.html
|
2017-12-05 22:33:04 +01:00
|
|
|
TERMUX_PKG_DESCRIPTION="Multilib binaries for cross-compilation"
|
2019-01-21 15:00:12 +01:00
|
|
|
TERMUX_PKG_LICENSE="NCSA"
|
2017-08-26 22:56:25 +02:00
|
|
|
TERMUX_PKG_VERSION=$TERMUX_NDK_VERSION
|
2019-07-20 10:42:33 +02:00
|
|
|
TERMUX_PKG_REVISION=1
|
2017-08-26 22:56:25 +02:00
|
|
|
TERMUX_PKG_PLATFORM_INDEPENDENT=true
|
2019-07-20 10:42:33 +02:00
|
|
|
TERMUX_PKG_NO_STATICSPLIT=yes
|
2017-08-26 22:56:25 +02:00
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
prepare_libs() {
|
2017-08-26 22:56:25 +02:00
|
|
|
local ARCH="$1"
|
|
|
|
local SUFFIX="$2"
|
|
|
|
local NDK_SUFFIX=$SUFFIX
|
|
|
|
|
|
|
|
if [ $ARCH = x86 ] || [ $ARCH = x86_64 ]; then
|
|
|
|
NDK_SUFFIX=$ARCH
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib
|
|
|
|
local BASEDIR=$NDK/platforms/android-${TERMUX_PKG_API_LEVEL}/arch-$ARCH/usr/lib
|
2017-11-18 22:10:23 +01:00
|
|
|
if [ $ARCH = x86_64 ]; then BASEDIR+="64"; fi
|
2017-08-26 22:56:25 +02:00
|
|
|
cp $BASEDIR/*.o $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib
|
|
|
|
|
|
|
|
LIBATOMIC=$NDK/toolchains/${NDK_SUFFIX}-*/prebuilt/linux-*/${SUFFIX}/lib
|
2018-09-19 23:29:39 +02:00
|
|
|
if [ $ARCH = "arm64" ] || [ $ARCH = "x86_64" ]; then LIBATOMIC+="64"; fi
|
2018-02-15 02:02:13 +01:00
|
|
|
if [ $ARCH = "arm" ]; then LIBATOMIC+="/armv7-a"; fi
|
2018-02-15 17:57:03 +01:00
|
|
|
cp $LIBATOMIC/libatomic.a $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib/
|
|
|
|
|
|
|
|
LIBGCC=$NDK/toolchains/${NDK_SUFFIX}-*/prebuilt/linux-*/lib/gcc/${SUFFIX}/4.9.x
|
|
|
|
if [ $ARCH = "arm" ]; then LIBGCC+="/armv7-a"; fi
|
|
|
|
cp $LIBGCC/libgcc.a $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib/
|
2017-08-26 22:56:25 +02:00
|
|
|
}
|
|
|
|
|
2019-02-08 10:37:29 +01:00
|
|
|
termux_step_extract_into_massagedir() {
|
2017-08-26 22:56:25 +02:00
|
|
|
prepare_libs "arm" "arm-linux-androideabi"
|
|
|
|
prepare_libs "arm64" "aarch64-linux-android"
|
|
|
|
prepare_libs "x86" "i686-linux-android"
|
|
|
|
prepare_libs "x86_64" "x86_64-linux-android"
|
|
|
|
}
|