vcmi: update to version 1.3.1

Most of our patch hs been upstreamed. The remaining part would break
other platforms.
This commit is contained in:
PulkoMandy
2023-09-09 13:59:19 +02:00
parent e6f51abf55
commit 2b6971a2aa
3 changed files with 35 additions and 97 deletions

View File

@@ -1,95 +0,0 @@
From c8826a02d817f00325ee1b4a075823d4ab165a7e Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sun, 26 Mar 2023 18:42:08 +0200
Subject: Haiku patch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 84fe7a7..be08c7d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -341,6 +341,9 @@ if(NOT WIN32 AND NOT APPLE_IOS)
if(HAVE_RT_LIB)
set(SYSTEM_LIBS ${SYSTEM_LIBS} rt)
endif()
+ if(HAIKU)
+ set(SYSTEM_LIBS ${SYSTEM_LIBS} network)
+ endif()
endif()
if(ENABLE_LUA)
diff --git a/Global.h b/Global.h
index afb2994..9a69cbe 100644
--- a/Global.h
+++ b/Global.h
@@ -41,6 +41,10 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
# define VCMI_UNIX
# define VCMI_XDG
# define VCMI_FREEBSD
+#elif defined(__HAIKU__)
+# define VCMI_UNIX
+# define VCMI_XDG
+# define VCMI_HAIKU
#elif defined(__GNU__) || defined(__gnu_hurd__) || (defined(__MACH__) && !defined(__APPLE__))
# define VCMI_UNIX
# define VCMI_XDG
diff --git a/lib/CThreadHelper.cpp b/lib/CThreadHelper.cpp
index 240aa6c..e98a422 100644
--- a/lib/CThreadHelper.cpp
+++ b/lib/CThreadHelper.cpp
@@ -12,6 +12,8 @@
#ifdef VCMI_WINDOWS
#include <windows.h>
+#elif defined(VCMI_HAIKU)
+ #include <OS.h>
#elif !defined(VCMI_APPLE) && !defined(VCMI_FREEBSD) && !defined(VCMI_HURD)
#include <sys/prctl.h>
#endif
@@ -89,6 +91,8 @@ void setThreadName(const std::string &name)
prctl(PR_SET_NAME, name.c_str(), 0, 0, 0);
#elif defined(VCMI_APPLE)
pthread_setname_np(name.c_str());
+#elif defined(VCMI_HAIKU)
+ rename_thread(find_thread(NULL), name.c_str());
#endif
}
diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt
index 9eabe58..fd69809 100644
--- a/server/CMakeLists.txt
+++ b/server/CMakeLists.txt
@@ -33,7 +33,7 @@ else()
set(server_LIBS vcmi)
endif()
-if(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
+if(CMAKE_SYSTEM_NAME MATCHES FreeBSD OR HAIKU)
set(server_LIBS execinfo ${server_LIBS})
endif()
target_link_libraries(vcmiserver PRIVATE ${server_LIBS} minizip::minizip)
diff --git a/vcmibuilder b/vcmibuilder
index 027a7a7..996277a 100755
--- a/vcmibuilder
+++ b/vcmibuilder
@@ -52,7 +52,7 @@ then
echo " --convertMP3 " "Convert all mp3 files into ogg/vorbis"
echo " " "Requires ffmpeg or avconv"
echo
- echo " --dest DIRECTORY " "Path where resulting data will be placed. Default is ~/.local/share/vcmi"
+ echo " --dest DIRECTORY " "Path where resulting data will be placed. Default is `finddir B_USER_NONPACKAGED_DATA_DIRECTORY`/vcmi"
echo
echo " --validate " "Run basic validness checks"
exit 0
@@ -161,7 +161,7 @@ then
dest_dir="$HOME/Library/Application Support/vcmi"
elif [[ -z "$XDG_DATA_HOME" ]]
then
- dest_dir="$HOME/.local/share/vcmi"
+ dest_dir="`finddir B_USER_NONPACKAGED_DATA_DIRECTORY`/vcmi"
else
dest_dir="$XDG_DATA_HOME/vcmi"
fi
--
2.37.3

View File

@@ -0,0 +1,31 @@
From c8826a02d817f00325ee1b4a075823d4ab165a7e Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sun, 26 Mar 2023 18:42:08 +0200
Subject: Haiku patch
diff --git a/vcmibuilder b/vcmibuilder
index 027a7a7..996277a 100755
--- a/vcmibuilder
+++ b/vcmibuilder
@@ -52,7 +52,7 @@ then
echo " --convertMP3 " "Convert all mp3 files into ogg/vorbis"
echo " " "Requires ffmpeg or avconv"
echo
- echo " --dest DIRECTORY " "Path where resulting data will be placed. Default is ~/.local/share/vcmi"
+ echo " --dest DIRECTORY " "Path where resulting data will be placed. Default is `finddir B_USER_NONPACKAGED_DATA_DIRECTORY`/vcmi"
echo
echo " --validate " "Run basic validness checks"
exit 0
@@ -161,7 +161,7 @@ then
dest_dir="$HOME/Library/Application Support/vcmi"
elif [[ -z "$XDG_DATA_HOME" ]]
then
- dest_dir="$HOME/.local/share/vcmi"
+ dest_dir="`finddir B_USER_NONPACKAGED_DATA_DIRECTORY`/vcmi"
else
dest_dir="$XDG_DATA_HOME/vcmi"
fi
--
2.37.3

View File

@@ -6,11 +6,11 @@ application with an impressive amount of features.
You'll require the original game files to use this port."
HOMEPAGE="https://vcmi.eu"
COPYRIGHT="2005-2017 VCMI Team"
COPYRIGHT="2005-2023 VCMI Team"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/vcmi/vcmi/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="fb7ad26f19e91647c480fed3183e205c8c3f48da955f7ab797ebdbae74efc2d3"
CHECKSUM_SHA256="1c714487a6c3c7b9fd956fc2a50d05a1ebcc9431c6b9c72f256143be38f4e0da"
PATCHES="vcmi-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
@@ -101,4 +101,6 @@ INSTALL()
make -C build install
rm -r $prefix/share # desktop file and png icons we don't care about
addAppDeskbarSymlink $binDir/vcmilauncher "VCMI (Heroes Of Might And Magic III)"
}