summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Vaněk <arkamar@atlas.cz>2022-07-01 15:23:28 +0200
committerSam James <sam@gentoo.org>2022-07-02 14:55:33 +0000
commit881481e001d00a730884606bfb07eebd5b130dde (patch)
tree9406b7a2186cbe668ea86107d839ce7440bd2521 /dev-db/redis
parentgames-roguelike/stone-soup: lua 5.1 only (diff)
downloadgentoo-881481e001d00a730884606bfb07eebd5b130dde.tar.gz
gentoo-881481e001d00a730884606bfb07eebd5b130dde.tar.bz2
gentoo-881481e001d00a730884606bfb07eebd5b130dde.zip
dev-db/redis: build fix for luajit-2.1
luajit-2.1 integrated few extensions from lua5.2 [1] luaL_setfuncs being one of them. The same function is implemented in bundled lua-cjson for lua5.1 but is not properly guarded for luajit-2.1. This change backports the fix [2,3] from https://github.com/openresty/lua-cjson. [1] https://github.com/LuaJIT/LuaJIT/commit/de97b9d52bbc42effeaf1180764053a912526873 [2] https://github.com/openresty/lua-cjson/commit/638ac2741a7f274979ac3fe2e1ea5fd6487702fe [3] https://github.com/openresty/lua-cjson/pull/32 Closes: https://bugs.gentoo.org/842444 Signed-off-by: Petr Vaněk <arkamar@atlas.cz> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-db/redis')
-rw-r--r--dev-db/redis/files/redis-5.0-luajit-2.1-fix.patch47
-rw-r--r--dev-db/redis/redis-5.0.14.ebuild1
-rw-r--r--dev-db/redis/redis-6.0.16.ebuild1
-rw-r--r--dev-db/redis/redis-6.2.6.ebuild1
4 files changed, 50 insertions, 0 deletions
diff --git a/dev-db/redis/files/redis-5.0-luajit-2.1-fix.patch b/dev-db/redis/files/redis-5.0-luajit-2.1-fix.patch
new file mode 100644
index 000000000000..968fc865da86
--- /dev/null
+++ b/dev-db/redis/files/redis-5.0-luajit-2.1-fix.patch
@@ -0,0 +1,47 @@
+Backported from https://github.com/openresty/lua-cjson
+
+Upstream-commit: 638ac2741a7f ("optimize: improved forward-compatibility with older versions of Lua/LuaJIT.")
+Link: https://github.com/openresty/lua-cjson/commit/638ac2741a7f274979ac3fe2e1ea5fd6487702fe
+Upstream-PR: https://github.com/openresty/lua-cjson/pull/32
+See-also: https://www.freelists.org/post/luajit/ANN-LuaJIT210beta3,3
+
+diff --git a/deps/lua/src/lua_cjson.c b/deps/lua/src/lua_cjson.c
+index c26c0d7b8..af9e4ca54 100644
+--- a/deps/lua/src/lua_cjson.c
++++ b/deps/lua/src/lua_cjson.c
+@@ -1293,11 +1293,13 @@ static int json_decode(lua_State *l)
+ /* ===== INITIALISATION ===== */
+
+ #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
+-/* Compatibility for Lua 5.1.
++/* Compatibility for Lua 5.1 and older LuaJIT.
+ *
+- * luaL_setfuncs() is used to create a module table where the functions have
+- * json_config_t as their first upvalue. Code borrowed from Lua 5.2 source. */
+-static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
++ * compat_luaL_setfuncs() is used to create a module table where the functions
++ * have json_config_t as their first upvalue. Code borrowed from Lua 5.2
++ * source's luaL_setfuncs().
++ */
++static void compat_luaL_setfuncs(lua_State *l, const luaL_Reg *reg, int nup)
+ {
+ int i;
+
+@@ -1310,6 +1312,8 @@ static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
+ }
+ lua_pop(l, nup); /* remove upvalues */
+ }
++#else
++#define compat_luaL_setfuncs(L, reg, nup) luaL_setfuncs(L, reg, nup)
+ #endif
+
+ /* Call target function in protected mode with all supplied args.
+@@ -1365,7 +1369,7 @@ static int lua_cjson_new(lua_State *l)
+
+ /* Register functions with config data as upvalue */
+ json_create_config(l);
+- luaL_setfuncs(l, reg, 1);
++ compat_luaL_setfuncs(l, reg, 1);
+
+ /* Set cjson.null */
+ lua_pushlightuserdata(l, NULL);
diff --git a/dev-db/redis/redis-5.0.14.ebuild b/dev-db/redis/redis-5.0.14.ebuild
index b12534f6948d..5064cb59f2ec 100644
--- a/dev-db/redis/redis-5.0.14.ebuild
+++ b/dev-db/redis/redis-5.0.14.ebuild
@@ -45,6 +45,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-5.0-sharedlua.patch
"${FILESDIR}"/${PN}-5.0.8-ppc-atomic.patch
"${FILESDIR}"/${PN}-sentinel-5.0-config.patch
+ "${FILESDIR}"/${PN}-5.0-luajit-2.1-fix.patch
)
src_prepare() {
diff --git a/dev-db/redis/redis-6.0.16.ebuild b/dev-db/redis/redis-6.0.16.ebuild
index 45e59b644a37..9c1f2e88c2da 100644
--- a/dev-db/redis/redis-6.0.16.ebuild
+++ b/dev-db/redis/redis-6.0.16.ebuild
@@ -60,6 +60,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-6.0.12-sharedlua.patch
"${FILESDIR}"/${PN}-5.0.8-ppc-atomic.patch
"${FILESDIR}"/${PN}-sentinel-5.0-config.patch
+ "${FILESDIR}"/${PN}-5.0-luajit-2.1-fix.patch
)
src_prepare() {
diff --git a/dev-db/redis/redis-6.2.6.ebuild b/dev-db/redis/redis-6.2.6.ebuild
index 5f9d87086347..364e49a7adb2 100644
--- a/dev-db/redis/redis-6.2.6.ebuild
+++ b/dev-db/redis/redis-6.2.6.ebuild
@@ -60,6 +60,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-6.2.1-sharedlua.patch
"${FILESDIR}"/${PN}-6.2.3-ppc-atomic.patch
"${FILESDIR}"/${PN}-sentinel-5.0-config.patch
+ "${FILESDIR}"/${PN}-5.0-luajit-2.1-fix.patch
)
src_prepare() {