X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/2497d95791cbc8bedfae1d286f4d523ba826633a..5b7c3ff6d3b196ff0a85a74009087639ce6fe535:/build-package.sh?ds=sidebyside diff --git a/build-package.sh b/build-package.sh index 9d1c8df5..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 () { @@ -68,7 +68,7 @@ fi # Handle 'all' arch: if [ $TERMUX_ARCH = 'all' ]; then - for arch in 'arm' 'i686' 'aarch64'; do + for arch in 'arm' 'i686' 'aarch64' 'x86_64'; do ./build-package.sh -a $arch $1 done exit @@ -123,7 +123,7 @@ TERMUX_PKG_INCLUDE_IN_DEVPACKAGE="" TERMUX_PKG_DEVPACKAGE_DEPENDS="" # Set if a host build should be done in TERMUX_PKG_HOSTBUILD_DIR: TERMUX_PKG_HOSTBUILD="" -TERMUX_PKG_MAINTAINER="Fredrik Fornwall " +TERMUX_PKG_MAINTAINER="Fredrik Fornwall @fornwall" TERMUX_PKG_CLANG=no # Cleanup old state @@ -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