From a5b4ca0cb76a94bc38c60cb6fcc2733f3d8d9f6c Mon Sep 17 00:00:00 2001 From: Vishal Biswas Date: Sun, 23 Oct 2016 18:27:41 +0530 Subject: [PATCH] Builder script and ndk patch improvements (#520) - Add MOUNTED path. - Add debug switch. - Add switch for disabled package. --- build-package.sh | 15 ++++++++++++--- ndk_patches/paths.h.patch | 14 +++++++++++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/build-package.sh b/build-package.sh index 9584b2b8d..408ee9b01 100755 --- a/build-package.sh +++ b/build-package.sh @@ -18,19 +18,24 @@ test -f $HOME/.termuxrc && . $HOME/.termuxrc : ${TERMUX_API_LEVEL:="21"} : ${TERMUX_ANDROID_BUILD_TOOLS_VERSION:="24.0.1"} : ${TERMUX_NDK_VERSION:="13"} +: ${TERMUX_IS_DISABLED:=""} # Handle command-line arguments: show_usage () { - echo "Usage: ./build-package.sh [-a ARCH] PACKAGE" + echo "Usage: ./build-package.sh [-a ARCH] [-d] [-D] PACKAGE" echo "Build a package." + echo "Use -d for debug build." + echo "-D for disabled package." echo "" exit 1 } -while getopts :a:h option +while getopts :a:h:d:D option do case "$option" in a) TERMUX_ARCH="$OPTARG";; h) show_usage;; + d) TERMUX_DEBUG=true;; + D) TERMUX_IS_DISABLED=true;; ?) echo "./build-package.sh: illegal option -$OPTARG"; exit 1;; esac done @@ -58,7 +63,11 @@ if [[ $1 == *"/"* ]]; then export TERMUX_PKG_BUILDER_DIR=`realpath $1` else # Package name: - export TERMUX_PKG_BUILDER_DIR=$TERMUX_SCRIPTDIR/packages/$TERMUX_PKG_NAME + if [ -n $TERMUX_IS_DISABLED ]; then + export TERMUX_PKG_BUILDER_DIR=$TERMUX_SCRIPTDIR/disabled-packages/$TERMUX_PKG_NAME + else + export TERMUX_PKG_BUILDER_DIR=$TERMUX_SCRIPTDIR/packages/$TERMUX_PKG_NAME + fi fi TERMUX_PKG_BUILDER_SCRIPT=$TERMUX_PKG_BUILDER_DIR/build.sh if test ! -f $TERMUX_PKG_BUILDER_SCRIPT; then diff --git a/ndk_patches/paths.h.patch b/ndk_patches/paths.h.patch index 2d45efe98..d85d507b6 100644 --- a/ndk_patches/paths.h.patch +++ b/ndk_patches/paths.h.patch @@ -1,6 +1,5 @@ -diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm64/usr/include/paths.h ./usr/include/paths.h ---- /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm64/usr/include/paths.h 2016-03-03 16:54:24.000000000 -0500 -+++ ./usr/include/paths.h 2016-05-30 17:18:24.726803678 -0400 +--- /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm64/usr/include/paths.h 2016-10-09 16:37:54.394746195 +0530 ++++ ./usr/include/paths.h 2016-10-21 23:28:38.689411903 +0530 @@ -33,12 +33,12 @@ #define _PATHS_H_ @@ -17,6 +16,15 @@ diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm64/usr/in #define _PATH_CONSOLE "/dev/console" #define _PATH_CSHELL "/bin/csh" #define _PATH_DEVDB "/var/run/dev.db" +@@ -51,7 +51,7 @@ + #define _PATH_MAN "/usr/share/man" + #define _PATH_MEM "/dev/mem" + #define _PATH_MNTTAB "/etc/fstab" +-#define _PATH_MOUNTED "/etc/mtab" ++#define _PATH_MOUNTED "/proc/mounts" + #define _PATH_NOLOGIN "/etc/nologin" + #define _PATH_PRESERVE "/var/lib" + #define _PATH_RWHODIR "/var/spool/rwho" @@ -66,9 +66,9 @@ /* Provide trailing slash, since mostly used for building pathnames. */