From cdee62c94bf0909b27b839c8de1937e5ae8460dd Mon Sep 17 00:00:00 2001 From: Mystro256 Date: May 03 2018 18:18:56 +0000 Subject: Add patch for lua 5.3 --- diff --git a/love-11.1-lua53.patch b/love-11.1-lua53.patch new file mode 100644 index 0000000..c13e73b --- /dev/null +++ b/love-11.1-lua53.patch @@ -0,0 +1,59 @@ +# HG changeset patch +# User Bart van Strien +# Date 1525370656 -7200 +# Node ID 6724986f3935b8373319067e99400a681a18cfc3 +# Parent a95b5df234f888dcf751f3fb3a39783a7bb67b5f +Restore lua 5.2/5.3 compatibility (fixes #1408) + +diff --git a/src/common/runtime.cpp b/src/common/runtime.cpp +--- a/src/common/runtime.cpp ++++ b/src/common/runtime.cpp +@@ -879,4 +879,13 @@ + return Type::byName(luaL_checkstring(L, idx)); + } + ++int luax_resume(lua_State *L, int nargs) ++{ ++#if LUA_VERSION_NUM >= 502 ++ return lua_resume(L, nullptr, nargs); ++#else ++ return lua_resume(L, nargs); ++#endif ++} ++ + } // love +diff --git a/src/common/runtime.h b/src/common/runtime.h +--- a/src/common/runtime.h ++++ b/src/common/runtime.h +@@ -676,6 +676,11 @@ + return 0; + } + ++/** ++ * Compatibility shim for lua_resume ++ **/ ++int luax_resume(lua_State *L, int nargs); ++ + } // love + + #endif // LOVE_RUNTIME_H +diff --git a/src/love.cpp b/src/love.cpp +--- a/src/love.cpp ++++ b/src/love.cpp +@@ -19,6 +19,7 @@ + **/ + + #include "common/version.h" ++#include "common/runtime.h" + #include "modules/love/love.h" + #include + +@@ -214,7 +215,7 @@ + lua_newthread(L); + lua_pushvalue(L, -2); + int stackpos = lua_gettop(L); +- while (lua_resume(L, 0) == LUA_YIELD) ++ while (love::luax_resume(L, 0) == LUA_YIELD) + lua_pop(L, lua_gettop(L) - stackpos); + + retval = 0; diff --git a/love.spec b/love.spec index 27e5c05..cfe5d25 100644 --- a/love.spec +++ b/love.spec @@ -19,6 +19,10 @@ License: zlib and Public Domain URL: http://love2d.org Source0: https://bitbucket.org/rude/%{name}/get/%{version}.tar.gz#/%{name}-%{version}.tar.gz +# Fix for lua 5.3, cherry-picked from upstream master: +#https://bitbucket.org/rude/love/commits/6724986f3935b8373319067e99400a681a18cf +Patch1: %{name}-%{version}-lua53.patch + BuildRequires: desktop-file-utils BuildRequires: freetype-devel BuildRequires: mesa-libGL