Yay, got it working!

This commit is contained in:
Zion Nimchuk
2018-04-12 22:54:52 -07:00
parent 0bbf5a8ed1
commit a00b8edf65
+4 -17
View File
@@ -1,5 +1,5 @@
--- a/AppRun.c
+++ b/AppRun.c.new
+++ b/AppRun.c
@@ -164,6 +164,9 @@
char *old_env;
size_t length;
@@ -10,7 +10,7 @@
/* https://docs.python.org/2/using/cmdline.html#envvar-PYTHONHOME */
SET_NEW_ENV(new_pythonhome, appdir_s, "PYTHONHOME=%s/usr/", appdir);
@@ -171,8 +174,37 @@
@@ -171,8 +174,24 @@
old_env = getenv("PATH") ?: "";
SET_NEW_ENV(new_path, appdir_s*5 + strlen(old_env), "PATH=%s/usr/bin/:%s/usr/sbin/:%s/usr/games/:%s/bin/:%s/sbin/:%s", appdir, appdir, appdir, appdir, appdir, old_env);
@@ -22,33 +22,20 @@
+ fgets(version, sizeof(version), fp);
+ char codename[1035];
+ fgets(codename, sizeof(codename), fp);
+ printf("version: %s, codename: %s\n", version, codename);
+ if (strcmp(version, "14.04\n") == 0 && strcmp(codename, "trusty") == 0)
+ {
+ printf("All is good\n");
+ if (strcmp(version, "14.04\n") == 0 && strcmp(codename, "trusty\n") == 0)
+ isUbuntu1404 = 1;
+ }
+ else
+ {
+ printf("failed: %d, %d\n", strcmp(version, "14.04"), strcmp(codename, "14.04"));
+ }
+
+ }
old_env = getenv("LD_LIBRARY_PATH") ?: "";
SET_NEW_ENV(new_ld_library_path, appdir_s*10 + strlen(old_env), "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);
+ if (isUbuntu1404)
+ {
+ printf("this is ubuntu 14.04! *kicks off ledge*\n");
+ SET_NEW_ENV(new_ld_library_path, strlen(optional_ld_library_path) + appdir_s*10 + strlen(old_env), "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_ld_library_path, appdir, appdir, appdir, appdir, appdir, appdir, appdir, appdir, appdir, appdir, old_env);
+ }
+ else
+ {
+ printf("this is not ubuntu.\n");
+ }
old_env = getenv("PYTHONPATH") ?: "";
SET_NEW_ENV(new_pythonpath, appdir_s + strlen(old_env), "PYTHONPATH=%s/usr/share/pyshared/:%s", appdir, old_env);
@@ -201,6 +233,9 @@
@@ -201,6 +220,9 @@
if (ret == -1)
die("Error executing '%s': %s\n", exe, strerror(error));