summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsoloturn2019-01-02 21:53:14 +0100
committersoloturn2019-01-02 21:59:01 +0100
commit23ccd2242828f38449bb40ec18e400095e68d1b0 (patch)
treebb4ff22632b27eae52740a656099d9b43e238042
downloadaur-23ccd2242828f38449bb40ec18e400095e68d1b0.tar.gz
restore xmoto from ABS, update to new gcc
xmoto was deleted from ABS, restore it from: https://git.archlinux.org/svntogit/community.git/tree/xmoto/repos/community-x86_64?id=3c59fdc5b185fa18af9fe6912d52ba215b57c80a to build with the newest environment, copy gcc-7 and utf patch from debian master.
-rw-r--r--.SRCINFO32
-rw-r--r--PKGBUILD61
-rw-r--r--gcc-7.patch51
-rw-r--r--lua52_compat.patch45
-rw-r--r--utf8.patch16
5 files changed, 205 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..277c3e9418f6
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = xmoto
+ pkgdesc = A challenging 2D motocross platform game, where physics play an important role.
+ pkgver = 0.5.11
+ pkgrel = 7
+ url = http://xmoto.tuxfamily.org
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = mesa
+ depends = libjpeg
+ depends = libpng
+ depends = lua52
+ depends = sdl_mixer
+ depends = ode
+ depends = curl
+ depends = sqlite
+ depends = sdl_ttf
+ depends = sdl_net
+ depends = glu
+ depends = libxdg-basedir
+ depends = libxml2
+ source = http://download.tuxfamily.org/xmoto/xmoto/0.5.11/xmoto-0.5.11-src.tar.gz
+ source = gcc-7.patch
+ source = utf8.patch
+ source = lua52_compat.patch
+ sha1sums = a795616fb359e60be343e339f7acf5e95e0f1ce2
+ sha1sums = d30fad6a138de36566c5343ea04e6c7141e767f8
+ sha1sums = 1a64966b887ecbd7280d97988cd8526813820611
+ sha1sums = 104542546fbbd24172ddaa179f87e1b26df8b761
+
+pkgname = xmoto
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..866496d1202c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,61 @@
+# $Id$
+# Maintainer: soloturn@gmail.com
+# Contributor: Ronald van Haren <ronald.archlinux.org>
+# Contributor: Travis Willard <travisw@wmpub.ca>
+# Contributor: Denis (dtonator@gmail.com)
+
+pkgname=xmoto
+pkgver=0.5.11
+pkgrel=7
+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' 'lua52' 'sdl_mixer' 'ode' 'curl' 'sqlite' 'sdl_ttf'
+ 'sdl_net' 'glu' 'libxdg-basedir' 'libxml2')
+makedepends=('mesa')
+source=("http://download.tuxfamily.org/${pkgname}/${pkgname}/${pkgver}/${pkgname}-${pkgver}-src.tar.gz"
+ 'gcc-7.patch'
+ 'utf8.patch'
+ 'lua52_compat.patch')
+sha1sums=('a795616fb359e60be343e339f7acf5e95e0f1ce2'
+ 'd30fad6a138de36566c5343ea04e6c7141e767f8'
+ '1a64966b887ecbd7280d97988cd8526813820611'
+ '104542546fbbd24172ddaa179f87e1b26df8b761')
+
+prepare() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ patch -Np1 -i "${srcdir}/gcc-7.patch"
+ patch -Np1 -i "${srcdir}/utf8.patch"
+ patch -Np1 -i "${srcdir}/lua52_compat.patch"
+ ./bootstrap
+
+ # Remove bundled ode library because its headers get picked up during build
+ rm -r src/ode
+}
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ # Build using the old C++ ABI to fix issue with missing text; the issue
+ # should be fixed in the next stable release (if that ever does happen)
+ CPPFLAGS+=' -D_GLIBCXX_USE_CXX11_ABI=0'
+
+ ./configure --prefix=/usr --disable-sdltest
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" mangdir=/usr/share/man/man6 install
+
+ # install desktop file
+ install -Dm0644 "${srcdir}/${pkgname}-${pkgver}/extra/xmoto.desktop" \
+ "${pkgdir}/usr/share/applications/xmoto.desktop"
+
+ # install icon for desktop file
+ install -Dm0644 "${srcdir}/${pkgname}-${pkgver}/extra/xmoto.xpm" \
+ "${pkgdir}/usr/share/pixmaps/xmoto.xpm"
+}
+
diff --git a/gcc-7.patch b/gcc-7.patch
new file mode 100644
index 000000000000..4226b32e8221
--- /dev/null
+++ b/gcc-7.patch
@@ -0,0 +1,51 @@
+Description: Avoid comparing pointers with booleans
+Author: Stephen Kitt <skitt@debian.org>
+Forwarded: https://github.com/xmoto/xmoto/pull/16
+
+--- a/src/WWW.cpp
++++ b/src/WWW.cpp
+@@ -206,7 +206,7 @@
+ std::string v_www_agent = WWW_AGENT;
+
+ /* open the file */
+- if( (v_destinationFile = fopen(v_local_file_tmp.c_str(), "wb")) == false) {
++ if( (v_destinationFile = fopen(v_local_file_tmp.c_str(), "wb")) == NULL) {
+ throw Exception("error : unable to open output file "
+ + v_local_file_tmp);
+ }
+@@ -320,7 +320,7 @@
+ LogInfo(std::string("Uploading replay " + p_replayFilename).c_str());
+
+ /* open the file */
+- if( (v_destinationFile = fopen(v_local_file.c_str(), "wb")) == false) {
++ if( (v_destinationFile = fopen(v_local_file.c_str(), "wb")) == NULL) {
+ throw Exception("error : unable to open output file " DEFAULT_WWW_MSGFILE("UR"));
+ }
+
+@@ -478,7 +478,7 @@
+ LogInfo("Sending vote");
+
+ /* open the file */
+- if( (v_destinationFile = fopen(v_local_file.c_str(), "wb")) == false) {
++ if( (v_destinationFile = fopen(v_local_file.c_str(), "wb")) == NULL) {
+ throw Exception("error : unable to open output file " DEFAULT_WWW_MSGFILE("SV"));
+ }
+
+@@ -562,7 +562,7 @@
+ LogInfo("Sending report");
+
+ /* open the file */
+- if( (v_destinationFile = fopen(v_local_file.c_str(), "wb")) == false) {
++ if( (v_destinationFile = fopen(v_local_file.c_str(), "wb")) == NULL) {
+ throw Exception("error : unable to open output file " DEFAULT_WWW_MSGFILE("SR"));
+ }
+
+@@ -677,7 +677,7 @@
+ LogInfo(std::string("Uploading dbsync " + p_dbSyncFilename + " to " + p_url_to_transfert).c_str());
+
+ /* open the file */
+- if( (v_destinationFile = fopen(p_answerFile.c_str(), "wb")) == false) {
++ if( (v_destinationFile = fopen(p_answerFile.c_str(), "wb")) == NULL) {
+ throw Exception("error : unable to open output file " + p_answerFile);
+ }
+
diff --git a/lua52_compat.patch b/lua52_compat.patch
new file mode 100644
index 000000000000..54aaf20d6a6a
--- /dev/null
+++ b/lua52_compat.patch
@@ -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>
diff --git a/utf8.patch b/utf8.patch
new file mode 100644
index 000000000000..e5d0dfb2a4be
--- /dev/null
+++ b/utf8.patch
@@ -0,0 +1,16 @@
+Description: Build with g++'s new utf8.h
+Author: Stephen Kitt <skitt@debian.org>
+
+--- a/src/helpers/utf8.h
++++ b/src/helpers/utf8.h
+@@ -18,8 +18,8 @@
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ =============================================================================*/
+
+-#ifndef __UTF8_H__
+-#define __UTF8_H__
++#ifndef __XMOTO_UTF8_H__
++#define __XMOTO_UTF8_H__
+
+ #include <vector>
+ #include <string>