1 |
commit: 634e9eb09ef7db117ac05ad24926a6078eb07170 |
2 |
Author: Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon Oct 18 22:29:34 2021 +0000 |
4 |
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 19 19:55:44 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=634e9eb0 |
7 |
|
8 |
dev-lua/luasocket: publish API and sonames |
9 |
|
10 |
Add patches to publish API and sonames for external linking (see #730352 for |
11 |
rationale). |
12 |
Patches available at https://github.com/winterheart/luasocket/tree/public-api |
13 |
|
14 |
Closes: https://github.com/gentoo/gentoo/pull/22631 |
15 |
Bug: https://bugs.gentoo.org/730352 |
16 |
Package-Manager: Portage-3.0.20, Repoman-3.0.3 |
17 |
Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com> |
18 |
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org> |
19 |
|
20 |
.../luasocket-3.0_rc1_p20200328_makefile.patch | 89 +++++++ |
21 |
.../luasocket-3.0_rc1_p20200328_publish_API.patch | 294 +++++++++++++++++++++ |
22 |
.../luasocket-3.0_rc1_p20200328-r103.ebuild | 90 +++++++ |
23 |
3 files changed, 473 insertions(+) |
24 |
|
25 |
diff --git a/dev-lua/luasocket/files/luasocket-3.0_rc1_p20200328_makefile.patch b/dev-lua/luasocket/files/luasocket-3.0_rc1_p20200328_makefile.patch |
26 |
new file mode 100644 |
27 |
index 00000000000..c6e25d7969f |
28 |
--- /dev/null |
29 |
+++ b/dev-lua/luasocket/files/luasocket-3.0_rc1_p20200328_makefile.patch |
30 |
@@ -0,0 +1,89 @@ |
31 |
+From 49f935a774661d5d0d9b1727c2eee12d11f3b692 Mon Sep 17 00:00:00 2001 |
32 |
+From: "Azamat H. Hackimov" <azamat.hackimov@×××××.com> |
33 |
+Date: Tue, 19 Oct 2021 01:13:28 +0300 |
34 |
+Subject: [PATCH 2/2] Fix CFLAGS and LDFLAGS options |
35 |
+ |
36 |
+Remove CFLAGS optimization overrides, add -Wl,-soname option to LDFLAGS |
37 |
+for external linking. |
38 |
+--- |
39 |
+ src/makefile | 21 +++++++++------------ |
40 |
+ 1 file changed, 9 insertions(+), 12 deletions(-) |
41 |
+ |
42 |
+diff --git a/src/makefile b/src/makefile |
43 |
+index 522d378..cf4a571 100755 |
44 |
+--- a/src/makefile |
45 |
++++ b/src/makefile |
46 |
+@@ -162,7 +162,7 @@ SO_macosx=so |
47 |
+ O_macosx=o |
48 |
+ CC_macosx=gcc |
49 |
+ DEF_macosx= -DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN |
50 |
+-CFLAGS_macosx=$(LUAINC:%=-I%) $(DEF) -Wall -O2 -fno-common |
51 |
++CFLAGS_macosx=$(LUAINC:%=-I%) $(DEF) -Wall -fno-common |
52 |
+ LDFLAGS_macosx= -bundle -undefined dynamic_lookup -o |
53 |
+ LD_macosx=gcc |
54 |
+ SOCKET_macosx=usocket.o |
55 |
+@@ -174,8 +174,7 @@ SO_linux=so |
56 |
+ O_linux=o |
57 |
+ CC_linux=gcc |
58 |
+ DEF_linux=-DLUASOCKET_$(DEBUG) |
59 |
+-CFLAGS_linux=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \ |
60 |
+- -Wimplicit -O2 -ggdb3 -fpic |
61 |
++CFLAGS_linux=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra -Wimplicit -fpic |
62 |
+ LDFLAGS_linux=-O -shared -fpic -o |
63 |
+ LD_linux=gcc |
64 |
+ SOCKET_linux=usocket.o |
65 |
+@@ -187,8 +186,7 @@ SO_freebsd=so |
66 |
+ O_freebsd=o |
67 |
+ CC_freebsd=gcc |
68 |
+ DEF_freebsd=-DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN |
69 |
+-CFLAGS_freebsd=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \ |
70 |
+- -Wimplicit -O2 -ggdb3 -fpic |
71 |
++CFLAGS_freebsd=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra -Wimplicit -fpic |
72 |
+ LDFLAGS_freebsd=-O -shared -fpic -o |
73 |
+ LD_freebsd=gcc |
74 |
+ SOCKET_freebsd=usocket.o |
75 |
+@@ -200,8 +198,7 @@ SO_solaris=so |
76 |
+ O_solaris=o |
77 |
+ CC_solaris=gcc |
78 |
+ DEF_solaris=-DLUASOCKET_$(DEBUG) |
79 |
+-CFLAGS_solaris=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \ |
80 |
+- -Wimplicit -O2 -ggdb3 -fpic |
81 |
++CFLAGS_solaris=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra -Wimplicit -fpic |
82 |
+ LDFLAGS_solaris=-lnsl -lsocket -lresolv -O -shared -fpic -o |
83 |
+ LD_solaris=gcc |
84 |
+ SOCKET_solaris=usocket.o |
85 |
+@@ -214,7 +211,7 @@ O_mingw=o |
86 |
+ CC_mingw=gcc |
87 |
+ DEF_mingw= -DLUASOCKET_$(DEBUG) \ |
88 |
+ -DWINVER=0x0501 |
89 |
+-CFLAGS_mingw=$(LUAINC:%=-I%) $(DEF) -Wall -O2 -fno-common |
90 |
++CFLAGS_mingw=$(LUAINC:%=-I%) $(DEF) -Wall -fno-common |
91 |
+ LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o |
92 |
+ LD_mingw=gcc |
93 |
+ SOCKET_mingw=wsocket.o |
94 |
+@@ -396,18 +393,18 @@ none: |
95 |
+ all: $(SOCKET_SO) $(MIME_SO) |
96 |
+ |
97 |
+ $(SOCKET_SO): $(SOCKET_OBJS) |
98 |
+- $(LD) $(SOCKET_OBJS) $(LDFLAGS)$@ |
99 |
++ $(LD) $(SOCKET_OBJS) -Wl,-soname,socket/core.so $(LDFLAGS)$@ |
100 |
+ |
101 |
+ $(MIME_SO): $(MIME_OBJS) |
102 |
+- $(LD) $(MIME_OBJS) $(LDFLAGS)$@ |
103 |
++ $(LD) $(MIME_OBJS) -Wl,-soname,mime/core.so $(LDFLAGS)$@ |
104 |
+ |
105 |
+ all-unix: all $(UNIX_SO) $(SERIAL_SO) |
106 |
+ |
107 |
+ $(UNIX_SO): $(UNIX_OBJS) |
108 |
+- $(LD) $(UNIX_OBJS) $(LDFLAGS)$@ |
109 |
++ $(LD) $(UNIX_OBJS) -Wl,-soname,socket/unix.so $(LDFLAGS)$@ |
110 |
+ |
111 |
+ $(SERIAL_SO): $(SERIAL_OBJS) |
112 |
+- $(LD) $(SERIAL_OBJS) $(LDFLAGS)$@ |
113 |
++ $(LD) $(SERIAL_OBJS) -Wl,-soname,socket/serial.so $(LDFLAGS)$@ |
114 |
+ |
115 |
+ install: |
116 |
+ $(INSTALL_DIR) $(INSTALL_TOP_LDIR) |
117 |
+-- |
118 |
+2.32.0 |
119 |
+ |
120 |
|
121 |
diff --git a/dev-lua/luasocket/files/luasocket-3.0_rc1_p20200328_publish_API.patch b/dev-lua/luasocket/files/luasocket-3.0_rc1_p20200328_publish_API.patch |
122 |
new file mode 100644 |
123 |
index 00000000000..874f0eb26a7 |
124 |
--- /dev/null |
125 |
+++ b/dev-lua/luasocket/files/luasocket-3.0_rc1_p20200328_publish_API.patch |
126 |
@@ -0,0 +1,294 @@ |
127 |
+From 88cefd1ff8e70c10661c81b96baf5da1fc49feef Mon Sep 17 00:00:00 2001 |
128 |
+From: Jonas Wielicki <j.wielicki@×××××××××.net> |
129 |
+Date: Wed, 31 Jul 2013 14:25:23 +0200 |
130 |
+Subject: [PATCH 1/2] Make the API more accessible by publishing constants |
131 |
+ |
132 |
+--- |
133 |
+ src/buffer.h | 15 ++++++++------- |
134 |
+ src/common.h | 16 ++++++++++++++++ |
135 |
+ src/io.h | 7 ++++--- |
136 |
+ src/socket.h | 51 ++++++++++++++++++++++++++------------------------- |
137 |
+ src/timeout.h | 19 ++++++++++--------- |
138 |
+ src/usocket.c | 6 ------ |
139 |
+ src/usocket.h | 16 ++++++++++++++++ |
140 |
+ src/wsocket.c | 4 ---- |
141 |
+ src/wsocket.h | 5 +++++ |
142 |
+ 9 files changed, 85 insertions(+), 54 deletions(-) |
143 |
+ create mode 100644 src/common.h |
144 |
+ |
145 |
+diff --git a/src/buffer.h b/src/buffer.h |
146 |
+index a0901fc..66acf09 100644 |
147 |
+--- a/src/buffer.h |
148 |
++++ b/src/buffer.h |
149 |
+@@ -18,6 +18,7 @@ |
150 |
+ #include "luasocket.h" |
151 |
+ #include "io.h" |
152 |
+ #include "timeout.h" |
153 |
++#include "common.h" |
154 |
+ |
155 |
+ /* buffer size in bytes */ |
156 |
+ #define BUF_SIZE 8192 |
157 |
+@@ -37,13 +38,13 @@ typedef t_buffer *p_buffer; |
158 |
+ #pragma GCC visibility push(hidden) |
159 |
+ #endif |
160 |
+ |
161 |
+-int buffer_open(lua_State *L); |
162 |
+-void buffer_init(p_buffer buf, p_io io, p_timeout tm); |
163 |
+-int buffer_meth_getstats(lua_State *L, p_buffer buf); |
164 |
+-int buffer_meth_setstats(lua_State *L, p_buffer buf); |
165 |
+-int buffer_meth_send(lua_State *L, p_buffer buf); |
166 |
+-int buffer_meth_receive(lua_State *L, p_buffer buf); |
167 |
+-int buffer_isempty(p_buffer buf); |
168 |
++LUASOCKET_API int buffer_open(lua_State *L); |
169 |
++LUASOCKET_API void buffer_init(p_buffer buf, p_io io, p_timeout tm); |
170 |
++LUASOCKET_API int buffer_meth_getstats(lua_State *L, p_buffer buf); |
171 |
++LUASOCKET_API int buffer_meth_setstats(lua_State *L, p_buffer buf); |
172 |
++LUASOCKET_API int buffer_meth_send(lua_State *L, p_buffer buf); |
173 |
++LUASOCKET_API int buffer_meth_receive(lua_State *L, p_buffer buf); |
174 |
++LUASOCKET_API int buffer_isempty(p_buffer buf); |
175 |
+ |
176 |
+ #ifndef _WIN32 |
177 |
+ #pragma GCC visibility pop |
178 |
+diff --git a/src/common.h b/src/common.h |
179 |
+new file mode 100644 |
180 |
+index 0000000..9bb0666 |
181 |
+--- /dev/null |
182 |
++++ b/src/common.h |
183 |
+@@ -0,0 +1,16 @@ |
184 |
++#ifndef LUASOCKET_COMMON_H |
185 |
++#define LUASOCKET_COMMON_H |
186 |
++ |
187 |
++#ifndef LUASOCKET_API |
188 |
++#define LUASOCKET_API extern |
189 |
++#endif |
190 |
++ |
191 |
++#ifndef UNIX_API |
192 |
++#define UNIX_API extern |
193 |
++#endif |
194 |
++ |
195 |
++#ifndef MIME_API |
196 |
++#define MIME_API extern |
197 |
++#endif |
198 |
++ |
199 |
++#endif |
200 |
+diff --git a/src/io.h b/src/io.h |
201 |
+index b8a54df..6e399fb 100644 |
202 |
+--- a/src/io.h |
203 |
++++ b/src/io.h |
204 |
+@@ -14,13 +14,14 @@ |
205 |
+ \*=========================================================================*/ |
206 |
+ #include "luasocket.h" |
207 |
+ #include "timeout.h" |
208 |
++#include "common.h" |
209 |
+ |
210 |
+ /* IO error codes */ |
211 |
+ enum { |
212 |
+ IO_DONE = 0, /* operation completed successfully */ |
213 |
+ IO_TIMEOUT = -1, /* operation timed out */ |
214 |
+ IO_CLOSED = -2, /* the connection has been closed */ |
215 |
+- IO_UNKNOWN = -3 |
216 |
++ IO_UNKNOWN = -3 |
217 |
+ }; |
218 |
+ |
219 |
+ /* interface to error message function */ |
220 |
+@@ -60,8 +61,8 @@ typedef t_io *p_io; |
221 |
+ #pragma GCC visibility push(hidden) |
222 |
+ #endif |
223 |
+ |
224 |
+-void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx); |
225 |
+-const char *io_strerror(int err); |
226 |
++LUASOCKET_API void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx); |
227 |
++LUASOCKET_API const char *io_strerror(int err); |
228 |
+ |
229 |
+ #ifndef _WIN32 |
230 |
+ #pragma GCC visibility pop |
231 |
+diff --git a/src/socket.h b/src/socket.h |
232 |
+index e541f27..e0b6432 100644 |
233 |
+--- a/src/socket.h |
234 |
++++ b/src/socket.h |
235 |
+@@ -10,6 +10,7 @@ |
236 |
+ * creates a interface compatible with the io.h module. |
237 |
+ \*=========================================================================*/ |
238 |
+ #include "io.h" |
239 |
++#include "common.h" |
240 |
+ |
241 |
+ /*=========================================================================*\ |
242 |
+ * Platform specific compatibilization |
243 |
+@@ -40,31 +41,31 @@ typedef struct sockaddr SA; |
244 |
+ #pragma GCC visibility push(hidden) |
245 |
+ #endif |
246 |
+ |
247 |
+-int socket_waitfd(p_socket ps, int sw, p_timeout tm); |
248 |
+-int socket_open(void); |
249 |
+-int socket_close(void); |
250 |
+-void socket_destroy(p_socket ps); |
251 |
+-int socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds, p_timeout tm); |
252 |
+-int socket_create(p_socket ps, int domain, int type, int protocol); |
253 |
+-int socket_bind(p_socket ps, SA *addr, socklen_t addr_len); |
254 |
+-int socket_listen(p_socket ps, int backlog); |
255 |
+-void socket_shutdown(p_socket ps, int how); |
256 |
+-int socket_connect(p_socket ps, SA *addr, socklen_t addr_len, p_timeout tm); |
257 |
+-int socket_accept(p_socket ps, p_socket pa, SA *addr, socklen_t *addr_len, p_timeout tm); |
258 |
+-int socket_send(p_socket ps, const char *data, size_t count, size_t *sent, p_timeout tm); |
259 |
+-int socket_sendto(p_socket ps, const char *data, size_t count, size_t *sent, SA *addr, socklen_t addr_len, p_timeout tm); |
260 |
+-int socket_recv(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm); |
261 |
+-int socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got, SA *addr, socklen_t *addr_len, p_timeout tm); |
262 |
+-int socket_write(p_socket ps, const char *data, size_t count, size_t *sent, p_timeout tm); |
263 |
+-int socket_read(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm); |
264 |
+-void socket_setblocking(p_socket ps); |
265 |
+-void socket_setnonblocking(p_socket ps); |
266 |
+-int socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp); |
267 |
+-int socket_gethostbyname(const char *addr, struct hostent **hp); |
268 |
+-const char *socket_hoststrerror(int err); |
269 |
+-const char *socket_strerror(int err); |
270 |
+-const char *socket_ioerror(p_socket ps, int err); |
271 |
+-const char *socket_gaistrerror(int err); |
272 |
++LUASOCKET_API int socket_waitfd(p_socket ps, int sw, p_timeout tm); |
273 |
++LUASOCKET_API int socket_open(void); |
274 |
++LUASOCKET_API int socket_close(void); |
275 |
++LUASOCKET_API void socket_destroy(p_socket ps); |
276 |
++LUASOCKET_API int socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds, p_timeout tm); |
277 |
++LUASOCKET_API int socket_create(p_socket ps, int domain, int type, int protocol); |
278 |
++LUASOCKET_API int socket_bind(p_socket ps, SA *addr, socklen_t addr_len); |
279 |
++LUASOCKET_API int socket_listen(p_socket ps, int backlog); |
280 |
++LUASOCKET_API void socket_shutdown(p_socket ps, int how); |
281 |
++LUASOCKET_API int socket_connect(p_socket ps, SA *addr, socklen_t addr_len, p_timeout tm); |
282 |
++LUASOCKET_API int socket_accept(p_socket ps, p_socket pa, SA *addr, socklen_t *addr_len, p_timeout tm); |
283 |
++LUASOCKET_API int socket_send(p_socket ps, const char *data, size_t count, size_t *sent, p_timeout tm); |
284 |
++LUASOCKET_API int socket_sendto(p_socket ps, const char *data, size_t count, size_t *sent, SA *addr, socklen_t addr_len, p_timeout tm); |
285 |
++LUASOCKET_API int socket_recv(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm); |
286 |
++LUASOCKET_API int socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got, SA *addr, socklen_t *addr_len, p_timeout tm); |
287 |
++LUASOCKET_API int socket_write(p_socket ps, const char *data, size_t count, size_t *sent, p_timeout tm); |
288 |
++LUASOCKET_API int socket_read(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm); |
289 |
++LUASOCKET_API void socket_setblocking(p_socket ps); |
290 |
++LUASOCKET_API void socket_setnonblocking(p_socket ps); |
291 |
++LUASOCKET_API int socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp); |
292 |
++LUASOCKET_API int socket_gethostbyname(const char *addr, struct hostent **hp); |
293 |
++LUASOCKET_API const char *socket_hoststrerror(int err); |
294 |
++LUASOCKET_API const char *socket_strerror(int err); |
295 |
++LUASOCKET_API const char *socket_ioerror(p_socket ps, int err); |
296 |
++LUASOCKET_API const char *socket_gaistrerror(int err); |
297 |
+ |
298 |
+ #ifndef _WIN32 |
299 |
+ #pragma GCC visibility pop |
300 |
+diff --git a/src/timeout.h b/src/timeout.h |
301 |
+index 9e5250d..b36bd58 100644 |
302 |
+--- a/src/timeout.h |
303 |
++++ b/src/timeout.h |
304 |
+@@ -5,6 +5,7 @@ |
305 |
+ * LuaSocket toolkit |
306 |
+ \*=========================================================================*/ |
307 |
+ #include "luasocket.h" |
308 |
++#include "common.h" |
309 |
+ |
310 |
+ /* timeout control structure */ |
311 |
+ typedef struct t_timeout_ { |
312 |
+@@ -18,18 +19,18 @@ typedef t_timeout *p_timeout; |
313 |
+ #pragma GCC visibility push(hidden) |
314 |
+ #endif |
315 |
+ |
316 |
+-void timeout_init(p_timeout tm, double block, double total); |
317 |
+-double timeout_get(p_timeout tm); |
318 |
+-double timeout_getstart(p_timeout tm); |
319 |
+-double timeout_getretry(p_timeout tm); |
320 |
+-p_timeout timeout_markstart(p_timeout tm); |
321 |
++LUASOCKET_API void timeout_init(p_timeout tm, double block, double total); |
322 |
++LUASOCKET_API double timeout_get(p_timeout tm); |
323 |
++LUASOCKET_API double timeout_getstart(p_timeout tm); |
324 |
++LUASOCKET_API double timeout_getretry(p_timeout tm); |
325 |
++LUASOCKET_API p_timeout timeout_markstart(p_timeout tm); |
326 |
+ |
327 |
+-double timeout_gettime(void); |
328 |
++LUASOCKET_API double timeout_gettime(void); |
329 |
+ |
330 |
+-int timeout_open(lua_State *L); |
331 |
++LUASOCKET_API int timeout_open(lua_State *L); |
332 |
+ |
333 |
+-int timeout_meth_settimeout(lua_State *L, p_timeout tm); |
334 |
+-int timeout_meth_gettimeout(lua_State *L, p_timeout tm); |
335 |
++LUASOCKET_API int timeout_meth_settimeout(lua_State *L, p_timeout tm); |
336 |
++LUASOCKET_API int timeout_meth_gettimeout(lua_State *L, p_timeout tm); |
337 |
+ |
338 |
+ #ifndef _WIN32 |
339 |
+ #pragma GCC visibility pop |
340 |
+diff --git a/src/usocket.c b/src/usocket.c |
341 |
+index acfe186..7490df5 100644 |
342 |
+--- a/src/usocket.c |
343 |
++++ b/src/usocket.c |
344 |
+@@ -20,9 +20,6 @@ |
345 |
+ #ifndef SOCKET_SELECT |
346 |
+ #include <sys/poll.h> |
347 |
+ |
348 |
+-#define WAITFD_R POLLIN |
349 |
+-#define WAITFD_W POLLOUT |
350 |
+-#define WAITFD_C (POLLIN|POLLOUT) |
351 |
+ int socket_waitfd(p_socket ps, int sw, p_timeout tm) { |
352 |
+ int ret; |
353 |
+ struct pollfd pfd; |
354 |
+@@ -41,9 +38,6 @@ int socket_waitfd(p_socket ps, int sw, p_timeout tm) { |
355 |
+ } |
356 |
+ #else |
357 |
+ |
358 |
+-#define WAITFD_R 1 |
359 |
+-#define WAITFD_W 2 |
360 |
+-#define WAITFD_C (WAITFD_R|WAITFD_W) |
361 |
+ |
362 |
+ int socket_waitfd(p_socket ps, int sw, p_timeout tm) { |
363 |
+ int ret; |
364 |
+diff --git a/src/usocket.h b/src/usocket.h |
365 |
+index 45f2f99..ca67c95 100644 |
366 |
+--- a/src/usocket.h |
367 |
++++ b/src/usocket.h |
368 |
+@@ -56,4 +56,20 @@ typedef struct sockaddr_storage t_sockaddr_storage; |
369 |
+ |
370 |
+ #define SOCKET_INVALID (-1) |
371 |
+ |
372 |
++#ifndef SOCKET_SELECT |
373 |
++#include <sys/poll.h> |
374 |
++ |
375 |
++#define WAITFD_R POLLIN |
376 |
++#define WAITFD_W POLLOUT |
377 |
++#define WAITFD_C (POLLIN|POLLOUT) |
378 |
++ |
379 |
++#else |
380 |
++ |
381 |
++#define WAITFD_R 1 |
382 |
++#define WAITFD_W 2 |
383 |
++#define WAITFD_C (WAITFD_R|WAITFD_W) |
384 |
++ |
385 |
++#endif |
386 |
++ |
387 |
++ |
388 |
+ #endif /* USOCKET_H */ |
389 |
+diff --git a/src/wsocket.c b/src/wsocket.c |
390 |
+index 20da330..6101dd6 100755 |
391 |
+--- a/src/wsocket.c |
392 |
++++ b/src/wsocket.c |
393 |
+@@ -42,10 +42,6 @@ int socket_close(void) { |
394 |
+ /*-------------------------------------------------------------------------*\ |
395 |
+ * Wait for readable/writable/connected socket with timeout |
396 |
+ \*-------------------------------------------------------------------------*/ |
397 |
+-#define WAITFD_R 1 |
398 |
+-#define WAITFD_W 2 |
399 |
+-#define WAITFD_E 4 |
400 |
+-#define WAITFD_C (WAITFD_E|WAITFD_W) |
401 |
+ |
402 |
+ int socket_waitfd(p_socket ps, int sw, p_timeout tm) { |
403 |
+ int ret; |
404 |
+diff --git a/src/wsocket.h b/src/wsocket.h |
405 |
+index 3986640..55ab0a9 100644 |
406 |
+--- a/src/wsocket.h |
407 |
++++ b/src/wsocket.h |
408 |
+@@ -30,4 +30,9 @@ typedef t_socket *p_socket; |
409 |
+ #define AI_NUMERICSERV (0) |
410 |
+ #endif |
411 |
+ |
412 |
++#define WAITFD_R 1 |
413 |
++#define WAITFD_W 2 |
414 |
++#define WAITFD_E 4 |
415 |
++#define WAITFD_C (WAITFD_E|WAITFD_W) |
416 |
++ |
417 |
+ #endif /* WSOCKET_H */ |
418 |
+-- |
419 |
+2.32.0 |
420 |
+ |
421 |
|
422 |
diff --git a/dev-lua/luasocket/luasocket-3.0_rc1_p20200328-r103.ebuild b/dev-lua/luasocket/luasocket-3.0_rc1_p20200328-r103.ebuild |
423 |
new file mode 100644 |
424 |
index 00000000000..6011ad7d597 |
425 |
--- /dev/null |
426 |
+++ b/dev-lua/luasocket/luasocket-3.0_rc1_p20200328-r103.ebuild |
427 |
@@ -0,0 +1,90 @@ |
428 |
+# Copyright 1999-2021 Gentoo Authors |
429 |
+# Distributed under the terms of the GNU General Public License v2 |
430 |
+ |
431 |
+EAPI=8 |
432 |
+ |
433 |
+EGIT_COMMIT="5b18e475f38fcf28429b1cc4b17baee3b9793a62" |
434 |
+LUA_COMPAT=( lua5-{1..4} luajit ) |
435 |
+MY_P="${PN}-${EGIT_COMMIT}" |
436 |
+ |
437 |
+inherit lua toolchain-funcs |
438 |
+ |
439 |
+DESCRIPTION="Networking support library for the Lua language" |
440 |
+HOMEPAGE=" |
441 |
+ http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/ |
442 |
+ https://github.com/diegonehab/luasocket |
443 |
+" |
444 |
+SRC_URI="https://github.com/diegonehab/${PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" |
445 |
+S="${WORKDIR}/${MY_P}" |
446 |
+ |
447 |
+LICENSE="MIT" |
448 |
+SLOT="0" |
449 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" |
450 |
+REQUIRED_USE="${LUA_REQUIRED_USE}" |
451 |
+RESTRICT="test" |
452 |
+ |
453 |
+RDEPEND="${LUA_DEPS}" |
454 |
+DEPEND="${RDEPEND}" |
455 |
+BDEPEND="virtual/pkgconfig" |
456 |
+ |
457 |
+HTML_DOCS="doc/." |
458 |
+ |
459 |
+PATCHES=( |
460 |
+ "${FILESDIR}/${P}_publish_API.patch" |
461 |
+ "${FILESDIR}/${P}_makefile.patch" |
462 |
+) |
463 |
+ |
464 |
+src_prepare() { |
465 |
+ default |
466 |
+ lua_copy_sources |
467 |
+} |
468 |
+ |
469 |
+lua_src_compile() { |
470 |
+ pushd "${BUILD_DIR}" || die |
471 |
+ |
472 |
+ local myemakeargs=( |
473 |
+ "CC=$(tc-getCC)" |
474 |
+ "LD=$(tc-getCC)" |
475 |
+ "LUAINC_linux=$(lua_get_include_dir)" |
476 |
+ "LUAV=${ELUA}" |
477 |
+ "MIME_V=1.0.3-${ELUA}" |
478 |
+ "MYCFLAGS=${CFLAGS}" |
479 |
+ "MYLDFLAGS=${LDFLAGS}" |
480 |
+ "SOCKET_V=3.0-rc1-${ELUA}" |
481 |
+ ) |
482 |
+ |
483 |
+ emake "${myemakeargs[@]}" all |
484 |
+ |
485 |
+ popd |
486 |
+} |
487 |
+ |
488 |
+src_compile() { |
489 |
+ lua_foreach_impl lua_src_compile |
490 |
+} |
491 |
+ |
492 |
+lua_src_install() { |
493 |
+ pushd "${BUILD_DIR}" || die |
494 |
+ |
495 |
+ local myemakeargs=( |
496 |
+ "CDIR=$(lua_get_cmod_dir)" |
497 |
+ "DESTDIR=${ED}" |
498 |
+ "LDIR=$(lua_get_lmod_dir)" |
499 |
+ "LUAPREFIX_linux=" |
500 |
+ "MIME_V=1.0.3-${ELUA}" |
501 |
+ "SOCKET_V=3.0-rc1-${ELUA}" |
502 |
+ ) |
503 |
+ |
504 |
+ emake "${myemakeargs[@]}" install |
505 |
+ emake "${myemakeargs[@]}" install-unix |
506 |
+ |
507 |
+ insinto "$(lua_get_include_dir)"/luasocket |
508 |
+ doins src/*.h |
509 |
+ |
510 |
+ popd |
511 |
+} |
512 |
+ |
513 |
+src_install() { |
514 |
+ lua_foreach_impl lua_src_install |
515 |
+ |
516 |
+ einstalldocs |
517 |
+} |