[arch-commits] Commit in xmoto/trunk (PKGBUILD lua52_compat.patch)

Anatol Pomozov anatolik at archlinux.org
Sat May 9 03:58:02 UTC 2015


    Date: Saturday, May 9, 2015 @ 05:58:02
  Author: anatolik
Revision: 132998

Lua 5.2 rebuild

This version is not compatible with lua 5.3

Added:
  xmoto/trunk/lua52_compat.patch
Modified:
  xmoto/trunk/PKGBUILD

--------------------+
 PKGBUILD           |    8 ++++++--
 lua52_compat.patch |   45 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 2 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-05-09 02:28:08 UTC (rev 132997)
+++ PKGBUILD	2015-05-09 03:58:02 UTC (rev 132998)
@@ -5,20 +5,22 @@
 
 pkgname=xmoto
 pkgver=0.5.11
-pkgrel=1
+pkgrel=2
 pkgdesc="A challenging 2D motocross platform game, where physics play an important role."
 arch=('i686' 'x86_64')
 url="http://xmoto.tuxfamily.org"
 license=('GPL')
-depends=('libjpeg' 'libpng' 'lua' 'sdl_mixer' 'ode' 'curl' 'sqlite3' 'sdl_ttf'
+depends=('libjpeg' 'libpng' 'lua52' 'sdl_mixer' 'ode' 'curl' 'sqlite' 'sdl_ttf'
          'desktop-file-utils' 'sdl_net' 'glu' 'libxdg-basedir' 'libxml2')
 makedepends=('mesa')
 install=xmoto.install
 source=("http://download.tuxfamily.org/${pkgname}/${pkgname}/${pkgver}/${pkgname}-${pkgver}-src.tar.gz"
         'xmoto-0.5.10-libpng15.patch'
+        'lua52_compat.patch'
         'system.cpp.patch')
 sha1sums=('a795616fb359e60be343e339f7acf5e95e0f1ce2'
           '9d13fa09f1c558a0fc504f7e7b1ceac6b4b7b20d'
+          '104542546fbbd24172ddaa179f87e1b26df8b761'
           'e741f769d1fc5779a6688970ee97e2a61a50c7ae')
 
 prepare() {
@@ -26,6 +28,7 @@
 
   patch -Np1 -i "${srcdir}/xmoto-0.5.10-libpng15.patch"
   patch -Np1 -i "${srcdir}/system.cpp.patch"
+  patch -Np1 -i "${srcdir}/lua52_compat.patch"
 
   # Remove bundled ode library because its headers get picked up during build
   rm -r src/ode
@@ -34,6 +37,7 @@
 build() {
   cd "${srcdir}/${pkgname}-${pkgver}"
 
+  ./bootstrap # regenrate confif file because the lua patch modifies configure.in
   ./configure --prefix=/usr --disable-sdltest
   make
 }

Added: lua52_compat.patch
===================================================================
--- lua52_compat.patch	                        (rev 0)
+++ lua52_compat.patch	2015-05-09 03:58:02 UTC (rev 132998)
@@ -0,0 +1,45 @@
+diff --git a/configure.in b/configure.in
+index 452f196..dbceb05 100644
+--- a/configure.in
++++ b/configure.in
+@@ -157,8 +157,8 @@ AM_CONDITIONAL([USE_SDLGFX], test "$USE_SDLGFX" = "1")
+ # m
+ AC_CHECK_LIB(m, floor, , AC_MSG_ERROR(No math library found))
+ 
+-AC_SEARCH_LIBS(lua_pushboolean,lua lua5.1 lua50, [], [AC_MSG_ERROR(liblua5.1, liblua50, or liblua required)])
+-AC_SEARCH_LIBS(luaopen_math,lualib lualib5.1 lualib50, [], [AC_MSG_ERROR(liblualib5.1, liblualib50, or liblualib required)])
++AC_SEARCH_LIBS(lua_pushboolean,lua lua5.2 lua5.1 lua50, [], [AC_MSG_ERROR(liblua5.2 liblua5.1, liblua50, or liblua required)])
++AC_SEARCH_LIBS(luaopen_math,lualib liblua5.2 lualib5.1 lualib50, [], [AC_MSG_ERROR(liblualib5.2 liblualib5.1, liblualib50, or liblualib required)])
+ 
+ dnl ***** Check lua headers, as they are prone to be located random places on random systems! *****
+ dnl The following three lines where suggested by Eric Piel, but they don't seem to work on my system
+@@ -174,6 +174,8 @@ AC_CHECK_HEADER(lua/lua.h,    AC_DEFINE(HAVE_LUA_LUA_H)   [USE_LUA_VERSION="unkn
+ AC_CHECK_HEADER(lua50/lua.h,  AC_DEFINE(HAVE_LUA50_LUA_H) [USE_LUA_VERSION="5.0"])
+ AC_CHECK_HEADER(lua51/lua.h,  AC_DEFINE(HAVE_LUA51_LUA_H) [USE_LUA_VERSION="5.1"])
+ AC_CHECK_HEADER(lua5.1/lua.h, AC_DEFINE(HAVE_LUA5_1_LUA_H)[USE_LUA_VERSION="5.1"])
++AC_CHECK_HEADER(lua52/lua.h,  AC_DEFINE(HAVE_LUA52_LUA_H) [USE_LUA_VERSION="5.2"])
++AC_CHECK_HEADER(lua5.2/lua.h, AC_DEFINE(HAVE_LUA5_2_LUA_H)[USE_LUA_VERSION="5.2"])
+ AC_DEFINE(LUA_COMPAT_MODULE, 1)
+ 
+ AC_LANG_PUSH([C++])
+diff --git a/src/include/xm_lua.h b/src/include/xm_lua.h
+index 8a2cc17..f470de2 100644
+--- a/src/include/xm_lua.h
++++ b/src/include/xm_lua.h
+@@ -4,7 +4,15 @@ extern "C" {
+     #include "lauxlib.h"
+     #include "lualib.h"
+   #else
+-    #if defined(HAVE_LUA5_1_LUA_H)
++    #if defined(HAVE_LUA5_2_LUA_H)
++      #include <lua5.2/lua.h>
++      #include <lua5.2/lauxlib.h>
++      #include <lua5.2/lualib.h>
++    #elif defined(HAVE_LUA52_LUA_H)
++      #include <lua52/lua.h>
++      #include <lua52/lauxlib.h>
++      #include <lua52/lualib.h>
++    #elif defined(HAVE_LUA5_1_LUA_H)
+       #include <lua5.1/lua.h>
+       #include <lua5.1/lauxlib.h>
+       #include <lua5.1/lualib.h>



More information about the arch-commits mailing list