anura: add chdir() calls to allow launching from Tracker (#9649)

This commit is contained in:
augiedoggie
2023-10-19 12:27:29 -06:00
committed by GitHub
parent 16dace3ebb
commit 97da11a248
2 changed files with 44 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ COPYRIGHT="2003-2013 by David White
2014-2019 Omar Cornut"
LICENSE="BSD (3-clause)
MIT"
REVISION="1"
REVISION="2"
SOURCE_URI="$HOMEPAGE/archive/refs/tags/v$portVersion.tar.gz"
CHECKSUM_SHA256="0a70229efc108a85fa07c6008aaa2b4bd9ddc3c14621d4129a9264c52eeb55d7"
SOURCE_FILENAME="anura-v$portVersion.tar.gz"
@@ -87,7 +87,8 @@ BUILD()
{
mkdir -p imgui
cp -r $sourceDir2/imgui-$srcGitRev_2/* imgui
make $jobArgs
CXXFLAGS="-DANURA_DATA_DIR=\\\"$dataDir/anura\\\" -D_DEFAULT_SOURCE" \
make $jobArgs
}
INSTALL()

View File

@@ -1,4 +1,4 @@
From dc4fa36f66e206f64d363a34cabadb9f2459bc61 Mon Sep 17 00:00:00 2001
From ae831d3fe6e46aa3eac912ad6259aef3dc18aae1 Mon Sep 17 00:00:00 2001
From: Begasus <begasus@gmail.com>
Date: Tue, 17 Oct 2023 11:27:20 +0200
Subject: Don't use -Werror
@@ -21,7 +21,7 @@ index d2bb2e6..80e8edd 100644
2.42.0
From 4c31c0a144685c72d87591c277494e145c1f328c Mon Sep 17 00:00:00 2001
From 777158780d8d03d6e4310fbc1b4e78b090e2d0e3 Mon Sep 17 00:00:00 2001
From: Begasus <begasus@gmail.com>
Date: Tue, 17 Oct 2023 11:29:05 +0200
Subject: Fix linking errors
@@ -43,3 +43,42 @@ index 80e8edd..15aac7e 100644
--
2.42.0
From 5633f7c9e6668a153b7e37bd8855ec70d565dae7 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Thu, 19 Oct 2023 12:17:10 -0600
Subject: chdir() to the data directory
needed twice because SDL_Init on Haiku also changes the working directory
diff --git a/src/main.cpp b/src/main.cpp
index 8f7ee83..919ba3d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -502,6 +502,11 @@ int main(int argcount, char* argvec[])
std::cout<< "Changed working directory to: " << getcwd(0, 0) << std::endl;
#endif
+#if defined(ANURA_DATA_DIR)
+ chdir(ANURA_DATA_DIR);
+ std::cout<< "Changed working directory to: " << getcwd(0, 0) << std::endl;
+#endif
+
game_logic::init_callable_definitions();
std::string level_cfg = "titlescreen.cfg";
@@ -980,6 +985,11 @@ int main(int argcount, char* argvec[])
SDL::SDL_ptr manager(new SDL::SDL());
+#if defined(ANURA_DATA_DIR)
+ chdir(ANURA_DATA_DIR);
+ std::cout<< "Changed working directory to: " << getcwd(0, 0) << std::endl;
+#endif
+
WindowManager wm("SDL");
variant_builder hints;
--
2.42.0