From 0376da5b5093f68506c22907bc1ae38ff9a80490 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Tue, 20 Dec 2016 21:45:15 -0500 Subject: [PATCH] torsocks: Add as disabled package --- disabled-packages/torsocks/build.sh | 12 ++++++++++++ .../torsocks/src-common-config-file.h.patch | 14 ++++++++++++++ disabled-packages/torsocks/src-lib-torsocks.h.patch | 21 +++++++++++++++++++++ disabled-packages/torsocks/tests-Makefile.am.patch | 12 ++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 disabled-packages/torsocks/build.sh create mode 100644 disabled-packages/torsocks/src-common-config-file.h.patch create mode 100644 disabled-packages/torsocks/src-lib-torsocks.h.patch create mode 100644 disabled-packages/torsocks/tests-Makefile.am.patch diff --git a/disabled-packages/torsocks/build.sh b/disabled-packages/torsocks/build.sh new file mode 100644 index 00000000..82f63009 --- /dev/null +++ b/disabled-packages/torsocks/build.sh @@ -0,0 +1,12 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/dgoulet/torsocks +TERMUX_PKG_DESCRIPTION="Wrapper to safely torify applications" +TERMUX_PKG_VERSION=2.2.0 +TERMUX_PKG_SRCURL=https://github.com/dgoulet/torsocks/archive/v${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_DEPENDS="tor" +TERMUX_PKG_FOLDERNAME=torsocks-$TERMUX_PKG_VERSION + +termux_step_pre_configure () { + cd $TERMUX_PKG_SRCDIR + ./autogen.sh +} + diff --git a/disabled-packages/torsocks/src-common-config-file.h.patch b/disabled-packages/torsocks/src-common-config-file.h.patch new file mode 100644 index 00000000..3cc97b19 --- /dev/null +++ b/disabled-packages/torsocks/src-common-config-file.h.patch @@ -0,0 +1,14 @@ +diff -u -r ../torsocks-2.2.0/src/common/config-file.h ./src/common/config-file.h +--- ../torsocks-2.2.0/src/common/config-file.h 2016-10-18 12:44:01.000000000 -0400 ++++ ./src/common/config-file.h 2016-12-20 21:18:35.084929826 -0500 +@@ -21,6 +21,10 @@ + #define CONFIG_FILE_H + + #include ++#ifdef __ANDROID__ ++/* For in_addr_t. */ ++#include ++#endif + + #include "connection.h" + #include "socks5.h" diff --git a/disabled-packages/torsocks/src-lib-torsocks.h.patch b/disabled-packages/torsocks/src-lib-torsocks.h.patch new file mode 100644 index 00000000..84486085 --- /dev/null +++ b/disabled-packages/torsocks/src-lib-torsocks.h.patch @@ -0,0 +1,21 @@ +diff -u -r ../torsocks-2.2.0/src/lib/torsocks.h ./src/lib/torsocks.h +--- ../torsocks-2.2.0/src/lib/torsocks.h 2016-10-18 12:44:01.000000000 -0400 ++++ ./src/lib/torsocks.h 2016-12-20 21:22:07.973637763 -0500 +@@ -167,7 +167,7 @@ + #define LIBC_GETHOSTBYADDR_R_NAME gethostbyaddr_r + #define LIBC_GETHOSTBYADDR_R_NAME_STR XSTR(LIBC_GETHOSTBYADDR_R_NAME) + #define LIBC_GETHOSTBYADDR_R_RET_TYPE int +-#define LIBC_GETHOSTBYADDR_R_SIG const void *addr, socklen_t len, int type, \ ++#define LIBC_GETHOSTBYADDR_R_SIG const void *addr, int len, int type, \ + struct hostent *hret, char *buf, size_t buflen, \ + struct hostent **result, int *h_errnop + #define LIBC_GETHOSTBYADDR_R_ARGS addr, len, type, hret, buf, \ +@@ -197,7 +197,7 @@ + /* recvmsg(2) */ + #define LIBC_RECVMSG_NAME recvmsg + #define LIBC_RECVMSG_NAME_STR XSTR(LIBC_RECVMSG_NAME) +-#define LIBC_RECVMSG_RET_TYPE ssize_t ++#define LIBC_RECVMSG_RET_TYPE int + #define LIBC_RECVMSG_SIG \ + int sockfd, struct msghdr *msg, int flags + #define LIBC_RECVMSG_ARGS \ diff --git a/disabled-packages/torsocks/tests-Makefile.am.patch b/disabled-packages/torsocks/tests-Makefile.am.patch new file mode 100644 index 00000000..0f1d079d --- /dev/null +++ b/disabled-packages/torsocks/tests-Makefile.am.patch @@ -0,0 +1,12 @@ +diff -u -r ../torsocks-2.2.0/tests/Makefile.am ./tests/Makefile.am +--- ../torsocks-2.2.0/tests/Makefile.am 2016-10-18 12:44:01.000000000 -0400 ++++ ./tests/Makefile.am 2016-12-20 21:23:41.960184652 -0500 +@@ -29,7 +29,7 @@ + test_connect_LDADD = $(LIBTAP) $(LIBTORSOCKS) + + test_fd_passing_SOURCES = test_fd_passing.c +-test_fd_passing_LDADD = $(LIBTAP) $(LIBTORSOCKS) -lpthread ++test_fd_passing_LDADD = $(LIBTAP) $(LIBTORSOCKS) + + test_getpeername_SOURCES = test_getpeername.c + test_getpeername_LDADD = $(LIBTAP) $(LIBTORSOCKS) -- 2.11.0