From 87dfa916c92c3795aa76c4155d125cf0c48858f2 Mon Sep 17 00:00:00 2001 From: augiedoggie Date: Sun, 8 May 2022 13:57:22 -0600 Subject: [PATCH] nanosaur: update patch for better data folder handling (#6898) --- games-action/nanosaur/nanosaur-1.4.3.recipe | 2 +- .../nanosaur/patches/nanosaur-1.4.3.patchset | 84 ++++++++++--------- 2 files changed, 46 insertions(+), 40 deletions(-) diff --git a/games-action/nanosaur/nanosaur-1.4.3.recipe b/games-action/nanosaur/nanosaur-1.4.3.recipe index 29b28d9cb..8ad331e8f 100644 --- a/games-action/nanosaur/nanosaur-1.4.3.recipe +++ b/games-action/nanosaur/nanosaur-1.4.3.recipe @@ -5,7 +5,7 @@ sent back in time 20 minutes before a giant asteroid hits the Earth." HOMEPAGE="https://pangeasoft.net/nano" COPYRIGHT="1998 Pangea Software, Inc." LICENSE="CC-BY-NC-SA-4.0" -REVISION="1" +REVISION="2" SOURCE_URI="https://github.com/jorio/Nanosaur/archive/refs/tags/v$portVersion.tar.gz" CHECKSUM_SHA256="5458ed6bf7d58facd7adf30161680546148b2a4e187c336b8af02cb864188da0" diff --git a/games-action/nanosaur/patches/nanosaur-1.4.3.patchset b/games-action/nanosaur/patches/nanosaur-1.4.3.patchset index bbdd59562..4f8ddf9f0 100644 --- a/games-action/nanosaur/patches/nanosaur-1.4.3.patchset +++ b/games-action/nanosaur/patches/nanosaur-1.4.3.patchset @@ -1,11 +1,11 @@ -From c5dc01605d0ded5f7e990bfe52bde69e2ef27c3b Mon Sep 17 00:00:00 2001 +From 83d1893b2d8e41112ef9420d5703d676c9ef0980 Mon Sep 17 00:00:00 2001 From: Ivan Holmes 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 27e773a..c9e1f09 100644 +index 27e773a..42046d7 100644 --- a/cmake/FindSDL2.cmake +++ b/cmake/FindSDL2.cmake @@ -58,7 +58,7 @@ elseif(APPLE) @@ -21,43 +21,7 @@ index 27e773a..c9e1f09 100644 2.30.2 -From 7dd83117f6cc0f636cff289351b76d4a63da777a Mon Sep 17 00:00:00 2001 -From: Ivan Holmes -Date: Sat, 7 May 2022 00:11:00 +0100 -Subject: use find_directory to find game data - - -diff --git a/src/Main.cpp b/src/Main.cpp -index 37e2986..f03bbad 100644 ---- a/src/Main.cpp -+++ b/src/Main.cpp -@@ -10,6 +10,9 @@ - #if __APPLE__ - #include - #include -+#elif defined(__HAIKU__) -+#include -+#include - #endif - - extern "C" -@@ -47,6 +50,11 @@ static fs::path FindGameData() - - dataPath = pathbuf; - dataPath = dataPath.parent_path().parent_path() / "Resources"; -+#elif defined(__HAIKU__) -+ BPath appsBPath; -+ find_directory(B_SYSTEM_APPS_DIRECTORY, &appsBPath); -+ dataPath = appsBPath.Path(); -+ dataPath = dataPath / "Nanosaur" / "Data"; - #else - dataPath = "Data"; - #endif --- -2.30.2 - - -From 4a1b97544e88aa4f50701cfd1ce8af7d1d4198df Mon Sep 17 00:00:00 2001 +From fb097edf18e44b56082334be2d9a10bb35ce3c4e Mon Sep 17 00:00:00 2001 From: Ivan Holmes Date: Sat, 7 May 2022 00:16:00 +0100 Subject: Link with libbe @@ -82,3 +46,45 @@ index b335bfe..dd2772a 100644 -- 2.30.2 + +From dd1c449ab08bec7dadf5e26dbc52845fb11127f7 Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Sun, 8 May 2022 13:50:12 -0600 +Subject: locate data directory relative to the app on Haiku + + +diff --git a/src/Main.cpp b/src/Main.cpp +index 37e2986..577e6c0 100644 +--- a/src/Main.cpp ++++ b/src/Main.cpp +@@ -10,6 +10,8 @@ + #if __APPLE__ + #include + #include ++#elif defined(__HAIKU__) ++#include + #endif + + extern "C" +@@ -47,6 +49,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 +