SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

View file

@ -0,0 +1,32 @@
COMMENT= MessagePack implementation and bindings for Lua
DISTNAME= lua-cmsgpack-0.3.0
REVISION= 1
CATEGORIES= devel
HOMEPAGE= https://github.com/antirez/lua-cmsgpack
# BSD
PERMIT_PACKAGE= Yes
MASTER_SITES= https://distfiles.sigtrap.nl/
MODULES= lang/lua
FLAVORS= lua52
FLAVOR?=
TEST_DEPENDS=${BUILD_PKGPATH}
do-build:
cd ${WRKSRC} && ${CC} ${CFLAGS} -fPIC -I${MODLUA_INCL_DIR} -shared \
${WRKSRC}/lua_cmsgpack.c -o ${WRKSRC}/cmsgpack.so
do-install:
${INSTALL_DATA_DIR} ${MODLUA_LIBDIR}
${INSTALL_DATA} ${WRKSRC}/cmsgpack.so ${MODLUA_LIBDIR}
do-test:
cd ${WRKSRC} && ${MODLUA_BIN} test.lua
.include <bsd.port.mk>

View file

@ -0,0 +1,2 @@
SHA256 (lua-cmsgpack-0.3.0.tar.gz) = 1YSGUqbpaL0KRh+Yh8UYrODmnOFz8E5dC7zkqkKvhAg=
SIZE (lua-cmsgpack-0.3.0.tar.gz) = 138961

View file

@ -0,0 +1,31 @@
--- lua_cmsgpack.c.orig Mon Nov 5 20:14:43 2012
+++ lua_cmsgpack.c Tue May 17 09:15:56 2016
@@ -328,7 +328,11 @@ static void mp_encode_lua_type(lua_State *L, mp_buf *b
/* Convert a lua table into a message pack list. */
static void mp_encode_lua_table_as_array(lua_State *L, mp_buf *buf, int level) {
+#if LUA_VERSION_NUM <= 501
size_t len = lua_objlen(L,-1), j;
+#else
+ size_t len = lua_rawlen(L,-1), j;
+#endif
mp_encode_array(buf,len);
for (j = 1; j <= len; j++) {
@@ -687,14 +691,14 @@ static int mp_unpack(lua_State *L) {
/* ---------------------------------------------------------------------------- */
-static const struct luaL_reg thislib[] = {
+static const struct luaL_Reg thislib[] = {
{"pack", mp_pack},
{"unpack", mp_unpack},
{NULL, NULL}
};
LUALIB_API int luaopen_cmsgpack (lua_State *L) {
- luaL_register(L, "cmsgpack", thislib);
+ luaL_openlib(L, "cmsgpack", thislib, 0);
lua_pushliteral(L, LUACMSGPACK_VERSION);
lua_setfield(L, -2, "_VERSION");

View file

@ -0,0 +1,11 @@
--- test.lua.orig Mon Nov 5 20:26:45 2012
+++ test.lua Mon Nov 5 20:27:36 2012
@@ -2,6 +2,8 @@
-- Copyright(C) 2012 Salvatore Sanfilippo, All Rights Reserved.
-- See the copyright notice at the end of lua_cmsgpack.c for more information.
+local cmsgpack = require 'cmsgpack'
+
passed = 0
failed = 0

View file

@ -0,0 +1 @@
Lua-cmsgpack is a MessagePack implementation and bindings for Lua.

View file

@ -0,0 +1 @@
lib/lua/${MODLUA_VERSION}/cmsgpack.so