Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-proxy/torsocks/files/, net-proxy/torsocks/
Date: Thu, 13 Oct 2016 09:04:56
Message-Id: 1476349436.26ab0d26a3447e795e3766c08a599b41d974d81b.blueness@gentoo
1 commit: 26ab0d26a3447e795e3766c08a599b41d974d81b
2 Author: Felix Janda <felix.janda <AT> posteo <DOT> de>
3 AuthorDate: Tue Oct 11 23:43:45 2016 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 13 09:03:56 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26ab0d26
7
8 net-proxy/torsocks: fix build with musl libc, bump eapi
9
10 Gentoo-Bug: https://bugs.gentoo.org/583730
11
12 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
13
14 net-proxy/torsocks/files/torsocks-2.1.0-musl.patch | 121 +++++++++++++++++++++
15 ...socks-2.1.0.ebuild => torsocks-2.1.0-r1.ebuild} | 17 +--
16 2 files changed, 130 insertions(+), 8 deletions(-)
17
18 diff --git a/net-proxy/torsocks/files/torsocks-2.1.0-musl.patch b/net-proxy/torsocks/files/torsocks-2.1.0-musl.patch
19 new file mode 100644
20 index 00000000..c11cf69
21 --- /dev/null
22 +++ b/net-proxy/torsocks/files/torsocks-2.1.0-musl.patch
23 @@ -0,0 +1,121 @@
24 +From 3e793e9eac05ad926cc016da5129e95986d105f2 Mon Sep 17 00:00:00 2001
25 +From: David Goulet <dgoulet@×××××.net>
26 +Date: Mon, 13 Jun 2016 14:39:53 -0400
27 +Subject: [PATCH] Add support for musl-libc
28 +
29 +Musl library does not have a specific define so use __linux__ instead.
30 +
31 +Signed-off-by: David Goulet <dgoulet@×××××.net>
32 +---
33 + src/common/compat.c | 5 +++--
34 + src/common/compat.h | 5 +++--
35 + src/common/ref.h | 5 +++--
36 + src/lib/torsocks.h | 9 +++++----
37 + 4 files changed, 14 insertions(+), 10 deletions(-)
38 +
39 +diff --git a/src/common/compat.c b/src/common/compat.c
40 +index a861b3d..323f2ed 100644
41 +--- a/src/common/compat.c
42 ++++ b/src/common/compat.c
43 +@@ -19,7 +19,8 @@
44 +
45 + #include "compat.h"
46 +
47 +-#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__darwin__) || defined(__NetBSD__))
48 ++#if (defined(__linux__) || defined(__GLIBC__) || defined(__FreeBSD__) || \
49 ++ defined(__darwin__) || defined(__NetBSD__))
50 +
51 + /*
52 + * Initialize a pthread mutex. This never fails.
53 +@@ -96,4 +97,4 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine)(void))
54 + tsocks_mutex_unlock(&o->mutex);
55 + }
56 +
57 +-#endif /* __GLIBC__, __darwin__, __FreeBSD__, __NetBSD__ */
58 ++#endif /* __linux__, __GLIBC__, __darwin__, __FreeBSD__, __NetBSD__ */
59 +diff --git a/src/common/compat.h b/src/common/compat.h
60 +index ce47129..6c8ce32 100644
61 +--- a/src/common/compat.h
62 ++++ b/src/common/compat.h
63 +@@ -22,7 +22,8 @@
64 + #define __darwin__ 1
65 + #endif
66 +
67 +-#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__darwin__) || defined(__NetBSD__))
68 ++#if (defined(__linux__) || defined(__GLIBC__) || defined(__FreeBSD__) || \
69 ++ defined(__darwin__) || defined(__NetBSD__))
70 +
71 + #define RTLD_NEXT ((void *) -1)
72 +
73 +@@ -55,7 +56,7 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine)(void));
74 +
75 + #else
76 + #error "OS not supported."
77 +-#endif /* __GLIBC__, __darwin__, __FreeBSD__, __NetBSD__ */
78 ++#endif /* __linux__, __GLIBC__, __darwin__, __FreeBSD__, __NetBSD__ */
79 +
80 + #if defined(__linux__)
81 + #include <unistd.h>
82 +diff --git a/src/common/ref.h b/src/common/ref.h
83 +index 88aec2e..d9b9df8 100644
84 +--- a/src/common/ref.h
85 ++++ b/src/common/ref.h
86 +@@ -26,7 +26,8 @@ struct ref {
87 + long count;
88 + };
89 +
90 +-#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__darwin__) || defined(__NetBSD__))
91 ++#if (defined(__linux__) || defined(__GLIBC__) || defined(__FreeBSD__) || \
92 ++ defined(__darwin__) || defined(__NetBSD__))
93 +
94 + /*
95 + * Get a reference by incrementing the refcount.
96 +@@ -57,6 +58,6 @@ static inline void ref_put(struct ref *r,
97 +
98 + #else
99 + #error "OS not supported"
100 +-#endif /* __GLIBC__, __FreeBSD__, __darwin__ */
101 ++#endif /* __linux__, __GLIBC__, __FreeBSD__, __darwin__, __NetBSD__ */
102 +
103 + #endif /* TORSOCKS_REF_H */
104 +diff --git a/src/lib/torsocks.h b/src/lib/torsocks.h
105 +index 076f3a5..0eeef2a 100644
106 +--- a/src/lib/torsocks.h
107 ++++ b/src/lib/torsocks.h
108 +@@ -33,7 +33,8 @@
109 + #define TSOCKS_DECL(name, type, sig) \
110 + extern type tsocks_##name(sig);
111 +
112 +-#if (defined(__GLIBC__) || defined(__FreeBSD__) || defined(__darwin__) || defined(__NetBSD__))
113 ++#if (defined(__linux__) || defined(__GLIBC__) || defined(__FreeBSD__) || \
114 ++ defined(__darwin__) || defined(__NetBSD__))
115 +
116 + /* connect(2) */
117 + #include <sys/types.h>
118 +@@ -207,7 +208,7 @@ struct hostent **result, int *h_errnop
119 +
120 + #else
121 + #error "OS not supported."
122 +-#endif /* __GLIBC__ , __FreeBSD__, __darwin__, __NetBSD__ */
123 ++#endif /* __linux__, __GLIBC__ , __FreeBSD__, __darwin__, __NetBSD__ */
124 +
125 + #if (defined(__linux__))
126 +
127 +@@ -241,7 +242,7 @@ struct hostent **result, int *h_errnop
128 +
129 + #endif /* __FreeBSD__, __darwin__, __NetBSD__ */
130 +
131 +-#if defined(__GLIBC__) && defined(__FreeBSD_kernel__)
132 ++#if (defined(__linux__) || defined(__GLIBC__)) && defined(__FreeBSD_kernel__)
133 +
134 + /* syscall(2) */
135 + #define LIBC_SYSCALL_NAME syscall
136 +@@ -250,7 +251,7 @@ struct hostent **result, int *h_errnop
137 + #define LIBC_SYSCALL_SIG long int number, ...
138 + #define LIBC_SYSCALL_ARGS number
139 +
140 +-#endif /* __GLIBC__ && __FreeBSD_kernel__ */
141 ++#endif /* (__linux__ || __GLIBC__) && __FreeBSD_kernel__ */
142 +
143 + /* __syscall(2) */
144 + #if defined(__FreeBSD__)
145
146 diff --git a/net-proxy/torsocks/torsocks-2.1.0.ebuild b/net-proxy/torsocks/torsocks-2.1.0-r1.ebuild
147 similarity index 75%
148 rename from net-proxy/torsocks/torsocks-2.1.0.ebuild
149 rename to net-proxy/torsocks/torsocks-2.1.0-r1.ebuild
150 index b085f65..b389659 100644
151 --- a/net-proxy/torsocks/torsocks-2.1.0.ebuild
152 +++ b/net-proxy/torsocks/torsocks-2.1.0-r1.ebuild
153 @@ -1,10 +1,10 @@
154 -# Copyright 1999-2015 Gentoo Foundation
155 +# Copyright 1999-2016 Gentoo Foundation
156 # Distributed under the terms of the GNU General Public License v2
157 # $Id$
158
159 -EAPI=5
160 +EAPI=6
161
162 -inherit autotools eutils multilib versionator
163 +inherit autotools versionator
164
165 MY_PV="$(replace_version_separator 3 -)"
166 MY_PF="${PN}-${MY_PV}"
167 @@ -23,6 +23,9 @@ IUSE="static-libs"
168 DEPEND=""
169 RDEPEND="${DEPEND}"
170
171 +PATCHES=( "${FILESDIR}"/${P}-musl.patch )
172 +DOCS=( ChangeLog README.md TODO doc/notes/DEBUG doc/socks/{SOCKS5,socks-extensions.txt} )
173 +
174 src_prepare() {
175 sed -i -e "/dist_doc_DATA/s/^/#/" Makefile.am doc/Makefile.am || die
176
177 @@ -30,6 +33,7 @@ src_prepare() {
178 sed -i -e '/^\.\/test_dns$/d' tests/test_list || \
179 die "failed to disable network tests"
180
181 + default
182 eautoreconf
183 }
184
185 @@ -40,9 +44,6 @@ src_configure() {
186 src_install() {
187 default
188
189 - dodoc ChangeLog README.md TODO doc/notes/DEBUG doc/socks/{SOCKS5,socks-extensions.txt}
190 -
191 - #Remove libtool .la files
192 - cd "${D}"/usr/$(get_libdir)/torsocks || die
193 - rm -f *.la
194 + # Remove libtool .la files
195 + find "${D}" -name '*.la' -delete || die
196 }