vcmi: add recipe for version 0.99.

build, untested (needs game data files).
This commit is contained in:
Jerome Duval
2017-11-06 21:33:44 +01:00
parent 0032262fa3
commit 234fc0c680
2 changed files with 248 additions and 0 deletions

View File

@@ -0,0 +1,147 @@
From a86a1589dca96679890a9e53214cf8a403737171 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Tue, 7 Jan 2014 23:02:10 +0100
Subject: Link to libnetwork, since we use sockets.
diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt
index 563913b..f1e6424 100644
--- a/server/CMakeLists.txt
+++ b/server/CMakeLists.txt
@@ -24,6 +24,10 @@ set_target_properties(vcmiserver PROPERTIES ${PCH_PROPERTIES})
set_target_properties(vcmiserver PROPERTIES XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks @executable_path/")
cotire(vcmiserver)
+if (HAIKU)
+ target_link_libraries(vcmiserver network)
+endif()
+
if (NOT APPLE) # Already inside vcmiclient bundle
install(TARGETS vcmiserver DESTINATION ${BIN_DIR})
endif()
--
2.14.2
From 4748787f27ceb9515eb89154f94eb5ce3da1ca09 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Wed, 8 Jan 2014 21:14:51 +0100
Subject: Support for renaming threads.
diff --git a/lib/CThreadHelper.cpp b/lib/CThreadHelper.cpp
index 2027390..3a0a207 100644
--- a/lib/CThreadHelper.cpp
+++ b/lib/CThreadHelper.cpp
@@ -3,6 +3,8 @@
#ifdef VCMI_WINDOWS
#include <windows.h>
+#elif defined(__HAIKU__)
+ #include <OS.h>
#elif !defined(VCMI_APPLE) && !defined(VCMI_FREEBSD) && !defined(VCMI_HURD)
#include <sys/prctl.h>
#endif
@@ -80,6 +82,8 @@ void setThreadName(const std::string &name)
//not supported
#endif
+#elif defined(__HAIKU__)
+ rename_thread(find_thread(NULL), name.c_str());
#elif defined(__linux__)
prctl(PR_SET_NAME, name.c_str(), 0, 0, 0);
#endif
--
2.14.2
From 25f533d80108594cace58ca3dbc7736700baed90 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Mon, 27 Jan 2014 20:18:36 +0100
Subject: Fix settings dir path.
diff --git a/Global.h b/Global.h
index b661afa..c90fbc6 100644
--- a/Global.h
+++ b/Global.h
@@ -51,7 +51,7 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
# define VCMI_WINDOWS_32
#elif defined(_WIN32_WCE)
# error "Windows CE isn't supported"
-#elif defined(__linux__) || defined(__gnu_linux__) || defined(linux) || defined(__linux)
+#elif defined(__linux__) || defined(__gnu_linux__) || defined(linux) || defined(__linux) || defined(__HAIKU__)
# define VCMI_UNIX
# define VCMI_XDG
# ifdef __ANDROID__
diff --git a/vcmibuilder b/vcmibuilder
index d9f9c97..fd824a8 100755
--- a/vcmibuilder
+++ b/vcmibuilder
@@ -56,7 +56,7 @@ then
# echo " --download " "Automatically download optional package using wget"
# echo " " "Requires wget and Internet connection"
# 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_SETTINGS_DIRECTORY`/vcmi"
echo
echo " --validate " "Run basic validness checks"
exit 0
@@ -146,7 +146,7 @@ if [[ -z "$dest_dir" ]]
then
if [[ -z "$XDG_DATA_HOME" ]]
then
- dest_dir="$HOME/.local/share/vcmi"
+ dest_dir="`finddir B_USER_SETTINGS_DIRECTORY`/vcmi"
else
dest_dir="$XDG_DATA_HOME/vcmi"
fi
--
2.14.2
From 821d04ae49a167ba86d785493f419d3efdae5f47 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 6 Nov 2017 21:23:13 +0100
Subject: don't use backtrace on Haiku
diff --git a/Global.h b/Global.h
index c90fbc6..f4e959b 100644
--- a/Global.h
+++ b/Global.h
@@ -57,6 +57,9 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
# ifdef __ANDROID__
# define VCMI_ANDROID
# endif
+# ifdef __HAIKU__
+# define VCMI_HAIKU
+# endif
#elif defined(__FreeBSD_kernel__) || defined(__FreeBSD__)
# define VCMI_UNIX
# define VCMI_XDG
diff --git a/server/CVCMIServer.cpp b/server/CVCMIServer.cpp
index 2856422..1d2ba8d 100644
--- a/server/CVCMIServer.cpp
+++ b/server/CVCMIServer.cpp
@@ -540,7 +540,7 @@ static void handleCommandOptions(int argc, char *argv[])
}
}
-#if defined(__GNUC__) && !defined (__MINGW32__) && !defined(VCMI_ANDROID)
+#if defined(__GNUC__) && !defined (__MINGW32__) && !defined(VCMI_ANDROID) && !defined(VCMI_HAIKU)
void handleLinuxSignal(int sig)
{
const int STACKTRACE_SIZE = 100;
@@ -571,7 +571,7 @@ int main(int argc, char** argv)
{
// Installs a sig sev segmentation violation handler
// to log stacktrace
- #if defined(__GNUC__) && !defined (__MINGW32__) && !defined(VCMI_ANDROID)
+ #if defined(__GNUC__) && !defined (__MINGW32__) && !defined(VCMI_ANDROID) && !defined(VCMI_HAIKU)
signal(SIGSEGV, handleLinuxSignal);
#endif
--
2.14.2

View File

@@ -0,0 +1,101 @@
SUMMARY="An open source engine for Heroes or Migh and Magic III"
DESCRIPTION="
We want to rewrite the entire H3 engine (VCMI is NOT another mod) giving it \
new possibilities. Few years of intensive work resulted in creating an \
application with an impressive amount of features.
You'll require the original game files to use this port."
HOMEPAGE="http://vcmi.eu"
COPYRIGHT="2005-2017 VCMI Team"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/vcmi/vcmi/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="b7f2459d7e054c8bdcf419cbb80040e751d3dbb06dc1113ac28f7365930f902e"
PATCHES="vcmi-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64"
SECONDARY_ARCHITECTURES="?x86"
PROVIDES="
vcmi$secondaryArchSuffix = $portVersion
cmd:vcmibuilder
cmd:vcmiclient
cmd:vcmilauncher
cmd:vcmiserver
lib:libminizip$secondaryArchSuffix
lib:libvcmi$secondaryArchSuffix
devel:libfuzzylite_static$secondaryArchSuffix
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libavcodec$secondaryArchSuffix
lib:libboost_program_options$secondaryArchSuffix
lib:libboost_filesystem$secondaryArchSuffix
lib:libboost_system$secondaryArchSuffix
lib:libboost_thread$secondaryArchSuffix
lib:libboost_unit_test_framework$secondaryArchSuffix
lib:libQt5Core$secondaryArchSuffix
lib:libQt5Gui$secondaryArchSuffix
lib:libQt5Network$secondaryArchSuffix
lib:libQt5Widgets$secondaryArchSuffix
lib:libSDL2_2.0$secondaryArchSuffix
lib:libSDL2_mixer_2.0$secondaryArchSuffix
lib:libSDL2_image$secondaryArchSuffix
lib:libSDL2_ttf$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libavcodec$secondaryArchSuffix
devel:libboost_program_options$secondaryArchSuffix
devel:libboost_filesystem$secondaryArchSuffix
devel:libboost_system$secondaryArchSuffix
devel:libboost_thread$secondaryArchSuffix
devel:libboost_unit_test_framework$secondaryArchSuffix
devel:libexecinfo$secondaryArchSuffix
devel:libQt5Core$secondaryArchSuffix
devel:libQt5Gui$secondaryArchSuffix
devel:libQt5Network$secondaryArchSuffix
devel:libQt5Widgets$secondaryArchSuffix
devel:libSDL2_2.0$secondaryArchSuffix
devel:libSDL2_mixer_2.0$secondaryArchSuffix
devel:libSDL2_image$secondaryArchSuffix
devel:libSDL2_ttf$secondaryArchSuffix
devel:libz$secondaryArchSuffix
# dependency of devel:libQt5Gui
devel:libGL$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:make
cmd:gcc$secondaryArchSuffix
cmd:as$secondaryArchSuffix
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
mkdir -p build
cd build
export CFLAGS=-DUSE_FILE32API
export CXXFLAGS="$CFLAGS -DBOOST_NO_CXX11_CONSTEXPR"
cmake .. -DDATA_DIR=$relativeDataDir/vcmi \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DLIB_DIR=$relativeLibDir \
-DCMAKE_BUILD_TYPE='Release'
make $jobArgs
}
INSTALL()
{
cd build
make install
mkdir -p $(dirname $includeDir)
mv $prefix/include $includeDir
prepareInstalledDevelLibs libfuzzylite-static
rm -r $prefix/share # desktop file and png icons we don't care about
}