pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

torsocks-git: fix build on netbsd.



Module Name:	pkgsrc-wip
Committed By:	coypu <coypu%sdf.org@localhost>
Pushed By:	coypu
Date:		Mon Oct 8 20:08:41 2018 +0300
Changeset:	f1675c2b17530610f0b38815b5d4d87ca0b22c8c

Modified Files:
	torsocks-git/Makefile
	torsocks-git/PLIST
Added Files:
	torsocks-git/distinfo
	torsocks-git/patches/patch-configure.ac
	torsocks-git/patches/patch-src_lib_accept.c
	torsocks-git/patches/patch-src_lib_torsocks.h

Log Message:
torsocks-git: fix build on netbsd.

From Tomasz Kazimierz Motyl

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=f1675c2b17530610f0b38815b5d4d87ca0b22c8c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 torsocks-git/Makefile                         |  6 ++++-
 torsocks-git/PLIST                            |  2 +-
 torsocks-git/distinfo                         |  5 ++++
 torsocks-git/patches/patch-configure.ac       | 13 +++++++++++
 torsocks-git/patches/patch-src_lib_accept.c   | 13 +++++++++++
 torsocks-git/patches/patch-src_lib_torsocks.h | 33 +++++++++++++++++++++++++++
 6 files changed, 70 insertions(+), 2 deletions(-)

diffs:
diff --git a/torsocks-git/Makefile b/torsocks-git/Makefile
index 87d4e7a26b..b54b8423b7 100644
--- a/torsocks-git/Makefile
+++ b/torsocks-git/Makefile
@@ -1,6 +1,8 @@
-# $NetBSD: Makefile,v 1.4 2015/05/24 13:55:43 i3enedek Exp $
+# $NetBSD: Makefile,v 1.5 2018/08/13 13:55:43 i3enedek, tmotyl Exp $
 
+TORSOCKS_VERSION = 0
 DISTNAME=	torsocks
+PKGNAME=	torsocks-${TORSOCKS_VERSION}
 CATEGORIES=	net security
 
 MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
@@ -42,6 +44,8 @@ SUBST_MESSAGE.lib=	Fixing src/lib/torsocks.h
 SUBST_FILES.lib=	src/lib/torsocks.h
 SUBST_SED.lib=		-e '/LIBC_GETHOSTBYADDR_SIG/ s/const void \*addr/const char *addr/'
 .endif
+PKG_ARGS_ADD += -v
+PKGBASE_FROM_BSD_MK = ${PKGNAME:C/-[^-]*$//}
 
 pre-configure:
 	cd ${WRKSRC} && autoreconf -fiv
diff --git a/torsocks-git/PLIST b/torsocks-git/PLIST
index 0addcfbbe9..45aa2eb66b 100644
--- a/torsocks-git/PLIST
+++ b/torsocks-git/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.3 2014/08/15 20:59:39 leot1990 Exp $
+@comment $NetBSD$
 bin/torsocks
 etc/tor/torsocks.conf
 lib/torsocks/libtorsocks.la
diff --git a/torsocks-git/distinfo b/torsocks-git/distinfo
new file mode 100644
index 0000000000..c181fcef1f
--- /dev/null
+++ b/torsocks-git/distinfo
@@ -0,0 +1,5 @@
+$NetBSD$
+
+SHA1 (patch-configure.ac) = 97b6239a07a0090ac18bd98db3351f4b6850d4c2
+SHA1 (patch-src_lib_accept.c) = 4b56eafc8ab87a93bf53e6df628258226cd514de
+SHA1 (patch-src_lib_torsocks.h) = 1b876b023bec6cc2b6758a9c3bf741d493e758c8
diff --git a/torsocks-git/patches/patch-configure.ac b/torsocks-git/patches/patch-configure.ac
new file mode 100644
index 0000000000..64405b7001
--- /dev/null
+++ b/torsocks-git/patches/patch-configure.ac
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- configure.ac.orig	2018-10-08 16:14:24.525273866 +0000
++++ configure.ac
+@@ -124,7 +124,7 @@ AS_CASE([$host_os],
+ 	[linux*|kfreebsd*-gnu|freebsd*],
+ 	[
+ 		libc_name=`ldd /usr/bin/yes | grep 'libc\.' | cut -d ' ' -f 1 | tr -d '\t'`
+-		if test "${libc_name}" == ""; then
++		if test "${libc_name}" = ""; then
+ 			# Default libc on most system.
+ 			libc_name="libc.so.6"
+ 		fi
diff --git a/torsocks-git/patches/patch-src_lib_accept.c b/torsocks-git/patches/patch-src_lib_accept.c
new file mode 100644
index 0000000000..cfb50eb952
--- /dev/null
+++ b/torsocks-git/patches/patch-src_lib_accept.c
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/lib/accept.c.orig	2018-10-08 16:15:36.361359954 +0000
++++ src/lib/accept.c
+@@ -87,7 +87,7 @@ LIBC_ACCEPT_DECL
+ 	return tsocks_accept(LIBC_ACCEPT_ARGS);
+ }
+ 
+-#if (defined(__linux__))
++#if (defined(__linux__) || defined(__NetBSD__))
+ 
+ TSOCKS_LIBC_DECL(accept4, LIBC_ACCEPT4_RET_TYPE, LIBC_ACCEPT4_SIG)
+ 
diff --git a/torsocks-git/patches/patch-src_lib_torsocks.h b/torsocks-git/patches/patch-src_lib_torsocks.h
new file mode 100644
index 0000000000..cceb1abfd1
--- /dev/null
+++ b/torsocks-git/patches/patch-src_lib_torsocks.h
@@ -0,0 +1,33 @@
+$NetBSD$
+
+--- src/lib/torsocks.h.orig	2018-10-08 16:16:47.830610306 +0000
++++ src/lib/torsocks.h
+@@ -242,6 +242,9 @@ struct hostent **result, int *h_errnop
+ #define LIBC_SYSCALL_SIG long int number, ...
+ #define LIBC_SYSCALL_ARGS number
+ 
++#endif /* __linux__ */
++
++#if defined(__linux__) || defined(__NetBSD__)
+ /* accept4(2) */
+ #define LIBC_ACCEPT4_NAME accept4
+ #define LIBC_ACCEPT4_NAME_STR XSTR(LIBC_ACCEPT4_NAME)
+@@ -249,8 +252,8 @@ struct hostent **result, int *h_errnop
+ #define LIBC_ACCEPT4_SIG \
+ 	int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags
+ #define LIBC_ACCEPT4_ARGS sockfd, addr, addrlen, flags
++#endif
+ 
+-#endif /* __linux__ */
+ 
+ #if (defined(__FreeBSD__) || defined(__darwin__) || defined(__NetBSD__))
+ 
+@@ -414,7 +417,7 @@ TSOCKS_DECL(accept, LIBC_ACCEPT_RET_TYPE
+ 		LIBC_ACCEPT_NAME(LIBC_ACCEPT_SIG)
+ 
+ /* accept4(2) */
+-#if (defined(__linux__))
++#if (defined(__linux__) || defined(__NetBSD__))
+ extern TSOCKS_LIBC_DECL(accept4, LIBC_ACCEPT4_RET_TYPE, LIBC_ACCEPT4_SIG)
+ TSOCKS_DECL(accept4, LIBC_ACCEPT4_RET_TYPE, LIBC_ACCEPT4_SIG)
+ #define LIBC_ACCEPT4_DECL LIBC_ACCEPT4_RET_TYPE \


Home | Main Index | Thread Index | Old Index