mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-21 03:00:05 +02:00
91 lines
2.1 KiB
Plaintext
91 lines
2.1 KiB
Plaintext
From 98ddda1eb217c7b29160e9b4bf1d059d487640cb 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 e712dc3..bd22a3d 100644
|
|
--- a/cmake/FindSDL2.cmake
|
|
+++ b/cmake/FindSDL2.cmake
|
|
@@ -55,7 +55,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 1430e364142efe2cd76b75cfe837b17c4af1ae5d 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 639c859..675a580 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -93,6 +93,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 bfccbbacef7e45f92c59b3578d153b5f276ad188 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/Main.cpp b/src/Main.cpp
|
|
index d59905c..7bc444c 100644
|
|
--- a/src/Main.cpp
|
|
+++ b/src/Main.cpp
|
|
@@ -17,6 +17,8 @@
|
|
#include "killmacmouseacceleration.h"
|
|
#include <libproc.h>
|
|
#include <unistd.h>
|
|
+#elif defined(__HAIKU__)
|
|
+#include <image.h>
|
|
#endif
|
|
|
|
extern "C"
|
|
@@ -51,6 +53,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
|
|
|