Browse Source

Update from NDK r13 to r14

For those using Docker build environments: run scripts/update-docker.sh
to pull the latest Docker image with r14 installed.

Otherwise, remove the $NDK directory (defaults to
$HOME/lib/android-ndk if not setup in the environment) and run
scripts/setup-android-sdk.sh to setup a r14 installation.
android-5
Fredrik Fornwall 8 years ago
parent
commit
b26283d4a7
  1. 9
      build-package.sh
  2. 7
      packages/aapt/build.sh
  3. 84
      packages/aapt/log.h.patch.txt
  4. 3
      packages/libcaca/build.sh
  5. 1
      packages/libgcrypt/build.sh
  6. 2
      scripts/setup-android-sdk.sh

9
build-package.sh

@ -183,7 +183,7 @@ termux_step_setup_variables() {
: "${TERMUX_DEBUG:=""}" : "${TERMUX_DEBUG:=""}"
: "${TERMUX_API_LEVEL:="21"}" : "${TERMUX_API_LEVEL:="21"}"
: "${TERMUX_ANDROID_BUILD_TOOLS_VERSION:="25.0.1"}" : "${TERMUX_ANDROID_BUILD_TOOLS_VERSION:="25.0.1"}"
: "${TERMUX_NDK_VERSION:="13"}" : "${TERMUX_NDK_VERSION:="14"}"
if [ "x86_64" = "$TERMUX_ARCH" ] || [ "aarch64" = "$TERMUX_ARCH" ]; then if [ "x86_64" = "$TERMUX_ARCH" ] || [ "aarch64" = "$TERMUX_ARCH" ]; then
TERMUX_ARCH_BITS=64 TERMUX_ARCH_BITS=64
@ -218,7 +218,7 @@ termux_step_setup_variables() {
TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_TOPDIR/_lib/toolchain-${TERMUX_ARCH}-ndk${TERMUX_NDK_VERSION}-api${TERMUX_API_LEVEL}" TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_TOPDIR/_lib/toolchain-${TERMUX_ARCH}-ndk${TERMUX_NDK_VERSION}-api${TERMUX_API_LEVEL}"
# Bump the below version if a change is made in toolchain setup to ensure # Bump the below version if a change is made in toolchain setup to ensure
# that everyone gets an updated toolchain: # that everyone gets an updated toolchain:
TERMUX_STANDALONE_TOOLCHAIN+="-v13" TERMUX_STANDALONE_TOOLCHAIN+="-v14"
export TERMUX_TAR="tar" export TERMUX_TAR="tar"
export TERMUX_TOUCH="touch" export TERMUX_TOUCH="touch"
@ -564,7 +564,9 @@ termux_step_setup_toolchain() {
# ifaddrs.h: Added in android-24 unified headers, use a inline implementation for now. # ifaddrs.h: Added in android-24 unified headers, use a inline implementation for now.
cp "$TERMUX_SCRIPTDIR"/ndk_patches/{elf.h,sysexits.h,ifaddrs.h} $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/include cp "$TERMUX_SCRIPTDIR"/ndk_patches/{elf.h,sysexits.h,ifaddrs.h} $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/include
$TERMUX_ELF_CLEANER usr/lib/*.so local _LIBDIR=usr/lib
if [ $TERMUX_ARCH = x86_64 ]; then _LIBDIR+=64; fi
$TERMUX_ELF_CLEANER $_LIBDIR/*.so
# zlib is really version 1.2.8 in the Android platform (at least # zlib is really version 1.2.8 in the Android platform (at least
# starting from Android 5), not older as the NDK headers claim. # starting from Android 5), not older as the NDK headers claim.
@ -595,6 +597,7 @@ termux_step_setup_toolchain() {
_STL_LIBFILE=$TERMUX_STANDALONE_TOOLCHAIN/${TERMUX_HOST_PLATFORM}/lib64/libgnustl_shared.so _STL_LIBFILE=$TERMUX_STANDALONE_TOOLCHAIN/${TERMUX_HOST_PLATFORM}/lib64/libgnustl_shared.so
fi fi
cp "$_STL_LIBFILE" . cp "$_STL_LIBFILE" .
$TERMUX_ELF_CLEANER libgnustl_shared.so
ln -f -s libgnustl_shared.so libstdc++.so ln -f -s libgnustl_shared.so libstdc++.so
fi fi

7
packages/aapt/build.sh

@ -37,7 +37,8 @@ termux_step_make_install () {
mkdir -p android-base mkdir -p android-base
cd android-base cd android-base
tar xf $ANDROID_BASE_INCLUDE_TARFILE tar xf $ANDROID_BASE_INCLUDE_TARFILE
cd ../log
patch -p0 < $TERMUX_PKG_BUILDER_DIR/log.h.patch.txt
# Build libcutils: # Build libcutils:
mkdir -p $TERMUX_PKG_SRCDIR/{libcutils,androidfw} mkdir -p $TERMUX_PKG_SRCDIR/{libcutils,androidfw}
@ -114,6 +115,7 @@ termux_step_make_install () {
tar xf $LIBUTILS_TARFILE tar xf $LIBUTILS_TARFILE
# From Android.mk: # From Android.mk:
#CallStack.cpp \ #CallStack.cpp \
#SystemClock.cpp \
commonSources="\ commonSources="\
FileMap.cpp \ FileMap.cpp \
JenkinsHash.cpp \ JenkinsHash.cpp \
@ -128,7 +130,6 @@ termux_step_make_install () {
StopWatch.cpp \ StopWatch.cpp \
String8.cpp \ String8.cpp \
String16.cpp \ String16.cpp \
SystemClock.cpp \
Threads.cpp \ Threads.cpp \
Timers.cpp \ Timers.cpp \
Tokenizer.cpp \ Tokenizer.cpp \
@ -161,9 +162,9 @@ termux_step_make_install () {
rm -Rf $TERMUX_PREFIX/include/aosp/android-base rm -Rf $TERMUX_PREFIX/include/aosp/android-base
mv include/android-base $TERMUX_PREFIX/include/aosp mv include/android-base $TERMUX_PREFIX/include/aosp
patch -p1 < $TERMUX_PKG_BUILDER_DIR/libbase-patch.txt patch -p1 < $TERMUX_PKG_BUILDER_DIR/libbase-patch.txt
#logging.cpp \
libbase_src_files="\ libbase_src_files="\
file.cpp \ file.cpp \
logging.cpp \
parsenetaddress.cpp \ parsenetaddress.cpp \
stringprintf.cpp \ stringprintf.cpp \
strings.cpp \ strings.cpp \

84
packages/aapt/log.h.patch.txt

@ -0,0 +1,84 @@
--- log-orig.h 2017-03-04 02:11:04.589477520 +0100
+++ log.h 2017-03-04 02:11:54.556875283 +0100
@@ -217,7 +217,7 @@
*/
#ifndef SLOGV
#define __SLOGV(...) \
- ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
+ ((void)__android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
#if LOG_NDEBUG
#define SLOGV(...) do { if (0) { __SLOGV(__VA_ARGS__); } } while (0)
#else
@@ -231,7 +231,7 @@
#else
#define SLOGV_IF(cond, ...) \
( (__predict_false(cond)) \
- ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
+ ? ((void)__android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
: (void)0 )
#endif
#endif
@@ -241,13 +241,13 @@
*/
#ifndef SLOGD
#define SLOGD(...) \
- ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
+ ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
#endif
#ifndef SLOGD_IF
#define SLOGD_IF(cond, ...) \
( (__predict_false(cond)) \
- ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
+ ? ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
: (void)0 )
#endif
@@ -256,13 +256,13 @@
*/
#ifndef SLOGI
#define SLOGI(...) \
- ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))
+ ((void)__android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))
#endif
#ifndef SLOGI_IF
#define SLOGI_IF(cond, ...) \
( (__predict_false(cond)) \
- ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \
+ ? ((void)__android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \
: (void)0 )
#endif
@@ -271,13 +271,13 @@
*/
#ifndef SLOGW
#define SLOGW(...) \
- ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__))
+ ((void)__android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__))
#endif
#ifndef SLOGW_IF
#define SLOGW_IF(cond, ...) \
( (__predict_false(cond)) \
- ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \
+ ? ((void)__android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \
: (void)0 )
#endif
@@ -286,13 +286,13 @@
*/
#ifndef SLOGE
#define SLOGE(...) \
- ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
+ ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__))
#endif
#ifndef SLOGE_IF
#define SLOGE_IF(cond, ...) \
( (__predict_false(cond)) \
- ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
+ ? ((void)__android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
: (void)0 )
#endif

3
packages/libcaca/build.sh

@ -4,10 +4,9 @@ TERMUX_PKG_VERSION=0.99.beta19
# Switched to mirror on 2014-12-22 since master was down: # Switched to mirror on 2014-12-22 since master was down:
TERMUX_PKG_SRCURL=http://fossies.org/linux/privat/libcaca-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SRCURL=http://fossies.org/linux/privat/libcaca-${TERMUX_PKG_VERSION}.tar.gz
# http://caca.zoy.org/files/libcaca/libcaca-${TERMUX_PKG_VERSION}.tar.gz # http://caca.zoy.org/files/libcaca/libcaca-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=128b467c4ed03264c187405172a4e83049342cc8cc2f655f53a2d0ee9d3772f4
TERMUX_PKG_DEPENDS="ncurses" TERMUX_PKG_DEPENDS="ncurses"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-python --disable-java --disable-ruby --disable-doc" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-python --disable-java --disable-ruby --disable-doc"
# "fatal error: error in backend: Do not know how to split this operator's operand":
TERMUX_PKG_CLANG=no
termux_step_post_configure () { termux_step_post_configure () {
if [ $TERMUX_ARCH = x86_64 ]; then if [ $TERMUX_ARCH = x86_64 ]; then

1
packages/libgcrypt/build.sh

@ -11,6 +11,7 @@ termux_step_pre_configure () {
# libgcrypt uses syslog, which we redirect to android logging: # libgcrypt uses syslog, which we redirect to android logging:
LDFLAGS="$LDFLAGS -llog" LDFLAGS="$LDFLAGS -llog"
CFLAGS+=" -no-integrated-as"
if [ $TERMUX_ARCH = "arm" ]; then if [ $TERMUX_ARCH = "arm" ]; then
# See http://marc.info/?l=gnupg-devel&m=139136972631909&w=3 # See http://marc.info/?l=gnupg-devel&m=139136972631909&w=3
CFLAGS+=" -mno-unaligned-access" CFLAGS+=" -mno-unaligned-access"

2
scripts/setup-android-sdk.sh

@ -21,7 +21,7 @@ if [ ! -d $NDK ]; then
mkdir -p $NDK mkdir -p $NDK
cd $NDK/.. cd $NDK/..
rm -Rf `basename $NDK` rm -Rf `basename $NDK`
NDK_VERSION=r13 NDK_VERSION=r14
curl --fail --retry 3 -o ndk.zip \ curl --fail --retry 3 -o ndk.zip \
http://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-`uname`-x86_64.zip http://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-`uname`-x86_64.zip

Loading…
Cancel
Save