echo " -a The architecture to build for: aarch64(default), arm, i686, x86_64 or all."
echo " -d Build with debug symbols."
echo " -D Build a disabled package in disabled-packages/."
+ echo " -s Skip dependency check."
exit 1
}
-while getopts :a:hdD option
+while getopts :a:hdDs option
do
case "$option" in
a) TERMUX_ARCH="$OPTARG";;
h) show_usage;;
d) TERMUX_DEBUG=true;;
D) TERMUX_IS_DISABLED=true;;
+ s) export TERMUX_SKIP_DEPCHECK=true;;
?) echo "./build-package.sh: illegal option -$OPTARG"; exit 1;;
esac
done
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
exit 0
fi
-echo "termux - building $1 for arch $TERMUX_ARCH..."
-test -t 1 && printf "\033]0;%s...\007" "$1"
+if [ -z "${TERMUX_SKIP_DEPCHECK:=""}" ]; then
+ for p in `./scripts/buildorder.py $TERMUX_PKG_NAME`; do
+ if [ "$p" != "$TERMUX_PKG_NAME" ]; then
+ echo "Building dependency $p if necessary..."
+ ./build-package.sh -s $p
+ fi
+ done
+fi
# Compute full version:
TERMUX_PKG_FULLVERSION=$TERMUX_PKG_VERSION
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
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