AAAA: fix crash on start

This commit is contained in:
Gerasim Troeglazov
2021-09-30 21:53:40 +10:00
parent a1295c9faa
commit 95bfd13762
2 changed files with 17 additions and 17 deletions

View File

@@ -6,14 +6,14 @@ on the gaming console GP2X Caanoo and GP2X Wiz, and later ported to Pandora and
HOMEPAGE="https://github.com/EXL/AdamantArmorAffectionAdventure/"
COPYRIGHT="2016-2018 EXL"
LICENSE="MIT"
REVISION="1"
REVISION="3"
SOURCE_URI="https://github.com/EXL/AdamantArmorAffectionAdventure/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="a350fcf72827e600adcd7028fc8e453870c8087532b1e663975fa9fddcf3b1bd"
SOURCE_DIR="AdamantArmorAffectionAdventure-$portVersion"
PATCHES="aaaa-$portVersion.patchset"
ADDITIONAL_FILES="aaaa.rdef.in"
ARCHITECTURES="all !x86_gcc2 ?x86"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
GLOBAL_WRITABLE_FILES="
@@ -58,7 +58,7 @@ BUILD()
-DCMAKE_BUILD_TYPE=Release \
-DGLES=off \
-DANDROID=off \
-DCMAKE_C_FLAGS="-D__linux__" \
-DCMAKE_C_FLAGS="-D__linux__ -DAPPDIR=\"\\\"$appsDir/AAAA\\\"\"" \
../aaaa/src/main/cpp
make $jobArgs
}
@@ -85,5 +85,6 @@ INSTALL()
addResourcesToBinaries $sourceDir/aaaa.rdef \
"$appsDir/AAAA/Adamant Armor Affection Adventure"
addAppDeskbarSymlink "$appsDir/AAAA/Adamant Armor Affection Adventure" "Adamant Armor Affection Adventure"
addAppDeskbarSymlink "$appsDir/AAAA/Adamant Armor Affection Adventure" \
"Adamant Armor Affection Adventure"
}

View File

@@ -1,29 +1,28 @@
From ed099174e329d792de8b18e7aba960768c039179 Mon Sep 17 00:00:00 2001
From 8880009f418542377f3a74b85a8124fa2037d75f Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 9 Sep 2019 23:54:02 +1000
Date: Thu, 30 Sep 2021 21:49:13 +1000
Subject: Set current dir
diff --git a/aaaa/src/main/cpp/AAAA-Engine/main.c b/aaaa/src/main/cpp/AAAA-Engine/main.c
index 81242ed..738acc1 100644
index 81242ed..add02a9 100644
--- a/aaaa/src/main/cpp/AAAA-Engine/main.c
+++ b/aaaa/src/main/cpp/AAAA-Engine/main.c
@@ -4,6 +4,15 @@
@@ -2,8 +2,14 @@
#include "zcore.h"
#include "zresm.h"
+#include <unistd.h>
+
int main(int argc, char *argv[])
{
+#ifdef __HAIKU__
+ char *binpath = realpath(argv[0], NULL);
+ if (binpath != NULL) {
+ char *appdir = strrchr(binpath, '/');
+ *appdir = '\0';
+ chdir(binpath);
+ free(binpath);
+ }
+#ifdef APPDIR
+ chdir(APPDIR);
+#endif
+
zresminit();
zcoreinit();
--
2.23.0
2.30.2