From 5710df056ccec478bddf5e2d3dadbf7fc6b7bedb Mon Sep 17 00:00:00 2001 From: Lily Date: Mon, 4 Dec 2023 18:49:40 +0300 Subject: [PATCH 1/2] [TERMUX] Fix debian dependency --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a6506cfe..2a774551e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -806,7 +806,7 @@ set(CPACK_DEBIAN_PACKAGE_MAINTAINER "ptitSeb") set(CPACK_PACKAGE_CONTACT "ptitSeb@box86.org") set(CPACK_PACKAGE_DESCRIPTION "Box86 - Linux Userspace x86 Emulator with a twist") if(TERMUX) -set(CPACK_DEBIAN_PACKAGE_DEPENDS "libandroid-sysv-semaphore" "libandroid-spawn") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libandroid-sysv-semaphore, libandroid-spawn") else() set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6") endif() From b245e34a6ac7b320f579a09bd4e44e22723865c6 Mon Sep 17 00:00:00 2001 From: Lily Date: Mon, 4 Dec 2023 19:01:53 +0300 Subject: [PATCH 2/2] [TERMUX] Library path and rc file load fix --- src/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main.c b/src/main.c index 83b60a2f6..94e0b736e 100644 --- a/src/main.c +++ b/src/main.c @@ -957,6 +957,7 @@ void LoadEnvVars(box86context_t *context) AddPath("/mnt/utmp/box86/lib/i386-linux-gnu", &context->box86_ld_lib, 1); //TODO: add relative path to box86 location #endif +#ifndef TERMUX if(FileExist("/lib/box86", 0)) AddPath("/lib/box86", &context->box86_ld_lib, 1); if(FileExist("/usr/lib/box86", 0)) @@ -971,6 +972,12 @@ void LoadEnvVars(box86context_t *context) AddPath("/usr/lib/i686-pc-linux-gnu", &context->box86_ld_lib, 1); if(FileExist("/usr/lib32", 0)) AddPath("/usr/lib32", &context->box86_ld_lib, 1); +#else + if(FileExist("/data/data/com.termux/files/usr/lib/i386-linux-gnu", 0)) + AddPath("/data/data/com.termux/files/usr/lib/i386-linux-gnu", &context->box86_ld_lib, 1); + if(FileExist("/data/data/com.termux/files/usr/lib/i686-linux-gnu", 0)) + AddPath("/data/data/com.termux/files/usr/lib/i686-linux-gnu", &context->box86_ld_lib, 1); +#endif if(getenv("LD_LIBRARY_PATH")) PrependList(&context->box86_ld_lib, getenv("LD_LIBRARY_PATH"), 1); // in case some of the path are for x86 world if(getenv("BOX86_EMULATED_LIBS")) { @@ -1180,8 +1187,13 @@ void endBox86() static void load_rcfiles() { + #ifndef TERMUX if(FileExist("/etc/box86.box86rc", IS_FILE)) LoadRCFile("/etc/box86.box86rc"); + #else + if(FileExist("/data/data/com.termux/files/usr/etc/box86.box86rc", IS_FILE)) + LoadRCFile("/data/data/com.termux/files/usr/etc/box86.box86rc"); + #endif #ifdef PANDORA if(FileExist("/mnt/utmp/codeblocks/usr/etc/box86.box86rc", IS_FILE)) LoadRCFile("/mnt/utmp/codeblocks/usr/etc/box86.box86rc");