From e9147cd3d5e2b232e1dbb85909169e7508f6b94a Mon Sep 17 00:00:00 2001 From: Zion Nimchuk <zionnimchuk@gmail.com> Date: Fri, 21 Sep 2018 10:55:04 -0700 Subject: [PATCH] output libraries with proper names and add mint 18.3 to whitelist --- AppRun.c.patch | 15 ++++++++------- Makefile | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/AppRun.c.patch b/AppRun.c.patch index 6fa14fe..5bf8f9d 100644 --- a/AppRun.c.patch +++ b/AppRun.c.patch @@ -10,12 +10,11 @@ /* https://docs.python.org/2/using/cmdline.html#envvar-PYTHONHOME */ SET_NEW_ENV(new_pythonhome, appdir_s, "PYTHONHOME=%s/usr/", appdir); -@@ -171,8 +174,27 @@ +@@ -171,8 +174,28 @@ 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); -+ int isUbuntu1404 = 0; -+ int isUbuntu1604 = 0; ++ int doUseBuiltinSTDCPP = 0; + FILE *fp = popen("/usr/bin/lsb_release -rcs 2>/dev/null", "r"); + if (fp != NULL) + { @@ -24,21 +23,23 @@ + char codename[1035]; + fgets(codename, sizeof(codename), fp); + if (strcmp(version, "14.04\n") == 0 && strcmp(codename, "trusty\n") == 0) -+ isUbuntu1404 = 1; ++ doUseBuiltinSTDCPP = 1; + else if (strcmp(version, "16.04\n") == 0 && strcmp(codename, "xenial\n") == 0) -+ isUbuntu1604 = 1; ++ doUseBuiltinSTDCPP = 1; ++ else if (strcmp(version, "18.3\n") == 0 && strcmp(codename, "sylvia\n") == 0) ++ doUseBuiltinSTDCPP = 1; + + } 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 || isUbuntu1604) ++ if (doUseBuiltinSTDCPP) + { + 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); + } 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 +223,9 @@ +@@ -201,6 +224,9 @@ if (ret == -1) die("Error executing '%s': %s\n", exe, strerror(error)); diff --git a/Makefile b/Makefile index cd8fe34..b66dc3d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ CFLAGS ?= -O2 -Wall -Wextra LDFLAGS += -s BIN = AppRun_patched -LIB = exec.so +LIB = exec-x86_64.so EXEC_TEST = exec_test ENV_TEST = env_test