From 264a941f76886bf5b0ddaa0d25642ea2c8ec26f3 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Tue, 25 Apr 2023 12:57:23 +0200 Subject: [PATCH] dev-lang/lua: Add from Gentoo It's from Gentoo commit 6bdbc578b28bc576068247ac6a76931055532146. --- .../portage-stable/dev-lang/lua/Manifest | 3 ++ .../lua/files/5.1/0001-extern_C.patch | 20 +++++++ ...x-stack-overflow-in-vararg-functions.patch | 17 ++++++ .../dev-lang/lua/files/lua-5.1.4-test.patch | 11 ++++ .../files/lua-5.4.4-lparser-overread.patch | 34 ++++++++++++ .../dev-lang/lua/lua-5.1.5-r200.ebuild | 49 +++++++++++++++++ .../dev-lang/lua/lua-5.3.6-r102.ebuild | 50 +++++++++++++++++ .../dev-lang/lua/lua-5.4.4-r103.ebuild | 54 +++++++++++++++++++ .../portage-stable/dev-lang/lua/metadata.xml | 18 +++++++ 9 files changed, 256 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/dev-lang/lua/Manifest create mode 100644 sdk_container/src/third_party/portage-stable/dev-lang/lua/files/5.1/0001-extern_C.patch create mode 100644 sdk_container/src/third_party/portage-stable/dev-lang/lua/files/5.1/0002-Fix-stack-overflow-in-vararg-functions.patch create mode 100644 sdk_container/src/third_party/portage-stable/dev-lang/lua/files/lua-5.1.4-test.patch create mode 100644 sdk_container/src/third_party/portage-stable/dev-lang/lua/files/lua-5.4.4-lparser-overread.patch create mode 100644 sdk_container/src/third_party/portage-stable/dev-lang/lua/lua-5.1.5-r200.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/dev-lang/lua/lua-5.3.6-r102.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/dev-lang/lua/lua-5.4.4-r103.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/dev-lang/lua/metadata.xml diff --git a/sdk_container/src/third_party/portage-stable/dev-lang/lua/Manifest b/sdk_container/src/third_party/portage-stable/dev-lang/lua/Manifest new file mode 100644 index 0000000000..222d628af9 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-lang/lua/Manifest @@ -0,0 +1,3 @@ +DIST lua-5.1.5.tar.xz 397416 BLAKE2B ef3880d78be1def383a9db6753b7aec4160f6fa8719529c2ea6266015771a23a1be81424520de10bb087a86081f1ec48c58c36eb8b24bff53adb6bd8d791e31b SHA512 bd827cb2e63cd71d15d846eb29c8745bf869e7b70e12c565ce173623d1fcd29dabf4d33a99c48f294151bb580d830c112cf178e2d80a5a5c36acc7b3bfcd7d24 +DIST lua-5.3.6.tar.xz 541220 BLAKE2B c356cec06b14cdcbb29e382c951491432a3189618f9fd8c8832bdc8c831640fbcb9e212db05b61a577633c5fe9831e75a158cb97720c1e51cab27544526c9e24 SHA512 9a632a90806fa71398d70be7d38769065c1258fd94709cef72236753b42131b8d30da2a5dd28c74211ef8d04b0c30f52d0c593d49c2e8686568c8896b69577d7 +DIST lua-5.4.4.tar.xz 606456 BLAKE2B ba6cad647c0171e5e737151b189b5b404948c08182e9f17d7974a6c6c3b7d99b03cf930add863188db22674b8613fc600d771f62f9dfc99232aab9caea9b073c SHA512 8f3950ed5972a29d7c79e72af617526f6b9f6be7ab268e66206d7e453acc2564541c9d01e2de08a7e9046ab24c66b02167e48a0d5764753befd95dc922b61219 diff --git a/sdk_container/src/third_party/portage-stable/dev-lang/lua/files/5.1/0001-extern_C.patch b/sdk_container/src/third_party/portage-stable/dev-lang/lua/files/5.1/0001-extern_C.patch new file mode 100644 index 0000000000..6e4f711f0e --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/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" +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/sdk_container/src/third_party/portage-stable/dev-lang/lua/files/5.1/0002-Fix-stack-overflow-in-vararg-functions.patch b/sdk_container/src/third_party/portage-stable/dev-lang/lua/files/5.1/0002-Fix-stack-overflow-in-vararg-functions.patch new file mode 100644 index 0000000000..2bb5657b4d --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/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 +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/sdk_container/src/third_party/portage-stable/dev-lang/lua/files/lua-5.1.4-test.patch b/sdk_container/src/third_party/portage-stable/dev-lang/lua/files/lua-5.1.4-test.patch new file mode 100644 index 0000000000..4dcfbb9d69 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-lang/lua/files/lua-5.1.4-test.patch @@ -0,0 +1,11 @@ +--- a/test/sieve.lua ++++ b/test/sieve.lua +@@ -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/sdk_container/src/third_party/portage-stable/dev-lang/lua/files/lua-5.4.4-lparser-overread.patch b/sdk_container/src/third_party/portage-stable/dev-lang/lua/files/lua-5.4.4-lparser-overread.patch new file mode 100644 index 0000000000..3e625aa4ff --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-lang/lua/files/lua-5.4.4-lparser-overread.patch @@ -0,0 +1,34 @@ +From https://github.com/lua/lua/commit/1f3c6f4534c6411313361697d98d1145a1f030fa Mon Sep 17 00:00:00 2001 +From: Roberto Ierusalimschy +Date: Tue, 15 Feb 2022 12:28:46 -0300 +Subject: [PATCH] Bug: Lua can generate wrong code when _ENV is + +--- a/src/lparser.c ++++ b/src/lparser.c +@@ -468,6 +468,7 @@ static void singlevar (LexState *ls, expdesc *var) { + expdesc key; + singlevaraux(fs, ls->envn, var, 1); /* get environment variable */ + lua_assert(var->k != VVOID); /* this one must exist */ ++ luaK_exp2anyregup(fs, var); /* but could be a constant */ + codestring(&key, varname); /* key is variable name */ + luaK_indexed(fs, var, &key); /* env[varname] */ + } +--- a/tests/attrib.lua ++++ b/tests/attrib.lua +@@ -434,6 +434,16 @@ a.aVeryLongName012345678901234567890123456789012345678901234567890123456789 == + 10) + + ++do ++ -- _ENV constant ++ local function foo () ++ local _ENV = 11 ++ X = "hi" ++ end ++ local st, msg = pcall(foo) ++ assert(not st and string.find(msg, "number")) ++end ++ + + -- test of large float/integer indices + diff --git a/sdk_container/src/third_party/portage-stable/dev-lang/lua/lua-5.1.5-r200.ebuild b/sdk_container/src/third_party/portage-stable/dev-lang/lua/lua-5.1.5-r200.ebuild new file mode 100644 index 0000000000..eff2fdb452 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-lang/lua/lua-5.1.5-r200.ebuild @@ -0,0 +1,49 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit optfeature + +DESCRIPTION="A powerful light-weight programming language designed for extending applications" +HOMEPAGE="https://www.lua.org/" +# tarballs produced from ${PV} branches in https://gitweb.gentoo.org/proj/lua-patches.git +SRC_URI="https://dev.gentoo.org/~soap/distfiles/${P}.tar.xz" + +LICENSE="MIT" +SLOT="5.1" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="+deprecated readline" + +DEPEND=" + >=app-eselect/eselect-lua-3 + readline? ( sys-libs/readline:= ) + !dev-lang/lua:0" +RDEPEND="${DEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( "${FILESDIR}"/${SLOT} ) + +src_prepare() { + ! use deprecated && PATCHES+=( + "${FILESDIR}"/${PN}-5.1.4-test.patch + ) + default +} + +src_configure() { + econf \ + $(use_enable deprecated) \ + $(use_with readline) +} + +src_install() { + default + find "${ED}" -name '*.la' -delete || die +} + +pkg_postinst() { + eselect lua set --if-unset "${PN}${SLOT}" + + optfeature "Lua support for Emacs" app-emacs/lua-mode +} diff --git a/sdk_container/src/third_party/portage-stable/dev-lang/lua/lua-5.3.6-r102.ebuild b/sdk_container/src/third_party/portage-stable/dev-lang/lua/lua-5.3.6-r102.ebuild new file mode 100644 index 0000000000..5f02b32717 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-lang/lua/lua-5.3.6-r102.ebuild @@ -0,0 +1,50 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit flag-o-matic optfeature + +DESCRIPTION="A powerful light-weight programming language designed for extending applications" +HOMEPAGE="https://www.lua.org/" +# tarballs produced from ${PV} branches in https://gitweb.gentoo.org/proj/lua-patches.git +SRC_URI="https://dev.gentoo.org/~soap/distfiles/${P}.tar.xz" + +LICENSE="MIT" +SLOT="5.3" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="+deprecated readline" + +DEPEND=" + >=app-eselect/eselect-lua-3 + readline? ( sys-libs/readline:= ) + !dev-lang/lua:0" +RDEPEND="${DEPEND}" +BDEPEND="virtual/pkgconfig" + +src_prepare() { + default + + if use elibc_musl; then + # locales on musl are non-functional (#834153) + # https://wiki.musl-libc.org/open-issues.html#Locale-limitations + sed -e 's|os.setlocale("pt_BR") or os.setlocale("ptb")|false|g' \ + -i tests/literals.lua || die + fi +} + +src_configure() { + use deprecated && append-cppflags -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 + econf $(use_with readline) +} + +src_install() { + default + find "${ED}" -name '*.la' -delete || die +} + +pkg_postinst() { + eselect lua set --if-unset "${PN}${SLOT}" + + optfeature "Lua support for Emacs" app-emacs/lua-mode +} diff --git a/sdk_container/src/third_party/portage-stable/dev-lang/lua/lua-5.4.4-r103.ebuild b/sdk_container/src/third_party/portage-stable/dev-lang/lua/lua-5.4.4-r103.ebuild new file mode 100644 index 0000000000..88415e2579 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-lang/lua/lua-5.4.4-r103.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit flag-o-matic optfeature + +DESCRIPTION="A powerful light-weight programming language designed for extending applications" +HOMEPAGE="https://www.lua.org/" +# tarballs produced from ${PV} branches in https://gitweb.gentoo.org/proj/lua-patches.git +SRC_URI="https://dev.gentoo.org/~soap/distfiles/${P}.tar.xz" + +LICENSE="MIT" +SLOT="5.4" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="+deprecated readline" + +DEPEND=" + >=app-eselect/eselect-lua-3 + readline? ( sys-libs/readline:= ) + !dev-lang/lua:0" +RDEPEND="${DEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}/${P}-lparser-overread.patch" +) + +src_prepare() { + default + + if use elibc_musl; then + # locales on musl are non-functional (#834153) + # https://wiki.musl-libc.org/open-issues.html#Locale-limitations + sed -e 's|os.setlocale("pt_BR") or os.setlocale("ptb")|false|g' \ + -i tests/literals.lua || die + fi +} + +src_configure() { + use deprecated && append-cppflags -DLUA_COMPAT_5_3 + econf $(use_with readline) +} + +src_install() { + default + find "${ED}" -name '*.la' -delete || die +} + +pkg_postinst() { + eselect lua set --if-unset "${PN}${SLOT}" + + optfeature "Lua support for Emacs" app-emacs/lua-mode +} diff --git a/sdk_container/src/third_party/portage-stable/dev-lang/lua/metadata.xml b/sdk_container/src/third_party/portage-stable/dev-lang/lua/metadata.xml new file mode 100644 index 0000000000..9237282a3c --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-lang/lua/metadata.xml @@ -0,0 +1,18 @@ + + + + + williamh@gentoo.org + William Hubbs + + + robbat2@gentoo.org + Robin H. Johnson + + + make deprecated data structures/routines available + + + lua/lua + +