Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package lua-ldbus for openSUSE:Factory checked in at 2025-11-05 16:18:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lua-ldbus (Old) and /work/SRC/openSUSE:Factory/.lua-ldbus.new.1980 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lua-ldbus" Wed Nov 5 16:18:08 2025 rev:8 rq:1315154 version:0.0+git20250404.5cc933b Changes: -------- --- /work/SRC/openSUSE:Factory/lua-ldbus/lua-ldbus.changes 2023-01-25 17:50:35.750439587 +0100 +++ /work/SRC/openSUSE:Factory/.lua-ldbus.new.1980/lua-ldbus.changes 2025-11-05 16:20:32.831734383 +0100 @@ -1,0 +2,27 @@ +Fri Oct 24 14:48:14 UTC 2025 - Matej Cepl <[email protected]> + +- Switch off building lua51 build of the package. + +------------------------------------------------------------------- +Sat Oct 11 15:43:45 UTC 2025 - Matej Cepl <[email protected]> + +- Update to a version 0.0+git20250404.5cc933b: + - Lua 5.4 is now supported + - src/message_iter: Bind dbus_mesage_iter_get_element_count() + - Added support for DESTDIR + - src/message_iter: Maintain reference to underlying DBusMessage +- Remove obsolete conditionals for openSUSE/Leap 42.3 +- Remove upstreamed patch: + - lua54.patch + +------------------------------------------------------------------- +Sat Oct 11 15:25:16 UTC 2025 - Matej Cepl <[email protected]> + +- Update to a version 0.0+git20250404.5cc933b: + * src/message_iter: Maintain reference to underlying DBusMessage + * Added support for DESTDIR + * src/message_iter: Bind dbus_mesage_iter_get_element_count() + * Lua 5.4 is now supported + * Squashed 'vendor/compat-5.3/' changes from daebe77..e245d3a + +------------------------------------------------------------------- Old: ---- lua-ldbus-0.0+git20190816.9e176fe.tar.xz lua54.patch New: ---- _scmsync.obsinfo build.specials.obscpio lua-ldbus-0.0+git20250404.5cc933b.tar.xz ----------(Old B)---------- Old:- Remove upstreamed patch: - lua54.patch ----------(Old E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lua-ldbus.spec ++++++ --- /var/tmp/diff_new_pack.upVGXL/_old 2025-11-05 16:20:33.559764987 +0100 +++ /var/tmp/diff_new_pack.upVGXL/_new 2025-11-05 16:20:33.563765156 +0100 @@ -18,22 +18,17 @@ %define flavor @BUILD_FLAVOR@ %define mod_name ldbus -Version: 0.0+git20190816.9e176fe +Version: 0.0+git20250404.5cc933b Release: 0 Summary: Lua bindings to dbus License: MIT Group: Development/Libraries/Other -URL: https://github.com/daurnimator/ldbus/ +URL: https://github.com/daurnimator/ldbus Source: lua-ldbus-%{version}.tar.xz -Patch0: lua54.patch BuildRequires: %{flavor}-devel BuildRequires: lua-macros Requires: %{flavor} -%if 0%{?suse_version} < 1330 -BuildRequires: dbus-1-devel -%else BuildRequires: pkgconfig(dbus-1) -%endif %lua_provides %if "%{flavor}" == "" Name: lua-%{mod_name} @@ -48,23 +43,13 @@ %prep %autosetup -n lua-ldbus-%{version} -p1 -%if "%{flavor}" != "lua53" -sed -i -e "s/lua5.3/lua%{lua_version}/" src/Makefile -%endif - %build -%if 0%{?suse_version} < 1330 -export CFLAGS="-I/usr/include/lua%{lua_version} -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include" -%if "%{flavor}" != "lua53" -export CFLAGS="$CFLAGS -Ivendor/compat-5.3" -%endif -%endif cd src -make %{?_make_output_sync} %{?_smp_mflags} +make %{?_make_output_sync} %{?_smp_mflags} LUA_PKGNAME="lua" LUA_LIBDIR="%{lua_archdir}" %install cd src -%make_install LUA_LIBDIR='$(DESTDIR)%{lua_archdir}' +%make_install LUA_LIBDIR='%{lua_archdir}' %files %license LICENSE ++++++ _multibuild ++++++ --- /var/tmp/diff_new_pack.upVGXL/_old 2025-11-05 16:20:33.599766669 +0100 +++ /var/tmp/diff_new_pack.upVGXL/_new 2025-11-05 16:20:33.607767006 +0100 @@ -1,5 +1,5 @@ <multibuild> -<package>lua51</package> +<package>luajit</package> <package>lua53</package> <package>lua54</package> </multibuild> ++++++ _scmsync.obsinfo ++++++ mtime: 1761317294 commit: 8afe48fc3e76a6b22c513d0e18dfeb72b51e985cc775639a539aa9e87fe0b3f8 url: https://src.opensuse.org/lua/lua-ldbus.git revision: 8afe48fc3e76a6b22c513d0e18dfeb72b51e985cc775639a539aa9e87fe0b3f8 projectscmsync: https://src.opensuse.org/lua/_ObsPrj.git ++++++ _service ++++++ --- /var/tmp/diff_new_pack.upVGXL/_old 2025-11-05 16:20:33.647768687 +0100 +++ /var/tmp/diff_new_pack.upVGXL/_new 2025-11-05 16:20:33.651768855 +0100 @@ -1,17 +1,16 @@ <services> - <service name="tar_scm" mode="disabled"> + <service name="tar_scm" mode="manual"> <param name="url">https://github.com/daurnimator/ldbus</param> <param name="filename">lua-ldbus</param> <param name="versionformat">0.0+git%cd.%h</param> <param name="scm">git</param> - <param name="revision">9e176fe851006037a643610e6d8f3a8e597d4073</param> <param name="changesgenerate">enable</param> </service> - <service name="recompress" mode="disabled"> + <service name="recompress" mode="manual"> <param name="compression">xz</param> <param name="file">*.tar</param> </service> - <service name="set_version" mode="disabled" /> + <service name="set_version" mode="manual" /> </services> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.upVGXL/_old 2025-11-05 16:20:33.679770032 +0100 +++ /var/tmp/diff_new_pack.upVGXL/_new 2025-11-05 16:20:33.683770201 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/daurnimator/ldbus</param> - <param name="changesrevision">9e176fe851006037a643610e6d8f3a8e597d4073</param></service></servicedata> + <param name="changesrevision">5cc933bfad2b73674bc005ebcce771555a614792</param></service></servicedata> (No newline at EOF) ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2025-10-24 16:48:24.000000000 +0200 @@ -0,0 +1,6 @@ +.osc +*.obscpio +*.osc +_build.* +.pbuild +ldbus/ ++++++ lua-ldbus-0.0+git20190816.9e176fe.tar.xz -> lua-ldbus-0.0+git20250404.5cc933b.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/.gitignore new/lua-ldbus-0.0+git20250404.5cc933b/.gitignore --- old/lua-ldbus-0.0+git20190816.9e176fe/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/lua-ldbus-0.0+git20250404.5cc933b/.gitignore 2025-04-04 03:51:09.000000000 +0200 @@ -0,0 +1,3 @@ +*.so +*.o +*.rock diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/README.md new/lua-ldbus-0.0+git20250404.5cc933b/README.md --- old/lua-ldbus-0.0+git20190816.9e176fe/README.md 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/README.md 2025-04-04 03:51:09.000000000 +0200 @@ -2,7 +2,7 @@ ldbus is a C binding to dbus for Lua. -Compatible with Lua 5.1, 5.2 and 5.3 (thanks [compat-5.3](https://github.com/keplerproject/lua-compat-5.3)). +Compatible with Lua 5.1, 5.2, 5.3 and 5.4 (thanks [compat-5.3](https://github.com/keplerproject/lua-compat-5.3)). # Status @@ -99,6 +99,7 @@ [`dbus_message_get_signature()`](http://dbus.freedesktop.org/doc/api/html/group__DBusMessage.html#gaed63e4c2baaa50d782e8ebb7643def19) | `my_message:get_signature()` | [`dbus_message_iter_has_next()`](http://dbus.freedesktop.org/doc/api/html/group__DBusMessage.html#gaaffc75a699c96ff6197287f166df2149) | `bool = my_message_iter:has_next()` | [`dbus_message_iter_next()`](http://dbus.freedesktop.org/doc/api/html/group__DBusMessage.html#ga554e9fafd4dcc84cebe9da9344846a82) | `bool = my_message_iter:next()` | +[`dbus_message_iter_get_element_count()`](https://dbus.freedesktop.org/doc/api/html/group__DBusMessage.html#gabe60e5d5c3f06f90254eef3e72b5cf49) | `number = my_message_iter:get_element_count()` | [`dbus_message_iter_get_element_type()`](http://dbus.freedesktop.org/doc/api/html/group__DBusMessage.html#ga868a7aeddb9b54b2805776b512f68cb4) | `type = my_message_iter:get_element_type()` | `DBUS_TYPE_INVALID` is returned as `nil` [`dbus_message_iter_recurse()`](http://dbus.freedesktop.org/doc/api/html/group__DBusMessage.html#ga7652e1208743da5dd4ecc5aef07bf207) | `sub_iter = my_message_iter:recurse([sub_iter])` | Creates a new `DBusMessageIter` if one is not passed [`dbus_message_iter_get_signature()`](http://dbus.freedesktop.org/doc/api/html/group__DBusMessage.html#gab4579a88a1a7eaf648350466f585ef8b) | `sig = my_message_iter:get_signature()` | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/ldbus-scm-0.rockspec new/lua-ldbus-0.0+git20250404.5cc933b/ldbus-scm-0.rockspec --- old/lua-ldbus-0.0+git20190816.9e176fe/ldbus-scm-0.rockspec 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/ldbus-scm-0.rockspec 2025-04-04 03:51:09.000000000 +0200 @@ -12,7 +12,7 @@ } dependencies = { - "lua >= 5.1, < 5.4"; + "lua >= 5.1, < 5.5"; } external_dependencies = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/src/Makefile new/lua-ldbus-0.0+git20250404.5cc933b/src/Makefile --- old/lua-ldbus-0.0+git20190816.9e176fe/src/Makefile 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/src/Makefile 2025-04-04 03:51:09.000000000 +0200 @@ -20,5 +20,5 @@ rm -f -- ldbus.so $(OBJS) install: ldbus.so - mkdir -p $(LUA_LIBDIR) - cp ldbus.so $(LUA_LIBDIR) + mkdir -p $(DESTDIR)$(LUA_LIBDIR) + cp ldbus.so $(DESTDIR)$(LUA_LIBDIR) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/src/message.c new/lua-ldbus-0.0+git20250404.5cc933b/src/message.c --- old/lua-ldbus-0.0+git20190816.9e176fe/src/message.c 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/src/message.c 2025-04-04 03:51:09.000000000 +0200 @@ -134,16 +134,22 @@ static int ldbus_message_iter_init(lua_State *L) { DBusMessage *message = check_DBusMessage(L, 1); - DBusMessageIter *iter; + lDBusMessageIter *iter; if (lua_gettop(L) == 1) { push_DBusMessageIter(L); + iter = lua_touserdata(L, 2); } else { lua_settop(L, 2); + iter = luaL_checkudata(L, 2, DBUS_MESSAGE_ITER_METATABLE); + unref_ldbus_message_iter(iter); } - iter = luaL_checkudata(L, 2, DBUS_MESSAGE_ITER_METATABLE); - if (!dbus_message_iter_init(message, iter)) { + if (!dbus_message_iter_init(message, &iter->iter)) { lua_pushnil(L); + iter->message = NULL; + } else { + iter->message = message; + dbus_message_ref(message); } return 1; @@ -151,15 +157,20 @@ static int ldbus_message_iter_init_append(lua_State *L) { DBusMessage *message = check_DBusMessage(L, 1); - DBusMessageIter *iter; + lDBusMessageIter *iter; if (lua_gettop(L) == 1) { push_DBusMessageIter(L); + iter = lua_touserdata(L, 2); } else { lua_settop(L, 2); + iter = luaL_checkudata(L, 2, DBUS_MESSAGE_ITER_METATABLE); + unref_ldbus_message_iter(iter); } - iter = luaL_checkudata(L, 2, DBUS_MESSAGE_ITER_METATABLE); - dbus_message_iter_init_append(message, iter); + dbus_message_iter_init_append(message, &iter->iter); + + iter->message = message; + dbus_message_ref(iter->message); return 1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/src/message_iter.c new/lua-ldbus-0.0+git20250404.5cc933b/src/message_iter.c --- old/lua-ldbus-0.0+git20190816.9e176fe/src/message_iter.c 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/src/message_iter.c 2025-04-04 03:51:09.000000000 +0200 @@ -14,11 +14,16 @@ static int ldbus_message_iter_clone(lua_State *L) { - DBusMessageIter *iter = luaL_checkudata(L, 1, DBUS_MESSAGE_ITER_METATABLE); - DBusMessageIter *clone; + lDBusMessageIter *iter = luaL_checkudata(L, 1, DBUS_MESSAGE_ITER_METATABLE); + lDBusMessageIter *clone; push_DBusMessageIter(L); clone = lua_touserdata(L, -1); - memcpy(clone, iter, sizeof(DBusMessageIter)); + memcpy(clone, iter, sizeof(lDBusMessageIter)); + + if (clone->message) { + dbus_message_ref(clone->message); + } + return 1; } @@ -51,6 +56,14 @@ return 1; } +static int ldbus_message_iter_get_element_count(lua_State *L) { + DBusMessageIter *iter = luaL_checkudata(L, 1, DBUS_MESSAGE_ITER_METATABLE); + + lua_pushinteger(L, dbus_message_iter_get_element_count(iter)); + + return 1; +} + static int ldbus_message_iter_get_element_type(lua_State *L) { DBusMessageIter *iter = luaL_checkudata(L, 1, DBUS_MESSAGE_ITER_METATABLE); @@ -65,16 +78,21 @@ } static int ldbus_message_iter_recurse(lua_State *L) { - DBusMessageIter *iter = luaL_checkudata(L, 1, DBUS_MESSAGE_ITER_METATABLE); - DBusMessageIter *sub; + lDBusMessageIter *iter = luaL_checkudata(L, 1, DBUS_MESSAGE_ITER_METATABLE); + lDBusMessageIter *sub; if (lua_gettop(L) == 1) { push_DBusMessageIter(L); + sub = lua_touserdata(L, 2); } else { lua_settop(L, 2); + sub = luaL_checkudata(L, 2, DBUS_MESSAGE_ITER_METATABLE); + /* remove possible reference to previously referred message */ + unref_ldbus_message_iter(sub); } - sub = luaL_checkudata(L, 2, DBUS_MESSAGE_ITER_METATABLE); - dbus_message_iter_recurse(iter, sub); + dbus_message_iter_recurse(&iter->iter, &sub->iter); + sub->message = iter->message; + dbus_message_ref(sub->message); return 1; } @@ -286,10 +304,10 @@ } static int ldbus_message_iter_open_container(lua_State *L) { - DBusMessageIter *iter = luaL_checkudata(L, 1, DBUS_MESSAGE_ITER_METATABLE); + lDBusMessageIter *iter = luaL_checkudata(L, 1, DBUS_MESSAGE_ITER_METATABLE); int argtype; const char *contained_signature; - DBusMessageIter *sub; + lDBusMessageIter *sub; if (lua_type(L, 2) != LUA_TSTRING || lua_rawlen(L, 2) != 1) { return luaL_argerror(L, 2, lua_pushfstring(L, "character expected, got %s", luaL_typename(L, 2))); } @@ -297,15 +315,22 @@ contained_signature = luaL_optstring(L, 3, NULL); if (lua_gettop(L) < 4) { push_DBusMessageIter(L); + sub = lua_touserdata(L, -1); } else { lua_settop(L, 4); + sub = luaL_checkudata(L, 4, DBUS_MESSAGE_ITER_METATABLE); + /* remove possible reference to previously referred message */ + unref_ldbus_message_iter(sub); } - sub = luaL_checkudata(L, -1, DBUS_MESSAGE_ITER_METATABLE); - if (!dbus_message_iter_open_container(iter, argtype, contained_signature, sub)) { + if (!dbus_message_iter_open_container(&iter->iter, argtype, contained_signature, &sub->iter)) { + sub->message = NULL; return luaL_error(L, LDBUS_NO_MEMORY); } + sub->message = iter->message; + dbus_message_ref(sub->message); + return 1; } @@ -318,23 +343,41 @@ return 1; } +LDBUS_INTERNAL void unref_ldbus_message_iter(lDBusMessageIter *iter) { + if (iter->message) { + dbus_message_unref(iter->message); + iter->message = NULL; + } +} + +static int ldbus_message_iter_gc(lua_State *L) +{ + lDBusMessageIter *iter = luaL_checkudata(L, 1, DBUS_MESSAGE_ITER_METATABLE); + + unref_ldbus_message_iter(iter); + + return 0; +} + LDBUS_INTERNAL int push_DBusMessageIter(lua_State *L) { static luaL_Reg const methods [] = { - { "clone", ldbus_message_iter_clone }, - { "has_next", ldbus_message_iter_has_next }, - { "next", ldbus_message_iter_next }, - { "get_arg_type", ldbus_message_iter_get_arg_type }, - { "get_element_type", ldbus_message_iter_get_element_type }, - { "recurse", ldbus_message_iter_recurse }, - { "get_signature", ldbus_message_iter_get_signature }, - { "get_basic", ldbus_message_iter_get_basic }, - { "append_basic", ldbus_message_iter_append_basic }, - { "open_container", ldbus_message_iter_open_container }, - { "close_container", ldbus_message_iter_close_container }, + { "clone", ldbus_message_iter_clone }, + { "has_next", ldbus_message_iter_has_next }, + { "next", ldbus_message_iter_next }, + { "get_arg_type", ldbus_message_iter_get_arg_type }, + { "get_element_count", ldbus_message_iter_get_element_count }, + { "get_element_type", ldbus_message_iter_get_element_type }, + { "recurse", ldbus_message_iter_recurse }, + { "get_signature", ldbus_message_iter_get_signature }, + { "get_basic", ldbus_message_iter_get_basic }, + { "append_basic", ldbus_message_iter_append_basic }, + { "open_container", ldbus_message_iter_open_container }, + { "close_container", ldbus_message_iter_close_container }, { NULL, NULL } }; - lua_newuserdata(L, sizeof(DBusMessageIter)); + lDBusMessageIter *iter = lua_newuserdata(L, sizeof(lDBusMessageIter)); + iter->message = NULL; if (luaL_newmetatable(L, DBUS_MESSAGE_ITER_METATABLE)) { luaL_newlib(L, methods); @@ -343,6 +386,9 @@ lua_pushcfunction(L, tostring); lua_setfield(L, -2, "__tostring"); + lua_pushcfunction(L, ldbus_message_iter_gc); + lua_setfield(L, -2, "__gc"); + lua_pushstring(L, "DBusMessageIter"); lua_setfield(L, -2, "__udtype"); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/src/message_iter.h new/lua-ldbus-0.0+git20250404.5cc933b/src/message_iter.h --- old/lua-ldbus-0.0+git20190816.9e176fe/src/message_iter.h 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/src/message_iter.h 2025-04-04 03:51:09.000000000 +0200 @@ -5,9 +5,23 @@ #include "ldbus.h" +typedef struct { + /* This must be the first member, thus for binding functions that doesn't + care about the underlying DBusMessage, this structure could be safely + referred with a DBusMessageIter pointer. + */ + DBusMessageIter iter; + /* The message which this iterator refers to. NULL if this iterator hasn't + been initialized with a message. + We need to unref it when the iterator is garbagecollected. + */ + DBusMessage *message; +} lDBusMessageIter; + #define DBUS_MESSAGE_ITER_METATABLE "ldbus_DBusMessageIter" LDBUS_INTERNAL int push_DBusMessageIter(lua_State *L); LDBUS_INTERNAL void load_dbus_message_iter(lua_State *L); +LDBUS_INTERNAL void unref_ldbus_message_iter(lDBusMessageIter *iter); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/.gitignore new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/.gitignore --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/.gitignore 2025-04-04 03:51:09.000000000 +0200 @@ -0,0 +1,10 @@ +# generated files +*.so +*.dll +*.o +*.obj +HISTO + +# vim temporaries +.*.swp + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/README.md new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/README.md --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/README.md 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/README.md 2025-04-04 03:51:09.000000000 +0200 @@ -35,7 +35,7 @@ a meaningful return value, so the usual idiom of storing the return of `require` in a local variable makes no sense. -When run under Lua 5.3, this module does nothing. +When run under Lua 5.3+, this module does nothing. When run under Lua 5.2 or 5.1, it replaces some of your standard functions and adds new ones to bring your environment closer to that @@ -125,6 +125,7 @@ * `lua_KContext` (see [here][14]) * `lua_KFunction` (see [here][14]) * `lua_dump` (extra `strip` parameter, ignored, see [here][15]) +* `lua_getextraspace` (limited compatibilitiy, see [here][24]) * `lua_getfield` (return value) * `lua_geti` and `lua_seti` * `lua_getglobal` (return value) @@ -186,7 +187,6 @@ [`lua-compat-5.2`][2] for a detailed list. * the following C API functions/macros: * `lua_isyieldable` - * `lua_getextraspace` * `lua_arith` (new operators missing) * `lua_push(v)fstring` (new formats missing) * `lua_upvalueid` (5.1) @@ -236,4 +236,5 @@ [21]: https://github.com/keplerproject/lua-compat-5.3/wiki/luaL_checkversion [22]: https://github.com/keplerproject/lua-compat-5.3/wiki/luaL_Buffer [23]: https://github.com/keplerproject/lua-compat-5.3/wiki/coroutine.running + [24]: https://github.com/keplerproject/lua-compat-5.3/wiki/lua_getextraspace diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/c-api/compat-5.3.c new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/c-api/compat-5.3.c --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/c-api/compat-5.3.c 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/c-api/compat-5.3.c 2025-04-04 03:51:09.000000000 +0200 @@ -28,8 +28,9 @@ #endif /* VC++ _fsopen for share-allowed file read */ #ifndef COMPAT53_HAVE_STRERROR_R -# if defined(__GLIBC__) || defined(_POSIX_VERSION) || defined(__APPLE__) || \ - (!defined (__MINGW32__) && defined(__GNUC__) && (__GNUC__ < 6)) +# if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) || \ + (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 600) || \ + defined(__APPLE__) # define COMPAT53_HAVE_STRERROR_R 1 # else /* none of the defines matched: define to 0 */ # define COMPAT53_HAVE_STRERROR_R 0 @@ -448,7 +449,9 @@ COMPAT53_API int lua_load (lua_State *L, lua_Reader reader, void *data, const char *source, const char *mode) { int status = LUA_OK; - compat53_reader_data compat53_data = { reader, data, 1, 0, 0 }; + compat53_reader_data compat53_data = { 0, NULL, 1, 0, 0 }; + compat53_data.reader = reader; + compat53_data.ud = data; compat53_data.peeked_data = reader(L, data, &(compat53_data.peeked_data_size)); if (compat53_data.peeked_data && compat53_data.peeked_data_size && compat53_data.peeked_data[0] == LUA_SIGNATURE[0]) /* binary file? */ @@ -720,6 +723,63 @@ } +#ifndef LUA_EXTRASPACE +#define LUA_EXTRASPACE (sizeof(void*)) +#endif + +COMPAT53_API void *lua_getextraspace (lua_State *L) { + int is_main = 0; + void *ptr = NULL; + luaL_checkstack(L, 4, "not enough stack slots available"); + lua_pushliteral(L, "__compat53_extraspace"); + lua_pushvalue(L, -1); + lua_rawget(L, LUA_REGISTRYINDEX); + if (!lua_istable(L, -1)) { + lua_pop(L, 1); + lua_createtable(L, 0, 2); + lua_createtable(L, 0, 1); + lua_pushliteral(L, "k"); + lua_setfield(L, -2, "__mode"); + lua_setmetatable(L, -2); + lua_pushvalue(L, -2); + lua_pushvalue(L, -2); + lua_rawset(L, LUA_REGISTRYINDEX); + } + lua_replace(L, -2); + is_main = lua_pushthread(L); + lua_rawget(L, -2); + ptr = lua_touserdata(L, -1); + if (!ptr) { + lua_pop(L, 1); + ptr = lua_newuserdata(L, LUA_EXTRASPACE); + if (is_main) { + memset(ptr, '\0', LUA_EXTRASPACE); + lua_pushthread(L); + lua_pushvalue(L, -2); + lua_rawset(L, -4); + lua_pushboolean(L, 1); + lua_pushvalue(L, -2); + lua_rawset(L, -4); + } else { + void* mptr = NULL; + lua_pushboolean(L, 1); + lua_rawget(L, -3); + mptr = lua_touserdata(L, -1); + if (mptr) + memcpy(ptr, mptr, LUA_EXTRASPACE); + else + memset(ptr, '\0', LUA_EXTRASPACE); + lua_pop(L, 1); + lua_pushthread(L); + lua_pushvalue(L, -2); + lua_rawset(L, -4); + } + } + lua_pop(L, 2); + return ptr; +} + + COMPAT53_API int lua_isinteger (lua_State *L, int index) { if (lua_type(L, index) == LUA_TNUMBER) { lua_Number n = lua_tonumber(L, index); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/c-api/compat-5.3.h new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/c-api/compat-5.3.h --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/c-api/compat-5.3.h 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/c-api/compat-5.3.h 2025-04-04 03:51:09.000000000 +0200 @@ -293,6 +293,9 @@ #define lua_geti COMPAT53_CONCAT(COMPAT53_PREFIX, _geti) COMPAT53_API int lua_geti (lua_State *L, int index, lua_Integer i); +#define lua_getextraspace COMPAT53_CONCAT(COMPAT53_PREFIX, _getextraspace) +COMPAT53_API void *lua_getextraspace (lua_State *L); + #define lua_isinteger COMPAT53_CONCAT(COMPAT53_PREFIX, _isinteger) COMPAT53_API int lua_isinteger (lua_State *L, int index); @@ -339,7 +342,6 @@ /* XXX not implemented: * lua_isyieldable - * lua_getextraspace * lua_arith (new operators) * lua_pushfstring (new formats) */ @@ -397,11 +399,11 @@ /* other Lua versions */ -#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 503 +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 504 -# error "unsupported Lua version (i.e. not Lua 5.1, 5.2, or 5.3)" +# error "unsupported Lua version (i.e. not Lua 5.1, 5.2, 5.3, or 5.4)" -#endif /* other Lua versions except 5.1, 5.2, and 5.3 */ +#endif /* other Lua versions except 5.1, 5.2, 5.3, and 5.4 */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/lbitlib.c new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/lbitlib.c --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/lbitlib.c 1970-01-01 01:00:00.000000000 +0100 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/lbitlib.c 2025-04-04 03:51:09.000000000 +0200 @@ -0,0 +1,243 @@ +/* +** $Id: lbitlib.c,v 1.30.1.1 2017/04/19 17:20:42 roberto Exp $ +** Standard library for bitwise operations +** See Copyright Notice in lua.h +*/ + +#define lbitlib_c +#define LUA_LIB + +#include "lprefix.h" + + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + +#if defined(LUA_COMPAT_BITLIB) /* { */ + + +#define pushunsigned(L,n) (sizeof(lua_Integer) > 4 ? lua_pushinteger(L, (lua_Integer)(n)) : lua_pushnumber(L, (lua_Number)(n))) +static lua_Unsigned checkunsigned(lua_State *L, int i) { + if (sizeof(lua_Integer) > 4) + return (lua_Unsigned)luaL_checkinteger(L, i); + else { + lua_Number d = luaL_checknumber(L, i); + if (d < 0) + d = (d + 1) + (~(lua_Unsigned)0); + luaL_argcheck(L, d >= 0 && d <= (~(lua_Unsigned)0), i, "value out of range"); + return (lua_Unsigned)d; + } +} + + +/* number of bits to consider in a number */ +#if !defined(LUA_NBITS) +#define LUA_NBITS 32 +#endif + + +/* +** a lua_Unsigned with its first LUA_NBITS bits equal to 1. (Shift must +** be made in two parts to avoid problems when LUA_NBITS is equal to the +** number of bits in a lua_Unsigned.) +*/ +#define ALLONES (~(((~(lua_Unsigned)0) << (LUA_NBITS - 1)) << 1)) + + +/* macro to trim extra bits */ +#define trim(x) ((x) & ALLONES) + + +/* builds a number with 'n' ones (1 <= n <= LUA_NBITS) */ +#define mask(n) (~((ALLONES << 1) << ((n) - 1))) + + + +static lua_Unsigned andaux (lua_State *L) { + int i, n = lua_gettop(L); + lua_Unsigned r = ~(lua_Unsigned)0; + for (i = 1; i <= n; i++) + r &= checkunsigned(L, i); + return trim(r); +} + + +static int b_and (lua_State *L) { + lua_Unsigned r = andaux(L); + pushunsigned(L, r); + return 1; +} + + +static int b_test (lua_State *L) { + lua_Unsigned r = andaux(L); + lua_pushboolean(L, r != 0); + return 1; +} + + +static int b_or (lua_State *L) { + int i, n = lua_gettop(L); + lua_Unsigned r = 0; + for (i = 1; i <= n; i++) + r |= checkunsigned(L, i); + pushunsigned(L, trim(r)); + return 1; +} + + +static int b_xor (lua_State *L) { + int i, n = lua_gettop(L); + lua_Unsigned r = 0; + for (i = 1; i <= n; i++) + r ^= checkunsigned(L, i); + pushunsigned(L, trim(r)); + return 1; +} + + +static int b_not (lua_State *L) { + lua_Unsigned r = ~checkunsigned(L, 1); + pushunsigned(L, trim(r)); + return 1; +} + + +static int b_shift (lua_State *L, lua_Unsigned r, lua_Integer i) { + if (i < 0) { /* shift right? */ + i = -i; + r = trim(r); + if (i >= LUA_NBITS) r = 0; + else r >>= i; + } + else { /* shift left */ + if (i >= LUA_NBITS) r = 0; + else r <<= i; + r = trim(r); + } + pushunsigned(L, r); + return 1; +} + + +static int b_lshift (lua_State *L) { + return b_shift(L, checkunsigned(L, 1), luaL_checkinteger(L, 2)); +} + + +static int b_rshift (lua_State *L) { + return b_shift(L, checkunsigned(L, 1), -luaL_checkinteger(L, 2)); +} + + +static int b_arshift (lua_State *L) { + lua_Unsigned r = checkunsigned(L, 1); + lua_Integer i = luaL_checkinteger(L, 2); + if (i < 0 || !(r & ((lua_Unsigned)1 << (LUA_NBITS - 1)))) + return b_shift(L, r, -i); + else { /* arithmetic shift for 'negative' number */ + if (i >= LUA_NBITS) r = ALLONES; + else + r = trim((r >> i) | ~(trim(~(lua_Unsigned)0) >> i)); /* add signal bit */ + pushunsigned(L, r); + return 1; + } +} + + +static int b_rot (lua_State *L, lua_Integer d) { + lua_Unsigned r = checkunsigned(L, 1); + int i = d & (LUA_NBITS - 1); /* i = d % NBITS */ + r = trim(r); + if (i != 0) /* avoid undefined shift of LUA_NBITS when i == 0 */ + r = (r << i) | (r >> (LUA_NBITS - i)); + pushunsigned(L, trim(r)); + return 1; +} + + +static int b_lrot (lua_State *L) { + return b_rot(L, luaL_checkinteger(L, 2)); +} + + +static int b_rrot (lua_State *L) { + return b_rot(L, -luaL_checkinteger(L, 2)); +} + + +/* +** get field and width arguments for field-manipulation functions, +** checking whether they are valid. +** ('luaL_error' called without 'return' to avoid later warnings about +** 'width' being used uninitialized.) +*/ +static int fieldargs (lua_State *L, int farg, int *width) { + lua_Integer f = luaL_checkinteger(L, farg); + lua_Integer w = luaL_optinteger(L, farg + 1, 1); + luaL_argcheck(L, 0 <= f, farg, "field cannot be negative"); + luaL_argcheck(L, 0 < w, farg + 1, "width must be positive"); + if (f + w > LUA_NBITS) + luaL_error(L, "trying to access non-existent bits"); + *width = (int)w; + return (int)f; +} + + +static int b_extract (lua_State *L) { + int w; + lua_Unsigned r = trim(checkunsigned(L, 1)); + int f = fieldargs(L, 2, &w); + r = (r >> f) & mask(w); + pushunsigned(L, r); + return 1; +} + + +static int b_replace (lua_State *L) { + int w; + lua_Unsigned r = trim(checkunsigned(L, 1)); + lua_Unsigned v = trim(checkunsigned(L, 2)); + int f = fieldargs(L, 3, &w); + lua_Unsigned m = mask(w); + r = (r & ~(m << f)) | ((v & m) << f); + pushunsigned(L, r); + return 1; +} + + +static const luaL_Reg bitlib[] = { + {"arshift", b_arshift}, + {"band", b_and}, + {"bnot", b_not}, + {"bor", b_or}, + {"bxor", b_xor}, + {"btest", b_test}, + {"extract", b_extract}, + {"lrotate", b_lrot}, + {"lshift", b_lshift}, + {"replace", b_replace}, + {"rrotate", b_rrot}, + {"rshift", b_rshift}, + {NULL, NULL} +}; + + + +LUAMOD_API int luaopen_bit32 (lua_State *L) { + luaL_newlib(L, bitlib); + return 1; +} + + +#else /* }{ */ + + +LUAMOD_API int luaopen_bit32 (lua_State *L) { + return luaL_error(L, "library 'bit32' has been deprecated"); +} + +#endif /* } */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/lstrlib.c new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/lstrlib.c --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/lstrlib.c 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/lstrlib.c 2025-04-04 03:51:09.000000000 +0200 @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.254 2016/12/22 13:08:50 roberto Exp $ +** $Id: lstrlib.c,v 1.254.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -879,7 +879,7 @@ buff[i] = toupper(uchar(buff[i])); } else if (fmt[SIZELENMOD] != 'a') - luaL_error(L, "modifiers for format '%%a'/'%%A' not implemented"); + return luaL_error(L, "modifiers for format '%%a'/'%%A' not implemented"); return n; } @@ -1199,8 +1199,8 @@ static int getnumlimit (Header *h, const char **fmt, int df) { int sz = getnum(fmt, df); if (sz > MAXINTSIZE || sz <= 0) - luaL_error(h->L, "integral size (%d) out of limits [1,%d]", - sz, MAXINTSIZE); + return luaL_error(h->L, "integral size (%d) out of limits [1,%d]", + sz, MAXINTSIZE); return sz; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/ltablib.c new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/ltablib.c --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/ltablib.c 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/ltablib.c 2025-04-04 03:51:09.000000000 +0200 @@ -1,5 +1,5 @@ /* -** $Id: ltablib.c,v 1.93 2016/02/25 19:41:54 roberto Exp $ +** $Id: ltablib.c,v 1.93.1.1 2017/04/19 17:20:42 roberto Exp $ ** Library for Table Manipulation ** See Copyright Notice in lua.h */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/lutf8lib.c new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/lutf8lib.c --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/lutf8lib.c 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/lutf8lib.c 2025-04-04 03:51:09.000000000 +0200 @@ -1,5 +1,5 @@ /* -** $Id: lutf8lib.c,v 1.16 2016/12/22 13:08:50 roberto Exp $ +** $Id: lutf8lib.c,v 1.16.1.1 2017/04/19 17:29:57 roberto Exp $ ** Standard library for UTF-8 manipulation ** See Copyright Notice in lua.h */ @@ -171,7 +171,7 @@ } else { if (iscont(s + posi)) - luaL_error(L, "initial position is a continuation byte"); + return luaL_error(L, "initial position is a continuation byte"); if (n < 0) { while (n < 0 && posi > 0) { /* move back */ do { /* find beginning of previous character */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/rockspecs/bit32-5.3.5-1.rockspec new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/rockspecs/bit32-5.3.5-1.rockspec --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/rockspecs/bit32-5.3.5-1.rockspec 1970-01-01 01:00:00.000000000 +0100 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/rockspecs/bit32-5.3.5-1.rockspec 2025-04-04 03:51:09.000000000 +0200 @@ -0,0 +1,28 @@ +package = "bit32" +version = "5.3.5-1" +source = { + url = "https://github.com/keplerproject/lua-compat-5.3/archive/v0.9.zip", + dir = "lua-compat-5.3-0.9", +} +description = { + summary = "Lua 5.2 bit manipulation library", + detailed = [[ + bit32 is the native Lua 5.2 bit manipulation library, in the version + from Lua 5.3; it is compatible with Lua 5.1, 5.2 and 5.3. + ]], + homepage = "http://www.lua.org/manual/5.2/manual.html#6.7", + license = "MIT" +} +dependencies = { + "lua >= 5.1, < 5.5" +} +build = { + type = "builtin", + modules = { + bit32 = { + sources = { "lbitlib.c" }, + defines = { "LUA_COMPAT_BITLIB" }, + incdirs = { "c-api" }, + } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/rockspecs/bit32-scm-1.rockspec new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/rockspecs/bit32-scm-1.rockspec --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/rockspecs/bit32-scm-1.rockspec 1970-01-01 01:00:00.000000000 +0100 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/rockspecs/bit32-scm-1.rockspec 2025-04-04 03:51:09.000000000 +0200 @@ -0,0 +1,28 @@ +package = "bit32" +version = "scm-1" +source = { + url = "https://github.com/keplerproject/lua-compat-5.3/archive/master.zip", + dir = "lua-compat-5.3-master", +} +description = { + summary = "Lua 5.2 bit manipulation library", + detailed = [[ + bit32 is the native Lua 5.2 bit manipulation library, in the version + from Lua 5.3; it is compatible with Lua 5.1, 5.2 and 5.3. + ]], + homepage = "http://www.lua.org/manual/5.2/manual.html#6.7", + license = "MIT" +} +dependencies = { + "lua >= 5.1, < 5.5" +} +build = { + type = "builtin", + modules = { + bit32 = { + sources = { "lbitlib.c" }, + defines = { "LUA_COMPAT_BITLIB" }, + incdirs = { "c-api" }, + } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/rockspecs/compat53-0.7-1.rockspec new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/rockspecs/compat53-0.7-1.rockspec --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/rockspecs/compat53-0.7-1.rockspec 1970-01-01 01:00:00.000000000 +0100 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/rockspecs/compat53-0.7-1.rockspec 2025-04-04 03:51:09.000000000 +0200 @@ -0,0 +1,32 @@ +package = "compat53" +version = "0.7-1" +source = { + url = "https://github.com/keplerproject/lua-compat-5.3/archive/v0.7.zip", + dir = "lua-compat-5.3-0.7", +} +description = { + summary = "Compatibility module providing Lua-5.3-style APIs for Lua 5.2 and 5.1", + detailed = [[ + This is a small module that aims to make it easier to write Lua + code in a Lua-5.3-style that runs on Lua 5.3, 5.2, and 5.1. + It does *not* make Lua 5.2 (or even 5.1) entirely compatible + with Lua 5.3, but it brings the API closer to that of Lua 5.3. + ]], + homepage = "https://github.com/keplerproject/lua-compat-5.3", + license = "MIT" +} +dependencies = { + "lua >= 5.1, < 5.4", + --"struct" -- make Roberto's struct module optional +} +build = { + type = "builtin", + modules = { + ["compat53.init"] = "compat53/init.lua", + ["compat53.module"] = "compat53/module.lua", + ["compat53.utf8"] = "lutf8lib.c", + ["compat53.table"] = "ltablib.c", + ["compat53.string"] = "lstrlib.c", + } +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/rockspecs/compat53-0.8-1.rockspec new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/rockspecs/compat53-0.8-1.rockspec --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/rockspecs/compat53-0.8-1.rockspec 1970-01-01 01:00:00.000000000 +0100 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/rockspecs/compat53-0.8-1.rockspec 2025-04-04 03:51:09.000000000 +0200 @@ -0,0 +1,32 @@ +package = "compat53" +version = "0.8-1" +source = { + url = "https://github.com/keplerproject/lua-compat-5.3/archive/v0.8.zip", + dir = "lua-compat-5.3-0.8", +} +description = { + summary = "Compatibility module providing Lua-5.3-style APIs for Lua 5.2 and 5.1", + detailed = [[ + This is a small module that aims to make it easier to write Lua + code in a Lua-5.3-style that runs on Lua 5.1+. + It does *not* make Lua 5.2 (or even 5.1) entirely compatible + with Lua 5.3, but it brings the API closer to that of Lua 5.3. + ]], + homepage = "https://github.com/keplerproject/lua-compat-5.3", + license = "MIT" +} +dependencies = { + "lua >= 5.1, < 5.5", + --"struct" -- make Roberto's struct module optional +} +build = { + type = "builtin", + modules = { + ["compat53.init"] = "compat53/init.lua", + ["compat53.module"] = "compat53/module.lua", + ["compat53.utf8"] = "lutf8lib.c", + ["compat53.table"] = "ltablib.c", + ["compat53.string"] = "lstrlib.c", + } +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/rockspecs/compat53-scm-0.rockspec new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/rockspecs/compat53-scm-0.rockspec --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/rockspecs/compat53-scm-0.rockspec 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/rockspecs/compat53-scm-0.rockspec 2025-04-04 03:51:09.000000000 +0200 @@ -8,7 +8,7 @@ summary = "Compatibility module providing Lua-5.3-style APIs for Lua 5.2 and 5.1", detailed = [[ This is a small module that aims to make it easier to write Lua - code in a Lua-5.3-style that runs on Lua 5.3, 5.2, and 5.1. + code in a Lua-5.3-style that runs on Lua 5.1+. It does *not* make Lua 5.2 (or even 5.1) entirely compatible with Lua 5.3, but it brings the API closer to that of Lua 5.3. ]], @@ -16,7 +16,7 @@ license = "MIT" } dependencies = { - "lua >= 5.1, < 5.4", + "lua >= 5.1, < 5.5", --"struct" -- make Roberto's struct module optional } build = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/tests/test-bit32.lua new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/tests/test-bit32.lua --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/tests/test-bit32.lua 1970-01-01 01:00:00.000000000 +0100 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/tests/test-bit32.lua 2025-04-04 03:51:09.000000000 +0200 @@ -0,0 +1,10 @@ +#!/usr/bin/env lua + +local bit32 = require("bit32") + + +assert(bit32.bnot(0) == 2^32-1) +assert(bit32.bnot(-1) == 0) +assert(bit32.band(1, 3, 5) == 1) +assert(bit32.bor(1, 3, 5) == 7) + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/tests/test.lua new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/tests/test.lua --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/tests/test.lua 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/tests/test.lua 2025-04-04 03:51:09.000000000 +0200 @@ -664,14 +664,12 @@ print("isinteger", mod.isinteger(math.huge)) print("isinteger", mod.isinteger(math.sqrt(-1))) - ___'' print("rotate", mod.rotate(1, 1, 2, 3, 4, 5, 6)) print("rotate", mod.rotate(-1, 1, 2, 3, 4, 5, 6)) print("rotate", mod.rotate(4, 1, 2, 3, 4, 5, 6)) print("rotate", mod.rotate(-4, 1, 2, 3, 4, 5, 6)) - ___'' print("strtonum", mod.strtonum("+123")) print("strtonum", mod.strtonum(" 123 ")) @@ -679,7 +677,6 @@ print("strtonum", mod.strtonum(" 123 abc")) print("strtonum", mod.strtonum("jkl")) - ___'' local a, b, c = mod.requiref() print("requiref", type(a), type(b), type(c), @@ -687,6 +684,34 @@ type(requiref1), type(requiref2), type(requiref3)) ___'' +local c = coroutine.wrap(function() + mod.extraspace("uvw") + print("getextraspace", mod.extraspace()) + coroutine.yield() + print("getextraspace", mod.extraspace()) + coroutine.yield() + print("getextraspace", mod.extraspace()) +end) +c() +mod.extraspace("abc") +print("getextraspace", mod.extraspace()) +c() +local d = coroutine.wrap(function() + print("getextraspace", mod.extraspace()) + mod.extraspace("xyz") + print("getextraspace", mod.extraspace()) + coroutine.yield() + print("getextraspace", mod.extraspace()) + coroutine.yield() + print("getextraspace", mod.extraspace()) +end) +d() +print("getextraspace", mod.extraspace()) +mod.extraspace("123") +c() +d() + +___'' local proxy, backend = {}, {} setmetatable(proxy, { __index = backend, __newindex = backend }) print("geti/seti", rawget(proxy, 1), rawget(backend, 1)) @@ -705,7 +730,7 @@ ___'' print("tointeger", mod.tointeger(12)) -print("tointeger", mod.tointeger(-12)) +print("tointeger", mod.tointeger(12)) print("tointeger", mod.tointeger(12.1)) print("tointeger", mod.tointeger(12.9)) print("tointeger", mod.tointeger(-12.1)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/tests/testmod.c new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/tests/testmod.c --- old/lua-ldbus-0.0+git20190816.9e176fe/vendor/compat-5.3/tests/testmod.c 2019-08-16 06:26:05.000000000 +0200 +++ new/lua-ldbus-0.0+git20250404.5cc933b/vendor/compat-5.3/tests/testmod.c 2025-04-04 03:51:09.000000000 +0200 @@ -1,5 +1,6 @@ #include <stdio.h> #include <stdlib.h> +#include <errno.h> #include "compat-5.3.h" @@ -63,6 +64,21 @@ } +#ifndef LUA_EXTRASPACE +#define LUA_EXTRASPACE (sizeof(void*)) +#endif + +static int test_getextraspace (lua_State *L) { + size_t len = 0; + char const* s = luaL_optlstring(L, 1, NULL, &len); + char* p = (char*)lua_getextraspace(L); + lua_pushstring(L, p); + if (s) + memcpy(p, s, len > LUA_EXTRASPACE-1 ? LUA_EXTRASPACE-1 : len+1); + return 1; +} + + /* additional tests for Lua5.1 */ #define NUP 3 @@ -270,6 +286,7 @@ static int test_exec (lua_State *L) { const char *cmd = luaL_checkstring(L, 1); + errno = 0; return luaL_execresult(L, system(cmd)); } @@ -307,6 +324,7 @@ { "strtonum", test_str2num }, { "requiref", test_requiref }, { "getseti", test_getseti }, + { "extraspace", test_getextraspace }, { "newproxy", test_newproxy }, { "arith", test_arith }, { "compare", test_compare },
