if [ ! -d "$NDK" ]; then echo 'ERROR: $NDK not defined as pointing at a directory - define it pointing at a android NDK installation!'; exit 1; fi
: ${TERMUX_MAKE_PROCESSES:='4'}
: ${TERMUX_TOPDIR:="$HOME/termux"}
-: ${TERMUX_ARCH:="arm"} # (arm|aarch64|i686|x86_64) - the 64 bit variants do not work yet
+: ${TERMUX_ARCH:="arm"} # (arm|aarch64|i686|x86_64) - the x86_64 arch is not yet used or tested.
TERMUX_ARCH_BITS="32"
if [ "x86_64" = $TERMUX_ARCH -o "aarch64" = $TERMUX_ARCH ]; then
TERMUX_ARCH_BITS="64"
fi
TERMUX_ELF_CLEANER=$TERMUX_COMMON_CACHEDIR/termux-elf-cleaner
-TERMUX_ELF_CLEANER_SRC=$TERMUX_SCRIPTDIR/packages/termux-tools/termux-elf-cleaner.cpp
+TERMUX_ELF_CLEANER_SRC=$TERMUX_SCRIPTDIR/packages/termux-elf-cleaner/termux-elf-cleaner.cpp
if [ $TERMUX_ELF_CLEANER_SRC -nt $TERMUX_ELF_CLEANER ]; then
g++ -std=c++11 -Wall -Wextra -pedantic -Os $TERMUX_ELF_CLEANER_SRC -o $TERMUX_ELF_CLEANER
fi
cd $TERMUX_PKG_SRCDIR
# Suffix patch with ".patch32" or ".patch64" to only apply for these bitnesses:
for patch in $TERMUX_PKG_BUILDER_DIR/*.patch{$TERMUX_ARCH_BITS,}; do
- test -f $patch && sed "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $patch | patch -p1
+ test -f $patch && sed "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $patch | \
+ sed "s%\@TERMUX_HOME\@%${TERMUX_ANDROID_HOME}%g" | \
+ patch -p1
done
find . -name config.sub -exec chmod u+w '{}' \; -exec cp $TERMUX_COMMON_CACHEDIR/config.sub '{}' \;
# Remove lib/charset.alias which is installed by gettext-using packages:
rm -f lib/charset.alias
+
# Remove non-english man pages:
test -d share/man && (cd share/man; for f in `ls | grep -v man`; do rm -Rf $f; done )
- # Remove info pages and other docs:
- rm -Rf share/info share/doc share/locale
+
+ if [ -z ${TERMUX_PKG_KEEP_INFOPAGES+x} ]; then
+ # Remove info pages:
+ rm -Rf share/info
+ fi
+
+ # Remove other docs:
+ rm -Rf share/doc share/locale
+
# Remove old kept libraries (readline):
find . -name '*.old' -delete
- # .. remove static libraries:
+
+ # Remove static libraries:
if [ $TERMUX_PKG_KEEP_STATIC_LIBRARIES = "false" ]; then
find . -name '*.a' -delete
find . -name '*.la' -delete
find . -type f | xargs file | grep -E "(executable|shared object)" | grep ELF | cut -f 1 -d : | xargs $STRIP --strip-unneeded --preserve-dates -R '.gnu.version*'
fi
# Fix shebang paths:
- for file in `find . -type f`; do
- head -c 100 $file | grep -E "^#\!.*\\/bin\\/.*" | grep -q -E -v "^#\! ?\\/system" && sed --follow-symlinks -i -E "s@^#\!(.*)/bin/(.*)@#\!$TERMUX_PREFIX/bin/\2@" $file
+ for file in `find -L . -type f`; do
+ head -c 100 $file | grep -E "^#\!.*\\/bin\\/.*" | grep -q -E -v "^#\! ?\\/system" && sed --follow-symlinks -i -E "1 s@^#\!(.*)/bin/(.*)@#\!$TERMUX_PREFIX/bin/\2@" $file
done
set -e -o pipefail
# Remove DT_ entries which the android 5.1 linker warns about:
for includeset in $TERMUX_SUBPKG_INCLUDE; do
_INCLUDE_DIRSET=`dirname $includeset`
test "$_INCLUDE_DIRSET" = "." && _INCLUDE_DIRSET=""
- if [ -e $includeset ]; then
+ if [ -e $includeset -o -L $includeset ]; then
+ # Add the -L clause to handle relative symbolic links:
mkdir -p $SUB_PKG_MASSAGE_DIR/$_INCLUDE_DIRSET
mv $includeset $SUB_PKG_MASSAGE_DIR/$_INCLUDE_DIRSET
fi
exit 1
fi
- local TERMUX_GO_VERSION=go1.6
+ local TERMUX_GO_VERSION=go1.6.1
local TERMUX_GO_PLATFORM=linux-amd64
test `uname` = "Darwin" && TERMUX_GO_PLATFORM=darwin-amd64