torsocks: Add as disabled package
authorFredrik Fornwall <fredrik@fornwall.net>
Wed, 21 Dec 2016 02:45:15 +0000 (21:45 -0500)
committerFredrik Fornwall <fredrik@fornwall.net>
Wed, 21 Dec 2016 02:59:31 +0000 (21:59 -0500)
disabled-packages/torsocks/build.sh [new file with mode: 0644]
disabled-packages/torsocks/src-common-config-file.h.patch [new file with mode: 0644]
disabled-packages/torsocks/src-lib-torsocks.h.patch [new file with mode: 0644]
disabled-packages/torsocks/tests-Makefile.am.patch [new file with mode: 0644]

diff --git a/disabled-packages/torsocks/build.sh b/disabled-packages/torsocks/build.sh
new file mode 100644 (file)
index 0000000..82f6300
--- /dev/null
@@ -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 (file)
index 0000000..3cc97b1
--- /dev/null
@@ -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 <netinet/in.h>
++#ifdef __ANDROID__
++/* For in_addr_t. */
++#include <arpa/inet.h>
++#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 (file)
index 0000000..8448608
--- /dev/null
@@ -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 (file)
index 0000000..0f1d079
--- /dev/null
@@ -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)