From 3d401b88c8c798f187baa1ce44518eeecaace6a3 Mon Sep 17 00:00:00 2001 From: David King Date: Oct 02 2015 18:49:50 +0000 Subject: Use lua 5.2 patch from upstream bugtracker --- diff --git a/fillets-ng-1.0.1-lua-5.2.patch b/fillets-ng-1.0.1-lua-5.2.patch new file mode 100644 index 0000000..aa594e3 --- /dev/null +++ b/fillets-ng-1.0.1-lua-5.2.patch @@ -0,0 +1,50 @@ +Index: src/gengine/ScriptState.cpp +=================================================================== +RCS file: /cvsroot/fillets/fillets-ng/src/gengine/ScriptState.cpp,v +retrieving revision 1.13 +diff -u -r1.13 ScriptState.cpp +--- src/gengine/ScriptState.cpp 6 Jul 2005 18:50:18 -0000 1.13 ++++ src/gengine/ScriptState.cpp 6 Apr 2014 22:11:01 -0000 +@@ -22,11 +22,11 @@ + //----------------------------------------------------------------- + ScriptState::ScriptState() + { +- m_state = lua_open(); +- luaopen_base(m_state); +- luaopen_string(m_state); +- luaopen_math(m_state); +- luaopen_table(m_state); ++ m_state = luaL_newstate(); ++ luaL_requiref(m_state, "_G", luaopen_base, true); ++ luaL_requiref(m_state, LUA_STRLIBNAME, luaopen_string, true); ++ luaL_requiref(m_state, LUA_MATHLIBNAME, luaopen_math, true); ++ luaL_requiref(m_state, LUA_TABLIBNAME, luaopen_table, true); + + prepareErrorHandler(); + } +@@ -42,9 +42,11 @@ + void + ScriptState::prepareErrorHandler() + { ++ lua_pushglobaltable(m_state); + lua_pushliteral(m_state, "_TRACEBACK"); + lua_pushcfunction(m_state, script_debugStack); +- lua_settable(m_state, LUA_GLOBALSINDEX); ++ lua_settable(m_state, -3); ++ lua_pop(m_state, 1); + } + //----------------------------------------------------------------- + /** +@@ -53,9 +55,11 @@ + void + ScriptState::insertErrorHandler(int index) + { ++ lua_pushglobaltable(m_state); + lua_pushliteral(m_state, "_TRACEBACK"); +- lua_rawget(m_state, LUA_GLOBALSINDEX); ++ lua_rawget(m_state, -2); + lua_insert(m_state, index); ++ lua_pop(m_state, 1); + } + //----------------------------------------------------------------- + /** diff --git a/fillets-ng.spec b/fillets-ng.spec index 8a8137a..eeacecd 100644 --- a/fillets-ng.spec +++ b/fillets-ng.spec @@ -12,13 +12,15 @@ Source1: fillets.desktop # to exact cirles. Source2: fillets.svg Patch0: fillets-ng-0.8.1-gcc43.patch -Requires: fillets-ng-data >= 1.0.1 +# http://sourceforge.net/p/fillets/bugs/7/ +Patch1: fillets-ng-1.0.1-lua-5.2.patch +Requires: fillets-ng-data >= 1.0.1-4 BuildRequires: SDL-devel BuildRequires: SDL_mixer-devel BuildRequires: SDL_image-devel BuildRequires: SDL_ttf-devel -BuildRequires: compat-lua-devel BuildRequires: pkgconfig(fribidi) +BuildRequires: pkgconfig(lua) BuildRequires: desktop-file-utils Requires(post): coreutils Requires(postun): coreutils @@ -35,10 +37,11 @@ comforting music. %prep %setup -q %patch0 -p1 -b .gcc43 +%patch1 -p0 -b .lua52 %build -%configure LUA_CFLAGS='-I${includedir}/lua-5.1' LUA_LIBS='-llua-5.1 -lm -ldl' --datadir=%{_datadir}/fillets-ng +%configure --datadir=%{_datadir}/fillets-ng %{__make} %{?_smp_mflags} @@ -119,6 +122,7 @@ fi - Use license macro for COPYING - Remove obsolete clean and defattr statements - Use pkgconfig for BuildRequires +- Use lua 5.2 patch from upstream bugtracker * Wed Jun 17 2015 Fedora Release Engineering - 1.0.1-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild