[asc] fix for lua 5.2

Tom Callaway spot at fedoraproject.org
Fri May 10 15:53:20 UTC 2013


commit ec181d9341460790036c05c58e7f46d7d226fad7
Author: Tom Callaway <spot at fedoraproject.org>
Date:   Fri May 10 11:52:49 2013 -0400

    fix for lua 5.2

 asc-2.5.0.0-lua-5.2.patch |   83 +++++++++++++++++++++++++++++++++++++++++++++
 asc.spec                  |    7 +++-
 2 files changed, 89 insertions(+), 1 deletions(-)
---
diff --git a/asc-2.5.0.0-lua-5.2.patch b/asc-2.5.0.0-lua-5.2.patch
new file mode 100644
index 0000000..fb0d084
--- /dev/null
+++ b/asc-2.5.0.0-lua-5.2.patch
@@ -0,0 +1,83 @@
+diff -up asc-2.5.0.0/source/lua/commands_wrap.cxx.lua-52 asc-2.5.0.0/source/lua/commands_wrap.cxx
+--- asc-2.5.0.0/source/lua/commands_wrap.cxx.lua-52	2012-05-19 11:30:39.000000000 -0400
++++ asc-2.5.0.0/source/lua/commands_wrap.cxx	2013-05-10 11:27:27.549984527 -0400
+@@ -10,6 +10,13 @@
+ 
+ #define SWIGLUA
+ 
++#ifndef lua_strlen
++#define lua_strlen(L,i)        lua_rawlen(L, (i))
++#endif
++
++#ifndef lua_pushglobaltable
++#define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
++#endif
+ 
+ #ifdef __cplusplus
+ /* SwigValueWrapper is described in swig.swg */
+@@ -6159,7 +6166,7 @@ fail:
+ }
+ #endif
+ 
+-static const struct luaL_reg swig_commands[] = {
++static const struct luaL_Reg swig_commands[] = {
+     { "getActiveMap", _wrap_getActiveMap},
+     { "repaintMap", _wrap_repaintMap},
+     { "getObjectType", _wrap_getObjectType},
+@@ -6587,7 +6594,7 @@ SWIGEXPORT int SWIG_init(lua_State* L)
+ {
+   int i;
+   /* start with global table */
+-  lua_pushvalue(L,LUA_GLOBALSINDEX);
++  lua_pushglobaltable(L);
+   /* SWIG's internal initalisation */
+   SWIG_InitializeModule((void*)L);
+   SWIG_PropagateClientData();
+diff -up asc-2.5.0.0/source/lua/luastate.cpp.lua-52 asc-2.5.0.0/source/lua/luastate.cpp
+--- asc-2.5.0.0/source/lua/luastate.cpp.lua-52	2012-05-19 11:30:39.000000000 -0400
++++ asc-2.5.0.0/source/lua/luastate.cpp	2013-05-10 11:20:57.456998471 -0400
+@@ -12,6 +12,9 @@ extern "C"
+ 
+ #include "luastate.h"
+ 
++#ifndef lua_open
++#define lua_open()     luaL_newstate()
++#endif
+ 
+ class LuaStatePrivate {
+    public:
+diff -up asc-2.5.0.0/source/lua/mapedcommands_wrap.cxx.lua-52 asc-2.5.0.0/source/lua/mapedcommands_wrap.cxx
+--- asc-2.5.0.0/source/lua/mapedcommands_wrap.cxx.lua-52	2012-05-19 11:30:39.000000000 -0400
++++ asc-2.5.0.0/source/lua/mapedcommands_wrap.cxx	2013-05-10 11:28:30.558982275 -0400
+@@ -10,6 +10,13 @@
+ 
+ #define SWIGLUA
+ 
++#ifndef lua_strlen
++#define lua_strlen(L,i)        lua_rawlen(L, (i))
++#endif
++
++#ifndef lua_pushglobaltable
++#define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
++#endif
+ 
+ #ifdef __cplusplus
+ /* SwigValueWrapper is described in swig.swg */
+@@ -6637,7 +6644,7 @@ fail:
+ }
+ #endif
+ 
+-static const struct luaL_reg swig_commands[] = {
++static const struct luaL_Reg swig_commands[] = {
+     { "getActiveMap", _wrap_getActiveMap},
+     { "repaintMap", _wrap_repaintMap},
+     { "getObjectType", _wrap_getObjectType},
+@@ -7049,7 +7056,7 @@ SWIGEXPORT int SWIG_init(lua_State* L)
+ {
+   int i;
+   /* start with global table */
+-  lua_pushvalue(L,LUA_GLOBALSINDEX);
++  lua_pushglobaltable(L);
+   /* SWIG's internal initalisation */
+   SWIG_InitializeModule((void*)L);
+   SWIG_PropagateClientData();
diff --git a/asc.spec b/asc.spec
index 491abae..9d1ca0b 100644
--- a/asc.spec
+++ b/asc.spec
@@ -1,6 +1,6 @@
 Name:           asc
 Version:        2.5.0.0
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Advanced Strategic Command
 Group:          Amusements/Games
 License:        GPLv2+
@@ -8,6 +8,7 @@ URL:            http://www.asc-hq.org/
 Source0:        http://downloads.sourceforge.net/asc-hq/asc-%{version}.tar.bz2
 Source1:        %{name}.desktop
 Patch0:         asc-2.4.0.0-gcc47.patch
+Patch1:		asc-2.5.0.0-lua-5.2.patch
 BuildRequires:  SDL_image-devel SDL_mixer-devel SDL_sound-devel
 BuildRequires:  bzip2-devel libjpeg-devel libsigc++-devel physfs-devel
 BuildRequires:  libvorbis-devel libpng-devel libtiff-devel boost-devel
@@ -22,6 +23,7 @@ ASC is a free, turn based strategy game.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1 -b .lua-52
 sed -i 's|$datadir/games/|$datadir/|g' configure
 sed -i 's|$(datadir)/games/|$(datadir)/|g' `find -name Makefile.in`
 chmod -x source/libs/paragui/include/paragui.h
@@ -73,6 +75,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 
 
 %changelog
+* Fri May 10 2013 Tom Callaway <spot at fedoraproject.org> - 2.5.0.0-4
+- fix for lua 5.2
+
 * Fri May 10 2013 Hans de Goede <hdegoede at redhat.com> - 2.5.0.0-3
 - Cleanup .desktop file to match current standards
 


More information about the scm-commits mailing list