Files
haikuports/games-action/minetest/patches/minetest-5.9.1.patchset
Joachim Mairböck d1d5d61575 minetest: bump version, fix wrong cmake build type (#11302)
The custom irrlicht library was inlined, therefore there is one less SOURCE_DIR
now.

minetest_game isn't included any more, it is supposed to be downloaded
 separately.
2024-11-06 20:00:55 +01:00

171 lines
4.8 KiB
Plaintext

From 4689a5f8fd41d9f25deac4534c97313ae8966e26 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sun, 28 Feb 2021 17:54:22 +1000
Subject: Add haiku support
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9be4944..dff0463 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -255,7 +255,7 @@ install(FILES "doc/texture_packs.md" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/world_format.md" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "minetest.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}")
-if(UNIX AND NOT APPLE)
+if(UNIX AND NOT APPLE AND NOT HAIKU)
install(FILES "doc/minetest.6" "doc/minetestserver.6" DESTINATION "${MANDIR}/man6")
install(FILES "misc/net.minetest.minetest.desktop" DESTINATION "${XDG_APPS_DIR}")
install(FILES "misc/net.minetest.minetest.metainfo.xml" DESTINATION "${METAINFODIR}")
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 3109100..664b31b 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -266,7 +266,11 @@ void set_default_settings()
settings->setDefault("lighting_boost_spread", "0.2");
settings->setDefault("texture_path", "");
settings->setDefault("shader_path", "");
+#ifdef __HAIKU__
+ settings->setDefault("video_driver", "ogles2");
+#else
settings->setDefault("video_driver", "");
+#endif // __HAIKU__
settings->setDefault("cinematic", "false");
settings->setDefault("camera_smoothing", "0.0");
settings->setDefault("cinematic_camera_smoothing", "0.7");
@@ -297,7 +301,11 @@ void set_default_settings()
settings->setDefault("enable_local_map_saving", "false");
settings->setDefault("show_entity_selectionbox", "false");
settings->setDefault("ambient_occlusion_gamma", "1.8");
+#ifdef __HAIKU__
+ settings->setDefault("enable_shaders", "false");
+#else
settings->setDefault("enable_shaders", "true");
+#endif
settings->setDefault("enable_particles", "true");
settings->setDefault("arm_inertia", "true");
settings->setDefault("show_nametag_backgrounds", "true");
--
2.45.2
From 73feb53b4051028762ca6eee95b08bfad2764123 Mon Sep 17 00:00:00 2001
From: Maite Gamper <victor@wenzeslaus.de>
Date: Tue, 10 Oct 2023 07:17:36 +0200
Subject: fix 3dEye's patch
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 955bf05..c7c0247 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -267,9 +267,13 @@ endif()
# Use cmake_config.h
add_definitions(-DUSE_CMAKE_CONFIG_H)
-set(THREADS_PREFER_PTHREAD_FLAG ON)
-find_package(Threads REQUIRED)
-set(PLATFORM_LIBS Threads::Threads)
+if(HAIKU)
+ set(PLATFORM_LIBS ${PLATFORM_LIBS} intl be)
+else()
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package(Threads REQUIRED)
+ set(PLATFORM_LIBS Threads::Threads)
+endif(HAIKU)
if(WIN32)
# Windows
diff --git a/src/porting.cpp b/src/porting.cpp
index da97292..11b4dad 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -61,7 +61,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#endif
#if defined(__HAIKU__)
+ #include <Application.h>
#include <FindDirectory.h>
+ #include <Path.h>
+ #include <Roster.h>
+ #include <OS.h>
#endif
#if HAVE_MALLOC_TRIM
@@ -308,6 +312,15 @@ static bool getExecPathFromProcfs(char *buf, size_t buflen)
buf[len] = '\0';
return true;
+#elif defined(__HAIKU__)
+ app_info appInfo;
+ if (be_app->GetAppInfo(&appInfo) == B_OK) {
+ BPath path(&appInfo.ref);
+ sprintf(buf, path.Path());
+ } else {
+ sprintf(buf, "/system/apps/Minetest/Minetest");
+ }
+ return true;
#else
return false;
#endif
@@ -563,6 +576,19 @@ bool setSystemPaths()
return true;
}
+//// Haiku
+#elif defined(__HAIKU__)
+
+bool setSystemPaths()
+{
+ path_share = STATIC_SHAREDIR;
+ static char dir[PATH_MAX] = "";
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, dir, sizeof(dir)) != B_OK)
+ sprintf(dir, "/boot/home/config/settings");
+ dir[sizeof(dir) - 1] = 0;
+ path_user = std::string(dir) + "/" + lowercase(PROJECT_NAME);
+ return true;
+}
#else
--
2.45.2
From 8c8ac693632894e363bb7aac3063382dea313239 Mon Sep 17 00:00:00 2001
From: Maite Gamper <victor@wenzeslaus.de>
Date: Thu, 19 Oct 2023 08:36:46 +0200
Subject: fix for haiku (copied from irrlicht recipe)
diff --git a/irr/src/CFileSystem.h b/irr/src/CFileSystem.h
index 18bc7ff..ebb0c19 100644
--- a/irr/src/CFileSystem.h
+++ b/irr/src/CFileSystem.h
@@ -4,6 +4,8 @@
#pragma once
+#include <unistd.h>
+
#include "IFileSystem.h"
#include "irrArray.h"
diff --git a/irr/src/CMakeLists.txt b/irr/src/CMakeLists.txt
index 15a752c..7dbdcd1 100644
--- a/irr/src/CMakeLists.txt
+++ b/irr/src/CMakeLists.txt
@@ -73,6 +73,9 @@ elseif(EMSCRIPTEN)
elseif(SOLARIS)
add_definitions(-D_IRR_SOLARIS_PLATFORM_ -D_IRR_POSIX_API_)
set(DEVICE "X11")
+elseif(HAIKU)
+ add_definitions(-D_IRR_POSIX_API_)
+ set(DEVICE "SDL")
else()
add_definitions(-D_IRR_POSIX_API_)
set(LINUX_PLATFORM TRUE)
--
2.45.2