X-Git-Url: https://git.distorted.org.uk/~mdw/termux-packages/blobdiff_plain/66f3991fb392c98c10c2097fe9fcbaaa520786b7..6b87a6b879a06462689c473960a5b2e57b413ee6:/build-package.sh diff --git a/build-package.sh b/build-package.sh index d966918a..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,6 +574,16 @@ 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 @@ -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" @@ -885,4 +892,7 @@ fi echo "termux - build of '$1' done" test -t 1 && printf "\033]0;%s - DONE\007" "$1" + +mkdir -p /data/data/.built-packages +echo "$TERMUX_PKG_FULLVERSION" > "/data/data/.built-packages/$TERMUX_PKG_NAME" exit 0