mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 12:10:06 +02:00
97 lines
2.2 KiB
Plaintext
97 lines
2.2 KiB
Plaintext
From caee2c30aec23eb07bd6dada075b826a9b350dce Mon Sep 17 00:00:00 2001
|
|
From: Ivan Holmes <ivan@ivanholmes.co.uk>
|
|
Date: Sun, 8 May 2022 23:47:25 +0100
|
|
Subject: Add SDL2 header directory
|
|
|
|
|
|
diff --git a/cmake/FindSDL2.cmake b/cmake/FindSDL2.cmake
|
|
index f205218..35714f5 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.48.1
|
|
|
|
|
|
From ed8f266bcd59acaa0aebe95847576273ef9b960e Mon Sep 17 00:00:00 2001
|
|
From: Ivan Holmes <ivan@ivanholmes.co.uk>
|
|
Date: Sun, 8 May 2022 23:50:41 +0100
|
|
Subject: Link with libbe
|
|
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 620a07a..76c4c95 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -113,6 +113,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.48.1
|
|
|
|
|
|
From ad7babdeef194d89e4999f6f087795b12ebfb2d4 Mon Sep 17 00:00:00 2001
|
|
From: Chris Roberts <cpr420@gmail.com>
|
|
Date: Sun, 8 May 2022 23:54:54 +0100
|
|
Subject: locate data directory relative to the app on Haiku
|
|
|
|
|
|
diff --git a/src/Boot.cpp b/src/Boot.cpp
|
|
index a9078a2..4770e3f 100644
|
|
--- a/src/Boot.cpp
|
|
+++ b/src/Boot.cpp
|
|
@@ -13,6 +13,10 @@
|
|
#include "game.h"
|
|
#include "version.h"
|
|
|
|
+#if defined(__HAIKU__)
|
|
+#include <image.h>
|
|
+#endif
|
|
+
|
|
extern "C"
|
|
{
|
|
// bare minimum to satisfy externs in game code
|
|
@@ -229,7 +233,22 @@ int main(int argc, char** argv)
|
|
std::string finalErrorMessage = "";
|
|
bool showFinalErrorMessage = false;
|
|
|
|
+#if defined(__HAIKU__)
|
|
+ char* executablePath = NULL;
|
|
+
|
|
+ int32 cookie = 0;
|
|
+ image_info info;
|
|
+ while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK)
|
|
+ {
|
|
+ if (info.type == B_APP_IMAGE)
|
|
+ {
|
|
+ executablePath = info.name;
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+#else
|
|
const char* executablePath = argc > 0 ? argv[0] : NULL;
|
|
+#endif
|
|
|
|
// Start the game
|
|
try
|
|
--
|
|
2.48.1
|
|
|