forked from termux-user-repository/tur
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tur/luanti): prepend termux prefix to tmp paths (termux-user-repo…
…sitory#1326) Fixes termux-user-repository#1325 Lua portion adapted from the patch for the `/tmp` folder in the Lua packages of termux-packages, here: https://github.com/termux/termux-packages/blob/master/packages/liblua52/lua-5.2.4_src_loslib.c.patch
- Loading branch information
1 parent
a73f45e
commit 3ee3cd9
Showing
4 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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 THIS_IS_FOR_SURFACEFLINGER_IN_OWOKITTYS_OPINION | ||
return porting::path_cache; | ||
#else | ||
- return DIR_DELIM "tmp"; | ||
+ return "@TERMUX_PREFIX@" DIR_DELIM "tmp"; | ||
#endif | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters