wireguard-tools: Add package

Also run make if $TERMUX_PKG_EXTRA_MAKE_ARGS is defined, even if no $TERMUX_PKG_SRCDIR/Makefile exists.
This commit is contained in:
Henrik Grimler 2018-07-15 17:11:40 +02:00 committed by Fredrik Fornwall
parent 4207765ff6
commit e71adec6a5
3 changed files with 40 additions and 2 deletions

View File

@ -979,7 +979,7 @@ termux_step_make() {
QUIET_BUILD="-s"
fi
if ls ./*akefile &> /dev/null; then
if ls ./*akefile &> /dev/null || [ ! -z "$TERMUX_PKG_EXTRA_MAKE_ARGS" ]; then
if [ -z "$TERMUX_PKG_EXTRA_MAKE_ARGS" ]; then
make -j $TERMUX_MAKE_PROCESSES $QUIET_BUILD
else
@ -989,7 +989,7 @@ termux_step_make() {
}
termux_step_make_install() {
if ls ./*akefile &> /dev/null; then
if ls ./*akefile &> /dev/null || [ ! -z "$TERMUX_PKG_EXTRA_MAKE_ARGS" ]; then
: "${TERMUX_PKG_MAKE_INSTALL_TARGET:="install"}"
# Some packages have problem with parallell install, and it does not buy much, so use -j 1.
if [ -z "$TERMUX_PKG_EXTRA_MAKE_ARGS" ]; then

View File

@ -0,0 +1,24 @@
--- ../android.c.orig 2018-07-11 09:28:18.815358450 +0000
+++ ./src/tools/wg-quick/android.c 2018-07-11 09:29:03.722806783 +0000
@@ -247,17 +247,17 @@
if (!getuid())
return;
- args[0] = "su";
- args[1] = "-p";
+ args[0] = "tsu";
+ args[1] = "-a";
args[2] = "-c";
memcpy(&args[3], argv, argc * sizeof(*args));
args[argc + 3] = NULL;
- printf("[$] su -p -c ");
+ printf("[$] tsu -a -c ");
for (int i = 0; i < argc; ++i)
printf("%s%c", argv[i], i == argc - 1 ? '\n' : ' ');
- execvp("su", args);
+ execvp("tsu", args);
exit(errno);
}

View File

@ -0,0 +1,14 @@
TERMUX_PKG_HOMEPAGE=https://www.wireguard.com
TERMUX_PKG_DESCRIPTION="Tools for the WireGuard secure network tunnel"
TERMUX_PKG_VERSION=0.0.20180708
TERMUX_PKG_SRCURL=https://git.zx2c4.com/WireGuard/snapshot/WireGuard-$TERMUX_PKG_VERSION.tar.xz
TERMUX_PKG_SHA256=5e38d554f7d1e3a64e3a5319ca1a3b790c84ed89c896586c490a93ac1f953a91
TERMUX_PKG_DEPENDS="libmnl, tsu"
TERMUX_PKG_BUILD_IN_SRC=yes
TERMUX_PKG_EXTRA_MAKE_ARGS=" -C src/tools WITH_BASHCOMPLETION=yes WITH_WGQUICK=no WITH_SYSTEMDUNITS=no"
termux_step_post_make_install () {
cd src/tools/wg-quick
$CC $CFLAGS -DWG_CONFIG_SEARCH_PATHS="\"$TERMUX_ANDROID_HOME/.wireguard $TERMUX_PREFIX/etc/wireguard /data/misc/wireguard /data/data/com.wireguard.android/files\"" -o wg-quick android.c
install -m 0755 wg-quick $TERMUX_PREFIX/bin
}