0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-05-31 15:12:07 +00:00
Files
termux-packages/x11-packages/luanti/0002-prepend-termux-prefix-to-tmp-path.patch
Robert Kirkman dbfe81691b bump(x11/luanti): 5.12.0
- Fixes https://github.com/termux/termux-packages/issues/24817

- Luanti upstream officially migrated to SDL2, but if this build in Termux is switched to SDL2, some problems would happen:
  - EGL support would be disabled, which would significantly reduce performance and driver compatibility
  - A bug would start happening where the colors of everything would look strangely washed out
- Therefore, because non-SDL2 mode is still working well in this release, it makes more sense to keep `-DUSE_SDL2=0` for now, until the above problems are solved separately.

- `0001-fix-elf-directory-for-cross-compiling.patch` is no longer necessary, because the original problem was an error that happened because of `EXECUTABLE_OUTPUT_PATH` not being set during cross-compilation, now after 0695541bf5, `EXECUTABLE_OUTPUT_PATH` is always set to something that works in both `TERMUX_ON_DEVICE_BUILD=false` mode and `TERMUX_ON_DEVICE_BUILD=true` mode, so the patch is not necessary anymore.
2025-05-25 14:39:34 -05:00

31 lines
1007 B
Diff

Fixes "An error occurred: Failed to download 'Minetest Game'"
when trying to download any gamemode through the builtin browser,
as described here: https://github.com/termux-user-repository/tur/issues/1325
Lua portion adapted from https://github.com/termux/termux-packages/blob/master/packages/liblua52/lua-5.2.4_src_loslib.c.patch
--- a/lib/lua/src/luaconf.h
+++ b/lib/lua/src/luaconf.h
@@ -653,9 +653,9 @@ union luai_Cast { double l_d; long l_l; };
#if defined(LUA_USE_MKSTEMP)
#include <unistd.h>
-#define LUA_TMPNAMBUFSIZE 32
+#define LUA_TMPNAMBUFSIZE 512
#define lua_tmpnam(b,e) { \
- strcpy(b, "/tmp/lua_XXXXXX"); \
+ strcpy(b, "@TERMUX_PREFIX@/tmp/lua_XXXXXX"); \
e = mkstemp(b); \
if (e != -1) close(e); \
e = (e == -1); }
--- a/src/filesys.cpp
+++ b/src/filesys.cpp
@@ -439,7 +439,7 @@ std::string TempPath()
#ifdef DISABLING_THIS_BECAUSE_IT_IS_FOR_BUILDING_AN_APK
return porting::path_cache;
#else
- return DIR_DELIM "tmp";
+ return "@TERMUX_PREFIX@" DIR_DELIM "tmp";
#endif
}