mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-02-23 16:51:34 +01:00
In earlier versions of Lua, registering a C library would automatically create a global variable and store the library's table in it. In recent versions of Lua, that is not the case. However, LuaXml relied on its table being accessible in a global variable called "xml". If this global variable was not defined, several functions would break, including 'load' and 'eval'. If the XML received as input contained any nodes at all, these functions would fail with an error stating: "attempt to index a nil value". The reason why LuaXml wanted to access its own table of functions was to use those functions in the metatable for each parsed XML node. Instead of that, we can set up one shared metatable and stash it in the registry. Also, remove liblua from LIBS, since Lua modules should not link directly to liblua. (Ref: https://lua-users.org/wiki/BuildingModules)