Files
haikuports/games-action/mightymike/patches/mightymike-3.0.1.patchset
2022-05-12 08:26:05 +02:00

91 lines
2.1 KiB
Plaintext

From da4db6510e71131651812d54dd08fb2b225a2819 Mon Sep 17 00:00:00 2001
From: Ivan Holmes <ivan@ivanholmes.co.uk>
Date: Fri, 6 May 2022 22:22:59 +0100
Subject: Add Haiku header directory so we can find SDL2
diff --git a/cmake/FindSDL2.cmake b/cmake/FindSDL2.cmake
index 17a73ad..5d777f4 100644
--- a/cmake/FindSDL2.cmake
+++ b/cmake/FindSDL2.cmake
@@ -58,7 +58,7 @@ elseif(APPLE)
else()
find_path(SDL2_INCLUDE_DIRS "SDL.h"
HINTS $ENV{SDL2DIR}
- PATH_SUFFIXES "include/SDL2" "include"
+ PATH_SUFFIXES "include/SDL2" "include" "SDL2"
REQUIRED
)
--
2.30.2
From 22f13dfffb6be1a54074851c8c59423981f5e361 Mon Sep 17 00:00:00 2001
From: Ivan Holmes <ivan@ivanholmes.co.uk>
Date: Sat, 7 May 2022 00:16:00 +0100
Subject: Link with libbe
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 83be219..bc028ba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,6 +98,11 @@ elseif(APPLE)
${GAME_MAC_ICNS}
${SDL2_LIBRARIES}
)
+elseif(HAIKU)
+ # Link with libbe on Haiku to enable find_directory
+ list(APPEND GAME_LIBRARIES be)
+
+ add_executable(${GAME_TARGET} ${GAME_ALL_SOURCES})
else()
# Math lib, explicitly required on some Linux systems
list(APPEND GAME_LIBRARIES m)
--
2.30.2
From cc5ba89b021b50382a08e262bbc8083d4bb6e583 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Mon, 9 May 2022 00:11:29 +0100
Subject: locate data directory relative to the app on Haiku
diff --git a/src/Main.cpp b/src/Main.cpp
index a344920..fb2dad1 100644
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -10,6 +10,8 @@
#if __APPLE__
#include <libproc.h>
#include <unistd.h>
+#elif defined(__HAIKU__)
+#include <image.h>
#endif
#include "version.h"
@@ -45,6 +47,18 @@ static fs::path FindGameData()
dataPath = pathbuf;
dataPath = dataPath.parent_path().parent_path() / "Resources";
+#elif defined(__HAIKU__)
+ int32 cookie = 0;
+ image_info info;
+ while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK)
+ {
+ if (info.type == B_APP_IMAGE)
+ {
+ dataPath = info.name;
+ dataPath = dataPath.parent_path() / "Data";
+ break;
+ }
+ }
#else
dataPath = "Data";
#endif
--
2.30.2