public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-lua/luasocket/files/, dev-lua/luasocket/
@ 2021-01-27 19:48 Conrad Kostecki
  0 siblings, 0 replies; 3+ messages in thread
From: Conrad Kostecki @ 2021-01-27 19:48 UTC (permalink / raw
  To: gentoo-commits

commit:     8e426ef2f798dccad5ae3140be21f3eb4cd6f56c
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 24 18:12:20 2021 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Wed Jan 27 19:40:26 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e426ef2

dev-lua/luasocket: drop old version

Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 dev-lua/luasocket/Manifest                         |  1 -
 dev-lua/luasocket/files/proxy-fix.patch            | 31 ----------
 dev-lua/luasocket/luasocket-3.0_rc1-r5.ebuild      | 58 -----------------
 .../luasocket-3.0_rc1_p20200328-r1.ebuild          | 72 ----------------------
 4 files changed, 162 deletions(-)

diff --git a/dev-lua/luasocket/Manifest b/dev-lua/luasocket/Manifest
index ee78a733186..8e11fe11f0a 100644
--- a/dev-lua/luasocket/Manifest
+++ b/dev-lua/luasocket/Manifest
@@ -1,2 +1 @@
-DIST luasocket-3.0_rc1.tar.gz 328598 BLAKE2B 9cc382d909cfa018edec237ac901220cccb0cf0e3a775b9cd8083487ace42a94dfd280f9423097f677f37ee9f85afcfff844250cd49c0f813b7c50c3adc532c5 SHA512 f6efce259aaacaa11472911471f8a13b118fe009b8953a82c6aa18b9ec829cd1293180904e56935cb130d36d267e3f27c91db2d78e03f7488f3e100571ed0540
 DIST luasocket-3.0_rc1_p20200328.tar.gz 335628 BLAKE2B 9e5d3e415337903b689705669b586c4481179a319b4e3428823c8f442d04f26db86bfeca66db7e58d157e31431c31e4f687403f7163b75f57d6f87cdb934717f SHA512 bdf7086a0504b0072b9cfd1266fc4ae89504053801722859a426f567fca00ed76f4c295c2a3a968e93f0036d9b792cf97561e9baa82c09ea23999cfd473227eb

diff --git a/dev-lua/luasocket/files/proxy-fix.patch b/dev-lua/luasocket/files/proxy-fix.patch
deleted file mode 100644
index 302e63663ff..00000000000
--- a/dev-lua/luasocket/files/proxy-fix.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 1f9ccb2b586c3a7e29db3c99a23ac1cee6907cf2 Mon Sep 17 00:00:00 2001
-From: Pierre Chapuis <catwell@archlinux.us>
-Date: Fri, 5 Jul 2013 18:00:29 +0200
-Subject: [PATCH] http: look for PROXY in _M, not as a global
-
----
- src/http.lua | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/http.lua b/src/http.lua
-index 5f70a374..f83dcc55 100644
---- a/src/http.lua
-+++ b/src/http.lua
-@@ -186,7 +186,7 @@ end
- local function adjusturi(reqt)
-     local u = reqt
-     -- if there is a proxy, we need the full url. otherwise, just a part.
--    if not reqt.proxy and not PROXY then
-+    if not reqt.proxy and not _M.PROXY then
-         u = {
-            path = socket.try(reqt.path, "invalid path 'nil'"),
-            params = reqt.params,
-@@ -198,7 +198,7 @@ local function adjusturi(reqt)
- end
- 
- local function adjustproxy(reqt)
--    local proxy = reqt.proxy or PROXY
-+    local proxy = reqt.proxy or _M.PROXY
-     if proxy then
-         proxy = url.parse(proxy)
-         return proxy.host, proxy.port or 3128

diff --git a/dev-lua/luasocket/luasocket-3.0_rc1-r5.ebuild b/dev-lua/luasocket/luasocket-3.0_rc1-r5.ebuild
deleted file mode 100644
index 8a12093b847..00000000000
--- a/dev-lua/luasocket/luasocket-3.0_rc1-r5.ebuild
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit multilib multilib-minimal flag-o-matic toolchain-funcs
-
-DESCRIPTION="Networking support library for the Lua language"
-HOMEPAGE="http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/
-	https://github.com/diegonehab/luasocket"
-SRC_URI="https://github.com/diegonehab/${PN}/archive/v${PV/_/-}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ~hppa ~mips ppc ppc64 sparc x86"
-IUSE="debug"
-
-RDEPEND=">=dev-lang/lua-5.1.5-r2:0[${MULTILIB_USEDEP}]"
-DEPEND="${RDEPEND}"
-BDEPEND="virtual/pkgconfig"
-
-S=${WORKDIR}/${PN}-${PV/_/-}
-
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/proxy-fix.patch
-)
-
-src_prepare() {
-	default
-	multilib_copy_sources
-}
-
-multilib_src_compile() {
-	emake \
-		CC="$(tc-getCC) ${CFLAGS}" \
-		LD="$(tc-getCC) ${LDFLAGS}"\
-		$(usex debug DEBUG="DEBUG" "")
-}
-
-multilib_src_install() {
-	local luav=$($(tc-getPKG_CONFIG) --variable V lua)
-	emake \
-		DESTDIR="${D}" \
-		LUAPREFIX_linux="${EPREFIX}/usr" \
-		LUAV=${luav} \
-		CDIR_linux=$(get_libdir)/lua/${luav} \
-		install-unix
-	insinto /usr/include/lua${luav}/luasocket
-	doins src/*.h
-}
-
-multilib_src_install_all() {
-	dodoc NEW README
-	docinto html
-	dodoc -r doc/.
-}

diff --git a/dev-lua/luasocket/luasocket-3.0_rc1_p20200328-r1.ebuild b/dev-lua/luasocket/luasocket-3.0_rc1_p20200328-r1.ebuild
deleted file mode 100644
index b05a982025b..00000000000
--- a/dev-lua/luasocket/luasocket-3.0_rc1_p20200328-r1.ebuild
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-EGIT_COMMIT="5b18e475f38fcf28429b1cc4b17baee3b9793a62"
-
-inherit flag-o-matic toolchain-funcs
-
-DESCRIPTION="Networking support library for the Lua language"
-HOMEPAGE="
-	http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/
-	https://github.com/diegonehab/luasocket
-"
-SRC_URI="https://github.com/diegonehab/${PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
-S="${WORKDIR}/${PN}-${EGIT_COMMIT}"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
-IUSE="luajit"
-RESTRICT="test"
-
-RDEPEND="
-	luajit? ( dev-lang/luajit:2 )
-	!luajit? ( dev-lang/lua:0 )
-"
-DEPEND="${RDEPEND}"
-BDEPEND="virtual/pkgconfig"
-
-HTML_DOCS="doc/."
-
-src_prepare() {
-	default
-
-	# Respect users CFLAGS
-	sed -e 's/-O2 -ggdb3//g' -i src/makefile || die
-
-	# Workaround for 32-bit systems
-	append-cflags -fno-stack-protector
-}
-
-src_compile() {
-	local myemakeargs=(
-		"CC=$(tc-getCC)"
-		"LD=$(tc-getCC)"
-		"LDFLAGS_linux=-O -fpic -shared -o"
-		"LUAINC_linux=$($(tc-getPKG_CONFIG) --variable includedir $(usex luajit 'luajit' 'lua'))"
-		"LUAV=5.1"
-		"MYCFLAGS=${CFLAGS}"
-		"MYLDFLAGS=${LDFLAGS}"
-	)
-
-	emake "${myemakeargs[@]}" all
-}
-
-src_install() {
-	local myemakeargs=(
-		"CDIR=$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD $(usex luajit 'luajit' 'lua'))"
-		"DESTDIR=${ED}"
-		"LDIR=$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD $(usex luajit 'luajit' 'lua'))"
-		"LUAPREFIX_linux="
-	)
-
-	emake "${myemakeargs[@]}" install
-	emake "${myemakeargs[@]}" install-unix
-
-	insinto "$($(tc-getPKG_CONFIG) --variable includedir $(usex luajit 'luajit' 'lua'))/luasocket"
-	doins src/*.h
-
-	einstalldocs
-}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lua/luasocket/files/, dev-lua/luasocket/
@ 2021-10-19 19:56 Conrad Kostecki
  0 siblings, 0 replies; 3+ messages in thread
From: Conrad Kostecki @ 2021-10-19 19:56 UTC (permalink / raw
  To: gentoo-commits

commit:     634e9eb09ef7db117ac05ad24926a6078eb07170
Author:     Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
AuthorDate: Mon Oct 18 22:29:34 2021 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Tue Oct 19 19:55:44 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=634e9eb0

dev-lua/luasocket: publish API and sonames

Add patches to publish API and sonames for external linking (see #730352 for
rationale).
Patches available at https://github.com/winterheart/luasocket/tree/public-api

Closes: https://github.com/gentoo/gentoo/pull/22631
Bug: https://bugs.gentoo.org/730352
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com>
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 .../luasocket-3.0_rc1_p20200328_makefile.patch     |  89 +++++++
 .../luasocket-3.0_rc1_p20200328_publish_API.patch  | 294 +++++++++++++++++++++
 .../luasocket-3.0_rc1_p20200328-r103.ebuild        |  90 +++++++
 3 files changed, 473 insertions(+)

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
new file mode 100644
index 00000000000..c6e25d7969f
--- /dev/null
+++ b/dev-lua/luasocket/files/luasocket-3.0_rc1_p20200328_makefile.patch
@@ -0,0 +1,89 @@
+From 49f935a774661d5d0d9b1727c2eee12d11f3b692 Mon Sep 17 00:00:00 2001
+From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com>
+Date: Tue, 19 Oct 2021 01:13:28 +0300
+Subject: [PATCH 2/2] Fix CFLAGS and LDFLAGS options
+
+Remove CFLAGS optimization overrides, add -Wl,-soname option to LDFLAGS
+for external linking.
+---
+ src/makefile | 21 +++++++++------------
+ 1 file changed, 9 insertions(+), 12 deletions(-)
+
+diff --git a/src/makefile b/src/makefile
+index 522d378..cf4a571 100755
+--- a/src/makefile
++++ b/src/makefile
+@@ -162,7 +162,7 @@ SO_macosx=so
+ O_macosx=o
+ CC_macosx=gcc
+ DEF_macosx= -DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN
+-CFLAGS_macosx=$(LUAINC:%=-I%) $(DEF) -Wall -O2 -fno-common
++CFLAGS_macosx=$(LUAINC:%=-I%) $(DEF) -Wall -fno-common
+ LDFLAGS_macosx= -bundle -undefined dynamic_lookup -o 
+ LD_macosx=gcc
+ SOCKET_macosx=usocket.o
+@@ -174,8 +174,7 @@ SO_linux=so
+ O_linux=o
+ CC_linux=gcc
+ DEF_linux=-DLUASOCKET_$(DEBUG)
+-CFLAGS_linux=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \
+-	-Wimplicit -O2 -ggdb3 -fpic
++CFLAGS_linux=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra -Wimplicit -fpic
+ LDFLAGS_linux=-O -shared -fpic -o 
+ LD_linux=gcc
+ SOCKET_linux=usocket.o
+@@ -187,8 +186,7 @@ SO_freebsd=so
+ O_freebsd=o
+ CC_freebsd=gcc
+ DEF_freebsd=-DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN
+-CFLAGS_freebsd=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \
+-	-Wimplicit -O2 -ggdb3 -fpic
++CFLAGS_freebsd=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra -Wimplicit -fpic
+ LDFLAGS_freebsd=-O -shared -fpic -o 
+ LD_freebsd=gcc
+ SOCKET_freebsd=usocket.o
+@@ -200,8 +198,7 @@ SO_solaris=so
+ O_solaris=o
+ CC_solaris=gcc
+ DEF_solaris=-DLUASOCKET_$(DEBUG)
+-CFLAGS_solaris=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \
+-	-Wimplicit -O2 -ggdb3 -fpic
++CFLAGS_solaris=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra -Wimplicit -fpic
+ LDFLAGS_solaris=-lnsl -lsocket -lresolv -O -shared -fpic -o 
+ LD_solaris=gcc
+ SOCKET_solaris=usocket.o
+@@ -214,7 +211,7 @@ O_mingw=o
+ CC_mingw=gcc
+ DEF_mingw= -DLUASOCKET_$(DEBUG) \
+ 	-DWINVER=0x0501
+-CFLAGS_mingw=$(LUAINC:%=-I%) $(DEF) -Wall -O2 -fno-common
++CFLAGS_mingw=$(LUAINC:%=-I%) $(DEF) -Wall -fno-common
+ LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o 
+ LD_mingw=gcc
+ SOCKET_mingw=wsocket.o
+@@ -396,18 +393,18 @@ none:
+ all: $(SOCKET_SO) $(MIME_SO)
+ 
+ $(SOCKET_SO): $(SOCKET_OBJS)
+-	$(LD) $(SOCKET_OBJS) $(LDFLAGS)$@
++	$(LD) $(SOCKET_OBJS) -Wl,-soname,socket/core.so $(LDFLAGS)$@
+ 
+ $(MIME_SO): $(MIME_OBJS)
+-	$(LD) $(MIME_OBJS) $(LDFLAGS)$@
++	$(LD) $(MIME_OBJS) -Wl,-soname,mime/core.so $(LDFLAGS)$@
+ 
+ all-unix: all $(UNIX_SO) $(SERIAL_SO)
+ 
+ $(UNIX_SO): $(UNIX_OBJS)
+-	$(LD) $(UNIX_OBJS) $(LDFLAGS)$@
++	$(LD) $(UNIX_OBJS) -Wl,-soname,socket/unix.so $(LDFLAGS)$@
+ 
+ $(SERIAL_SO): $(SERIAL_OBJS)
+-	$(LD) $(SERIAL_OBJS) $(LDFLAGS)$@
++	$(LD) $(SERIAL_OBJS) -Wl,-soname,socket/serial.so $(LDFLAGS)$@
+ 
+ install:
+ 	$(INSTALL_DIR) $(INSTALL_TOP_LDIR)
+-- 
+2.32.0
+

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
new file mode 100644
index 00000000000..874f0eb26a7
--- /dev/null
+++ b/dev-lua/luasocket/files/luasocket-3.0_rc1_p20200328_publish_API.patch
@@ -0,0 +1,294 @@
+From 88cefd1ff8e70c10661c81b96baf5da1fc49feef Mon Sep 17 00:00:00 2001
+From: Jonas Wielicki <j.wielicki@sotecware.net>
+Date: Wed, 31 Jul 2013 14:25:23 +0200
+Subject: [PATCH 1/2] Make the API more accessible by publishing constants
+
+---
+ src/buffer.h  | 15 ++++++++-------
+ src/common.h  | 16 ++++++++++++++++
+ src/io.h      |  7 ++++---
+ src/socket.h  | 51 ++++++++++++++++++++++++++-------------------------
+ src/timeout.h | 19 ++++++++++---------
+ src/usocket.c |  6 ------
+ src/usocket.h | 16 ++++++++++++++++
+ src/wsocket.c |  4 ----
+ src/wsocket.h |  5 +++++
+ 9 files changed, 85 insertions(+), 54 deletions(-)
+ create mode 100644 src/common.h
+
+diff --git a/src/buffer.h b/src/buffer.h
+index a0901fc..66acf09 100644
+--- a/src/buffer.h
++++ b/src/buffer.h
+@@ -18,6 +18,7 @@
+ #include "luasocket.h"
+ #include "io.h"
+ #include "timeout.h"
++#include "common.h"
+ 
+ /* buffer size in bytes */
+ #define BUF_SIZE 8192
+@@ -37,13 +38,13 @@ typedef t_buffer *p_buffer;
+ #pragma GCC visibility push(hidden)
+ #endif
+ 
+-int buffer_open(lua_State *L);
+-void buffer_init(p_buffer buf, p_io io, p_timeout tm);
+-int buffer_meth_getstats(lua_State *L, p_buffer buf);
+-int buffer_meth_setstats(lua_State *L, p_buffer buf);
+-int buffer_meth_send(lua_State *L, p_buffer buf);
+-int buffer_meth_receive(lua_State *L, p_buffer buf);
+-int buffer_isempty(p_buffer buf);
++LUASOCKET_API int buffer_open(lua_State *L);
++LUASOCKET_API void buffer_init(p_buffer buf, p_io io, p_timeout tm);
++LUASOCKET_API int buffer_meth_getstats(lua_State *L, p_buffer buf);
++LUASOCKET_API int buffer_meth_setstats(lua_State *L, p_buffer buf);
++LUASOCKET_API int buffer_meth_send(lua_State *L, p_buffer buf);
++LUASOCKET_API int buffer_meth_receive(lua_State *L, p_buffer buf);
++LUASOCKET_API int buffer_isempty(p_buffer buf);
+ 
+ #ifndef _WIN32
+ #pragma GCC visibility pop
+diff --git a/src/common.h b/src/common.h
+new file mode 100644
+index 0000000..9bb0666
+--- /dev/null
++++ b/src/common.h
+@@ -0,0 +1,16 @@
++#ifndef LUASOCKET_COMMON_H
++#define LUASOCKET_COMMON_H
++
++#ifndef LUASOCKET_API
++#define LUASOCKET_API extern
++#endif
++
++#ifndef UNIX_API
++#define UNIX_API extern
++#endif
++
++#ifndef MIME_API
++#define MIME_API extern
++#endif
++
++#endif
+diff --git a/src/io.h b/src/io.h
+index b8a54df..6e399fb 100644
+--- a/src/io.h
++++ b/src/io.h
+@@ -14,13 +14,14 @@
+ \*=========================================================================*/
+ #include "luasocket.h"
+ #include "timeout.h"
++#include "common.h"
+ 
+ /* IO error codes */
+ enum {
+     IO_DONE = 0,        /* operation completed successfully */
+     IO_TIMEOUT = -1,    /* operation timed out */
+     IO_CLOSED = -2,     /* the connection has been closed */
+-	IO_UNKNOWN = -3
++    IO_UNKNOWN = -3
+ };
+ 
+ /* interface to error message function */
+@@ -60,8 +61,8 @@ typedef t_io *p_io;
+ #pragma GCC visibility push(hidden)
+ #endif
+ 
+-void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx);
+-const char *io_strerror(int err);
++LUASOCKET_API void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx);
++LUASOCKET_API const char *io_strerror(int err);
+ 
+ #ifndef _WIN32
+ #pragma GCC visibility pop
+diff --git a/src/socket.h b/src/socket.h
+index e541f27..e0b6432 100644
+--- a/src/socket.h
++++ b/src/socket.h
+@@ -10,6 +10,7 @@
+ * creates a interface compatible with the io.h module.
+ \*=========================================================================*/
+ #include "io.h"
++#include "common.h"
+ 
+ /*=========================================================================*\
+ * Platform specific compatibilization
+@@ -40,31 +41,31 @@ typedef struct sockaddr SA;
+ #pragma GCC visibility push(hidden)
+ #endif
+ 
+-int socket_waitfd(p_socket ps, int sw, p_timeout tm);
+-int socket_open(void);
+-int socket_close(void);
+-void socket_destroy(p_socket ps);
+-int socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds, p_timeout tm);
+-int socket_create(p_socket ps, int domain, int type, int protocol);
+-int socket_bind(p_socket ps, SA *addr, socklen_t addr_len); 
+-int socket_listen(p_socket ps, int backlog);
+-void socket_shutdown(p_socket ps, int how); 
+-int socket_connect(p_socket ps, SA *addr, socklen_t addr_len, p_timeout tm); 
+-int socket_accept(p_socket ps, p_socket pa, SA *addr, socklen_t *addr_len, p_timeout tm);
+-int socket_send(p_socket ps, const char *data, size_t count, size_t *sent, p_timeout tm);
+-int socket_sendto(p_socket ps, const char *data, size_t count, size_t *sent, SA *addr, socklen_t addr_len, p_timeout tm);
+-int socket_recv(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm);
+-int socket_recvfrom(p_socket ps, char *data, size_t count, size_t *got, SA *addr, socklen_t *addr_len, p_timeout tm);
+-int socket_write(p_socket ps, const char *data, size_t count, size_t *sent, p_timeout tm);
+-int socket_read(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm);
+-void socket_setblocking(p_socket ps);
+-void socket_setnonblocking(p_socket ps);
+-int socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp);
+-int socket_gethostbyname(const char *addr, struct hostent **hp);
+-const char *socket_hoststrerror(int err);
+-const char *socket_strerror(int err);
+-const char *socket_ioerror(p_socket ps, int err);
+-const char *socket_gaistrerror(int err);
++LUASOCKET_API int socket_waitfd(p_socket ps, int sw, p_timeout tm);
++LUASOCKET_API int socket_open(void);
++LUASOCKET_API int socket_close(void);
++LUASOCKET_API void socket_destroy(p_socket ps);
++LUASOCKET_API int socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds, p_timeout tm);
++LUASOCKET_API int socket_create(p_socket ps, int domain, int type, int protocol);
++LUASOCKET_API int socket_bind(p_socket ps, SA *addr, socklen_t addr_len);
++LUASOCKET_API int socket_listen(p_socket ps, int backlog);
++LUASOCKET_API void socket_shutdown(p_socket ps, int how);
++LUASOCKET_API int socket_connect(p_socket ps, SA *addr, socklen_t addr_len, p_timeout tm);
++LUASOCKET_API int socket_accept(p_socket ps, p_socket pa, SA *addr, socklen_t *addr_len, p_timeout tm);
++LUASOCKET_API int socket_send(p_socket ps, const char *data, size_t count, size_t *sent, p_timeout tm);
++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);
++LUASOCKET_API int socket_recv(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm);
++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);
++LUASOCKET_API int socket_write(p_socket ps, const char *data, size_t count, size_t *sent, p_timeout tm);
++LUASOCKET_API int socket_read(p_socket ps, char *data, size_t count, size_t *got, p_timeout tm);
++LUASOCKET_API void socket_setblocking(p_socket ps);
++LUASOCKET_API void socket_setnonblocking(p_socket ps);
++LUASOCKET_API int socket_gethostbyaddr(const char *addr, socklen_t len, struct hostent **hp);
++LUASOCKET_API int socket_gethostbyname(const char *addr, struct hostent **hp);
++LUASOCKET_API const char *socket_hoststrerror(int err);
++LUASOCKET_API const char *socket_strerror(int err);
++LUASOCKET_API const char *socket_ioerror(p_socket ps, int err);
++LUASOCKET_API const char *socket_gaistrerror(int err);
+ 
+ #ifndef _WIN32
+ #pragma GCC visibility pop
+diff --git a/src/timeout.h b/src/timeout.h
+index 9e5250d..b36bd58 100644
+--- a/src/timeout.h
++++ b/src/timeout.h
+@@ -5,6 +5,7 @@
+ * LuaSocket toolkit
+ \*=========================================================================*/
+ #include "luasocket.h"
++#include "common.h"
+ 
+ /* timeout control structure */
+ typedef struct t_timeout_ {
+@@ -18,18 +19,18 @@ typedef t_timeout *p_timeout;
+ #pragma GCC visibility push(hidden)
+ #endif
+ 
+-void timeout_init(p_timeout tm, double block, double total);
+-double timeout_get(p_timeout tm);
+-double timeout_getstart(p_timeout tm);
+-double timeout_getretry(p_timeout tm);
+-p_timeout timeout_markstart(p_timeout tm);
++LUASOCKET_API void timeout_init(p_timeout tm, double block, double total);
++LUASOCKET_API double timeout_get(p_timeout tm);
++LUASOCKET_API double timeout_getstart(p_timeout tm);
++LUASOCKET_API double timeout_getretry(p_timeout tm);
++LUASOCKET_API p_timeout timeout_markstart(p_timeout tm);
+ 
+-double timeout_gettime(void);
++LUASOCKET_API double timeout_gettime(void);
+ 
+-int timeout_open(lua_State *L);
++LUASOCKET_API int timeout_open(lua_State *L);
+ 
+-int timeout_meth_settimeout(lua_State *L, p_timeout tm);
+-int timeout_meth_gettimeout(lua_State *L, p_timeout tm);
++LUASOCKET_API int timeout_meth_settimeout(lua_State *L, p_timeout tm);
++LUASOCKET_API int timeout_meth_gettimeout(lua_State *L, p_timeout tm);
+ 
+ #ifndef _WIN32
+ #pragma GCC visibility pop
+diff --git a/src/usocket.c b/src/usocket.c
+index acfe186..7490df5 100644
+--- a/src/usocket.c
++++ b/src/usocket.c
+@@ -20,9 +20,6 @@
+ #ifndef SOCKET_SELECT
+ #include <sys/poll.h>
+ 
+-#define WAITFD_R        POLLIN
+-#define WAITFD_W        POLLOUT
+-#define WAITFD_C        (POLLIN|POLLOUT)
+ int socket_waitfd(p_socket ps, int sw, p_timeout tm) {
+     int ret;
+     struct pollfd pfd;
+@@ -41,9 +38,6 @@ int socket_waitfd(p_socket ps, int sw, p_timeout tm) {
+ }
+ #else
+ 
+-#define WAITFD_R        1
+-#define WAITFD_W        2
+-#define WAITFD_C        (WAITFD_R|WAITFD_W)
+ 
+ int socket_waitfd(p_socket ps, int sw, p_timeout tm) {
+     int ret;
+diff --git a/src/usocket.h b/src/usocket.h
+index 45f2f99..ca67c95 100644
+--- a/src/usocket.h
++++ b/src/usocket.h
+@@ -56,4 +56,20 @@ typedef struct sockaddr_storage t_sockaddr_storage;
+ 
+ #define SOCKET_INVALID (-1)
+ 
++#ifndef SOCKET_SELECT
++#include <sys/poll.h>
++
++#define WAITFD_R        POLLIN
++#define WAITFD_W        POLLOUT
++#define WAITFD_C        (POLLIN|POLLOUT)
++
++#else
++
++#define WAITFD_R        1
++#define WAITFD_W        2
++#define WAITFD_C        (WAITFD_R|WAITFD_W)
++
++#endif
++
++
+ #endif /* USOCKET_H */
+diff --git a/src/wsocket.c b/src/wsocket.c
+index 20da330..6101dd6 100755
+--- a/src/wsocket.c
++++ b/src/wsocket.c
+@@ -42,10 +42,6 @@ int socket_close(void) {
+ /*-------------------------------------------------------------------------*\
+ * Wait for readable/writable/connected socket with timeout
+ \*-------------------------------------------------------------------------*/
+-#define WAITFD_R        1
+-#define WAITFD_W        2
+-#define WAITFD_E        4
+-#define WAITFD_C        (WAITFD_E|WAITFD_W)
+ 
+ int socket_waitfd(p_socket ps, int sw, p_timeout tm) {
+     int ret;
+diff --git a/src/wsocket.h b/src/wsocket.h
+index 3986640..55ab0a9 100644
+--- a/src/wsocket.h
++++ b/src/wsocket.h
+@@ -30,4 +30,9 @@ typedef t_socket *p_socket;
+ #define AI_NUMERICSERV (0)
+ #endif
+ 
++#define WAITFD_R        1
++#define WAITFD_W        2
++#define WAITFD_E        4
++#define WAITFD_C        (WAITFD_E|WAITFD_W)
++
+ #endif /* WSOCKET_H */
+-- 
+2.32.0
+

diff --git a/dev-lua/luasocket/luasocket-3.0_rc1_p20200328-r103.ebuild b/dev-lua/luasocket/luasocket-3.0_rc1_p20200328-r103.ebuild
new file mode 100644
index 00000000000..6011ad7d597
--- /dev/null
+++ b/dev-lua/luasocket/luasocket-3.0_rc1_p20200328-r103.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+EGIT_COMMIT="5b18e475f38fcf28429b1cc4b17baee3b9793a62"
+LUA_COMPAT=( lua5-{1..4} luajit )
+MY_P="${PN}-${EGIT_COMMIT}"
+
+inherit lua toolchain-funcs
+
+DESCRIPTION="Networking support library for the Lua language"
+HOMEPAGE="
+	http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/
+	https://github.com/diegonehab/luasocket
+"
+SRC_URI="https://github.com/diegonehab/${PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+RESTRICT="test"
+
+RDEPEND="${LUA_DEPS}"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+HTML_DOCS="doc/."
+
+PATCHES=(
+	"${FILESDIR}/${P}_publish_API.patch"
+	"${FILESDIR}/${P}_makefile.patch"
+)
+
+src_prepare() {
+	default
+	lua_copy_sources
+}
+
+lua_src_compile() {
+	pushd "${BUILD_DIR}" || die
+
+	local myemakeargs=(
+		"CC=$(tc-getCC)"
+		"LD=$(tc-getCC)"
+		"LUAINC_linux=$(lua_get_include_dir)"
+		"LUAV=${ELUA}"
+		"MIME_V=1.0.3-${ELUA}"
+		"MYCFLAGS=${CFLAGS}"
+		"MYLDFLAGS=${LDFLAGS}"
+		"SOCKET_V=3.0-rc1-${ELUA}"
+	)
+
+	emake "${myemakeargs[@]}" all
+
+	popd
+}
+
+src_compile() {
+	lua_foreach_impl lua_src_compile
+}
+
+lua_src_install() {
+	pushd "${BUILD_DIR}" || die
+
+	local myemakeargs=(
+		"CDIR=$(lua_get_cmod_dir)"
+		"DESTDIR=${ED}"
+		"LDIR=$(lua_get_lmod_dir)"
+		"LUAPREFIX_linux="
+		"MIME_V=1.0.3-${ELUA}"
+		"SOCKET_V=3.0-rc1-${ELUA}"
+	)
+
+	emake "${myemakeargs[@]}" install
+	emake "${myemakeargs[@]}" install-unix
+
+	insinto "$(lua_get_include_dir)"/luasocket
+	doins src/*.h
+
+	popd
+}
+
+src_install() {
+	lua_foreach_impl lua_src_install
+
+	einstalldocs
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lua/luasocket/files/, dev-lua/luasocket/
@ 2022-03-27 15:15 Conrad Kostecki
  0 siblings, 0 replies; 3+ messages in thread
From: Conrad Kostecki @ 2022-03-27 15:15 UTC (permalink / raw
  To: gentoo-commits

commit:     c2dd3b753ecc9377ce4e21d30f6175e8f9ee46be
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 27 15:13:47 2022 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Sun Mar 27 15:15:24 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2dd3b75

dev-lua/luasocket: add 3.0.0

Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 dev-lua/luasocket/Manifest                         |  1 +
 .../luasocket/files/luasocket-3.0.0_makefile.patch | 73 ++++++++++++++++++
 dev-lua/luasocket/luasocket-3.0.0.ebuild           | 88 ++++++++++++++++++++++
 3 files changed, 162 insertions(+)

diff --git a/dev-lua/luasocket/Manifest b/dev-lua/luasocket/Manifest
index 8e11fe11f0a8..9c1c2992f0e5 100644
--- a/dev-lua/luasocket/Manifest
+++ b/dev-lua/luasocket/Manifest
@@ -1 +1,2 @@
+DIST luasocket-3.0.0.tar.gz 336231 BLAKE2B 71b87041a1edb2616ba269160382ac5cea6ba9b623281e8069e8adf97b6898d7836add7eff949010a1bc890bff8d2e4797a2ff5c619b45f8ee3adee5d6633843 SHA512 4f93d6c0b602333df50ee4f939cd0419243f6de333472ffebf99334e301143e8cdee3bc1655c29f81608622d6e7850a9bcf6929a6d4748210a70cdb8218a1ec6
 DIST luasocket-3.0_rc1_p20200328.tar.gz 335628 BLAKE2B 9e5d3e415337903b689705669b586c4481179a319b4e3428823c8f442d04f26db86bfeca66db7e58d157e31431c31e4f687403f7163b75f57d6f87cdb934717f SHA512 bdf7086a0504b0072b9cfd1266fc4ae89504053801722859a426f567fca00ed76f4c295c2a3a968e93f0036d9b792cf97561e9baa82c09ea23999cfd473227eb

diff --git a/dev-lua/luasocket/files/luasocket-3.0.0_makefile.patch b/dev-lua/luasocket/files/luasocket-3.0.0_makefile.patch
new file mode 100644
index 000000000000..8f6c9de42697
--- /dev/null
+++ b/dev-lua/luasocket/files/luasocket-3.0.0_makefile.patch
@@ -0,0 +1,73 @@
+--- a/src/makefile
++++ b/src/makefile
+@@ -162,7 +162,7 @@
+ O_macosx=o
+ CC_macosx=gcc
+ DEF_macosx= -DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN
+-CFLAGS_macosx=$(LUAINC:%=-I%) $(DEF) -Wall -O2 -fno-common
++CFLAGS_macosx=$(LUAINC:%=-I%) $(DEF) -Wall -fno-common
+ LDFLAGS_macosx= -bundle -undefined dynamic_lookup -o
+ LD_macosx=gcc
+ SOCKET_macosx=usocket.o
+@@ -174,8 +174,7 @@
+ O_linux=o
+ CC_linux=gcc
+ DEF_linux=-DLUASOCKET_$(DEBUG)
+-CFLAGS_linux=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \
+-	-Wimplicit -O2 -ggdb3 -fpic
++CFLAGS_linux=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra -Wimplicit -fpic
+ LDFLAGS_linux=-O -shared -fpic -o
+ LD_linux=gcc
+ SOCKET_linux=usocket.o
+@@ -187,8 +186,7 @@
+ O_freebsd=o
+ CC_freebsd=gcc
+ DEF_freebsd=-DLUASOCKET_$(DEBUG) -DUNIX_HAS_SUN_LEN
+-CFLAGS_freebsd=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \
+-	-Wimplicit -O2 -ggdb3 -fpic
++CFLAGS_freebsd=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra -Wimplicit -fpic
+ LDFLAGS_freebsd=-O -shared -fpic -o
+ LD_freebsd=gcc
+ SOCKET_freebsd=usocket.o
+@@ -200,8 +198,7 @@
+ O_solaris=o
+ CC_solaris=gcc
+ DEF_solaris=-DLUASOCKET_$(DEBUG)
+-CFLAGS_solaris=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \
+-	-Wimplicit -O2 -ggdb3 -fpic
++CFLAGS_freebsd=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra -Wimplicit -fpic
+ LDFLAGS_solaris=-lnsl -lsocket -lresolv -O -shared -fpic -o
+ LD_solaris=gcc
+ SOCKET_solaris=usocket.o
+@@ -214,7 +211,7 @@
+ CC_mingw=gcc
+ DEF_mingw= -DLUASOCKET_$(DEBUG) \
+ 	-DWINVER=0x0501
+-CFLAGS_mingw=$(LUAINC:%=-I%) $(DEF) -Wall -O2 -fno-common
++CFLAGS_mingw=$(LUAINC:%=-I%) $(DEF) -Wall -fno-common
+ LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o
+ LD_mingw=gcc
+ SOCKET_mingw=wsocket.o
+@@ -396,18 +393,18 @@
+ all: $(SOCKET_SO) $(MIME_SO)
+ 
+ $(SOCKET_SO): $(SOCKET_OBJS)
+-	$(LD) $(SOCKET_OBJS) $(LDFLAGS)$@
++	$(LD) $(SOCKET_OBJS) -Wl,-soname,socket/core.so $(LDFLAGS)$@
+ 
+ $(MIME_SO): $(MIME_OBJS)
+-	$(LD) $(MIME_OBJS) $(LDFLAGS)$@
++	$(LD) $(MIME_OBJS) -Wl,-soname,mime/core.so $(LDFLAGS)$@
+ 
+ all-unix: all $(UNIX_SO) $(SERIAL_SO)
+ 
+ $(UNIX_SO): $(UNIX_OBJS)
+-	$(LD) $(UNIX_OBJS) $(LDFLAGS)$@
++	$(LD) $(UNIX_OBJS) -Wl,-soname,socket/unix.so $(LDFLAGS)$@
+ 
+ $(SERIAL_SO): $(SERIAL_OBJS)
+-	$(LD) $(SERIAL_OBJS) $(LDFLAGS)$@
++	$(LD) $(SERIAL_OBJS) -Wl,-soname,socket/serial.so $(LDFLAGS)$@
+ 
+ install:
+ 	$(INSTALL_DIR) $(INSTALL_TOP_LDIR)

diff --git a/dev-lua/luasocket/luasocket-3.0.0.ebuild b/dev-lua/luasocket/luasocket-3.0.0.ebuild
new file mode 100644
index 000000000000..9c989a186eaf
--- /dev/null
+++ b/dev-lua/luasocket/luasocket-3.0.0.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( lua5-{1..4} luajit )
+MY_P="${PN}-${EGIT_COMMIT}"
+
+inherit lua toolchain-funcs
+
+DESCRIPTION="Networking support for the Lua language"
+HOMEPAGE="
+	http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/
+	https://github.com/lunarmodules/luasocket
+"
+SRC_URI="https://github.com/lunarmodules/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+RESTRICT="test"
+
+RDEPEND="${LUA_DEPS}"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+HTML_DOCS="docs/."
+
+PATCHES=(
+	"${FILESDIR}/${PN}-3.0_rc1_p20200328_publish_API.patch"
+	"${FILESDIR}/${PN}-3.0.0_makefile.patch"
+)
+
+src_prepare() {
+	default
+	lua_copy_sources
+}
+
+lua_src_compile() {
+	pushd "${BUILD_DIR}" || die
+
+	local myemakeargs=(
+		"CC=$(tc-getCC)"
+		"LD=$(tc-getCC)"
+		"LUAINC_linux=$(lua_get_include_dir)"
+		"LUAV=${ELUA}"
+		"MIME_V=1.0.3-${ELUA}"
+		"MYCFLAGS=${CFLAGS}"
+		"MYLDFLAGS=${LDFLAGS}"
+		"SOCKET_V=3.0.0-${ELUA}"
+	)
+
+	emake "${myemakeargs[@]}" all
+
+	popd
+}
+
+src_compile() {
+	lua_foreach_impl lua_src_compile
+}
+
+lua_src_install() {
+	pushd "${BUILD_DIR}" || die
+
+	local myemakeargs=(
+		"CDIR=$(lua_get_cmod_dir)"
+		"DESTDIR=${ED}"
+		"LDIR=$(lua_get_lmod_dir)"
+		"LUAPREFIX_linux="
+		"MIME_V=1.0.3-${ELUA}"
+		"SOCKET_V=3.0.0-${ELUA}"
+	)
+
+	emake "${myemakeargs[@]}" install
+	emake "${myemakeargs[@]}" install-unix
+
+	insinto "$(lua_get_include_dir)"/luasocket
+	doins src/*.h
+
+	popd
+}
+
+src_install() {
+	lua_foreach_impl lua_src_install
+
+	einstalldocs
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-27 15:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-27 15:15 [gentoo-commits] repo/gentoo:master commit in: dev-lua/luasocket/files/, dev-lua/luasocket/ Conrad Kostecki
  -- strict thread matches above, loose matches on Subject: below --
2021-10-19 19:56 Conrad Kostecki
2021-01-27 19:48 Conrad Kostecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox