From f3d667ce3bd611dfb75bcebe6c1cdf4d16ef462c162eb246786ea1595361c432 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Thu, 7 Jul 2022 10:56:38 +0000 Subject: [PATCH] Updating link to change in openSUSE:Factory/vlc revision 124.0 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/vlc?expand=0&rev=1d7e87d6e3085599e401b22df1e85bc9 --- 867.patch | 1506 +++++++++++++++++++++++++++++++++++++++++++++ vlc-lua-5.3.patch | 258 +++++++- vlc.changes | 6 + vlc.spec | 11 +- 4 files changed, 1771 insertions(+), 10 deletions(-) create mode 100644 867.patch diff --git a/867.patch b/867.patch new file mode 100644 index 0000000..555d634 --- /dev/null +++ b/867.patch @@ -0,0 +1,1506 @@ +From dc95063af0d2d54b36185ca8ef2203b364b568ef Mon Sep 17 00:00:00 2001 +From: Marvin Scholz +Date: Thu, 4 Nov 2021 18:10:43 +0100 +Subject: [PATCH 01/10] lua: common: do not use deprecated module function + +--- + share/lua/intf/cli.lua | 2 +- + share/lua/intf/http.lua | 2 +- + share/lua/modules/common.lua | 46 +++++++++++++++++++----------------- + 3 files changed, 26 insertions(+), 24 deletions(-) + +Index: vlc-3.0.17.4/share/lua/intf/cli.lua +=================================================================== +--- vlc-3.0.17.4.orig/share/lua/intf/cli.lua ++++ vlc-3.0.17.4/share/lua/intf/cli.lua +@@ -58,7 +58,9 @@ description= + * flatplaylist: 0 to disable, 1 to enable. + ]============================================================================] + +-require("common") ++local common = require("common") ++local host = require("host") ++ + skip = common.skip + skip2 = function(foo) return skip(skip(foo)) end + setarg = common.setarg +@@ -794,7 +796,6 @@ function on_write( client ) + end + + --[[ Setup host ]] +-require("host") + h = host.host() + + h.status_callbacks[host.status.password] = on_password +Index: vlc-3.0.17.4/share/lua/intf/http.lua +=================================================================== +--- vlc-3.0.17.4.orig/share/lua/intf/http.lua ++++ vlc-3.0.17.4/share/lua/intf/http.lua +@@ -30,7 +30,7 @@ Configuration options: + --]==========================================================================] + + +-require "common" ++local common = require "common" + + vlc.msg.info("Lua HTTP interface") + +Index: vlc-3.0.17.4/share/lua/modules/common.lua +=================================================================== +--- vlc-3.0.17.4.orig/share/lua/modules/common.lua ++++ vlc-3.0.17.4/share/lua/modules/common.lua +@@ -1,9 +1,9 @@ + --[[ This code is public domain (since it really isn't very interesting) ]]-- + +-module("common",package.seeall) ++local common = {} + + -- Iterate over a table in the keys' alphabetical order +-function pairs_sorted(t) ++function common.pairs_sorted(t) + local s = {} + for k,_ in pairs(t) do table.insert(s,k) end + table.sort(s) +@@ -12,17 +12,17 @@ function pairs_sorted(t) + end + + -- Return a function such as skip(foo)(a,b,c) = foo(b,c) +-function skip(foo) ++function common.skip(foo) + return function(discard,...) return foo(...) end + end + + -- Return a function such as setarg(foo,a)(b,c) = foo(a,b,c) +-function setarg(foo,a) ++function common.setarg(foo,a) + return function(...) return foo(a,...) end + end + + -- Trigger a hotkey +-function hotkey(arg) ++function common.hotkey(arg) + local id = vlc.misc.action_id( arg ) + if id ~= nil then + vlc.var.set( vlc.object.libvlc(), "key-action", id ) +@@ -33,14 +33,14 @@ function hotkey(arg) + end + + -- Take a video snapshot +-function snapshot() ++function common.snapshot() + local vout = vlc.object.vout() + if not vout then return end + vlc.var.set(vout,"video-snapshot",nil) + end + + -- Naive (non recursive) table copy +-function table_copy(t) ++function common.table_copy(t) + c = {} + for i,v in pairs(t) do c[i]=v end + return c +@@ -48,7 +48,7 @@ end + + -- tonumber() for decimals number, using a dot as decimal separator + -- regardless of the system locale +-function us_tonumber(str) ++function common.us_tonumber(str) + local s, i, d = string.match(str, "^([+-]?)(%d*)%.?(%d*)$") + if not s or not i or not d then + return nil +@@ -70,40 +70,40 @@ end + + -- tostring() for decimals number, using a dot as decimal separator + -- regardless of the system locale +-function us_tostring(n) ++function common.us_tostring(n) + s = tostring(n):gsub(",", ".", 1) + return s + end + + -- strip leading and trailing spaces +-function strip(str) ++function common.strip(str) + return string.gsub(str, "^%s*(.-)%s*$", "%1") + end + + -- print a table (recursively) +-function table_print(t,prefix) ++function common.table_print(t,prefix) + local prefix = prefix or "" + if not t then + print(prefix.."/!\\ nil") + return + end +- for a,b in pairs_sorted(t) do ++ for a,b in common.pairs_sorted(t) do + print(prefix..tostring(a),b) + if type(b)==type({}) then +- table_print(b,prefix.."\t") ++ common.table_print(b,prefix.."\t") + end + end + end + + -- print the list of callbacks registered in lua + -- useful for debug purposes +-function print_callbacks() ++function common.print_callbacks() + print "callbacks:" +- table_print(vlc.callbacks) ++ common.table_print(vlc.callbacks) + end + + -- convert a duration (in seconds) to a string +-function durationtostring(duration) ++function common.durationtostring(duration) + return string.format("%02d:%02d:%02d", + math.floor(duration/3600), + math.floor(duration/60)%60, +@@ -113,7 +113,7 @@ end + -- realpath + -- this is for URL paths - do not use for file paths as this has + -- no support for Windows '\' directory separators +-function realpath(path) ++function common.realpath(path) + -- detect URLs to extract and process the path component + local s, p, qf = string.match(path, "^([a-zA-Z0-9+%-%.]-://[^/]-)(/[^?#]*)(.*)$") + if not s then +@@ -149,7 +149,7 @@ end + + -- parse the time from a string and return the seconds + -- time format: [+ or -][:][:][] +-function parsetime(timestring) ++function common.parsetime(timestring) + local seconds = 0 + local hourspattern = "(%d+)[hH]" + local minutespattern = "(%d+)[mM']" +@@ -176,11 +176,11 @@ function parsetime(timestring) + end + + -- seek +-function seek(value) ++function common.seek(value) + local input = vlc.object.input() + if input ~= nil and value ~= nil then + if string.sub(value,-1) == "%" then +- local number = us_tonumber(string.sub(value,1,-2)) ++ local number = common.us_tonumber(string.sub(value,1,-2)) + if number ~= nil then + local posPercent = number/100 + if string.sub(value,1,1) == "+" or string.sub(value,1,1) == "-" then +@@ -190,7 +190,7 @@ function seek(value) + end + end + else +- local posTime = parsetime(value) ++ local posTime = common.parsetime(value) + if string.sub(value,1,1) == "+" or string.sub(value,1,1) == "-" then + vlc.var.set(input,"time",vlc.var.get(input,"time") + (posTime * 1000000)) + else +@@ -200,10 +200,12 @@ function seek(value) + end + end + +-function volume(value) ++function common.volume(value) + if type(value)=="string" and string.sub(value,1,1) == "+" or string.sub(value,1,1) == "-" then + vlc.volume.set(vlc.volume.get()+tonumber(value)) + else + vlc.volume.set(tostring(value)) + end + end ++ ++return common +Index: vlc-3.0.17.4/share/lua/modules/sandbox.lua +=================================================================== +--- vlc-3.0.17.4.orig/share/lua/modules/sandbox.lua ++++ vlc-3.0.17.4/share/lua/modules/sandbox.lua +@@ -21,7 +21,7 @@ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + --]==========================================================================] + +-module("sandbox",package.seeall) ++local sandbox = {} + + -- See Programming in Lua (second edition) for sandbox examples + -- See http://lua-users.org/wiki/SandBoxes for a list of SAFE/UNSAFE variables +@@ -49,7 +49,7 @@ if _VERSION == "Lua 5.1" then + sandbox_blacklist["loadstring"] = true + end + +-function readonly_table_proxy(name,src,blacklist) ++function sandbox.readonly_table_proxy(name,src,blacklist) + if type(src)=="nil" then return end + if type(src)~="table" then error("2nd argument must be a table (or nil)") end + local name = name +@@ -77,17 +77,17 @@ end + -- Of course, all of this is useless if the sandbox calling code has + -- another reference to one of these tables in his global environement. + local sandbox_proxy = { +- coroutine = readonly_table_proxy("coroutine",coroutine), +- string = readonly_table_proxy("string",string,{"dump"}), +- table = readonly_table_proxy("table",table), +- math = readonly_table_proxy("math",math), +- io = readonly_table_proxy("io",io), +- os = readonly_table_proxy("os",os,{"exit","getenv","remove", +- "rename","setlocale"}), +- sandbox = readonly_table_proxy("sandbox",sandbox), ++ coroutine = sandbox.readonly_table_proxy("coroutine",coroutine), ++ string = sandbox.readonly_table_proxy("string",string,{"dump"}), ++ table = sandbox.readonly_table_proxy("table",table), ++ math = sandbox.readonly_table_proxy("math",math), ++ io = sandbox.readonly_table_proxy("io",io), ++ os = sandbox.readonly_table_proxy("os",os,{"exit","getenv","remove", ++ "rename","setlocale"}), ++ sandbox = sandbox.readonly_table_proxy("sandbox",sandbox), + } + +-function sandbox(func,override) ++function sandbox.sandbox(func,override) + local _G = getfenv(2) + local override = override or {} + local sandbox_metatable = +@@ -121,3 +121,5 @@ function sandbox(func,override) + return unpack(ret) + end + end ++ ++return sandbox +Index: vlc-3.0.17.4/share/lua/modules/simplexml.lua +=================================================================== +--- vlc-3.0.17.4.orig/share/lua/modules/simplexml.lua ++++ vlc-3.0.17.4/share/lua/modules/simplexml.lua +@@ -21,7 +21,7 @@ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + --]==========================================================================] + +-module("simplexml",package.seeall) ++local simplexml = {} + + --[[ Returns the xml tree structure + -- Each node is of one of the following types: +@@ -86,19 +86,19 @@ local function parsexml(stream, errormsg + return tree + end + +-function parse_url(url) ++function simplexml.parse_url(url) + return parsexml(vlc.stream(url)) + end + +-function parse_stream(stream) ++function simplexml.parse_stream(stream) + return parsexml(stream) + end + +-function parse_string(str) ++function simplexml.parse_string(str) + return parsexml(vlc.memory_stream(str)) + end + +-function add_name_maps(tree) ++function simplexml.add_name_maps(tree) + tree.children_map = {} + for _, node in pairs(tree.children) do + if type(node) == "table" then +@@ -106,8 +106,9 @@ function add_name_maps(tree) + tree.children_map[node.name] = {} + end + table.insert(tree.children_map[node.name], node) +- add_name_maps(node) ++ simplexml.add_name_maps(node) + end + end + end + ++return simplexml +Index: vlc-3.0.17.4/share/lua/playlist/jamendo.lua +=================================================================== +--- vlc-3.0.17.4.orig/share/lua/playlist/jamendo.lua ++++ vlc-3.0.17.4/share/lua/playlist/jamendo.lua +@@ -20,7 +20,7 @@ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + --]] + +-require "simplexml" ++local simplexml = require "simplexml" + + -- Probe function. + function probe() +Index: vlc-3.0.17.4/share/lua/sd/fmc.lua +=================================================================== +--- vlc-3.0.17.4.orig/share/lua/sd/fmc.lua ++++ vlc-3.0.17.4/share/lua/sd/fmc.lua +@@ -19,7 +19,7 @@ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + --]] +-require "simplexml" ++local simplexml = require "simplexml" + + function descriptor() + return { title="Free Music Charts" } +Index: vlc-3.0.17.4/share/lua/sd/icecast.lua +=================================================================== +--- vlc-3.0.17.4.orig/share/lua/sd/icecast.lua ++++ vlc-3.0.17.4/share/lua/sd/icecast.lua +@@ -20,12 +20,13 @@ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + --]] + +-lazily_loaded = false ++local simplexml = nil + + function lazy_load() +- if lazily_loaded then return nil end +- require "simplexml" +- lazily_loaded = true ++ if simplexml == nil ++ then ++ simplexml = require "simplexml" ++ end + end + + function descriptor() +Index: vlc-3.0.17.4/share/lua/http/requests/browse.json +=================================================================== +--- vlc-3.0.17.4.orig/share/lua/http/requests/browse.json ++++ vlc-3.0.17.4/share/lua/http/requests/browse.json +@@ -27,7 +27,7 @@ vim:syntax=lua + +\ No newline at end of file ++?> +Index: vlc-3.0.17.4/share/lua/http/requests/status.json +=================================================================== +--- vlc-3.0.17.4.orig/share/lua/http/requests/status.json ++++ vlc-3.0.17.4/share/lua/http/requests/status.json +@@ -27,7 +27,7 @@ vim:syntax=lua + ++Date: Thu, 4 Nov 2021 16:15:53 +0100 ++Subject: [PATCH] Add EXE_EXT to allow specifying binary extension ++ ++This is needed to make the install step aware that the lua/luac ++binaries have a .exe suffix for Windows. ++--- ++ Makefile | 5 ++++- ++ 1 file changed, 4 insertions(+), 1 deletion(-) ++ ++diff --git a/Makefile b/Makefile ++index cae9b35..7913cd2 100644 ++--- a/Makefile +++++ b/Makefile ++@@ -34,13 +34,16 @@ INSTALL_DATA= $(INSTALL) -m 0644 ++ MKDIR= mkdir -p ++ RM= rm -f ++ +++# File extension used for executables +++EXE_EXT= +++ ++ # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= ++ ++ # Convenience platforms targets. ++ PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris ++ ++ # What to install. ++-TO_BIN= lua luac +++TO_BIN= lua$(EXE_EXT) luac$(EXE_EXT) ++ TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp ++ TO_LIB= liblua5.4.a ++ TO_MAN= lua.1 luac.1 ++-- ++2.33.0 ++ +Index: vlc-3.0.17.4/contrib/src/lua/Add-a-Makefile-variable-to-override-the-strip-tool.patch +=================================================================== +--- /dev/null ++++ vlc-3.0.17.4/contrib/src/lua/Add-a-Makefile-variable-to-override-the-strip-tool.patch +@@ -0,0 +1,33 @@ ++From bedf474c5b2f1c46188ff7774ad3b97c4c028108 Mon Sep 17 00:00:00 2001 ++From: Marvin Scholz ++Date: Wed, 10 Nov 2021 12:44:52 +0100 ++Subject: [PATCH] Add a Makefile variable to override the strip tool ++ ++--- ++ src/Makefile | 3 ++- ++ 1 file changed, 2 insertions(+), 1 deletion(-) ++ ++diff --git a/src/Makefile b/src/Makefile ++index af57fe2..db0a3e2 100644 ++--- a/src/Makefile +++++ b/src/Makefile ++@@ -15,6 +15,7 @@ AR= ar rcu ++ RANLIB= ranlib ++ RM= rm -f ++ UNAME= uname +++STRIP= strip ++ ++ SYSCFLAGS= ++ SYSLDFLAGS= ++@@ -131,7 +132,7 @@ Darwin macos macosx: ++ ++ mingw: ++ $(MAKE) "LUA_A=lua54.dll" "LUA_T=lua.exe" "LUA_A_LINK=lua54.lib" \ ++- "AR=$(CC) -shared -Wl,--out-implib,lua54.lib $(LDFLAGS) -o" "RANLIB=strip --strip-unneeded" \ +++ "AR=$(CC) -shared -Wl,--out-implib,lua54.lib $(LDFLAGS) -o" "RANLIB=$(STRIP) --strip-unneeded" \ ++ "SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe ++ $(MAKE) "LUAC_T=luac.exe" luac.exe ++ ++-- ++2.33.0 ++ +Index: vlc-3.0.17.4/contrib/src/lua/Add-version-to-library-name.patch +=================================================================== +--- /dev/null ++++ vlc-3.0.17.4/contrib/src/lua/Add-version-to-library-name.patch +@@ -0,0 +1,39 @@ ++From 55bc6b11605b7e35323daf28587990d4d57b5e59 Mon Sep 17 00:00:00 2001 ++From: Marvin Scholz ++Date: Thu, 4 Nov 2021 13:47:03 +0100 ++Subject: [PATCH] Add version to library name ++ ++--- ++ Makefile | 2 +- ++ src/Makefile | 2 +- ++ 2 files changed, 2 insertions(+), 2 deletions(-) ++ ++diff --git a/Makefile b/Makefile ++index fed75b3..29c50a3 100644 ++--- a/Makefile +++++ b/Makefile ++@@ -41,7 +41,7 @@ PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix ++ # What to install. ++ TO_BIN= lua luac ++ TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp ++-TO_LIB= liblua.a +++TO_LIB= liblua5.4.a ++ TO_MAN= lua.1 luac.1 ++ ++ # Lua version and release. ++diff --git a/src/Makefile b/src/Makefile ++index 91f2315..af57fe2 100644 ++--- a/src/Makefile +++++ b/src/Makefile ++@@ -32,7 +32,7 @@ CMCFLAGS= ++ ++ PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris ++ ++-LUA_A= liblua.a +++LUA_A= liblua5.4.a ++ LUA_A_LINK= $(LUA_A) ++ CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o ++ 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 ++-- ++2.33.0 ++ +Index: vlc-3.0.17.4/contrib/src/lua/Always-use-the-luac-32-bit-format.patch +=================================================================== +--- /dev/null ++++ vlc-3.0.17.4/contrib/src/lua/Always-use-the-luac-32-bit-format.patch +@@ -0,0 +1,161 @@ ++From ba66def0fbcbb4635e62f820ed588bd429b81dc9 Mon Sep 17 00:00:00 2001 ++From: Marvin Scholz ++Date: Thu, 4 Nov 2021 03:21:58 +0100 ++Subject: [PATCH] Always use the luac 32-bit format ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit ++ ++Based on the previous patch by Rémi Denis-Courmont ++ ++This forces lua and luac to use 32-bit integers even if it would ++usually use 64-bit ones, this makes it easier to cross-compile, ++as the build machine might be 64bit while the host is 32bit. ++--- ++ src/ldump.c | 4 +-- ++ src/luaconf.h | 68 ++++++++------------------------------------------- ++ src/lundump.c | 4 +-- ++ 3 files changed, 14 insertions(+), 62 deletions(-) ++ ++diff --git a/src/ldump.c b/src/ldump.c ++index f848b66..c66afe5 100644 ++--- a/src/ldump.c +++++ b/src/ldump.c ++@@ -56,9 +56,9 @@ static void dumpByte (DumpState *D, int y) { ++ ++ ++ /* dumpInt Buff Size */ ++-#define DIBS ((sizeof(size_t) * 8 / 7) + 1) +++#define DIBS ((sizeof(uint32_t) * 8 / 7) + 1) ++ ++-static void dumpSize (DumpState *D, size_t x) { +++static void dumpSize (DumpState *D, uint32_t x) { ++ lu_byte buff[DIBS]; ++ int n = 0; ++ do { ++diff --git a/src/luaconf.h b/src/luaconf.h ++index e64d2ee..0d04694 100644 ++--- a/src/luaconf.h +++++ b/src/luaconf.h ++@@ -10,6 +10,8 @@ ++ ++ #include ++ #include +++#include +++#include ++ ++ ++ /* ++@@ -116,7 +118,7 @@ ++ /* ++ @@ LUA_32BITS enables Lua with 32-bit integers and 32-bit floats. ++ */ ++-#define LUA_32BITS 0 +++#define LUA_32BITS 1 ++ ++ ++ /* ++@@ -503,7 +505,7 @@ ++ ** use LUAI_UACINT here to avoid problems with promotions (which ++ ** can turn a comparison between unsigneds into a signed comparison) ++ */ ++-#define LUA_UNSIGNED unsigned LUAI_UACINT +++#define LUA_UNSIGNED uint32_t ++ ++ ++ #define LUA_UNSIGNEDBITS (sizeof(LUA_UNSIGNED) * CHAR_BIT) ++@@ -511,66 +513,16 @@ ++ ++ /* now the variable definitions */ ++ ++-#if LUA_INT_TYPE == LUA_INT_INT /* { int */ ++- ++-#define LUA_INTEGER int +++#define LUA_INTEGER int32_t ++ #define LUA_INTEGER_FRMLEN "" ++ ++-#define LUA_MAXINTEGER INT_MAX ++-#define LUA_MININTEGER INT_MIN ++- ++-#define LUA_MAXUNSIGNED UINT_MAX ++- ++-#elif LUA_INT_TYPE == LUA_INT_LONG /* }{ long */ ++- ++-#define LUA_INTEGER long ++-#define LUA_INTEGER_FRMLEN "l" ++- ++-#define LUA_MAXINTEGER LONG_MAX ++-#define LUA_MININTEGER LONG_MIN ++- ++-#define LUA_MAXUNSIGNED ULONG_MAX ++- ++-#elif LUA_INT_TYPE == LUA_INT_LONGLONG /* }{ long long */ ++- ++-/* use presence of macro LLONG_MAX as proxy for C99 compliance */ ++-#if defined(LLONG_MAX) /* { */ ++-/* use ISO C99 stuff */ ++- ++-#define LUA_INTEGER long long ++-#define LUA_INTEGER_FRMLEN "ll" ++- ++-#define LUA_MAXINTEGER LLONG_MAX ++-#define LUA_MININTEGER LLONG_MIN ++- ++-#define LUA_MAXUNSIGNED ULLONG_MAX ++- ++-#elif defined(LUA_USE_WINDOWS) /* }{ */ ++-/* in Windows, can use specific Windows types */ ++- ++-#define LUA_INTEGER __int64 ++-#define LUA_INTEGER_FRMLEN "I64" +++#define LUA_MAXINTEGER INT32_MAX +++#define LUA_MININTEGER INT32_MIN ++ ++-#define LUA_MAXINTEGER _I64_MAX ++-#define LUA_MININTEGER _I64_MIN ++- ++-#define LUA_MAXUNSIGNED _UI64_MAX ++- ++-#else /* }{ */ ++- ++-#error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \ ++- or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)" ++- ++-#endif /* } */ ++- ++-#else /* }{ */ ++- ++-#error "numeric integer type not defined" ++- ++-#endif /* } */ ++- ++-/* }================================================================== */ +++#define LUA_MAXUNSIGNED UINT32_MAX ++ +++#define LUAI_UMEM size_t +++#define LUAI_MEM ssize_t ++ ++ /* ++ ** {================================================================== ++diff --git a/src/lundump.c b/src/lundump.c ++index 5aa55c4..54840ee 100644 ++--- a/src/lundump.c +++++ b/src/lundump.c ++@@ -81,12 +81,12 @@ static size_t loadUnsigned (LoadState *S, size_t limit) { ++ ++ ++ static size_t loadSize (LoadState *S) { ++- return loadUnsigned(S, ~(size_t)0); +++ return loadUnsigned(S, ~(uint32_t)0); ++ } ++ ++ ++ static int loadInt (LoadState *S) { ++- return cast_int(loadUnsigned(S, INT_MAX)); +++ return cast_int(loadUnsigned(S, INT32_MAX)); ++ } ++ ++ ++-- ++2.33.0 ++ +Index: vlc-3.0.17.4/contrib/src/lua/Avoid-usage-of-localeconv.patch +=================================================================== +--- /dev/null ++++ vlc-3.0.17.4/contrib/src/lua/Avoid-usage-of-localeconv.patch +@@ -0,0 +1,239 @@ ++From 1eb23c5258753ad13b1103909d3637a950cc7d3d Mon Sep 17 00:00:00 2001 ++From: Marvin Scholz ++Date: Thu, 4 Nov 2021 04:41:06 +0100 ++Subject: [PATCH] Avoid usage of localeconv ++ ++In order to properly do this, we need to implement a locale-independent ++version of strtof and snprintf, else lua will be unable to properly ++parse floating point numbers on systems that do not use a locale where ++the dot is the decimal point. ++--- ++ src/Makefile | 2 +- ++ src/clocwrappers.c | 159 +++++++++++++++++++++++++++++++++++++++++++++ ++ src/luaconf.h | 9 ++- ++ 3 files changed, 166 insertions(+), 4 deletions(-) ++ create mode 100644 src/clocwrappers.c ++ ++diff --git a/src/Makefile b/src/Makefile ++index f78c0b8..2f18923 100644 ++--- a/src/Makefile +++++ b/src/Makefile ++@@ -23,7 +23,7 @@ SYSLIBS= ++ MYCFLAGS= ++ MYLDFLAGS= ++ MYLIBS= ++-MYOBJS= +++MYOBJS= clocwrappers.o ++ ++ # Special flags for compiler modules; -Os reduces code size. ++ CMCFLAGS= ++diff --git a/src/clocwrappers.c b/src/clocwrappers.c ++new file mode 100644 ++index 0000000..5a9b4cc ++--- /dev/null +++++ b/src/clocwrappers.c ++@@ -0,0 +1,159 @@ +++#include +++#include +++#include +++ +++#if defined(__APPLE__) +++# include +++#elif defined(_WIN32) +++# include +++# include +++#else +++# define _GNU_SOURCE +++# include +++#endif +++ +++/* A strtof replacement that always uses the C locale to ensure +++ * it always accepts '.' as decimal point. +++ */ +++ +++#if defined(__APPLE__) +++ +++float strtof_c_locale(const char *nptr, char **endptr) +++{ +++ return strtof_l(nptr, endptr, LC_C_LOCALE); +++} +++ +++int snprintf_c_locale(char * restrict str, size_t size, const char * restrict format, ...) +++{ +++ int res; +++ va_list args; +++ +++ va_start(args, format); +++ res = vsnprintf_l(str, size, LC_C_LOCALE, format, args); +++ va_end(args); +++ +++ return res; +++} +++ +++#elif defined(_WIN32) +++ +++float strtof_c_locale(const char *nptr, char **endptr) +++{ +++ float res; +++ +++ // Store old threadlocale state +++ int cfgtlocale_old = _configthreadlocale(_ENABLE_PER_THREAD_LOCALE); +++ char *orig_locale = NULL; +++ if (cfgtlocale_old != -1) { +++ // Store current locale +++ orig_locale = setlocale(LC_NUMERIC, NULL); +++ setlocale(LC_NUMERIC, "C"); +++ } +++ res = strtof(nptr, endptr); +++ if (orig_locale != NULL) { +++ // Restore the old locale +++ setlocale(LC_NUMERIC, orig_locale); +++ } +++ if (cfgtlocale_old != _ENABLE_PER_THREAD_LOCALE && cfgtlocale_old != -1) { +++ // Restore the old threadlocale state +++ _configthreadlocale(cfgtlocale_old); +++ } +++ +++ return res; +++} +++ +++int snprintf_c_locale(char * restrict str, size_t size, const char * restrict format, ...) +++{ +++ int res; +++ +++ // Store old threadlocale state +++ int cfgtlocale_old = _configthreadlocale(_ENABLE_PER_THREAD_LOCALE); +++ char *orig_locale = NULL; +++ if (cfgtlocale_old != -1) { +++ // Store current locale +++ orig_locale = setlocale(LC_NUMERIC, NULL); +++ setlocale(LC_NUMERIC, "C"); +++ } +++ +++ va_list args; +++ va_start(args, format); +++ res = vsnprintf(str, size, format, args); +++ va_end(args); +++ +++ if (orig_locale != NULL) { +++ // Restore the old locale +++ setlocale(LC_NUMERIC, orig_locale); +++ } +++ if (cfgtlocale_old != _ENABLE_PER_THREAD_LOCALE && cfgtlocale_old != -1) { +++ // Restore the old threadlocale state +++ _configthreadlocale(cfgtlocale_old); +++ } +++ +++ return res; +++} +++ +++#elif defined(__ANDROID__) && (__ANDROID_API__ < 21) +++ +++float strtof_c_locale(const char *nptr, char **endptr) +++{ +++ // Android API level < 21 has no locales support +++ return strtof(nptr, endptr); +++} +++ +++int snprintf_c_locale(char * restrict str, size_t size, const char * restrict format, ...) +++{ +++ // Android API level < 21 has no locales support +++ va_list args; +++ va_start(args, format); +++ return vsnprintf(str, size, format, args); +++ va_end(args); +++} +++ +++#else // Version for all other OSes +++ +++float strtof_c_locale(const char *nptr, char **endptr) +++{ +++ float res; +++ +++ locale_t orig_locale = (locale_t)0; +++ locale_t locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0); +++ if (locale != (locale_t)0) { +++ // Store current locale +++ orig_locale = uselocale(locale); +++ } +++ res = strtof(nptr, endptr); +++ if (locale != (locale_t)0) { +++ // Restore old locale +++ uselocale(orig_locale); +++ freelocale(locale); +++ } +++ +++ return res; +++} +++ +++int snprintf_c_locale(char * restrict str, size_t size, const char * restrict format, ...) +++{ +++ int res; +++ +++ locale_t orig_locale = (locale_t)0; +++ locale_t locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0); +++ if (locale != (locale_t)0) { +++ // Store current locale +++ orig_locale = uselocale(locale); +++ } +++ +++ va_list args; +++ va_start(args, format); +++ res = vsnprintf(str, size, format, args); +++ va_end(args); +++ +++ if (locale != (locale_t)0) { +++ // Restore old locale +++ uselocale(orig_locale); +++ freelocale(locale); +++ } +++ +++ return res; +++} +++ +++#endif ++diff --git a/src/luaconf.h b/src/luaconf.h ++index 38be08d..4b632ee 100644 ++--- a/src/luaconf.h +++++ b/src/luaconf.h ++@@ -12,7 +12,10 @@ ++ #include ++ #include ++ #include +++#include ++ +++float strtof_c_locale(const char *nptr, char **endptr); +++int snprintf_c_locale(char * restrict str, size_t size, const char * restrict format, ...); ++ ++ /* ++ ** =================================================================== ++@@ -437,7 +440,7 @@ ++ ++ #define l_mathop(op) op##f ++ ++-#define lua_str2number(s,p) strtof((s), (p)) +++#define lua_str2number(s,p) strtof_c_locale((s), (p)) ++ ++ ++ #elif LUA_FLOAT_TYPE == LUA_FLOAT_LONGDOUBLE /* }{ long double */ ++@@ -535,7 +538,7 @@ ++ ** (All uses in Lua have only one format item.) ++ */ ++ #if !defined(LUA_USE_C89) ++-#define l_sprintf(s,sz,f,i) snprintf(s,sz,f,i) +++#define l_sprintf(s,sz,f,i) snprintf_c_locale(s,sz,f,i) ++ #else ++ #define l_sprintf(s,sz,f,i) ((void)(sz), sprintf(s,f,i)) ++ #endif ++@@ -609,7 +612,7 @@ ++ ** macro must include the header 'locale.h'.) ++ */ ++ #if !defined(lua_getlocaledecpoint) ++-#define lua_getlocaledecpoint() (localeconv()->decimal_point[0]) +++#define lua_getlocaledecpoint() '.' ++ #endif ++ ++ ++-- ++2.33.0 ++ +Index: vlc-3.0.17.4/contrib/src/lua/Create-an-import-library-needed-for-lld.patch +=================================================================== +--- /dev/null ++++ vlc-3.0.17.4/contrib/src/lua/Create-an-import-library-needed-for-lld.patch +@@ -0,0 +1,48 @@ ++From 536cf8d2acceb47bc5ef823d5553603eaa7fa8b1 Mon Sep 17 00:00:00 2001 ++From: Marvin Scholz ++Date: Thu, 4 Nov 2021 05:40:43 +0100 ++Subject: [PATCH] Create an import library needed for lld ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit ++ ++Based on the previous patch by Martin Storsjö ++--- ++ src/Makefile | 7 ++++--- ++ 1 file changed, 4 insertions(+), 3 deletions(-) ++ ++diff --git a/src/Makefile b/src/Makefile ++index 2f18923..91f2315 100644 ++--- a/src/Makefile +++++ b/src/Makefile ++@@ -33,6 +33,7 @@ CMCFLAGS= ++ PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris ++ ++ LUA_A= liblua.a +++LUA_A_LINK= $(LUA_A) ++ CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o ++ 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) ++@@ -61,7 +62,7 @@ $(LUA_A): $(BASE_O) ++ $(RANLIB) $@ ++ ++ $(LUA_T): $(LUA_O) $(LUA_A) ++- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) +++ $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A_LINK) $(LIBS) ++ ++ $(LUAC_T): $(LUAC_O) $(LUA_A) ++ $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) ++@@ -129,8 +130,8 @@ Darwin macos macosx: ++ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE" SYSLIBS="-lreadline" ++ ++ mingw: ++- $(MAKE) "LUA_A=lua54.dll" "LUA_T=lua.exe" \ ++- "AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \ +++ $(MAKE) "LUA_A=lua54.dll" "LUA_T=lua.exe" "LUA_A_LINK=lua54.lib" \ +++ "AR=$(CC) -shared -Wl,--out-implib,lua54.lib $(LDFLAGS) -o" "RANLIB=strip --strip-unneeded" \ ++ "SYSCFLAGS=-DLUA_BUILD_AS_DLL" "SYSLIBS=" "SYSLDFLAGS=-s" lua.exe ++ $(MAKE) "LUAC_T=luac.exe" luac.exe ++ ++-- ++2.33.0 ++ +Index: vlc-3.0.17.4/contrib/src/lua/Create-and-install-a-.pc-file.patch +=================================================================== +--- /dev/null ++++ vlc-3.0.17.4/contrib/src/lua/Create-and-install-a-.pc-file.patch +@@ -0,0 +1,87 @@ ++From 5b1f5e5d94dc380cded9ecf4fa49a2e19daccf0b Mon Sep 17 00:00:00 2001 ++From: Marvin Scholz ++Date: Thu, 4 Nov 2021 15:33:41 +0100 ++Subject: [PATCH] Create and install a .pc file ++ ++--- ++ Makefile | 27 ++++++++++++++++++++++----- ++ 1 file changed, 22 insertions(+), 5 deletions(-) ++ ++diff --git a/Makefile b/Makefile ++index 29c50a3..cae9b35 100644 ++--- a/Makefile +++++ b/Makefile ++@@ -14,6 +14,7 @@ INSTALL_TOP= /usr/local ++ INSTALL_BIN= $(INSTALL_TOP)/bin ++ INSTALL_INC= $(INSTALL_TOP)/include ++ INSTALL_LIB= $(INSTALL_TOP)/lib +++INSTALL_LIB_PKGCONFIG= $(INSTALL_LIB)/pkgconfig ++ INSTALL_MAN= $(INSTALL_TOP)/man/man1 ++ INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V ++ INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V ++@@ -43,6 +44,7 @@ TO_BIN= lua luac ++ TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp ++ TO_LIB= liblua5.4.a ++ TO_MAN= lua.1 luac.1 +++TO_PKGCONFIG= lua.pc ++ ++ # Lua version and release. ++ V= 5.4 ++@@ -54,12 +56,17 @@ all: $(PLAT) ++ $(PLATS) help test clean: ++ @cd src && $(MAKE) $@ ++ ++-install: dummy +++lua.pc: +++ $(MAKE) pc > lua.pc +++ +++ +++install: dummy $(TO_PKGCONFIG) ++ 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_DATA) $(TO_INC) $(INSTALL_INC) ++ cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) ++ cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) +++ $(INSTALL_DATA) $(TO_PKGCONFIG) $(INSTALL_LIB_PKGCONFIG) ++ ++ uninstall: ++ cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN) ++@@ -83,10 +90,12 @@ echo: ++ @echo "TO_INC= $(TO_INC)" ++ @echo "TO_LIB= $(TO_LIB)" ++ @echo "TO_MAN= $(TO_MAN)" +++ @echo "TO_PKGCONFIG= $(TO_PKGCONFIG)" ++ @echo "INSTALL_TOP= $(INSTALL_TOP)" ++ @echo "INSTALL_BIN= $(INSTALL_BIN)" ++ @echo "INSTALL_INC= $(INSTALL_INC)" ++ @echo "INSTALL_LIB= $(INSTALL_LIB)" +++ @echo "INSTALL_LIB_PKGCONFIG= $(INSTALL_LIB_PKGCONFIG)" ++ @echo "INSTALL_MAN= $(INSTALL_MAN)" ++ @echo "INSTALL_LMOD= $(INSTALL_LMOD)" ++ @echo "INSTALL_CMOD= $(INSTALL_CMOD)" ++@@ -95,10 +104,18 @@ echo: ++ ++ # Echo pkg-config data. ++ pc: ++- @echo "version=$R" ++- @echo "prefix=$(INSTALL_TOP)" ++- @echo "libdir=$(INSTALL_LIB)" ++- @echo "includedir=$(INSTALL_INC)" +++ @echo 'version=$R' +++ @echo 'prefix=$(INSTALL_TOP)' +++ @echo 'libdir=$(INSTALL_LIB)' +++ @echo 'includedir=$(INSTALL_INC)' +++ @echo '' +++ @echo 'Name: lua' +++ @echo 'Description: the lua programming language' +++ @echo 'Version: $R' +++ @echo 'URL: https://www.lua.org' +++ @echo 'Cflags: -I$${includedir}' +++ @echo 'Libs: -L$${libdir} -llua5.4' +++ @echo 'Requires:' ++ ++ # Targets that do not create files (not all makes understand .PHONY). ++ .PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc ++-- ++2.33.0 ++ +Index: vlc-3.0.17.4/contrib/src/lua/Disable-dynamic-library-loading-support.patch +=================================================================== +--- /dev/null ++++ vlc-3.0.17.4/contrib/src/lua/Disable-dynamic-library-loading-support.patch +@@ -0,0 +1,44 @@ ++From b299adde28756deebeb9e51b137aeaf6c332e5f1 Mon Sep 17 00:00:00 2001 ++From: Marvin Scholz ++Date: Thu, 4 Nov 2021 03:30:05 +0100 ++Subject: [PATCH] Disable dynamic library loading support ++MIME-Version: 1.0 ++Content-Type: text/plain; charset=UTF-8 ++Content-Transfer-Encoding: 8bit ++ ++Based on the previous patch by Rafaël Carré ++--- ++ src/luaconf.h | 6 +++--- ++ 1 file changed, 3 insertions(+), 3 deletions(-) ++ ++diff --git a/src/luaconf.h b/src/luaconf.h ++index 0d04694..38be08d 100644 ++--- a/src/luaconf.h +++++ b/src/luaconf.h ++@@ -55,20 +55,20 @@ ++ ++ ++ #if defined(LUA_USE_WINDOWS) ++-#define LUA_DL_DLL /* enable support for DLL */ +++//#define LUA_DL_DLL /* enable support for DLL */ ++ #define LUA_USE_C89 /* broadly, Windows is C89 */ ++ #endif ++ ++ ++ #if defined(LUA_USE_LINUX) ++ #define LUA_USE_POSIX ++-#define LUA_USE_DLOPEN /* needs an extra library: -ldl */ +++//#define LUA_USE_DLOPEN /* needs an extra library: -ldl */ ++ #endif ++ ++ ++ #if defined(LUA_USE_MACOSX) ++ #define LUA_USE_POSIX ++-#define LUA_USE_DLOPEN /* MacOS does not need -ldl */ +++//#define LUA_USE_DLOPEN /* MacOS does not need -ldl */ ++ #endif ++ ++ ++-- ++2.33.0 ++ +Index: vlc-3.0.17.4/contrib/src/lua/Disable-system-and-popen-for-windows-store-builds.patch +=================================================================== +--- /dev/null ++++ vlc-3.0.17.4/contrib/src/lua/Disable-system-and-popen-for-windows-store-builds.patch +@@ -0,0 +1,67 @@ ++From 105c0c6fcaa2e3498b52cb1a6e3328a670b64dc6 Mon Sep 17 00:00:00 2001 ++From: Marvin Scholz ++Date: Thu, 4 Nov 2021 06:42:04 +0100 ++Subject: [PATCH] Disable system and popen for windows store builds ++ ++--- ++ src/loslib.c | 4 ++++ ++ src/luaconf.h | 13 +++++++++++++ ++ 2 files changed, 17 insertions(+) ++ ++diff --git a/src/loslib.c b/src/loslib.c ++index 3e20d62..d7fdb40 100644 ++--- a/src/loslib.c +++++ b/src/loslib.c ++@@ -139,6 +139,7 @@ ++ ++ ++ +++#if !defined(LUA_USE_WINSTORE) ++ static int os_execute (lua_State *L) { ++ const char *cmd = luaL_optstring(L, 1, NULL); ++ int stat; ++@@ -151,6 +152,7 @@ static int os_execute (lua_State *L) { ++ return 1; ++ } ++ } +++#endif ++ ++ ++ static int os_remove (lua_State *L) { ++@@ -408,7 +410,9 @@ static const luaL_Reg syslib[] = { ++ {"clock", os_clock}, ++ {"date", os_date}, ++ {"difftime", os_difftime}, +++#if !defined(LUA_USE_WINSTORE) ++ {"execute", os_execute}, +++#endif ++ {"exit", os_exit}, ++ {"getenv", os_getenv}, ++ {"remove", os_remove}, ++diff --git a/src/luaconf.h b/src/luaconf.h ++index 4b632ee..382e70b 100644 ++--- a/src/luaconf.h +++++ b/src/luaconf.h ++@@ -54,6 +54,19 @@ int snprintf_c_locale(char * restrict str, size_t size, const char * restrict fo ++ */ ++ #if !defined(LUA_USE_C89) && defined(_WIN32) && !defined(_WIN32_WCE) ++ #define LUA_USE_WINDOWS /* enable goodies for regular Windows */ +++ +++#include +++#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) +++#define LUA_USE_WINSTORE +++#endif +++#endif +++ +++#if defined(LUA_USE_WINSTORE) +++#define l_popen(L,c,m) \ +++ ((void)c, (void)m, \ +++ luaL_error(L, "'popen' not supported"), \ +++ (FILE*)0) +++#define l_pclose(L,file) ((void)L, (void)file, -1) ++ #endif ++ ++ ++-- ++2.33.0 ++ +Index: vlc-3.0.17.4/contrib/src/lua/Do-not-use-large-file-offsets-with-too-old-Android-A.patch +=================================================================== +--- /dev/null ++++ vlc-3.0.17.4/contrib/src/lua/Do-not-use-large-file-offsets-with-too-old-Android-A.patch +@@ -0,0 +1,30 @@ ++From 02f5f23eb8efac1c1cbca8cffb9f136391639f51 Mon Sep 17 00:00:00 2001 ++From: Marvin Scholz ++Date: Fri, 5 Nov 2021 13:50:40 +0100 ++Subject: [PATCH] Do not use large file offsets with too old Android API level ++ ++--- ++ src/lprefix.h | 7 +++++++ ++ 1 file changed, 7 insertions(+) ++ ++diff --git a/src/lprefix.h b/src/lprefix.h ++index 484f2ad..11b2889 100644 ++--- a/src/lprefix.h +++++ b/src/lprefix.h ++@@ -8,6 +8,13 @@ ++ #define lprefix_h ++ ++ +++#if defined(__ANDROID__) && (__ANDROID_API__ < 24) +++// Android API level < 24 does not support large file +++// offsets, so define this here to prevent it being +++// defined to 64 below. +++#define _FILE_OFFSET_BITS 32 +++#endif +++ ++ /* ++ ** Allows POSIX/XSI stuff ++ */ ++-- ++2.33.0 ++ +Index: vlc-3.0.17.4/contrib/src/lua/Do-not-use-log2f-with-too-old-Android-API-level.patch +=================================================================== +--- /dev/null ++++ vlc-3.0.17.4/contrib/src/lua/Do-not-use-log2f-with-too-old-Android-API-level.patch +@@ -0,0 +1,25 @@ ++From d8cf6736921895a1f11ef69531e189261f944d53 Mon Sep 17 00:00:00 2001 ++From: Marvin Scholz ++Date: Fri, 5 Nov 2021 12:09:08 +0100 ++Subject: [PATCH] Do not use log2f with too old Android API level ++ ++--- ++ src/lmathlib.c | 2 +- ++ 1 file changed, 1 insertion(+), 1 deletion(-) ++ ++diff --git a/src/lmathlib.c b/src/lmathlib.c ++index 5f5983a..7c37c88 100644 ++--- a/src/lmathlib.c +++++ b/src/lmathlib.c ++@@ -173,7 +173,7 @@ static int math_log (lua_State *L) { ++ res = l_mathop(log)(x); ++ else { ++ lua_Number base = luaL_checknumber(L, 2); ++-#if !defined(LUA_USE_C89) +++#if !defined(LUA_USE_C89) && !(defined(__ANDROID__) && (__ANDROID_API__ < 18)) ++ if (base == l_mathop(2.0)) ++ res = l_mathop(log2)(x); ++ else ++-- ++2.33.0 ++ +Index: vlc-3.0.17.4/configure.ac +=================================================================== +--- vlc-3.0.17.4.orig/configure.ac ++++ vlc-3.0.17.4/configure.ac +@@ -1717,7 +1717,7 @@ then + AS_IF([test "${LUAC}" = "false"], [ + AC_MSG_ERROR([Could not find the LUA byte compiler.]) + ]) +- AS_IF([test -d "${CONTRIB_DIR}" -a -f "${CONTRIB_DIR}/lib/liblua.a" -a `echo|${LUAC} -o - -|od -j 8 -N 2 -t x2|head -n 1|tr -s ' '|cut -d' ' -f2` != 0404], [ ++ AS_IF([test -d "${CONTRIB_DIR}" -a -f "${CONTRIB_DIR}/lib/liblua5.4.a" -a `echo|${LUAC} -o - -|od -j 12 -N 2 -t x2|head -n 1|tr -s ' '|cut -d' ' -f2` != 0404], [ + AC_MSG_ERROR([You need 32-bits luac when using lua from contrib.]) + ]) + fi diff --git a/vlc-lua-5.3.patch b/vlc-lua-5.3.patch index a4ad4a9..21101ea 100644 --- a/vlc-lua-5.3.patch +++ b/vlc-lua-5.3.patch @@ -1,13 +1,263 @@ -Index: vlc-3.0.2/modules/lua/libs/io.c +From 0e0b070c26d197e848f1548fca455bf97db471a3 Mon Sep 17 00:00:00 2001 +From: Lukas Bergdoll +Date: Sat, 17 Nov 2018 13:53:27 +0100 +Subject: [PATCH] lua: replace deprecated luaL_checkint with luaL_checkinteger +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Acked-by: Shaleen Jain +Signed-off-by: Rémi Denis-Courmont +--- + modules/lua/demux.c | 4 ++-- + modules/lua/libs/dialog.c | 14 +++++++------- + modules/lua/libs/io.c | 2 +- + modules/lua/libs/net.c | 16 ++++++++-------- + modules/lua/libs/osd.c | 4 ++-- + modules/lua/libs/playlist.c | 10 +++++----- + modules/lua/libs/stream.c | 2 +- + modules/lua/libs/volume.c | 2 +- + 8 files changed, 27 insertions(+), 27 deletions(-) + +Index: vlc-3.0.17.4/modules/lua/demux.c =================================================================== ---- vlc-3.0.2.orig/modules/lua/libs/io.c -+++ vlc-3.0.2/modules/lua/libs/io.c +--- vlc-3.0.17.4.orig/modules/lua/demux.c ++++ vlc-3.0.17.4/modules/lua/demux.c +@@ -52,7 +52,7 @@ struct vlclua_playlist + static int vlclua_demux_peek( lua_State *L ) + { + stream_t *s = (stream_t *)vlclua_get_this(L); +- int n = luaL_checkint( L, 1 ); ++ int n = luaL_checkinteger( L, 1 ); + const uint8_t *p_peek; + + ssize_t val = vlc_stream_Peek(s->p_source, &p_peek, n); +@@ -66,7 +66,7 @@ static int vlclua_demux_peek( lua_State + static int vlclua_demux_read( lua_State *L ) + { + stream_t *s = (stream_t *)vlclua_get_this(L); +- int n = luaL_checkint( L, 1 ); ++ int n = luaL_checkinteger( L, 1 ); + char *buf = malloc(n); + + if (buf != NULL) +Index: vlc-3.0.17.4/modules/lua/libs/dialog.c +=================================================================== +--- vlc-3.0.17.4.orig/modules/lua/libs/dialog.c ++++ vlc-3.0.17.4/modules/lua/libs/dialog.c +@@ -382,7 +382,7 @@ static int lua_GetDialogUpdate( lua_Stat + /* Read entry in the Lua registry */ + lua_pushlightuserdata( L, (void*) &key_update ); + lua_gettable( L, LUA_REGISTRYINDEX ); +- return luaL_checkint( L, -1 ); ++ return luaL_checkinteger( L, -1 ); + } + + /** Manually update a dialog +@@ -573,22 +573,22 @@ static int vlclua_create_widget_inner( l + + /* Set common arguments: col, row, hspan, vspan, width, height */ + if( lua_isnumber( L, arg ) ) +- p_widget->i_column = luaL_checkint( L, arg ); ++ p_widget->i_column = luaL_checkinteger( L, arg ); + else goto end_of_args; + if( lua_isnumber( L, ++arg ) ) +- p_widget->i_row = luaL_checkint( L, arg ); ++ p_widget->i_row = luaL_checkinteger( L, arg ); + else goto end_of_args; + if( lua_isnumber( L, ++arg ) ) +- p_widget->i_horiz_span = luaL_checkint( L, arg ); ++ p_widget->i_horiz_span = luaL_checkinteger( L, arg ); + else goto end_of_args; + if( lua_isnumber( L, ++arg ) ) +- p_widget->i_vert_span = luaL_checkint( L, arg ); ++ p_widget->i_vert_span = luaL_checkinteger( L, arg ); + else goto end_of_args; + if( lua_isnumber( L, ++arg ) ) +- p_widget->i_width = luaL_checkint( L, arg ); ++ p_widget->i_width = luaL_checkinteger( L, arg ); + else goto end_of_args; + if( lua_isnumber( L, ++arg ) ) +- p_widget->i_height = luaL_checkint( L, arg ); ++ p_widget->i_height = luaL_checkinteger( L, arg ); + else goto end_of_args; + + end_of_args: +Index: vlc-3.0.17.4/modules/lua/libs/io.c +=================================================================== +--- vlc-3.0.17.4.orig/modules/lua/libs/io.c ++++ vlc-3.0.17.4/modules/lua/libs/io.c @@ -139,7 +139,7 @@ static int vlclua_io_file_seek( lua_Stat const char* psz_mode = luaL_optstring( L, 2, NULL ); if ( psz_mode != NULL ) { - long i_offset = luaL_optlong( L, 3, 0 ); -+ long i_offset = (long) luaL_optinteger(L, 3, 0); ++ long i_offset = luaL_optinteger( L, 3, 0 ); int i_mode; if ( !strcmp( psz_mode, "set" ) ) i_mode = SEEK_SET; +Index: vlc-3.0.17.4/modules/lua/libs/net.c +=================================================================== +--- vlc-3.0.17.4.orig/modules/lua/libs/net.c ++++ vlc-3.0.17.4/modules/lua/libs/net.c +@@ -179,7 +179,7 @@ static int vlclua_net_listen_tcp( lua_St + { + vlc_object_t *p_this = vlclua_get_this( L ); + const char *psz_host = luaL_checkstring( L, 1 ); +- int i_port = luaL_checkint( L, 2 ); ++ int i_port = luaL_checkinteger( L, 2 ); + int *pi_fd = net_ListenTCP( p_this, psz_host, i_port ); + if( pi_fd == NULL ) + return luaL_error( L, "Cannot listen on %s:%d", psz_host, i_port ); +@@ -251,7 +251,7 @@ static int vlclua_net_connect_tcp( lua_S + { + vlc_object_t *p_this = vlclua_get_this( L ); + const char *psz_host = luaL_checkstring( L, 1 ); +- int i_port = luaL_checkint( L, 2 ); ++ int i_port = luaL_checkinteger( L, 2 ); + int i_fd = net_ConnectTCP( p_this, psz_host, i_port ); + lua_pushinteger( L, vlclua_fd_map_safe( L, i_fd ) ); + return 1; +@@ -259,14 +259,14 @@ static int vlclua_net_connect_tcp( lua_S + + static int vlclua_net_close( lua_State *L ) + { +- int i_fd = luaL_checkint( L, 1 ); ++ int i_fd = luaL_checkinteger( L, 1 ); + vlclua_fd_unmap_safe( L, i_fd ); + return 0; + } + + static int vlclua_net_send( lua_State *L ) + { +- int fd = vlclua_fd_get( L, luaL_checkint( L, 1 ) ); ++ int fd = vlclua_fd_get( L, luaL_checkinteger( L, 1 ) ); + size_t i_len; + const char *psz_buffer = luaL_checklstring( L, 2, &i_len ); + +@@ -278,7 +278,7 @@ static int vlclua_net_send( lua_State *L + + static int vlclua_net_recv( lua_State *L ) + { +- int fd = vlclua_fd_get( L, luaL_checkint( L, 1 ) ); ++ int fd = vlclua_fd_get( L, luaL_checkinteger( L, 1 ) ); + size_t i_len = (size_t)luaL_optinteger( L, 2, 1 ); + char psz_buffer[i_len]; + +@@ -312,7 +312,7 @@ static int vlclua_net_poll( lua_State *L + lua_pushnil( L ); + for( int i = 0; lua_next( L, 1 ); i++ ) + { +- luafds[i] = luaL_checkint( L, -2 ); ++ luafds[i] = luaL_checkinteger( L, -2 ); + p_fds[i].fd = vlclua_fd_get( L, luafds[i] ); + p_fds[i].events = luaL_checkinteger( L, -1 ); + p_fds[i].events &= POLLIN | POLLOUT | POLLPRI; +@@ -360,7 +360,7 @@ static int vlclua_fd_open( lua_State *L + #ifndef _WIN32 + static int vlclua_fd_write( lua_State *L ) + { +- int fd = vlclua_fd_get( L, luaL_checkint( L, 1 ) ); ++ int fd = vlclua_fd_get( L, luaL_checkinteger( L, 1 ) ); + size_t i_len; + const char *psz_buffer = luaL_checklstring( L, 2, &i_len ); + +@@ -371,7 +371,7 @@ static int vlclua_fd_write( lua_State *L + + static int vlclua_fd_read( lua_State *L ) + { +- int fd = vlclua_fd_get( L, luaL_checkint( L, 1 ) ); ++ int fd = vlclua_fd_get( L, luaL_checkinteger( L, 1 ) ); + size_t i_len = (size_t)luaL_optinteger( L, 2, 1 ); + char psz_buffer[i_len]; + +Index: vlc-3.0.17.4/modules/lua/libs/osd.c +=================================================================== +--- vlc-3.0.17.4.orig/modules/lua/libs/osd.c ++++ vlc-3.0.17.4/modules/lua/libs/osd.c +@@ -154,7 +154,7 @@ static int vlc_osd_slider_type_from_stri + + static int vlclua_osd_slider( lua_State *L ) + { +- int i_position = luaL_checkint( L, 1 ); ++ int i_position = luaL_checkinteger( L, 1 ); + const char *psz_type = luaL_checkstring( L, 2 ); + int i_type = vlc_osd_slider_type_from_string( psz_type ); + int i_chan = (int)luaL_optinteger( L, 3, VOUT_SPU_CHANNEL_OSD ); +@@ -198,7 +198,7 @@ static int vlclua_spu_channel_register( + + static int vlclua_spu_channel_clear( lua_State *L ) + { +- int i_chan = luaL_checkint( L, 1 ); ++ int i_chan = luaL_checkinteger( L, 1 ); + input_thread_t *p_input = vlclua_get_input_internal( L ); + if( !p_input ) + return luaL_error( L, "Unable to find input." ); +Index: vlc-3.0.17.4/modules/lua/libs/playlist.c +=================================================================== +--- vlc-3.0.17.4.orig/modules/lua/libs/playlist.c ++++ vlc-3.0.17.4/modules/lua/libs/playlist.c +@@ -69,7 +69,7 @@ static int vlclua_playlist_next( lua_Sta + + static int vlclua_playlist_skip( lua_State * L ) + { +- int i_skip = luaL_checkint( L, 1 ); ++ int i_skip = luaL_checkinteger( L, 1 ); + playlist_t *p_playlist = vlclua_get_playlist_internal( L ); + playlist_Skip( p_playlist, i_skip ); + return 0; +@@ -127,7 +127,7 @@ static int vlclua_playlist_random( lua_S + + static int vlclua_playlist_gotoitem( lua_State * L ) + { +- int i_id = luaL_checkint( L, 1 ); ++ int i_id = luaL_checkinteger( L, 1 ); + playlist_t *p_playlist = vlclua_get_playlist_internal( L ); + PL_LOCK; + playlist_ViewPlay( p_playlist, NULL, +@@ -138,7 +138,7 @@ static int vlclua_playlist_gotoitem( lua + + static int vlclua_playlist_delete( lua_State * L ) + { +- int i_id = luaL_checkint( L, 1 ); ++ int i_id = luaL_checkinteger( L, 1 ); + playlist_t *p_playlist = vlclua_get_playlist_internal( L ); + + PL_LOCK; +@@ -152,8 +152,8 @@ static int vlclua_playlist_delete( lua_S + + static int vlclua_playlist_move( lua_State * L ) + { +- int i_item = luaL_checkint( L, 1 ); +- int i_target = luaL_checkint( L, 2 ); ++ int i_item = luaL_checkinteger( L, 1 ); ++ int i_target = luaL_checkinteger( L, 2 ); + playlist_t *p_playlist = vlclua_get_playlist_internal( L ); + PL_LOCK; + playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_item ); +Index: vlc-3.0.17.4/modules/lua/libs/stream.c +=================================================================== +--- vlc-3.0.17.4.orig/modules/lua/libs/stream.c ++++ vlc-3.0.17.4/modules/lua/libs/stream.c +@@ -123,7 +123,7 @@ static int vlclua_stream_read( lua_State + { + int i_read; + stream_t **pp_stream = (stream_t **)luaL_checkudata( L, 1, "stream" ); +- int n = luaL_checkint( L, 2 ); ++ int n = luaL_checkinteger( L, 2 ); + uint8_t *p_read = malloc( n ); + if( !p_read ) return vlclua_error( L ); + +Index: vlc-3.0.17.4/modules/lua/libs/volume.c +=================================================================== +--- vlc-3.0.17.4.orig/modules/lua/libs/volume.c ++++ vlc-3.0.17.4/modules/lua/libs/volume.c +@@ -48,7 +48,7 @@ + static int vlclua_volume_set( lua_State *L ) + { + playlist_t *p_this = vlclua_get_playlist_internal( L ); +- int i_volume = luaL_checkint( L, 1 ); ++ int i_volume = luaL_checkinteger( L, 1 ); + if( i_volume < 0 ) + i_volume = 0; + int i_ret = playlist_VolumeSet( p_this, i_volume/(float)AOUT_VOLUME_DEFAULT ); diff --git a/vlc.changes b/vlc.changes index 060f6df..a30adad 100644 --- a/vlc.changes +++ b/vlc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jul 6 16:40:48 UTC 2022 - Dominique Leuenberger + +- Extend vlc-lua-5.3.patch: match upstream commit 0e0b070c26. +- Add 867.patch: support LUA 5.4 (boo#1200944). + ------------------------------------------------------------------- Mon May 23 10:14:07 UTC 2022 - Dominique Leuenberger diff --git a/vlc.spec b/vlc.spec index 387532a..0ce89b2 100644 --- a/vlc.spec +++ b/vlc.spec @@ -49,10 +49,11 @@ Patch0: vlc.a52.patch Patch1: vlc-allow-deprecated-fribidi.patch # PATCH-FIX-UPSTREAM vlc-lua-5.3.patch dimstar@opensuse.org -- Replace lua_optlong with lua_optinteger Patch2: vlc-lua-5.3.patch +Patch3: 867.patch # PATCH-FIX-UPSTREAM fix-build-with-fdk-2.0.patch -- Fix building vlc with libfdk-aac v2 -Patch3: fix-build-with-fdk-2.0.patch +Patch4: fix-build-with-fdk-2.0.patch # PATCH-FIX-UPSTREAM vlc-dav1d-1.0.patch -- Fix build with dav1d 1.0 -Patch4: vlc-dav1d-1.0.patch +Patch5: vlc-dav1d-1.0.patch # PATCH-FEATURE-OPENSUSE vlc-projectM-qt5.patch -- Build against projectM-qt5; openSUSE provides projectM as -qt and -qt5 variant Patch100: vlc-projectM-qt5.patch # PATCH-FIX-UPSTREAM -- Use OpenCV C++ API @@ -311,7 +312,6 @@ Summary: Translations for package %{name} # We do not want to require vlc, which is GUI based, but only vlc-noX Group: System/Localization Requires: %{name}-noX = %{version} -Supplements: packageand(bundle-lang-other:%{name}-noX) Provides: %{name}-lang-all = %{version} BuildArch: noarch @@ -404,8 +404,8 @@ OpenCV based video filters and a face detection example. %setup -q %patch0 -p1 %patch1 -p1 -%patch3 -p1 %patch4 -p1 +%patch5 -p1 %if 0%{?suse_version} > 1320 && 0%{?suse_version} < 1550 && 0%{?sle_version} < 150200 %patch100 -p1 %endif @@ -419,9 +419,8 @@ fi ### And LUA 5.3.1 has some more API changes if pkg-config --atleast-version 5.3.1 lua; then - sed -i 's/luaL_checkint(/(int)luaL_checkinteger(/' \ - modules/lua/{demux,libs/{configuration,dialog,net,osd,playlist,stream,variables,volume}}.c %patch2 -p1 +%patch3 -p1 fi # We do not rely on contrib but make use of system libraries