XMoto: bump version

This commit is contained in:
Gerasim Troeglazov
2021-09-25 22:59:40 +10:00
parent ea3bbef3f0
commit be9d773d91
3 changed files with 189 additions and 238 deletions

View File

@@ -1,205 +0,0 @@
From 4512ab9748a106f16eba86dcb755ef53b08bc864 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kamil=20Krzy=C5=BCanowski?= <kamnxt@kamnxt.com>
Date: Fri, 12 Dec 2014 16:46:15 +0000
Subject: Patched the files to make them work on haiku.
diff --git a/configure.in b/configure.in
index c97ad4b..e623007 100644
--- a/configure.in
+++ b/configure.in
@@ -155,7 +155,7 @@ fi
AM_CONDITIONAL([USE_SDLGFX], test "$USE_SDLGFX" = "1")
# m
-AC_CHECK_LIB(m, floor, , AC_MSG_ERROR(No math library found))
+AC_SEARCH_LIBS(floor, m, , 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)])
diff --git a/src/GameInit.cpp b/src/GameInit.cpp
index 0ae9373..86f23d7 100644
--- a/src/GameInit.cpp
+++ b/src/GameInit.cpp
@@ -269,7 +269,7 @@ void GameApp::run_load(int nNumArgs, char** ppcArgs) {
struct sigaction v_act;
v_act.sa_handler = xmexit_term;
-#if !defined(__APPLE__) && !defined(__FreeBSD__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__HAIKU__)
v_act.sa_restorer = NULL;
#endif
sigemptyset(&v_act.sa_mask);
diff --git a/src/VFileIO.cpp b/src/VFileIO.cpp
index 7d6c7d9..cd95f58 100644
--- a/src/VFileIO.cpp
+++ b/src/VFileIO.cpp
@@ -106,7 +106,7 @@ std::string getPWDDir(bool i_asUtf8 = false) {
#endif
}
-#if !defined(WIN32) && !defined(__MORPHOS__) && !defined(__amigaos4__)
+#if !defined(WIN32) && !defined(__MORPHOS__) && !defined(__amigaos4__) && !defined(__HAIKU__)
void strlwr(char *pc) {
for(unsigned int i=0; i<strlen(pc); i++) pc[i] = tolower(pc[i]);
}
diff --git a/src/net/extSDL_net.cpp b/src/net/extSDL_net.cpp
index 1803710..0d130aa 100644
--- a/src/net/extSDL_net.cpp
+++ b/src/net/extSDL_net.cpp
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <errno.h>
// read the .h to understand why i redefine SDLNet_TCP_Send
-#if !defined(WIN32) && !defined(__APPLE__)
+#if !defined(WIN32) && !defined(__APPLE__) && !defined(__HAIKU__)
#include <sys/socket.h>
#define SOCKET int
--
2.26.0
From 5a048f626ba39373bc8bab717356ec0c5f8d0e69 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 30 Oct 2019 13:49:11 +1000
Subject: Fix build
diff --git a/src/PolyDraw.h b/src/PolyDraw.h
index aa2e6af..9a49f22 100644
--- a/src/PolyDraw.h
+++ b/src/PolyDraw.h
@@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef __POLYDRAW_H__
#define __POLYDRAW_H__
+#include <SDL.h>
+
class PolyDraw {
public:
struct EdgeValue {
diff --git a/src/WWW.cpp b/src/WWW.cpp
index a61e753..c717010 100644
--- a/src/WWW.cpp
+++ b/src/WWW.cpp
@@ -206,7 +206,7 @@ void FSWeb::downloadFile(const std::string &p_local_file,
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 @@ void FSWeb::uploadReplay(const std::string& p_replayFilename,
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 @@ void FSWeb::sendVote(const std::string& p_id_level,
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 @@ void FSWeb::sendReport(const std::string& p_reportauthor,
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 @@ void FSWeb::uploadDbSync(const std::string& p_dbSyncFilename,
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);
}
--
2.26.0
From 0b66f62ce479b6714609aed293e6e86a4cfa9705 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 20 May 2020 12:21:50 +1000
Subject: Use find_directory
diff --git a/src/VFileIO.cpp b/src/VFileIO.cpp
index cd95f58..d9b57ab 100644
--- a/src/VFileIO.cpp
+++ b/src/VFileIO.cpp
@@ -42,6 +42,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "XMSession_default.h"
#include "UserConfig.h"
+#ifdef __HAIKU__
+#include <Path.h>
+#include <FindDirectory.h>
+#include <StorageDefs.h>
+#endif
+
#ifdef WIN32
std::string win32_getHomeDir(bool i_asUtf8 = false) {
HANDLE hToken;
@@ -1191,6 +1197,20 @@ void XMFS::init(const std::string& AppDir, const std::string& i_binFile, const s
m_UserDataDirUTF8 = m_UserDataDir;
}
+#ifdef __HAIKU__
+ BPath settingsDir;
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, &settingsDir) == B_OK) {
+ m_UserDataDir = std::string(settingsDir.Path()) + std::string("/") + AppDir;
+ m_UserConfigDir = std::string(settingsDir.Path()) + std::string("/") + AppDir;
+ m_UserDataDirUTF8 = m_UserDataDir;
+ }
+ BPath cacheDir;
+ if (find_directory(B_USER_CACHE_DIRECTORY, &cacheDir) == B_OK) {
+ m_UserCacheDir = std::string(cacheDir.Path()) + std::string("/") + AppDir;
+ }
+#endif
+
+
/* And the data dir? */
m_SystemDataDir = std::string(GAMEDATADIR);
if(isDir(m_SystemDataDir)) {
--
2.26.0
From 3fb6d712a2ce19d848f2abf63ff2e1aa0f4e7d8c Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Thu, 21 May 2020 22:53:05 +1000
Subject: Hack for int32 conflict definitions
diff --git a/src/VFileIO.cpp b/src/VFileIO.cpp
index d9b57ab..de7b7fd 100644
--- a/src/VFileIO.cpp
+++ b/src/VFileIO.cpp
@@ -43,6 +43,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "UserConfig.h"
#ifdef __HAIKU__
+#define int32 FAKE_INT_TYPE
+#define uint32 FAKE_UINT_TYPE
+#include <SupportDefs.h>
#include <Path.h>
#include <FindDirectory.h>
#include <StorageDefs.h>
--
2.26.0

View File

@@ -0,0 +1,164 @@
From 3fd27675e042054ab0a7ad62ec8431b891c75a50 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 25 Sep 2021 22:40:52 +1000
Subject: Haiku fixes
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fdeb8e3..a3b6284 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -40,8 +40,8 @@ if(USE_OPENGL)
endif()
find_package(PNG REQUIRED)
-find_package(Lua)
-set(USE_SYSTEM_Lua $<AND:$<BOOL:${PREFER_SYSTEM_Lua}>,$<BOOL:${LUA51_FOUND}>,$<NOT:$<BOOL:${WIN32}>>>)
+find_package(Lua ${LUA_VERSION} EXACT REQUIRED)
+set(USE_SYSTEM_Lua $<AND:$<BOOL:${PREFER_SYSTEM_Lua}>,$<BOOL:${LUA_FOUND}>,$<NOT:$<BOOL:${WIN32}>>>)
if (NOT LUA_VERSION_STRING VERSION_LESS 5.2 AND LUA_VERSION_STRING VERSION_LESS 5.3)
add_definitions("-DLUA_COMPAT_ALL")
elseif (LUA_VERSION_STRING VERSION_GREATER_EQUAL "5.3")
@@ -443,6 +443,8 @@ target_link_libraries(xmoto PUBLIC
$<${USE_SYSTEM_XDG}:${XDG_LIBRARY}>
$<$<NOT:${USE_SYSTEM_XDG}>:xdgbasedir>
${ZLIB_LIBRARIES}
+ $<$<PLATFORM_ID:Haiku>:network>
+ $<$<PLATFORM_ID:Haiku>:be>
)
set_property(TARGET xmoto PROPERTY CXX_STANDARD 11)
diff --git a/src/common/PolyDraw.h b/src/common/PolyDraw.h
index 6036920..de0c5ec 100644
--- a/src/common/PolyDraw.h
+++ b/src/common/PolyDraw.h
@@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef __POLYDRAW_H__
#define __POLYDRAW_H__
+#include <SDL.h>
+
class PolyDraw {
public:
struct EdgeValue {
diff --git a/src/common/VFileIO.cpp b/src/common/VFileIO.cpp
index c38e39f..f29f79c 100644
--- a/src/common/VFileIO.cpp
+++ b/src/common/VFileIO.cpp
@@ -49,6 +49,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <iostream>
+#ifdef __HAIKU__
+#include <Path.h>
+#include <FindDirectory.h>
+#include <StorageDefs.h>
+#endif
+
#ifdef WIN32
std::string win32_getHomeDir(bool i_asUtf8 = false) {
HANDLE hToken;
@@ -115,7 +121,7 @@ std::string getPWDDir(bool i_asUtf8 = false) {
#endif
}
-#if !defined(WIN32) && !defined(__MORPHOS__) && !defined(__amigaos4__)
+#if !defined(WIN32) && !defined(__MORPHOS__) && !defined(__amigaos4__) && !defined(__HAIKU__)
void strlwr(char *pc) {
for (unsigned int i = 0; i < strlen(pc); i++)
pc[i] = tolower(pc[i]);
@@ -1274,6 +1280,27 @@ void XMFS::init(const std::string &AppDir,
/* Got a system-wide installation to fall back to! */
m_bGotSystemDataDir = true;
}
+#elif defined(__HAIKU__)
+ BPath settingsDir;
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, &settingsDir) == B_OK) {
+ m_UserDataDir = std::string(settingsDir.Path()) + std::string("/") + AppDir;
+ m_UserConfigDir = std::string(settingsDir.Path()) + std::string("/") + AppDir;
+ m_UserDataDirUTF8 = m_UserDataDir;
+ }
+ BPath cacheDir;
+ if (find_directory(B_USER_CACHE_DIRECTORY, &cacheDir) == B_OK) {
+ m_UserCacheDir = std::string(cacheDir.Path()) + std::string("/") + AppDir;
+ }
+ BPath appsDir;
+ if (find_directory(B_SYSTEM_APPS_DIRECTORY, &appsDir) == B_OK) {
+ m_SystemDataDir = std::string(appsDir.Path()) + std::string("/XMoto");
+ }
+ if (!isDir(m_SystemDataDir)) {
+ throw Exception("Bundle path doesn't exist: " + m_SystemDataDir);
+ } else {
+ m_bGotSystemDataDir = true;
+ }
+ m_SystemLocaleDir = std::string(appsDir.Path()) + std::string("/XMoto/locale");
#else /* Assume unix-like */
/* Determine users home dir, so we can find out where to get/save user
files */
diff --git a/src/drawlib/DrawLib.h b/src/drawlib/DrawLib.h
index 31d11f1..bf7b0ce 100644
--- a/src/drawlib/DrawLib.h
+++ b/src/drawlib/DrawLib.h
@@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "helpers/VMath.h"
#include "include/xm_SDL_ttf.h"
#include <vector>
+#include <map>
class Img;
class Camera;
diff --git a/src/drawlib/DrawLibSDLgfx.cpp b/src/drawlib/DrawLibSDLgfx.cpp
index fa07791..54a105b 100644
--- a/src/drawlib/DrawLibSDLgfx.cpp
+++ b/src/drawlib/DrawLibSDLgfx.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "xmoto/Game.h"
#ifdef ENABLE_SDLGFX
-#include "PolyDraw.h"
+#include "common/PolyDraw.h"
#include "SDL_gfxPrimitives.h"
#include "SDL_rotozoom.h"
#include "helpers/iqsort.h"
diff --git a/src/net/extSDL_net.cpp b/src/net/extSDL_net.cpp
index 930f875..478ef5d 100644
--- a/src/net/extSDL_net.cpp
+++ b/src/net/extSDL_net.cpp
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <errno.h>
// read the .h to understand why i redefine SDLNet_TCP_Send
-#if !defined(WIN32) && !defined(__APPLE__)
+#if !defined(WIN32) && !defined(__APPLE__) && !defined(__HAIKU__)
#include <sys/socket.h>
#define SOCKET int
diff --git a/src/xmoto/Game.cpp b/src/xmoto/Game.cpp
index be9e5fe..38b5e2f 100644
--- a/src/xmoto/Game.cpp
+++ b/src/xmoto/Game.cpp
@@ -128,7 +128,7 @@ void GameApp::_InitWin(bool bInitGraphics) {
SDL_WM_SetCaption(XMBuild::getVersionString(true).c_str(),
XMBuild::getVersionString(true).c_str());
-#if !defined(WIN32) && !defined(__APPLE__) && !defined(__amigaos4__)
+#if !defined(WIN32) && !defined(__APPLE__) && !defined(__amigaos4__) && !defined(__HAIKU__)
SDL_Surface *v_icon = SDL_LoadBMP(
(XMFS::getSystemDataDir() + std::string("/xmoto_icone_x.ico")).c_str());
if (v_icon != NULL) {
diff --git a/src/xmoto/GameInit.cpp b/src/xmoto/GameInit.cpp
index 1968294..42a8d79 100644
--- a/src/xmoto/GameInit.cpp
+++ b/src/xmoto/GameInit.cpp
@@ -1008,7 +1008,7 @@ void GameApp::run_unload() {
}
/* Shutdown SDL */
- SDL_Quit();
+ //SDL_Quit();
XMLDocument::clean();
--
2.30.2

View File

@@ -4,14 +4,11 @@ physics play an all important role in the gameplay. You need to control \
your bike to its limit, if you want to have a chance finishing the more \
difficult of the challenges."
HOMEPAGE="https://xmoto.tuxfamily.org"
COPYRIGHT="2006-2014 Nicolas Adenis-Lamarre
2007-2011 Emmanuel Gorse
2009-2010 Jens Erler
2005-2006 Rasmus Neckelmann"
COPYRIGHT="2005-2021 Tuxfamily"
LICENSE="GNU GPL v2"
REVISION="3"
SOURCE_URI="https://download.tuxfamily.org/xmoto/xmoto/dev/xmoto-$portVersion-src-svn3427.tar.gz"
CHECKSUM_SHA256="19785f67cc7bc575fa621adb4073a48314cb436ea4fe7a90fa4c03a12bde0325"
REVISION="1"
SOURCE_URI="https://github.com/xmoto/xmoto/archive/$portVersion/$portVersion.tar.gz"
CHECKSUM_SHA256="209c8c38b1742d0620d40f90365c7a56f67c86da826c80a76d37fa46ee9c9b66"
PATCHES="xmoto-$portVersion.patchset"
ADDITIONAL_FILES="xmoto.rdef.in"
@@ -20,7 +17,7 @@ SECONDARY_ARCHITECTURES="x86"
PROVIDES="
xmoto$secondaryArchSuffix = $portVersion
cmd:xmoto$secondaryArchSuffix = $portVersion
app:XMoto = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
@@ -30,8 +27,7 @@ REQUIRES="
lib:libglu$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:liblua$secondaryArchSuffix
lib:libode$secondaryArchSuffix
lib:liblua$secondaryArchSuffix >= 5.3
lib:libpng16$secondaryArchSuffix
lib:libSDL_1.2$secondaryArchSuffix
lib:libSDL_mixer_1.2$secondaryArchSuffix
@@ -43,13 +39,13 @@ REQUIRES="
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libbz2$secondaryArchSuffix
devel:libcurl$secondaryArchSuffix
devel:libgl$secondaryArchSuffix
devel:libglu$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
devel:liblua5.1$secondaryArchSuffix
devel:libode$secondaryArchSuffix
devel:liblua$secondaryArchSuffix >= 5.3
devel:libpng16$secondaryArchSuffix
devel:libSDL$secondaryArchSuffix
devel:libSDL_gfx$secondaryArchSuffix
@@ -61,41 +57,37 @@ BUILD_REQUIRES="
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel
cmd:autoconf
cmd:automake
cmd:awk
cmd:find
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:gettext$secondaryArchSuffix
cmd:grep
cmd:make
cmd:ode_config$secondaryArchSuffix
cmd:pkg_config$secondaryArchSuffix
cmd:sed
"
BUILD()
{
autoconf
export CFLAGS="-lGL -lbe"
export CXXFLAGS="-lGL -lbe"
runConfigure ./configure \
--bindir=$appsDir/XMoto \
--datarootdir=$appsDir/XMoto/data \
--datadir=$appsDir/XMoto/data \
--with-internal-xdg=1 \
--with-renderer-openGl=1 \
--with-renderer-sdlGfx=0 \
--disable-rpath
mkdir -p build
cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=$appsDir/XMoto \
-DCMAKE_CXX_FLAGS=-DdDOUBLE \
-DODE_DOUBLE_PRECISION=ON \
-DPREFER_SYSTEM_ODE=OFF \
-DPREFER_SYSTEM_XDG=OFF
make $jobArgs
}
INSTALL()
{
cd build
make install
rm -rf $docDir
mv $appsDir/XMoto/xmoto $appsDir/XMoto/XMoto
mv $appsDir/XMoto/share/locale $appsDir/XMoto
mv $appsDir/XMoto/share/xmoto/* $appsDir/XMoto
mv $appsDir/XMoto/bin/xmoto $appsDir/XMoto/XMoto
rm -rf $appsDir/XMoto/{bin,share,xmoto_icone_x.ico}
local APP_SIGNATURE="application/x-vnd.xmoto"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"