commit: 64f79037ce92852e07a64bd24752f30c063bf4b9
parent 2f3d08a2e0ce2249c0d4168f1b3b8a60fbbfff91
Author: Michael Forney <mforney@mforney.org>
Date: Sun, 3 Dec 2023 11:55:22 -0800
lua: Update to 5.4.6
Diffstat:
7 files changed, 77 insertions(+), 7 deletions(-)
diff --git a/pkg/lua/.gitignore b/pkg/lua/.gitignore
@@ -1,2 +1,2 @@
-/lua-5.2.4.tar.gz
+/lua-5.4.6.tar.gz
/src
diff --git a/pkg/lua/gen.lua b/pkg/lua/gen.lua
@@ -2,6 +2,7 @@ cflags{
'-std=c99', '-Wall', '-Wextra', '-Wpedantic', '-Wno-implicit-fallthrough',
'-D _DEFAULT_SOURCE',
'-D LUA_USE_POSIX',
+ '-D LUA_USE_JUMPTABLE=0',
}
pkg.hdrs = {
@@ -13,8 +14,8 @@ lib('liblua.a', [[src/(
lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c
lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c
ltm.c lundump.c lvm.c lzio.c
- lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c
- lmathlib.c loslib.c lstrlib.c ltablib.c loadlib.c linit.c
+ lauxlib.c lbaselib.c lcorolib.c ldblib.c liolib.c lmathlib.c
+ loslib.c lstrlib.c ltablib.c lutf8lib.c loadlib.c linit.c
)]])
file('lib/liblua.a', '644', '$outdir/liblua.a')
diff --git a/pkg/lua/sha256 b/pkg/lua/sha256
@@ -1 +1 @@
-b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b lua-5.2.4.tar.gz
+7d5ea1b9cb6aa0b59ca3dde1c6adcb57ef83a1ba8e5432c0ecd06bf439b3ad88 lua-5.4.6.tar.gz
diff --git a/pkg/lua/url b/pkg/lua/url
@@ -1 +1 @@
-url = "http://www.lua.org/ftp/lua-5.2.4.tar.gz"
+url = "http://www.lua.org/ftp/lua-5.4.6.tar.gz"
diff --git a/pkg/lua/ver b/pkg/lua/ver
@@ -1 +1 @@
-5.2.4 r0
+5.4.6 r0
diff --git a/pkg/mpv/patch/0005-Support-lua-5.4.patch b/pkg/mpv/patch/0005-Support-lua-5.4.patch
@@ -0,0 +1,69 @@
+From 8ab50c2f6569389e574546a306bd73da142c060b Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Sun, 3 Dec 2023 11:57:01 -0800
+Subject: [PATCH] Support lua 5.4
+
+---
+ player/lua.c | 5 -----
+ player/lua/osc.lua | 8 ++++----
+ 2 files changed, 4 insertions(+), 9 deletions(-)
+
+diff --git a/player/lua.c b/player/lua.c
+index b3a7167dce..0f2249bc96 100644
+--- a/player/lua.c
++++ b/player/lua.c
+@@ -452,11 +452,6 @@ static int load_lua(struct mp_script_args *args)
+
+ stats_register_thread_cputime(ctx->stats, "cpu");
+
+- if (LUA_VERSION_NUM != 501 && LUA_VERSION_NUM != 502) {
+- MP_FATAL(ctx, "Only Lua 5.1 and 5.2 are supported.\n");
+- goto error_out;
+- }
+-
+ lua_State *L = ctx->state = luaL_newstate();
+ if (!L) {
+ MP_FATAL(ctx, "Could not initialize Lua.\n");
+diff --git a/player/lua/osc.lua b/player/lua/osc.lua
+index a244280a35..799b6a16df 100644
+--- a/player/lua/osc.lua
++++ b/player/lua/osc.lua
+@@ -170,7 +170,7 @@ local margins_opts = {
+ function get_virt_scale_factor()
+ local w, h = mp.get_osd_size()
+ if w <= 0 or h <= 0 then
+- return 0, 0
++ return 1, 1
+ end
+ return osc_param.playresx / w, osc_param.playresy / h
+ end
+@@ -188,7 +188,7 @@ end
+
+ function set_virt_mouse_area(x0, y0, x1, y1, name)
+ local sx, sy = get_virt_scale_factor()
+- mp.set_mouse_area(x0 / sx, y0 / sy, x1 / sx, y1 / sy, name)
++ mp.set_mouse_area(x0 // sx, y0 // sy, x1 // sx, y1 // sy, name)
+ end
+
+ function scale_value(x0, x1, y0, y1, val)
+@@ -294,7 +294,7 @@ end
+
+ -- multiplies two alpha values, formular can probably be improved
+ function mult_alpha(alphaA, alphaB)
+- return 255 - (((1-(alphaA/255)) * (1-(alphaB/255))) * 255)
++ return alphaA + alphaB - alphaA * alphaB / 255
+ end
+
+ function add_area(name, x1, y1, x2, y2)
+@@ -313,7 +313,7 @@ function ass_append_alpha(ass, alpha, modifier)
+ if state.animation then
+ av = mult_alpha(av, state.animation)
+ end
+- ar[ai] = av
++ ar[ai] = math.floor(av)
+ end
+
+ ass:append(string.format("{\\1a&H%X&\\2a&H%X&\\3a&H%X&\\4a&H%X&}",
+--
+2.42.0
+
diff --git a/pkg/mpv/ver b/pkg/mpv/ver
@@ -1 +1 @@
-0.35.1 r0
+0.35.1 r1