X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/c629f2b1fd2384c60e01f87bc24734f54baffa6d..ae284287c652031694f26388cdfa4c6b14e97615:/build-package.sh diff --git a/build-package.sh b/build-package.sh index 667d0fee..8dfbd1b2 100755 --- a/build-package.sh +++ b/build-package.sh @@ -14,7 +14,7 @@ show_usage () { echo " -D Build a disabled package in disabled-packages/." exit 1 } -while getopts :a:hd:D option +while getopts :a:hdD option do case "$option" in a) TERMUX_ARCH="$OPTARG";; @@ -544,7 +544,7 @@ termux_setup_golang () { exit 1 fi - local TERMUX_GO_VERSION=go1.7.3 + local TERMUX_GO_VERSION=go1.7.4 local TERMUX_GO_PLATFORM=linux-amd64 test `uname` = "Darwin" && TERMUX_GO_PLATFORM=darwin-amd64 @@ -567,9 +567,6 @@ if [ -n "${TERMUX_PKG_BLACKLISTED_ARCHES:=""}" -a "$TERMUX_PKG_BLACKLISTED_ARCHE exit 0 fi -echo "termux - building $1 for arch $TERMUX_ARCH..." -test -t 1 && printf "\033]0;%s...\007" "$1" - # Compute full version: TERMUX_PKG_FULLVERSION=$TERMUX_PKG_VERSION if [ "$TERMUX_PKG_BUILD_REVISION" != "0" -o "$TERMUX_PKG_FULLVERSION" != "${TERMUX_PKG_FULLVERSION/-/}" ]; then @@ -577,11 +574,21 @@ if [ "$TERMUX_PKG_BUILD_REVISION" != "0" -o "$TERMUX_PKG_FULLVERSION" != "${TERM TERMUX_PKG_FULLVERSION+="-$TERMUX_PKG_BUILD_REVISION" fi +if [ -z "$TERMUX_DEBUG" -a -e "/data/data/.built-packages/$TERMUX_PKG_NAME" ]; then + if [ "`cat /data/data/.built-packages/$TERMUX_PKG_NAME`" = "$TERMUX_PKG_FULLVERSION" ]; then + echo "$TERMUX_PKG_NAME@$TERMUX_PKG_FULLVERSION built - skipping (rm /data/data/.built-packages/$TERMUX_PKG_NAME to force rebuild)" + exit 0 + fi +fi + +echo "termux - building $1 for arch $TERMUX_ARCH..." +test -t 1 && printf "\033]0;%s...\007" "$1" + # Compute standalone toolchain dir, bitness of arch and name of host platform: 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 # that everyone gets an updated toolchain: -TERMUX_STANDALONE_TOOLCHAIN+="-v2" +TERMUX_STANDALONE_TOOLCHAIN+="-v3" # We put this after system PATH to avoid picking up toolchain stripped python export PATH=$PATH:$TERMUX_STANDALONE_TOOLCHAIN/bin @@ -613,8 +620,8 @@ export STRIP=$TERMUX_HOST_PLATFORM-strip export CFLAGS="$_SPECSFLAG" export LDFLAGS="$_SPECSFLAG -L${TERMUX_PREFIX}/lib" # Android 7 started to support DT_RUNPATH (but not DT_RPATH), so we may want -# "-Wl,-rpath=$TERMUX_PREFIX/lib -Wl,--enable-new-dtags" here in the future -# - and no longer remove DT_RUNPATH in termux-elf-cleaner. +# LDFLAGS+="-Wl,-rpath=$TERMUX_PREFIX/lib -Wl,--enable-new-dtags" +# and no longer remove DT_RUNPATH in termux-elf-cleaner. if [ "$TERMUX_ARCH" = "arm" ]; then CFLAGS+=" -march=armv7-a -mfpu=neon -mfloat-abi=softfp" @@ -684,6 +691,14 @@ if [ ! -d $TERMUX_STANDALONE_TOOLCHAIN ]; then $TERMUX_ELF_CLEANER usr/lib/*.so + # zlib is really version 1.2.8 in the Android platform (at least + # starting from Android 5), not older as the NDK headers claim. + for file in zconf.h zlib.h; do + curl -o $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/include/$file \ + https://raw.githubusercontent.com/madler/zlib/v1.2.8/$file + done + unset file + mv $_TERMUX_TOOLCHAIN_TMPDIR $TERMUX_STANDALONE_TOOLCHAIN fi @@ -723,7 +738,7 @@ chmod +x $PKG_CONFIG cat > $PKG_CONFIG_LIBDIR/zlib.pc < "/data/data/.built-packages/$TERMUX_PKG_NAME" exit 0