mirror of
https://github.com/yuzu-emu/AppImageKit-checkrt.git
synced 2025-01-11 05:15:27 +00:00
29 lines
1.5 KiB
Diff
29 lines
1.5 KiB
Diff
--- a/AppRun.c
|
|
+++ b/AppRun.c
|
|
@@ -44,6 +44,8 @@
|
|
|
|
#define LINE_SIZE 255
|
|
|
|
+char *checkrt(char *usr_in_appdir);
|
|
+
|
|
int filter(const struct dirent *dir) {
|
|
char *p = (char*) &dir->d_name;
|
|
p = strrchr(p, '.');
|
|
@@ -156,6 +158,7 @@
|
|
char *old_env;
|
|
const int LENGTH = 2047;
|
|
char new_env[8][LENGTH+1];
|
|
+ char *optional = checkrt(usr_in_appdir);
|
|
|
|
/* https://docs.python.org/2/using/cmdline.html#envvar-PYTHONHOME */
|
|
snprintf(new_env[0], LENGTH, "PYTHONHOME=%s/usr/", appdir);
|
|
@@ -164,7 +167,7 @@
|
|
snprintf(new_env[1], LENGTH, "PATH=%s/usr/bin/:%s/usr/sbin/:%s/usr/games/:%s/bin/:%s/sbin/:%s", appdir, appdir, appdir, appdir, appdir, old_env);
|
|
|
|
old_env = getenv("LD_LIBRARY_PATH") ?: "";
|
|
- snprintf(new_env[2], LENGTH, "LD_LIBRARY_PATH=%s/usr/lib/:%s/usr/lib/i386-linux-gnu/:%s/usr/lib/x86_64-linux-gnu/:%s/usr/lib32/:%s/usr/lib64/:%s/lib/:%s/lib/i386-linux-gnu/:%s/lib/x86_64-linux-gnu/:%s/lib32/:%s/lib64/:%s", appdir, appdir, appdir, appdir, appdir, appdir, appdir, appdir, appdir, appdir, old_env);
|
|
+ snprintf(new_env[2], LENGTH, "LD_LIBRARY_PATH=%s%s/usr/lib/:%s/usr/lib/i386-linux-gnu/:%s/usr/lib/x86_64-linux-gnu/:%s/usr/lib32/:%s/usr/lib64/:%s/lib/:%s/lib/i386-linux-gnu/:%s/lib/x86_64-linux-gnu/:%s/lib32/:%s/lib64/:%s", optional, appdir, appdir, appdir, appdir, appdir, appdir, appdir, appdir, appdir, appdir, old_env);
|
|
|
|
old_env = getenv("PYTHONPATH") ?: "";
|
|
snprintf(new_env[3], LENGTH, "PYTHONPATH=%s/usr/share/pyshared/:%s", appdir, old_env);
|