pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
torsocks: start upgrade, fails to build, reported upstream
Module Name: pkgsrc-wip
Committed By: Thomas Klausner <wiz%NetBSD.org@localhost>
Pushed By: wiz
Date: Tue Dec 1 15:27:45 2026 +0100
Changeset: 51012728846ed9e629794ce4d7c9c8ada7364ca1
Modified Files:
Makefile
Added Files:
torsocks/DESCR
torsocks/Makefile
torsocks/PLIST
torsocks/TODO
torsocks/distinfo
torsocks/patches/patch-src_lib_torsocks.c
Log Message:
torsocks: start upgrade, fails to build, reported upstream
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=51012728846ed9e629794ce4d7c9c8ada7364ca1
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
Makefile | 1 +
torsocks/DESCR | 15 ++++++++
torsocks/Makefile | 59 +++++++++++++++++++++++++++++++
torsocks/PLIST | 7 ++++
torsocks/TODO | 26 ++++++++++++++
torsocks/distinfo | 6 ++++
torsocks/patches/patch-src_lib_torsocks.c | 23 ++++++++++++
7 files changed, 137 insertions(+)
diffs:
diff --git a/Makefile b/Makefile
index 2722c94200..d5a3c68cd2 100644
--- a/Makefile
+++ b/Makefile
@@ -5869,6 +5869,7 @@ SUBDIR+= torcs
SUBDIR+= torque2d
SUBDIR+= torque3d
SUBDIR+= torrentzip
+SUBDIR+= torsocks
SUBDIR+= torsocks-git
SUBDIR+= tortunnel
SUBDIR+= tosview
diff --git a/torsocks/DESCR b/torsocks/DESCR
new file mode 100644
index 0000000000..4043c286d1
--- /dev/null
+++ b/torsocks/DESCR
@@ -0,0 +1,15 @@
+Torsocks allows you to use most applications in a safe way with
+Tor. It ensures that DNS requests are handled safely and explicitly
+rejects any traffic other then TCP from the application you're
+using.
+
+Torsocks is an ELF shared library that is loaded before all others.
+The library overrides every needed Internet communication libc
+function calls such as connect(2) or gethostbyname(3).
+
+This process is transparent to the user and if torsocks detects
+any communication that can't go through the Tor network such as
+UDP traffic for instance, the connection is denied. If, in some
+way, there is no way for torsocks to provide the Tor anonymity
+guarantee with your application, torsocks will force the application
+to quit and stop everything.
diff --git a/torsocks/Makefile b/torsocks/Makefile
new file mode 100644
index 0000000000..4187e86178
--- /dev/null
+++ b/torsocks/Makefile
@@ -0,0 +1,59 @@
+# $NetBSD: Makefile,v 1.2 2018/11/20 23:42:59 leot Exp $
+
+DISTNAME= torsocks-v2.5.0
+PKGNAME= ${DISTNAME:S/v//}
+CATEGORIES= net
+MASTER_SITES= https://gitlab.torproject.org/tpo/core/torsocks/-/archive/v${PKGVERSION_NOREV}/
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://gitweb.torproject.org/torsocks.git
+COMMENT= Library to torify applications
+LICENSE= gnu-gpl-v2
+
+GNU_CONFIGURE= yes
+USE_LIBTOOL= yes
+USE_TOOLS+= autoconf automake autoreconf
+
+CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
+CONFIGURE_ARGS+= --with-conf=${PKG_SYSCONFDIR}/torsocks.conf
+
+EGDIR= ${PREFIX}/share/examples/torsocks
+CONF_FILES= ${EGDIR}/torsocks.conf \
+ ${PKG_SYSCONFDIR}/torsocks.conf
+
+SUBST_CLASSES+= configure
+SUBST_STAGE.configure= pre-configure
+SUBST_MESSAGE.configure= Fixing non-standard test(1) == operator
+SUBST_FILES.configure= configure
+SUBST_SED.configure= -e '/test/ s/ == / = /g'
+
+SUBST_CLASSES+= confdir
+SUBST_STAGE.confdir= pre-configure
+SUBST_MESSAGE.confdir= Adjusting confdir
+SUBST_FILES.confdir= doc/Makefile.am
+SUBST_SED.confdir= -e '/^confdir/ s;/tor;;'
+
+SUBST_CLASSES+= conffile
+SUBST_STAGE.conffile= pre-configure
+SUBST_MESSAGE.conffile= Adjusting DEFAULT_CONF_FILE
+SUBST_FILES.conffile= src/common/defaults.h
+SUBST_SED.conffile= -e '/DEFAULT_CONF_FILE/ s;"/tor/";"/";'
+
+SUBST_CLASSES+= man
+SUBST_STAGE.man= pre-configure
+SUBST_MESSAGE.man= Fix hardcoded paths in man pages
+SUBST_FILES.man= doc/torsocks.1 doc/torsocks.8 doc/torsocks.conf.5
+SUBST_SED.man= -e 's;/etc/tor;${PKG_SYSCONFDIR};g'
+
+TEST_TARGET= check
+
+post-patch:
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} autoreconf -fiv
+
+post-install:
+ ${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR}
+ cd ${DESTDIR}${PREFIX} && ${RM} -fr share/doc
+ ${MV} ${DESTDIR}${PKG_SYSCONFDIR}/torsocks.conf \
+ ${DESTDIR}${EGDIR}/torsocks.conf
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/torsocks/PLIST b/torsocks/PLIST
new file mode 100644
index 0000000000..3c63e8a799
--- /dev/null
+++ b/torsocks/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST,v 1.1 2018/02/26 13:19:55 leot Exp $
+bin/torsocks
+lib/torsocks/libtorsocks.la
+man/man1/torsocks.1
+man/man5/torsocks.conf.5
+man/man8/torsocks.8
+share/examples/torsocks/torsocks.conf
diff --git a/torsocks/TODO b/torsocks/TODO
new file mode 100644
index 0000000000..d39c215aec
--- /dev/null
+++ b/torsocks/TODO
@@ -0,0 +1,26 @@
+https://gitlab.torproject.org/tpo/core/torsocks/-/work_items/40036
+
+--- socketpair.lo ---
+In file included from socketpair.c:22:
+torsocks.h:75:49: warning: argument 4 of type 'int[2]' with mismatched bound [-Warray-parameter=]
+ 75 | int domain, int type, int protocol, int sv[2]
+ | ~~~~^~~~~
+torsocks.h:329:63: note: in expansion of macro 'LIBC_SOCKETPAIR_SIG'
+ 329 | LIBC_SOCKETPAIR_RET_TYPE LIBC_SOCKETPAIR_NAME(LIBC_SOCKETPAIR_SIG)
+ | ^~~~~~~~~~~~~~~~~~~
+socketpair.c:48:1: note: in expansion of macro 'LIBC_SOCKETPAIR_DECL'
+ 48 | LIBC_SOCKETPAIR_DECL
+ | ^~~~~~~~~~~~~~~~~~~~
+In file included from ../../src/common/compat.h:249,
+ from ../../src/common/log.h:28,
+ from socketpair.c:20:
+/usr/include/sys/socket.h:650:35: note: previously declared as 'int *'
+ 650 | int socketpair(int, int, int, int *);
+ | ^~~~~
+--- getaddrinfo.lo ---
+getaddrinfo.c: In function 'tsocks_getaddrinfo':
+getaddrinfo.c:77:37: error: 'AI_V4MAPPED' undeclared (first use in this function)
+ 77 | .ai_flags = AI_V4MAPPED | AI_ADDRCONFIG,
+ | ^~~~~~~~~~~
+getaddrinfo.c:77:37: note: each undeclared identifier is reported only once for each function it appears in
+*** [getaddrinfo.lo] Error code 1
diff --git a/torsocks/distinfo b/torsocks/distinfo
new file mode 100644
index 0000000000..4c845829b8
--- /dev/null
+++ b/torsocks/distinfo
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.4 2021/10/26 11:07:04 nia Exp $
+
+BLAKE2s (torsocks-v2.5.0.tar.gz) = 36a74753c936a8ae9065ae78e5c3ee510c6e667f382fcdfc968fd9eaff186464
+SHA512 (torsocks-v2.5.0.tar.gz) = dcf4d4d817eb79e52930afff12915eb040b8fc7acd75ec60f28e0d06528cf011b20968ae6ea9bcb3dc51aebe26f88e89fc53d0630487e9216371ed7f71d25773
+Size (torsocks-v2.5.0.tar.gz) = 122020 bytes
+SHA1 (patch-src_lib_torsocks.c) = 18b7aa88c0d455a7a53e1d1db1ec19a7f1324290
diff --git a/torsocks/patches/patch-src_lib_torsocks.c b/torsocks/patches/patch-src_lib_torsocks.c
new file mode 100644
index 0000000000..06c1c44e85
--- /dev/null
+++ b/torsocks/patches/patch-src_lib_torsocks.c
@@ -0,0 +1,23 @@
+$NetBSD: patch-src_lib_torsocks.c,v 1.1 2018/11/20 23:42:59 leot Exp $
+
+LIBC_ACCEPT4_* is defined only on Linux.
+
+--- src/lib/torsocks.c.orig 2018-04-20 15:41:42.000000000 +0000
++++ src/lib/torsocks.c
+@@ -234,9 +234,15 @@ static void init_libc_symbols(void)
+ tsocks_libc_socket = dlsym(libc_ptr, LIBC_SOCKET_NAME_STR);
+ tsocks_libc_syscall = dlsym(libc_ptr, LIBC_SYSCALL_NAME_STR);
+ tsocks_libc_execve = dlsym(libc_ptr, LIBC_EXECVE_NAME_STR);
++#ifdef LIBC_ACCEPT4_NAME_STR
+ tsocks_libc_accept4 = dlsym(libc_ptr, LIBC_ACCEPT4_NAME_STR);
++#endif
+ if (!tsocks_libc_connect || !tsocks_libc_close || !tsocks_libc_socket ||
+- !tsocks_libc_syscall || !tsocks_libc_execve || ! tsocks_libc_accept4) {
++ !tsocks_libc_syscall || !tsocks_libc_execve
++#ifdef LIBC_ACCEPT4_NAME_STR
++ || !tsocks_libc_accept4
++#endif
++ ) {
+ ERR("Unable to lookup symbols in " LIBC_NAME "(%s)", dlerror());
+ goto error;
+ }
Home |
Main Index |
Thread Index |
Old Index