summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/lua/files')
-rw-r--r--dev-lang/lua/files/5.1.4/01_all_boolean_expression.upstream.patch48
-rw-r--r--dev-lang/lua/files/5.1.4/02_all_table.upstream.patch22
-rw-r--r--dev-lang/lua/files/5.1.4/03_all_debug_getfenv.upstream.patch10
-rw-r--r--dev-lang/lua/files/5.1.4/04_all_gc_performance.upstream.patch14
-rw-r--r--dev-lang/lua/files/5.1.4/05_all_string_format.upstream.patch21
-rw-r--r--dev-lang/lua/files/5.1.4/06_all_io_read.upstream.patch15
-rw-r--r--dev-lang/lua/files/5.1.4/07_all_boolean_expression.upstream.patch30
-rw-r--r--dev-lang/lua/files/5.1.4/08_all_metatable.upstream.patch10
-rw-r--r--dev-lang/lua/files/5.1.4/09_all_prototype_collection.upstream.patch13
-rw-r--r--dev-lang/lua/files/5.1/0001-extern_C.patch20
-rw-r--r--dev-lang/lua/files/5.1/0002-Fix-stack-overflow-in-vararg-functions.patch17
-rw-r--r--dev-lang/lua/files/5.2.0/01_all_memory_hoarding.upstream.patch49
-rw-r--r--dev-lang/lua/files/5.2.0/02_all_hex_number_handling.upstream.patch26
-rw-r--r--dev-lang/lua/files/configure.in5
-rw-r--r--dev-lang/lua/files/lua-5.1-make-r1.patch66
-rw-r--r--dev-lang/lua/files/lua-5.1-make-r2.patch97
-rw-r--r--dev-lang/lua/files/lua-5.1-make_static-r1.patch12
-rw-r--r--dev-lang/lua/files/lua-5.1-module_paths.patch30
-rw-r--r--dev-lang/lua/files/lua-5.1-readline.patch10
-rw-r--r--dev-lang/lua/files/lua-5.1.4-deprecated.patch46
-rw-r--r--dev-lang/lua/files/lua-5.1.5-disable-deprecated.patch59
-rw-r--r--dev-lang/lua/files/lua-5.1.5-fix_vararg_calls.patch12
-rw-r--r--dev-lang/lua/files/lua-5.1.5-gentoo-build.patch118
-rw-r--r--dev-lang/lua/files/lua-5.1.5-make.patch97
-rw-r--r--dev-lang/lua/files/lua-5.1.5-readline.patch17
-rw-r--r--dev-lang/lua/files/lua-5.2-make-r1.patch75
-rw-r--r--dev-lang/lua/files/lua-5.2.4-make.patch75
-rw-r--r--dev-lang/lua/files/lua-5.3-make-r1.patch91
-rw-r--r--dev-lang/lua/files/lua-5.3.6-make.patch91
-rw-r--r--dev-lang/lua/files/lua-5.4-makefiles.patch99
-rw-r--r--dev-lang/lua/files/lua-5.4.2-make.patch99
-rw-r--r--dev-lang/lua/files/lua-5.4.6-sparc-tests.patch44
-rw-r--r--dev-lang/lua/files/lua.pc31
33 files changed, 81 insertions, 1388 deletions
diff --git a/dev-lang/lua/files/5.1.4/01_all_boolean_expression.upstream.patch b/dev-lang/lua/files/5.1.4/01_all_boolean_expression.upstream.patch
deleted file mode 100644
index f04eb85075a2..000000000000
--- a/dev-lang/lua/files/5.1.4/01_all_boolean_expression.upstream.patch
+++ /dev/null
@@ -1,48 +0,0 @@
---- lua-5.1.4.orig/src/lcode.c 2007/12/28 15:32:23 2.25.1.3
-+++ lua-5.1.4/src/lcode.c 2009/06/15 14:07:34
-@@ -544,15 +544,18 @@
- pc = NO_JUMP; /* always true; do nothing */
- break;
- }
-- case VFALSE: {
-- pc = luaK_jump(fs); /* always jump */
-- break;
-- }
- case VJMP: {
- invertjump(fs, e);
- pc = e->u.s.info;
- break;
- }
-+ case VFALSE: {
-+ if (!hasjumps(e)) {
-+ pc = luaK_jump(fs); /* always jump */
-+ break;
-+ }
-+ /* else go through */
-+ }
- default: {
- pc = jumponcond(fs, e, 0);
- break;
-@@ -572,14 +575,17 @@
- pc = NO_JUMP; /* always false; do nothing */
- break;
- }
-- case VTRUE: {
-- pc = luaK_jump(fs); /* always jump */
-- break;
-- }
- case VJMP: {
- pc = e->u.s.info;
- break;
- }
-+ case VTRUE: {
-+ if (!hasjumps(e)) {
-+ pc = luaK_jump(fs); /* always jump */
-+ break;
-+ }
-+ /* else go through */
-+ }
- default: {
- pc = jumponcond(fs, e, 1);
- break;
-
diff --git a/dev-lang/lua/files/5.1.4/02_all_table.upstream.patch b/dev-lang/lua/files/5.1.4/02_all_table.upstream.patch
deleted file mode 100644
index 9ffc1bb28843..000000000000
--- a/dev-lang/lua/files/5.1.4/02_all_table.upstream.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- lua-5.1.4.orig/src/lvm.c 2007/12/28 15:32:23 2.63.1.3
-+++ lua-5.1.4/src/lvm.c 2009/07/01 20:36:59
-@@ -133,6 +133,7 @@
-
- void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
- int loop;
-+ TValue temp;
- for (loop = 0; loop < MAXTAGLOOP; loop++) {
- const TValue *tm;
- if (ttistable(t)) { /* `t' is a table? */
-@@ -152,7 +153,9 @@
- callTM(L, tm, t, key, val);
- return;
- }
-- t = tm; /* else repeat with `tm' */
-+ /* else repeat with `tm' */
-+ setobj(L, &temp, tm); /* avoid pointing inside table (may rehash) */
-+ t = &temp;
- }
- luaG_runerror(L, "loop in settable");
- }
-
diff --git a/dev-lang/lua/files/5.1.4/03_all_debug_getfenv.upstream.patch b/dev-lang/lua/files/5.1.4/03_all_debug_getfenv.upstream.patch
deleted file mode 100644
index fce4d47db8f4..000000000000
--- a/dev-lang/lua/files/5.1.4/03_all_debug_getfenv.upstream.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- lua-5.1.4.orig/src/ldblib.c 2007/12/28 15:32:23 2.63.1.3
-+++ lua-5.1.4/src/ldblib.c 2010/02/23 12:36:59
-@@ -45,6 +45,7 @@
-
-
- static int db_getfenv (lua_State *L) {
-+ luaL_checkany(L, 1);
- lua_getfenv(L, 1);
- return 1;
- }
diff --git a/dev-lang/lua/files/5.1.4/04_all_gc_performance.upstream.patch b/dev-lang/lua/files/5.1.4/04_all_gc_performance.upstream.patch
deleted file mode 100644
index 3c78525b0b2f..000000000000
--- a/dev-lang/lua/files/5.1.4/04_all_gc_performance.upstream.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- lua-5.1.4.orig/src/llex.c 2007/12/28 15:32:23 2.63.1.3
-+++ lua-5.1.4/src/llex.c 2010/02/23 12:36:59
-@@ -118,8 +118,10 @@
- lua_State *L = ls->L;
- TString *ts = luaS_newlstr(L, str, l);
- TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */
-- if (ttisnil(o))
-+ if (ttisnil(o)) {
- setbvalue(o, 1); /* make sure `str' will not be collected */
-+ luaC_checkGC(L);
-+ }
- return ts;
- }
-
diff --git a/dev-lang/lua/files/5.1.4/05_all_string_format.upstream.patch b/dev-lang/lua/files/5.1.4/05_all_string_format.upstream.patch
deleted file mode 100644
index 5127507df9f6..000000000000
--- a/dev-lang/lua/files/5.1.4/05_all_string_format.upstream.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- lua-5.1.4.orig/src/lstrlib.c 2008/07/11 17:27:21 1.132.1.4
-+++ lua-5.1.4/src/lstrlib.c 2010/05/14 15:12:53
-@@ -754,6 +754,7 @@
-
-
- static int str_format (lua_State *L) {
-+ int top = lua_gettop(L);
- int arg = 1;
- size_t sfl;
- const char *strfrmt = luaL_checklstring(L, arg, &sfl);
-@@ -768,7 +769,8 @@
- else { /* format item */
- char form[MAX_FORMAT]; /* to store the format (`%...') */
- char buff[MAX_ITEM]; /* to store the formatted item */
-- arg++;
-+ if (++arg > top)
-+ luaL_argerror(L, arg, "no value");
- strfrmt = scanformat(L, strfrmt, form);
- switch (*strfrmt++) {
- case 'c': {
-
diff --git a/dev-lang/lua/files/5.1.4/06_all_io_read.upstream.patch b/dev-lang/lua/files/5.1.4/06_all_io_read.upstream.patch
deleted file mode 100644
index 94634c591404..000000000000
--- a/dev-lang/lua/files/5.1.4/06_all_io_read.upstream.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- lua-5.1.4.orig/src/liolib.c 2008/01/18 17:47:43 2.73.1.3
-+++ lua-5.1.4/src/liolib.c 2010/05/14 15:29:29
-@@ -276,7 +276,10 @@
- lua_pushnumber(L, d);
- return 1;
- }
-- else return 0; /* read fails */
-+ else {
-+ lua_pushnil(L); /* "result" to be removed */
-+ return 0; /* read fails */
-+ }
- }
-
-
-
diff --git a/dev-lang/lua/files/5.1.4/07_all_boolean_expression.upstream.patch b/dev-lang/lua/files/5.1.4/07_all_boolean_expression.upstream.patch
deleted file mode 100644
index 956e966817d4..000000000000
--- a/dev-lang/lua/files/5.1.4/07_all_boolean_expression.upstream.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- lua-5.1.4.orig/src/lcode.c 2007/12/28 15:32:23 2.25.1.3
-+++ lua-5.1.4/src/lcode.c 2009/06/15 14:07:34
-@@ -549,13 +549,6 @@
- pc = e->u.s.info;
- break;
- }
-- case VFALSE: {
-- if (!hasjumps(e)) {
-- pc = luaK_jump(fs); /* always jump */
-- break;
-- }
-- /* else go through */
-- }
- default: {
- pc = jumponcond(fs, e, 0);
- break;
-@@ -579,13 +572,6 @@
- pc = e->u.s.info;
- break;
- }
-- case VTRUE: {
-- if (!hasjumps(e)) {
-- pc = luaK_jump(fs); /* always jump */
-- break;
-- }
-- /* else go through */
-- }
- default: {
- pc = jumponcond(fs, e, 1);
- break;
diff --git a/dev-lang/lua/files/5.1.4/08_all_metatable.upstream.patch b/dev-lang/lua/files/5.1.4/08_all_metatable.upstream.patch
deleted file mode 100644
index b74bafbebe41..000000000000
--- a/dev-lang/lua/files/5.1.4/08_all_metatable.upstream.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- lua-5.1.4.orig/src/lvm.c 2009/07/01 21:10:33 2.63.1.4
-+++ lua-5.1.4/src/lvm.c 2011/08/17 20:36:28
-@@ -142,6 +142,7 @@
- if (!ttisnil(oldval) || /* result is no nil? */
- (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */
- setobj2t(L, oldval, val);
-+ h->flags = 0;
- luaC_barriert(L, h, val);
- return;
- }
diff --git a/dev-lang/lua/files/5.1.4/09_all_prototype_collection.upstream.patch b/dev-lang/lua/files/5.1.4/09_all_prototype_collection.upstream.patch
deleted file mode 100644
index 000f78ccc7da..000000000000
--- a/dev-lang/lua/files/5.1.4/09_all_prototype_collection.upstream.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- lua-5.1.4.orig/src/lparser.c 2007/12/28 15:32:23 2.42.1.3
-+++ lua-5.1.4/src/lparser.c 2011/10/17 13:10:43
-@@ -374,9 +374,9 @@
- lua_assert(luaG_checkcode(f));
- lua_assert(fs->bl == NULL);
- ls->fs = fs->prev;
-- L->top -= 2; /* remove table and prototype from the stack */
- /* last token read was anchored in defunct function; must reanchor it */
- if (fs) anchor_token(ls);
-+ L->top -= 2; /* remove table and prototype from the stack */
- }
-
-
diff --git a/dev-lang/lua/files/5.1/0001-extern_C.patch b/dev-lang/lua/files/5.1/0001-extern_C.patch
new file mode 100644
index 000000000000..6e4f711f0ecd
--- /dev/null
+++ b/dev-lang/lua/files/5.1/0001-extern_C.patch
@@ -0,0 +1,20 @@
+https://salsa.debian.org/lua-team/lua5.1/-/blob/master/debian/patches/0003-extern_C.patch
+
+From: "John V. Belmonte" <jbelmonte@debian.org>
+Date: Tue, 26 Aug 2014 16:20:49 +0200
+Subject: extern_C
+
+--- a/src/luaconf.h.in
++++ b/src/luaconf.h.in
+@@ -168,7 +168,11 @@
+
+ #else
+
++#ifdef __cplusplus
++#define LUA_API extern "C"
++#else
+ #define LUA_API extern
++#endif
+
+ #endif
+
diff --git a/dev-lang/lua/files/5.1/0002-Fix-stack-overflow-in-vararg-functions.patch b/dev-lang/lua/files/5.1/0002-Fix-stack-overflow-in-vararg-functions.patch
new file mode 100644
index 000000000000..2bb5657b4d45
--- /dev/null
+++ b/dev-lang/lua/files/5.1/0002-Fix-stack-overflow-in-vararg-functions.patch
@@ -0,0 +1,17 @@
+https://salsa.debian.org/lua-team/lua5.1/-/blob/master/debian/patches/0004-Fix-stack-overflow-in-vararg-functions.patch
+
+From: Enrico Tassi <gareuselesinge@debian.org>
+Date: Tue, 26 Aug 2014 16:20:55 +0200
+Subject: Fix stack overflow in vararg functions (CVE-2014-5461)
+
+--- a/src/ldo.c
++++ b/src/ldo.c
+@@ -274,7 +274,7 @@ int luaD_precall (lua_State *L, StkId func, int nresults) {
+ CallInfo *ci;
+ StkId st, base;
+ Proto *p = cl->p;
+- luaD_checkstack(L, p->maxstacksize);
++ luaD_checkstack(L, p->maxstacksize + p->numparams);
+ func = restorestack(L, funcr);
+ if (!p->is_vararg) { /* no varargs? */
+ base = func + 1;
diff --git a/dev-lang/lua/files/5.2.0/01_all_memory_hoarding.upstream.patch b/dev-lang/lua/files/5.2.0/01_all_memory_hoarding.upstream.patch
deleted file mode 100644
index 9fda24ad6609..000000000000
--- a/dev-lang/lua/files/5.2.0/01_all_memory_hoarding.upstream.patch
+++ /dev/null
@@ -1,49 +0,0 @@
---- lua-5.2.0.orig/src/ldblib.c 2007/12/28 15:32:23 2.25.1.3
-+++ lua-5.2.0/src/ldblib.c 2009/06/15 14:07:34
-@@ -253,14 +253,15 @@
- }
-
-
--#define gethooktable(L) luaL_getsubtable(L, LUA_REGISTRYINDEX, HOOKKEY);
-+#define gethooktable(L) luaL_getsubtable(L, LUA_REGISTRYINDEX, HOOKKEY)
-
-
- static void hookf (lua_State *L, lua_Debug *ar) {
- static const char *const hooknames[] =
- {"call", "return", "line", "count", "tail call"};
- gethooktable(L);
-- lua_rawgetp(L, -1, L);
-+ lua_pushthread(L);
-+ lua_rawget(L, -2);
- if (lua_isfunction(L, -1)) {
- lua_pushstring(L, hooknames[(int)ar->event]);
- if (ar->currentline >= 0)
-@@ -306,10 +307,15 @@
- count = luaL_optint(L, arg+3, 0);
- func = hookf; mask = makemask(smask, count);
- }
-- gethooktable(L);
-+ if (gethooktable(L) == 0) { /* creating hook table? */
-+ lua_pushstring(L, "k");
-+ lua_setfield(L, -2, "__mode"); /** hooktable.__mode = "k" */
-+ lua_pushvalue(L, -1);
-+ lua_setmetatable(L, -2); /* setmetatable(hooktable) = hooktable */
-+ }
-+ lua_pushthread(L1); lua_xmove(L1, L, 1);
- lua_pushvalue(L, arg+1);
-- lua_rawsetp(L, -2, L1); /* set new hook */
-- lua_pop(L, 1); /* remove hook table */
-+ lua_rawset(L, -3); /* set new hook */
- lua_sethook(L1, func, mask, count); /* set hooks */
- return 0;
- }
-@@ -325,7 +331,8 @@
- lua_pushliteral(L, "external hook");
- else {
- gethooktable(L);
-- lua_rawgetp(L, -1, L1); /* get hook */
-+ lua_pushthread(L1); lua_xmove(L1, L, 1);
-+ lua_rawget(L, -2); /* get hook */
- lua_remove(L, -2); /* remove hook table */
- }
- lua_pushstring(L, unmakemask(mask, buff));
diff --git a/dev-lang/lua/files/5.2.0/02_all_hex_number_handling.upstream.patch b/dev-lang/lua/files/5.2.0/02_all_hex_number_handling.upstream.patch
deleted file mode 100644
index 26519e378e68..000000000000
--- a/dev-lang/lua/files/5.2.0/02_all_hex_number_handling.upstream.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- lua-5.2.0.orig/src/llex.c 2007/12/28 15:32:23 2.25.1.3
-+++ lua-5.2.0/src/llex.c 2009/06/15 14:07:34
-@@ -223,12 +223,19 @@
-
- /* LUA_NUMBER */
- static void read_numeral (LexState *ls, SemInfo *seminfo) {
-+ const char *expo = "Ee";
-+ int first = ls->current;
- lua_assert(lisdigit(ls->current));
-- do {
-- save_and_next(ls);
-- if (check_next(ls, "EePp")) /* exponent part? */
-+ save_and_next(ls);
-+ if (first == '0' && check_next(ls, "Xx")) /* hexadecimal? */
-+ expo = "Pp";
-+ for (;;) {
-+ if (check_next(ls, expo)) /* exponent part? */
- check_next(ls, "+-"); /* optional exponent sign */
-- } while (lislalnum(ls->current) || ls->current == '.');
-+ if (lisxdigit(ls->current) || ls->current == '.')
-+ save_and_next(ls);
-+ else break;
-+ }
- save(ls, '\0');
- buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */
- if (!buff2d(ls->buff, &seminfo->r)) /* format error? */
diff --git a/dev-lang/lua/files/configure.in b/dev-lang/lua/files/configure.in
deleted file mode 100644
index e4ba8164bbb5..000000000000
--- a/dev-lang/lua/files/configure.in
+++ /dev/null
@@ -1,5 +0,0 @@
-top_buildir=.
-
-AC_INIT(src/luaconf.h)
-AC_PROG_LIBTOOL
-AC_OUTPUT()
diff --git a/dev-lang/lua/files/lua-5.1-make-r1.patch b/dev-lang/lua/files/lua-5.1-make-r1.patch
deleted file mode 100644
index 8eecbdd40268..000000000000
--- a/dev-lang/lua/files/lua-5.1-make-r1.patch
+++ /dev/null
@@ -1,66 +0,0 @@
---- lua-5.1.1.orig/Makefile 2006-06-02 12:53:38.000000000 +0200
-+++ lua-5.1.1/Makefile 2006-11-16 02:16:53.000000000 +0100
-@@ -127,3 +127,21 @@
- .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho newer
-
- # (end of Makefile)
-+
-+# Use libtool for binary installs, etc.
-+
-+export V
-+export LIBTOOL = libtool --quiet --tag=CC
-+# See libtool manual about how to set this
-+
-+gentoo_clean:
-+ cd src; $(MAKE) $@
-+
-+gentoo_test: gentoo_linux
-+ test/lua.static test/hello.lua
-+
-+gentoo_install:
-+ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua luac $(INSTALL_BIN)
-+ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua.la $(INSTALL_LIB)
---- lua-5.1.1.orig/src/Makefile 2006-03-22 01:41:49.000000000 +0100
-+++ lua-5.1.1/src/Makefile 2006-11-16 02:10:27.000000000 +0100
-@@ -54,1 +54,1 @@
--$(LUA_T): $(LUA_O) $(LUA_A)
-+origin$(LUA_T): $(LUA_O) $(LUA_A)
-@@ -57,1 +57,1 @@
--$(LUAC_T): $(LUAC_O) $(LUA_A)
-+origin$(LUAC_T): $(LUAC_O) $(LUA_A)
-@@ -176,3 +176,33 @@
- ltm.h lzio.h lmem.h lopcodes.h lundump.h
-
- # (end of Makefile)
-+
-+export LIBTOOL = libtool --quiet --tag=CC
-+export LIB_VERSION = 6:1:1
-+
-+# The following rules use libtool for compiling and linking in order to
-+# provide shared library support.
-+
-+LIB_NAME = liblua.la
-+LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
-+
-+%.lo %.o: %.c
-+ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-+
-+$(LIB_NAME): $(LIB_OBJS)
-+ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
-+ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
-+
-+$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
-+
-+lua_test: $(LUA_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
-+
-+$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
-+
-+gentoo_clean:
-+ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua luac
-+
-+gentoo_all: $(LIB_NAME) $(LUA_T) lua_test $(LUAC_T)
diff --git a/dev-lang/lua/files/lua-5.1-make-r2.patch b/dev-lang/lua/files/lua-5.1-make-r2.patch
deleted file mode 100644
index 2905a62d0f9e..000000000000
--- a/dev-lang/lua/files/lua-5.1-make-r2.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-diff -ru lua-5.1.5.orig/Makefile lua-5.1.5/Makefile
---- lua-5.1.5.orig/Makefile 2014-04-15 17:43:34.845435031 +0200
-+++ lua-5.1.5/Makefile 2014-04-15 19:05:08.669304987 +0200
-@@ -11,7 +11,7 @@
- # so take care if INSTALL_TOP is not an absolute path.
- INSTALL_TOP= /usr/local
- INSTALL_BIN= $(INSTALL_TOP)/bin
--INSTALL_INC= $(INSTALL_TOP)/include
-+INSTALL_INC= $(INSTALL_TOP)/include/lua$V
- INSTALL_LIB= $(INSTALL_TOP)/lib
- INSTALL_MAN= $(INSTALL_TOP)/man/man1
- #
-@@ -126,3 +126,21 @@
- .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho
-
- # (end of Makefile)
-+
-+# Use libtool for binary installs, etc.
-+
-+export V
-+export LIBTOOL = libtool --quiet --tag=CC
-+# See libtool manual about how to set this
-+
-+gentoo_clean:
-+ cd src; $(MAKE) $@
-+
-+gentoo_test: gentoo_linux
-+ test/lua.static test/hello.lua
-+
-+gentoo_install:
-+ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$V luac$V $(INSTALL_BIN)
-+ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$V.la $(INSTALL_LIB)
-diff -ru lua-5.1.5.orig/src/Makefile lua-5.1.5/src/Makefile
---- lua-5.1.5.orig/src/Makefile 2014-04-15 17:43:34.844435031 +0200
-+++ lua-5.1.5/src/Makefile 2014-04-15 18:07:21.427397122 +0200
-@@ -29,10 +29,10 @@
- LIB_O= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \
- lstrlib.o loadlib.o linit.o
-
--LUA_T= lua
-+LUA_T= lua$V
- LUA_O= lua.o
-
--LUAC_T= luac
-+LUAC_T= luac$V
- LUAC_O= luac.o print.o
-
- ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
-@@ -51,10 +51,10 @@
- $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
- $(RANLIB) $@
-
--$(LUA_T): $(LUA_O) $(LUA_A)
-+origin$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
-
--$(LUAC_T): $(LUAC_O) $(LUA_A)
-+origin$(LUAC_T): $(LUAC_O) $(LUA_A)
- $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
-
- clean:
-@@ -180,3 +180,33 @@
- ltm.h lzio.h lmem.h lopcodes.h lundump.h
-
- # (end of Makefile)
-+
-+export LIBTOOL = libtool --tag=CC
-+export LIB_VERSION = 5:1:5
-+
-+# The following rules use libtool for compiling and linking in order to
-+# provide shared library support.
-+
-+LIB_NAME = liblua$V.la
-+LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
-+
-+%.lo %.o: %.c
-+ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-+
-+$(LIB_NAME): $(LIB_OBJS)
-+ $(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
-+ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
-+
-+$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
-+
-+lua_test: $(LUA_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
-+
-+$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
-+
-+gentoo_clean:
-+ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$V luac$V
-+
-+gentoo_all: $(LIB_NAME) $(LUA_T) lua_test $(LUAC_T)
diff --git a/dev-lang/lua/files/lua-5.1-make_static-r1.patch b/dev-lang/lua/files/lua-5.1-make_static-r1.patch
deleted file mode 100644
index e5fdc3a6bfa1..000000000000
--- a/dev-lang/lua/files/lua-5.1-make_static-r1.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ru lua-5.1.1.orig/src/Makefile lua-5.1.1/src/Makefile
---- lua-5.1.1.orig/src/Makefile 2006-11-21 07:19:31 +0000
-+++ lua-5.1.1/src/Makefile 2006-11-21 07:19:52 +0000
-@@ -196,7 +196,7 @@
- -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
-
- $(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
-- $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
-+ $(LIBTOOL) --mode=link $(CC) -static -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
-
- $(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
- $(LIBTOOL) --mode=link $(CC) -static -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
diff --git a/dev-lang/lua/files/lua-5.1-module_paths.patch b/dev-lang/lua/files/lua-5.1-module_paths.patch
deleted file mode 100644
index 29ac4c3bf4bd..000000000000
--- a/dev-lang/lua/files/lua-5.1-module_paths.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## src_luaconf.h.dpatch by John V. Belmonte <jbelmonte@debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Set Lua's default PATH and CPATH.
-
-@DPATCH@
-diff -urNad trunk~/src/luaconf.h trunk/src/luaconf.h
---- trunk~/src/luaconf.h 2006-02-10 12:44:06.000000000 -0500
-+++ trunk/src/luaconf.h 2006-02-17 21:32:55.000000000 -0500
-@@ -83,13 +83,17 @@
-
- #else
- #define LUA_ROOT "/usr/local/"
-+#define LUA_ROOT2 "/usr/"
- #define LUA_LDIR LUA_ROOT "share/lua/5.1/"
-+#define LUA_LDIR2 LUA_ROOT2 "share/lua/5.1/"
- #define LUA_CDIR LUA_ROOT "lib/lua/5.1/"
-+#define LUA_CDIR2 LUA_ROOT2 "lib/lua/5.1/"
- #define LUA_PATH_DEFAULT \
- "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
-- LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua"
-+ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \
-+ LUA_LDIR2"?.lua;" LUA_LDIR2"?/init.lua"
- #define LUA_CPATH_DEFAULT \
-- "./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
-+ "./?.so;" LUA_CDIR"?.so;" LUA_CDIR2"?.so;" LUA_CDIR"loadall.so"
- #endif
-
-
diff --git a/dev-lang/lua/files/lua-5.1-readline.patch b/dev-lang/lua/files/lua-5.1-readline.patch
deleted file mode 100644
index f144861efb6b..000000000000
--- a/dev-lang/lua/files/lua-5.1-readline.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- lua-5.1.1.orig/src/luaconf.h 2006-04-10 20:27:23.000000000 +0200
-+++ lua-5.1.1/src/luaconf.h 2006-11-15 14:53:07.000000000 +0100
-@@ -36,7 +36,6 @@
- #if defined(LUA_USE_LINUX)
- #define LUA_USE_POSIX
- #define LUA_USE_DLOPEN /* needs an extra library: -ldl */
--#define LUA_USE_READLINE /* needs some extra libraries */
- #endif
-
- #if defined(LUA_USE_MACOSX)
diff --git a/dev-lang/lua/files/lua-5.1.4-deprecated.patch b/dev-lang/lua/files/lua-5.1.4-deprecated.patch
deleted file mode 100644
index a88a991d053e..000000000000
--- a/dev-lang/lua/files/lua-5.1.4-deprecated.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-diff -rdu lua-5.1.3.orig/src/luaconf.h lua-5.1.3/src/luaconf.h
---- lua-5.1.3.orig/src/luaconf.h 2008-02-12 17:00:03.000000000 +0000
-+++ lua-5.1.3/src/luaconf.h 2008-02-12 17:07:55.000000000 +0000
-@@ -340,14 +340,14 @@
- ** CHANGE it to undefined as soon as your programs use only '...' to
- ** access vararg parameters (instead of the old 'arg' table).
- */
--#define LUA_COMPAT_VARARG
-+#undef LUA_COMPAT_VARARG
-
- /*
- @@ LUA_COMPAT_MOD controls compatibility with old math.mod function.
- ** CHANGE it to undefined as soon as your programs use 'math.fmod' or
- ** the new '%' operator instead of 'math.mod'.
- */
--#define LUA_COMPAT_MOD
-+#undef LUA_COMPAT_MOD
-
- /*
- @@ LUA_COMPAT_LSTR controls compatibility with old long string nesting
-@@ -355,14 +355,14 @@
- ** CHANGE it to 2 if you want the old behaviour, or undefine it to turn
- ** off the advisory error when nesting [[...]].
- */
--#define LUA_COMPAT_LSTR 1
-+#undef LUA_COMPAT_LSTR
-
- /*
- @@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.
- ** CHANGE it to undefined as soon as you rename 'string.gfind' to
- ** 'string.gmatch'.
- */
--#define LUA_COMPAT_GFIND
-+#undef LUA_COMPAT_GFIND
-
- /*
- @@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib'
-@@ -370,7 +370,7 @@
- ** CHANGE it to undefined as soon as you replace to 'luaL_register'
- ** your uses of 'luaL_openlib'
- */
--#define LUA_COMPAT_OPENLIB
-+#undef LUA_COMPAT_OPENLIB
-
-
-
diff --git a/dev-lang/lua/files/lua-5.1.5-disable-deprecated.patch b/dev-lang/lua/files/lua-5.1.5-disable-deprecated.patch
deleted file mode 100644
index d1d7fb10115f..000000000000
--- a/dev-lang/lua/files/lua-5.1.5-disable-deprecated.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-diff -rdu old/src/luaconf.h new/src/luaconf.h
---- old/src/luaconf.h 2008-02-12 17:00:03.000000000 +0000
-+++ new/src/luaconf.h 2008-02-12 17:07:55.000000000 +0000
-@@ -340,14 +340,14 @@
- ** CHANGE it to undefined as soon as your programs use only '...' to
- ** access vararg parameters (instead of the old 'arg' table).
- */
--#define LUA_COMPAT_VARARG
-+#undef LUA_COMPAT_VARARG
-
- /*
- @@ LUA_COMPAT_MOD controls compatibility with old math.mod function.
- ** CHANGE it to undefined as soon as your programs use 'math.fmod' or
- ** the new '%' operator instead of 'math.mod'.
- */
--#define LUA_COMPAT_MOD
-+#undef LUA_COMPAT_MOD
-
- /*
- @@ LUA_COMPAT_LSTR controls compatibility with old long string nesting
-@@ -355,14 +355,14 @@
- ** CHANGE it to 2 if you want the old behaviour, or undefine it to turn
- ** off the advisory error when nesting [[...]].
- */
--#define LUA_COMPAT_LSTR 1
-+#undef LUA_COMPAT_LSTR
-
- /*
- @@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name.
- ** CHANGE it to undefined as soon as you rename 'string.gfind' to
- ** 'string.gmatch'.
- */
--#define LUA_COMPAT_GFIND
-+#undef LUA_COMPAT_GFIND
-
- /*
- @@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib'
-@@ -370,7 +370,7 @@
- ** CHANGE it to undefined as soon as you replace to 'luaL_register'
- ** your uses of 'luaL_openlib'
- */
--#define LUA_COMPAT_OPENLIB
-+#undef LUA_COMPAT_OPENLIB
-
-
-
-diff -rdu old/test/sieve.lua new/test/sieve.lua
-Rename deprecated functions in test scripts
---- old/test/sieve.lua~ 2002-10-31 03:52:58.000000000 +0100
-+++ new/test/sieve.lua 2008-02-20 17:44:22.468281121 +0100
-@@ -14,7 +14,7 @@
- while 1 do
- local n = g()
- if n == nil then return end
-- if math.mod(n, p) ~= 0 then coroutine.yield(n) end
-+ if math.fmod(n, p) ~= 0 then coroutine.yield(n) end
- end
- end)
- end
diff --git a/dev-lang/lua/files/lua-5.1.5-fix_vararg_calls.patch b/dev-lang/lua/files/lua-5.1.5-fix_vararg_calls.patch
deleted file mode 100644
index cec818203360..000000000000
--- a/dev-lang/lua/files/lua-5.1.5-fix_vararg_calls.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -uNr lua-5.1.5.orig/src/ldo.c lua-5.1.5/src/ldo.c
---- lua-5.1.5.orig/src/ldo.c 2016-11-28 20:04:13.177047928 +0100
-+++ lua-5.1.5/src/ldo.c 2016-11-28 20:07:15.170432525 +0100
-@@ -274,7 +274,7 @@
- CallInfo *ci;
- StkId st, base;
- Proto *p = cl->p;
-- luaD_checkstack(L, p->maxstacksize);
-+ luaD_checkstack(L, p->maxstacksize + p->numparams);
- func = restorestack(L, funcr);
- if (!p->is_vararg) { /* no varargs? */
- base = func + 1;
diff --git a/dev-lang/lua/files/lua-5.1.5-gentoo-build.patch b/dev-lang/lua/files/lua-5.1.5-gentoo-build.patch
deleted file mode 100644
index 62c4ed33648d..000000000000
--- a/dev-lang/lua/files/lua-5.1.5-gentoo-build.patch
+++ /dev/null
@@ -1,118 +0,0 @@
---- old/Makefile 2012-02-10 10:50:23.000000000 +0100
-+++ new/Makefile 2019-07-12 12:00:30.807725876 +0200
-@@ -22,7 +22,8 @@
-
- # How to install. If your install program does not support "-p", then you
- # may have to run ranlib on the installed liblua.a (do "make ranlib").
--INSTALL= install -p
-+INSTALL?= install -p
-+INSTALL_LINK= ln -s
- INSTALL_EXEC= $(INSTALL) -m 0755
- INSTALL_DATA= $(INSTALL) -m 0644
- #
-@@ -33,7 +34,7 @@
-
- # Utilities.
- MKDIR= mkdir -p
--RANLIB= ranlib
-+RANLIB?= ranlib
-
- # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
-
-@@ -47,13 +48,17 @@
- TO_MAN= lua.1 luac.1
-
- # Lua version and release.
-+M= 5
- V= 5.1
- R= 5.1.5
-
-+# Export to sub-make
-+export M R
-+
- all: $(PLAT)
-
- $(PLATS) clean:
-- cd src && $(MAKE) $@
-+ cd src && $(MKDIR) .libs && $(MAKE) $@
-
- test: dummy
- src/lua test/hello.lua
-@@ -61,6 +66,8 @@
- install: dummy
- cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
- cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
-+ cd src && $(INSTALL_EXEC) $(TO_LIB:.a=.so.$(R)) $(INSTALL_LIB)
-+ cd src && $(INSTALL_LINK) $(TO_LIB:.a=.so.$(R)) $(INSTALL_LIB)/$(TO_LIB:.a=.so.$(M))
- cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
- cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
- cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
---- old/src/Makefile 2012-02-13 21:41:22.000000000 +0100
-+++ new/src/Makefile 2019-07-12 11:31:02.945290602 +0200
-@@ -7,12 +7,14 @@
- # Your platform. See PLATS for possible values.
- PLAT= none
-
--CC= gcc
--CFLAGS= -O2 -Wall $(MYCFLAGS)
--AR= ar rcu
--RANLIB= ranlib
-+CC?= gcc
-+CFLAGS?= -O2 -Wall $(MYCFLAGS)
-+SOFLAGS= -shared -fPIC -DPIC -Wl,-O1 -Wl,--as-needed -Wl,-soname -Wl,$(LUA_A:.a=.so.$(M)) $(MYLDFLAGS)
-+AR?= ar
-+ARFLAGS?= rcu
-+RANLIB?= ranlib
- RM= rm -f
--LIBS= -lm $(MYLIBS)
-+LIBS?= -lm $(MYLIBS)
-
- MYCFLAGS=
- MYLDFLAGS=
-@@ -35,8 +37,11 @@
- LUAC_T= luac
- LUAC_O= luac.o print.o
-
--ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
--ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
-+LUAS_T= $(LUA_A:.a=.so.$(R))
-+LUAS_O= $(addprefix .libs/,$(CORE_O) $(LIB_O) $(LUA_O))
-+
-+ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O) $(LUAS_O)
-+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUAS_T)
- ALL_A= $(LUA_A)
-
- default: $(PLAT)
-@@ -48,9 +53,12 @@
- a: $(ALL_A)
-
- $(LUA_A): $(CORE_O) $(LIB_O)
-- $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
-+ $(AR) $(ARFLAGS) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
- $(RANLIB) $@
-
-+$(LUAS_T): $(LUAS_O)
-+ $(CC) -o $@ $(SOFLAGS) $(LUAS_O) $(LIBS)
-+
- $(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
-
-@@ -67,7 +75,7 @@
- @echo "PLAT = $(PLAT)"
- @echo "CC = $(CC)"
- @echo "CFLAGS = $(CFLAGS)"
-- @echo "AR = $(AR)"
-+ @echo "AR = $(AR) $(ARFLAGS)"
- @echo "RANLIB = $(RANLIB)"
- @echo "RM = $(RM)"
- @echo "MYCFLAGS = $(MYCFLAGS)"
-@@ -120,6 +128,9 @@
-
- # DO NOT DELETE
-
-+.libs/%o: %c
-+ $(CC) $(CFLAGS) -fPIC -DPIC -c -o $@ $<
-+
- lapi.o: lapi.c lua.h luaconf.h lapi.h lobject.h llimits.h ldebug.h \
- lstate.h ltm.h lzio.h lmem.h ldo.h lfunc.h lgc.h lstring.h ltable.h \
- lundump.h lvm.h
diff --git a/dev-lang/lua/files/lua-5.1.5-make.patch b/dev-lang/lua/files/lua-5.1.5-make.patch
deleted file mode 100644
index 032652c0a5e1..000000000000
--- a/dev-lang/lua/files/lua-5.1.5-make.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-diff -ru lua-5.1.5.orig/Makefile lua-5.1.5/Makefile
---- lua-5.1.5.orig/Makefile 2014-04-15 17:43:34.845435031 +0200
-+++ lua-5.1.5/Makefile 2014-04-15 19:05:08.669304987 +0200
-@@ -11,7 +11,7 @@
- # so take care if INSTALL_TOP is not an absolute path.
- INSTALL_TOP= /usr/local
- INSTALL_BIN= $(INSTALL_TOP)/bin
--INSTALL_INC= $(INSTALL_TOP)/include
-+INSTALL_INC= $(INSTALL_TOP)/include/lua$V
- INSTALL_LIB= $(INSTALL_TOP)/lib
- INSTALL_MAN= $(INSTALL_TOP)/man/man1
- #
-@@ -126,3 +126,21 @@
- .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho
-
- # (end of Makefile)
-+
-+# Use libtool for binary installs, etc.
-+
-+export V
-+export LIBTOOL = libtool --quiet --tag=CC
-+# See libtool manual about how to set this
-+
-+gentoo_clean:
-+ cd src; $(MAKE) $@
-+
-+gentoo_test: gentoo_linux
-+ test/lua.static test/hello.lua
-+
-+gentoo_install:
-+ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$V luac$V $(INSTALL_BIN)
-+ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$V.la $(INSTALL_LIB)
-diff -ru lua-5.1.5.orig/src/Makefile lua-5.1.5/src/Makefile
---- lua-5.1.5.orig/src/Makefile 2014-04-15 17:43:34.844435031 +0200
-+++ lua-5.1.5/src/Makefile 2014-04-15 18:07:21.427397122 +0200
-@@ -29,10 +29,10 @@
- LIB_O= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \
- lstrlib.o loadlib.o linit.o
-
--LUA_T= lua
-+LUA_T= lua$V
- LUA_O= lua.o
-
--LUAC_T= luac
-+LUAC_T= luac$V
- LUAC_O= luac.o print.o
-
- ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
-@@ -51,10 +51,10 @@
- $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
- $(RANLIB) $@
-
--$(LUA_T): $(LUA_O) $(LUA_A)
-+origin$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
-
--$(LUAC_T): $(LUAC_O) $(LUA_A)
-+origin$(LUAC_T): $(LUAC_O) $(LUA_A)
- $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
-
- clean:
-@@ -180,3 +180,33 @@
- ltm.h lzio.h lmem.h lopcodes.h lundump.h
-
- # (end of Makefile)
-+
-+export LIBTOOL = libtool --tag=CC
-+export LIB_VERSION = 5:1:5
-+
-+# The following rules use libtool for compiling and linking in order to
-+# provide shared library support.
-+
-+LIB_NAME = liblua$V.la
-+LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
-+
-+%.lo %.o: %.c
-+ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-+
-+$(LIB_NAME): $(LIB_OBJS)
-+ $(LIBTOOL) --mode=link $(CC) -version-info 0:0:0 \
-+ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
-+
-+$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
-+
-+lua_test: $(LUA_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
-+
-+$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
-+
-+gentoo_clean:
-+ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$V luac$V
-+
-+gentoo_all: $(LIB_NAME) $(LUA_T) lua_test $(LUAC_T)
diff --git a/dev-lang/lua/files/lua-5.1.5-readline.patch b/dev-lang/lua/files/lua-5.1.5-readline.patch
deleted file mode 100644
index 2b5221a8ab48..000000000000
--- a/dev-lang/lua/files/lua-5.1.5-readline.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- old/src/luaconf.h 2006-04-10 20:27:23.000000000 +0200
-+++ new/src/luaconf.h 2006-11-15 14:53:07.000000000 +0100
-@@ -36,7 +36,6 @@
- #if defined(LUA_USE_LINUX)
- #define LUA_USE_POSIX
- #define LUA_USE_DLOPEN /* needs an extra library: -ldl */
--#define LUA_USE_READLINE /* needs some extra libraries */
- #endif
-
- #if defined(LUA_USE_MACOSX)
---- old/src/Makefile 2012-02-13 21:41:22.000000000 +0100
-+++ old/src/Makefile 2019-07-09 09:53:00.000000000 +0100
-@@ -98,3 +98,3 @@
- linux:
-- $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
-+ $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl"
-
diff --git a/dev-lang/lua/files/lua-5.2-make-r1.patch b/dev-lang/lua/files/lua-5.2-make-r1.patch
deleted file mode 100644
index c65f799c0dcc..000000000000
--- a/dev-lang/lua/files/lua-5.2-make-r1.patch
+++ /dev/null
@@ -1,75 +0,0 @@
---- lua-5.1.1.orig/Makefile 2006-06-02 12:53:38.000000000 +0200
-+++ lua-5.1.1/Makefile 2006-11-16 02:16:53.000000000 +0100
-@@ -11,7 +11,7 @@
- # so take care if INSTALL_TOP is not an absolute path.
- INSTALL_TOP= /usr/local
- INSTALL_BIN= $(INSTALL_TOP)/bin
--INSTALL_INC= $(INSTALL_TOP)/include
-+INSTALL_INC= $(INSTALL_TOP)/include/lua$V
- INSTALL_LIB= $(INSTALL_TOP)/lib
- INSTALL_MAN= $(INSTALL_TOP)/man/man1
- #
-@@ -127,3 +127,18 @@
- .PHONY: all $(PLATS) clean install local none dummy echo pecho lecho newer
-
- # (end of Makefile)
-+
-+# Use libtool for binary installs, etc.
-+
-+export V
-+export LIBTOOL = libtool --quiet --tag=CC
-+# See libtool manual about how to set this
-+
-+gentoo_clean:
-+ cd src; $(MAKE) $@
-+
-+gentoo_install:
-+ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$V luac$V $(INSTALL_BIN)
-+ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$V.la $(INSTALL_LIB)
---- lua-5.1.1.orig/src/Makefile 2006-03-22 01:41:49.000000000 +0100
-+++ lua-5.1.1/src/Makefile 2006-11-16 02:10:27.000000000 +0100
-@@ -39,1 +39,1 @@
--LUA_T= lua
-+LUA_T= lua$V
-@@ -42,1 +42,1 @@
--LUAC_T= luac
-+LUAC_T= luac$V
-@@ -54,1 +54,1 @@
--$(LUA_T): $(LUA_O) $(LUA_A)
-+origin$(LUA_T): $(LUA_O) $(LUA_A)
-@@ -57,1 +57,1 @@
--$(LUAC_T): $(LUAC_O) $(LUA_A)
-+origin$(LUAC_T): $(LUAC_O) $(LUA_A)
-@@ -185,3 +185,30 @@
- lzio.o: lzio.c lua.h luaconf.h llimits.h lmem.h lstate.h lobject.h ltm.h \
- lzio.h
-
-+
-+export LIBTOOL = libtool --quiet --tag=CC
-+export LIB_VERSION = 6:1:1
-+
-+# The following rules use libtool for compiling and linking in order to
-+# provide shared library support.
-+
-+LIB_NAME = liblua$V.la
-+LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
-+
-+%.lo %.o: %.c
-+ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-+
-+$(LIB_NAME): $(LIB_OBJS)
-+ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
-+ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
-+
-+$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
-+
-+$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
-+
-+gentoo_clean:
-+ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$V luac$V
-+
-+gentoo_all: $(LIB_NAME) $(LUA_T) $(LUAC_T)
diff --git a/dev-lang/lua/files/lua-5.2.4-make.patch b/dev-lang/lua/files/lua-5.2.4-make.patch
deleted file mode 100644
index 40e1f5aa7d0c..000000000000
--- a/dev-lang/lua/files/lua-5.2.4-make.patch
+++ /dev/null
@@ -1,75 +0,0 @@
---- lua-5.1.1.orig/Makefile 2006-06-02 12:53:38.000000000 +0200
-+++ lua-5.1.1/Makefile 2006-11-16 02:16:53.000000000 +0100
-@@ -11,7 +11,7 @@
- # so take care if INSTALL_TOP is not an absolute path.
- INSTALL_TOP= /usr/local
- INSTALL_BIN= $(INSTALL_TOP)/bin
--INSTALL_INC= $(INSTALL_TOP)/include
-+INSTALL_INC= $(INSTALL_TOP)/include/lua$V
- INSTALL_LIB= $(INSTALL_TOP)/lib
- INSTALL_MAN= $(INSTALL_TOP)/man/man1
- #
-@@ -127,3 +127,18 @@
- .PHONY: all $(PLATS) clean install local none dummy echo pecho lecho newer
-
- # (end of Makefile)
-+
-+# Use libtool for binary installs, etc.
-+
-+export V
-+export LIBTOOL = libtool --quiet --tag=CC
-+# See libtool manual about how to set this
-+
-+gentoo_clean:
-+ cd src; $(MAKE) $@
-+
-+gentoo_install:
-+ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$V luac$V $(INSTALL_BIN)
-+ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$V.la $(INSTALL_LIB)
---- lua-5.1.1.orig/src/Makefile 2006-03-22 01:41:49.000000000 +0100
-+++ lua-5.1.1/src/Makefile 2006-11-16 02:10:27.000000000 +0100
-@@ -39,1 +39,1 @@
--LUA_T= lua
-+LUA_T= lua$V
-@@ -42,1 +42,1 @@
--LUAC_T= luac
-+LUAC_T= luac$V
-@@ -54,1 +54,1 @@
--$(LUA_T): $(LUA_O) $(LUA_A)
-+origin$(LUA_T): $(LUA_O) $(LUA_A)
-@@ -57,1 +57,1 @@
--$(LUAC_T): $(LUAC_O) $(LUA_A)
-+origin$(LUAC_T): $(LUAC_O) $(LUA_A)
-@@ -185,3 +185,30 @@
- lzio.o: lzio.c lua.h luaconf.h llimits.h lmem.h lstate.h lobject.h ltm.h \
- lzio.h
-
-+
-+export LIBTOOL = libtool --quiet --tag=CC
-+export LIB_VERSION = 6:1:1
-+
-+# The following rules use libtool for compiling and linking in order to
-+# provide shared library support.
-+
-+LIB_NAME = liblua$V.la
-+LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
-+
-+%.lo %.o: %.c
-+ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-+
-+$(LIB_NAME): $(LIB_OBJS)
-+ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
-+ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
-+
-+$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
-+
-+$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
-+
-+gentoo_clean:
-+ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$V luac$V
-+
-+gentoo_all: $(LIB_NAME) $(LUA_T) $(LUAC_T)
diff --git a/dev-lang/lua/files/lua-5.3-make-r1.patch b/dev-lang/lua/files/lua-5.3-make-r1.patch
deleted file mode 100644
index d27eb9938ea0..000000000000
--- a/dev-lang/lua/files/lua-5.3-make-r1.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-diff -uNr lua-5.3.3.orig/Makefile lua-5.3.3/Makefile
---- lua-5.3.3.orig/Makefile 2016-12-04 22:29:54.839135901 +0100
-+++ lua-5.3.3/Makefile 2016-12-04 22:31:14.235851109 +0100
-@@ -12,7 +12,7 @@
- # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
- INSTALL_TOP= /usr/local
- INSTALL_BIN= $(INSTALL_TOP)/bin
--INSTALL_INC= $(INSTALL_TOP)/include
-+INSTALL_INC= $(INSTALL_TOP)/include/lua$V
- INSTALL_LIB= $(INSTALL_TOP)/lib
- INSTALL_MAN= $(INSTALL_TOP)/man/man1
- INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
-@@ -112,3 +112,18 @@
- .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho
-
- # (end of Makefile)
-+
-+# Use libtool for binary installs, etc.
-+
-+export V
-+export LIBTOOL = libtool --quiet --tag=CC
-+# See libtool manual about how to set this
-+
-+gentoo_clean:
-+ cd src; $(MAKE) $@
-+
-+gentoo_install:
-+ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$V luac$V $(INSTALL_BIN)
-+ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$V.la $(INSTALL_LIB)
-diff -uNr lua-5.3.3.orig/src/Makefile lua-5.3.3/src/Makefile
---- lua-5.3.3.orig/src/Makefile 2016-12-04 22:29:54.840135910 +0100
-+++ lua-5.3.3/src/Makefile 2016-12-04 22:34:55.980848068 +0100
-@@ -36,10 +36,10 @@
- lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o
- BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
-
--LUA_T= lua
-+LUA_T= lua$V
- LUA_O= lua.o
-
--LUAC_T= luac
-+LUAC_T= luac$V
- LUAC_O= luac.o
-
- ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-@@ -59,10 +59,10 @@
- $(AR) $@ $(BASE_O)
- $(RANLIB) $@
-
--$(LUA_T): $(LUA_O) $(LUA_A)
-+origin$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
-
--$(LUAC_T): $(LUAC_O) $(LUA_A)
-+origin$(LUAC_T): $(LUAC_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
-
- clean:
-@@ -195,3 +195,30 @@
- lobject.h ltm.h lzio.h
-
- # (end of Makefile)
-+
-+export LIBTOOL = libtool --quiet --tag=CC
-+export LIB_VERSION = 6:1:1
-+
-+# The following rules use libtool for compiling and linking in order to
-+# provide shared library support.
-+
-+LIB_NAME = liblua$V.la
-+LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
-+
-+%.lo %.o: %.c
-+ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-+
-+$(LIB_NAME): $(LIB_OBJS)
-+ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
-+ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
-+
-+$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
-+
-+$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
-+
-+gentoo_clean:
-+ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$V luac$V
-+
-+gentoo_all: $(LIB_NAME) $(LUA_T) $(LUAC_T)
diff --git a/dev-lang/lua/files/lua-5.3.6-make.patch b/dev-lang/lua/files/lua-5.3.6-make.patch
deleted file mode 100644
index 6e842caf4f65..000000000000
--- a/dev-lang/lua/files/lua-5.3.6-make.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-diff -uNr lua-5.3.3.orig/Makefile lua-5.3.3/Makefile
---- lua-5.3.3.orig/Makefile 2016-12-04 22:29:54.839135901 +0100
-+++ lua-5.3.3/Makefile 2016-12-04 22:31:14.235851109 +0100
-@@ -12,7 +12,7 @@
- # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
- INSTALL_TOP= /usr/local
- INSTALL_BIN= $(INSTALL_TOP)/bin
--INSTALL_INC= $(INSTALL_TOP)/include
-+INSTALL_INC= $(INSTALL_TOP)/include/lua$V
- INSTALL_LIB= $(INSTALL_TOP)/lib
- INSTALL_MAN= $(INSTALL_TOP)/man/man1
- INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
-@@ -112,3 +112,18 @@
- .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho
-
- # (end of Makefile)
-+
-+# Use libtool for binary installs, etc.
-+
-+export V
-+export LIBTOOL = libtool --quiet --tag=CC
-+# See libtool manual about how to set this
-+
-+gentoo_clean:
-+ cd src; $(MAKE) $@
-+
-+gentoo_install:
-+ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$V luac$V $(INSTALL_BIN)
-+ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$V.la $(INSTALL_LIB)
-diff -uNr lua-5.3.3.orig/src/Makefile lua-5.3.3/src/Makefile
---- lua-5.3.3.orig/src/Makefile 2016-12-04 22:29:54.840135910 +0100
-+++ lua-5.3.3/src/Makefile 2016-12-04 22:34:55.980848068 +0100
-@@ -36,10 +36,10 @@
- lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o
- BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
-
--LUA_T= lua
-+LUA_T= lua$V
- LUA_O= lua.o
-
--LUAC_T= luac
-+LUAC_T= luac$V
- LUAC_O= luac.o
-
- ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-@@ -59,10 +59,10 @@
- $(AR) $@ $(BASE_O)
- $(RANLIB) $@
-
--$(LUA_T): $(LUA_O) $(LUA_A)
-+origin$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
-
--$(LUAC_T): $(LUAC_O) $(LUA_A)
-+origin$(LUAC_T): $(LUAC_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
-
- clean:
-@@ -195,3 +195,30 @@
- lobject.h ltm.h lzio.h
-
- # (end of Makefile)
-+
-+export LIBTOOL = libtool --quiet --tag=CC
-+export LIB_VERSION = 6:1:1
-+
-+# The following rules use libtool for compiling and linking in order to
-+# provide shared library support.
-+
-+LIB_NAME = liblua$V.la
-+LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
-+
-+%.lo %.o: %.c
-+ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-+
-+$(LIB_NAME): $(LIB_OBJS)
-+ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
-+ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
-+
-+$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
-+
-+$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
-+
-+gentoo_clean:
-+ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$V luac$V
-+
-+gentoo_all: $(LIB_NAME) $(LUA_T) $(LUAC_T)
diff --git a/dev-lang/lua/files/lua-5.4-makefiles.patch b/dev-lang/lua/files/lua-5.4-makefiles.patch
deleted file mode 100644
index 67fb4ad1a339..000000000000
--- a/dev-lang/lua/files/lua-5.4-makefiles.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-diff --git a/Makefile b/Makefile
-index 1797df9..90284d8 100644
---- a/Makefile
-+++ b/Makefile
-@@ -10,11 +10,11 @@ PLAT= guess
- # so take care if INSTALL_TOP is not an absolute path. See the local target.
- # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
- # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
--INSTALL_TOP= /usr/local
-+INSTALL_TOP= /usr
- INSTALL_BIN= $(INSTALL_TOP)/bin
--INSTALL_INC= $(INSTALL_TOP)/include
-+INSTALL_INC= $(INSTALL_TOP)/include/lua$V
- INSTALL_LIB= $(INSTALL_TOP)/lib
--INSTALL_MAN= $(INSTALL_TOP)/man/man1
-+INSTALL_MAN= $(INSTALL_TOP)/share/man/man1
- INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
- INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
-
-@@ -104,3 +104,18 @@ pc:
- .PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc
-
- # (end of Makefile)
-+
-+# Use libtool for binary installs, etc.
-+
-+export V
-+export LIBTOOL = $(BROOT)/usr/bin/libtool --quiet --tag=CC
-+# See libtool manual about how to set this
-+
-+gentoo_clean:
-+ cd src; $(MAKE) $@
-+
-+gentoo_install:
-+ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$V luac$V $(INSTALL_BIN)
-+ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$V.la $(INSTALL_LIB)
-diff --git a/src/Makefile b/src/Makefile
-index 514593d..8af8f99 100644
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -37,10 +37,10 @@ CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem
- LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
- BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
-
--LUA_T= lua
-+LUA_T= lua$V
- LUA_O= lua.o
-
--LUAC_T= luac
-+LUAC_T= luac$V
- LUAC_O= luac.o
-
- ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-@@ -60,10 +60,10 @@ $(LUA_A): $(BASE_O)
- $(AR) $@ $(BASE_O)
- $(RANLIB) $@
-
--$(LUA_T): $(LUA_O) $(LUA_A)
-+origin$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
-
--$(LUAC_T): $(LUAC_O) $(LUA_A)
-+origin$(LUAC_T): $(LUAC_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
-
- test:
-@@ -218,3 +218,30 @@ lzio.o: lzio.c lprefix.h lua.h luaconf.h llimits.h lmem.h lstate.h \
- lobject.h ltm.h lzio.h
-
- # (end of Makefile)
-+
-+export LIBTOOL = $(BROOT)/usr/bin/libtool --quiet --tag=CC
-+export LIB_VERSION = 6:1:1
-+
-+# The following rules use libtool for compiling and linking in order to
-+# provide shared library support.
-+
-+LIB_NAME = liblua$V.la
-+LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
-+
-+%.lo %.o: %.c
-+ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-+
-+$(LIB_NAME): $(LIB_OBJS)
-+ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
-+ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
-+
-+$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
-+
-+$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
-+
-+gentoo_clean:
-+ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$V luac$V
-+
-+gentoo_all: $(LIB_NAME) $(LUA_T) $(LUAC_T)
diff --git a/dev-lang/lua/files/lua-5.4.2-make.patch b/dev-lang/lua/files/lua-5.4.2-make.patch
deleted file mode 100644
index 8758e88de91b..000000000000
--- a/dev-lang/lua/files/lua-5.4.2-make.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-diff --git a/Makefile b/Makefile
-index 1797df9..90284d8 100644
---- a/Makefile
-+++ b/Makefile
-@@ -10,11 +10,11 @@ PLAT= guess
- # so take care if INSTALL_TOP is not an absolute path. See the local target.
- # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
- # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
--INSTALL_TOP= /usr/local
-+INSTALL_TOP= /usr
- INSTALL_BIN= $(INSTALL_TOP)/bin
--INSTALL_INC= $(INSTALL_TOP)/include
-+INSTALL_INC= $(INSTALL_TOP)/include/lua$V
- INSTALL_LIB= $(INSTALL_TOP)/lib
--INSTALL_MAN= $(INSTALL_TOP)/man/man1
-+INSTALL_MAN= $(INSTALL_TOP)/share/man/man1
- INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
- INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
-
-@@ -104,3 +104,18 @@ pc:
- .PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc
-
- # (end of Makefile)
-+
-+# Use libtool for binary installs, etc.
-+
-+export V
-+export LIBTOOL = /usr/bin/libtool --quiet --tag=CC
-+# See libtool manual about how to set this
-+
-+gentoo_clean:
-+ cd src; $(MAKE) $@
-+
-+gentoo_install:
-+ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$V luac$V $(INSTALL_BIN)
-+ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
-+ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$V.la $(INSTALL_LIB)
-diff --git a/src/Makefile b/src/Makefile
-index 514593d..8af8f99 100644
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -37,10 +37,10 @@ CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem
- LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
- BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
-
--LUA_T= lua
-+LUA_T= lua$V
- LUA_O= lua.o
-
--LUAC_T= luac
-+LUAC_T= luac$V
- LUAC_O= luac.o
-
- ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-@@ -60,10 +60,10 @@ $(LUA_A): $(BASE_O)
- $(AR) $@ $(BASE_O)
- $(RANLIB) $@
-
--$(LUA_T): $(LUA_O) $(LUA_A)
-+origin$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
-
--$(LUAC_T): $(LUAC_O) $(LUA_A)
-+origin$(LUAC_T): $(LUAC_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
-
- test:
-@@ -218,3 +218,30 @@ lzio.o: lzio.c lprefix.h lua.h luaconf.h llimits.h lmem.h lstate.h \
- lobject.h ltm.h lzio.h
-
- # (end of Makefile)
-+
-+export LIBTOOL = /usr/bin/libtool --quiet --tag=CC
-+export LIB_VERSION = 6:1:1
-+
-+# The following rules use libtool for compiling and linking in order to
-+# provide shared library support.
-+
-+LIB_NAME = liblua$V.la
-+LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
-+
-+%.lo %.o: %.c
-+ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
-+
-+$(LIB_NAME): $(LIB_OBJS)
-+ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
-+ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
-+
-+$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS)
-+
-+$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME)
-+ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME)
-+
-+gentoo_clean:
-+ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$V luac$V
-+
-+gentoo_all: $(LIB_NAME) $(LUA_T) $(LUAC_T)
diff --git a/dev-lang/lua/files/lua-5.4.6-sparc-tests.patch b/dev-lang/lua/files/lua-5.4.6-sparc-tests.patch
new file mode 100644
index 000000000000..29515aad1639
--- /dev/null
+++ b/dev-lang/lua/files/lua-5.4.6-sparc-tests.patch
@@ -0,0 +1,44 @@
+https://github.com/lua/lua/commit/6baee9ef9d5657ab582c8a4b9f885ec58ed502d0
+https://bugs.gentoo.org/914562
+
+From 6baee9ef9d5657ab582c8a4b9f885ec58ed502d0 Mon Sep 17 00:00:00 2001
+From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
+Date: Fri, 8 Sep 2023 16:19:21 -0300
+Subject: [PATCH] Removed test for "corrupted binary dump"
+
+Test is too non portable. (For instance, it does not work for
+different number types.)
+--- a/src/lundump.c
++++ b/src/lundump.c
+@@ -81,7 +81,7 @@ static size_t loadUnsigned (LoadState *S, size_t limit) {
+
+
+ static size_t loadSize (LoadState *S) {
+- return loadUnsigned(S, ~(size_t)0);
++ return loadUnsigned(S, MAX_SIZET);
+ }
+
+
+--- a/tests/calls.lua
++++ b/tests/calls.lua
+@@ -342,20 +342,6 @@ do -- another bug (in 5.4.0)
+ end
+
+
+-do -- another bug (since 5.2)
+- -- corrupted binary dump: list of upvalue names is larger than number
+- -- of upvalues, overflowing the array of upvalues.
+- local code =
+- "\x1b\x4c\x75\x61\x54\x00\x19\x93\x0d\x0a\x1a\x0a\x04\x08\x08\x78\x56\z
+- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x28\x77\x40\x00\x86\x40\z
+- \x74\x65\x6d\x70\x81\x81\x01\x00\x02\x82\x48\x00\x02\x00\xc7\x00\x01\z
+- \x00\x80\x80\x80\x82\x00\x00\x80\x81\x82\x78\x80\x82\x81\x86\x40\x74\z
+- \x65\x6d\x70"
+-
+- assert(load(code)) -- segfaults in previous versions
+-end
+-
+-
+ x = string.dump(load("x = 1; return x"))
+ a = assert(load(read1(x), nil, "b"))
+ assert(a() == 1 and _G.x == 1)
diff --git a/dev-lang/lua/files/lua.pc b/dev-lang/lua/files/lua.pc
deleted file mode 100644
index e53971852c10..000000000000
--- a/dev-lang/lua/files/lua.pc
+++ /dev/null
@@ -1,31 +0,0 @@
-# lua.pc -- pkg-config data for Lua
-
-# vars from install Makefile
-
-# grep '^V=' ../Makefile
-V= 5.1
-# grep '^R=' ../Makefile
-R= 5.1.4
-
-# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
-prefix= /usr
-INSTALL_BIN= ${prefix}/bin
-INSTALL_INC= ${prefix}/include
-INSTALL_LIB= ${prefix}/,lib,
-INSTALL_MAN= ${prefix}/man/man1
-INSTALL_LMOD= ${prefix}/share/lua/${V}
-INSTALL_CMOD= ${prefix}/,lib,/lua/${V}
-
-# canonical vars
-exec_prefix=${prefix}
-libdir=${exec_prefix}/,lib,
-includedir=${prefix}/include
-
-Name: Lua
-Description: An Extensible Extension Language
-Version: ${R}
-Requires:
-Libs: -L${libdir} -llua -lm
-Cflags: -I${includedir}
-
-# (end of lua.pc)