X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/48670d1b9052ef893131eebf67acf9c0c189f0c1..5b7c3ff6d3b196ff0a85a74009087639ce6fe535:/build-package.sh diff --git a/build-package.sh b/build-package.sh index cfd08fe2..f213e511 100755 --- a/build-package.sh +++ b/build-package.sh @@ -10,14 +10,14 @@ test -f $HOME/.termuxrc && . $HOME/.termuxrc : ${NDK:="${HOME}/lib/android-ndk"} : ${TERMUX_MAKE_PROCESSES:='4'} : ${TERMUX_TOPDIR:="$HOME/.termux-build"} -: ${TERMUX_ARCH:="aarch64"} # (arm|aarch64|i686|x86_64) - the x86_64 arch is not yet used or tested. +: ${TERMUX_ARCH:="aarch64"} # arm, aarch64, i686 or x86_64. : ${TERMUX_PREFIX:='/data/data/com.termux/files/usr'} : ${TERMUX_ANDROID_HOME:='/data/data/com.termux/files/home'} : ${TERMUX_DEBUG:=""} : ${TERMUX_PROCESS_DEB:=""} : ${TERMUX_API_LEVEL:="21"} : ${TERMUX_ANDROID_BUILD_TOOLS_VERSION:="24.0.1"} -: ${TERMUX_NDK_VERSION:="12"} +: ${TERMUX_NDK_VERSION:="13"} # Handle command-line arguments: show_usage () { @@ -386,7 +386,7 @@ termux_step_massage () { find . -name '*.la' -delete fi - # .. move over sbin to bin + # Move over sbin to bin: for file in sbin/*; do if test -f $file; then mv $file bin/; fi; done # Remove world permissions and add write permissions. @@ -399,13 +399,14 @@ termux_step_massage () { find . -type f | xargs -r file | grep -E "(executable|shared object)" | grep ELF | cut -f 1 -d : | \ xargs -r $STRIP --strip-unneeded --preserve-dates set -e -o pipefail - # Remove DT_ entries which the android 5.1 linker warns about: - find . -type f -print0 | xargs -r -0 $TERMUX_ELF_CLEANER fi - # Fix shebang paths: - 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 + # Remove DT_ entries which the android 5.1 linker warns about: + find . -type f -print0 | xargs -r -0 $TERMUX_ELF_CLEANER + + # Fix shebang paths: + 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 test ! -z "$TERMUX_PKG_RM_AFTER_INSTALL" && rm -Rf $TERMUX_PKG_RM_AFTER_INSTALL @@ -619,7 +620,7 @@ else fi if [ -n "$TERMUX_DEBUG" ]; then - CFLAGS+=" -g3 -Og -fstack-protector --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2" + CFLAGS+=" -g3 -O1 -fstack-protector --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2" else CFLAGS+=" -Os" fi