From: Uwe Hermann Date: Thu, 11 Oct 2018 19:28:40 +0000 (+0200) Subject: sigrok-native-appimage: Add bugfix patch for AppImageKit. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c5aaf3346f1470bef34abfe85bc440c02e627414;p=sigrok-util.git sigrok-native-appimage: Add bugfix patch for AppImageKit. The problem was that relative paths would not work, since AppRun (part of the AppImage) would chdir() into the AppImage mount point (/tmp/.mount_xxxxx/usr), which would make glib's g_get_current_dir() return that path, so all glib functions calling that would do the wrong thing. For now, we fix this by patching away the chdir() in AppRun. Details: https://github.com/AppImage/AppImageKit/issues/172#issuecomment-229993161 This fixes bug #1300. --- diff --git a/cross-compile/appimage/README b/cross-compile/appimage/README index 36c37f1..f4c7fa1 100644 --- a/cross-compile/appimage/README +++ b/cross-compile/appimage/README @@ -33,6 +33,10 @@ install-build-deps.sh file). Then: $ cd $HOME $ git clone https://github.com/AppImage/AppImageKit $ cd AppImageKit + +Apply chdir.patch (required to fix sigrok bug #1300), then build: + + $ patch -p1 < chdir.patch $ ./build.sh Temporary workaround for an AppImageKit issue: diff --git a/cross-compile/appimage/chdir.patch b/cross-compile/appimage/chdir.patch new file mode 100644 index 0000000..40a735f --- /dev/null +++ b/cross-compile/appimage/chdir.patch @@ -0,0 +1,14 @@ +--- a/src/AppRun.c.orig 2018-10-11 20:59:25.978078674 +0200 ++++ b/src/AppRun.c 2018-10-11 20:59:37.082078674 +0200 +@@ -156,9 +156,11 @@ int main(int argc, char *argv[]) { + size_t appdir_s = strlen(appdir); + char *usr_in_appdir = malloc(appdir_s + 5); + snprintf(usr_in_appdir, appdir_s + 5, "%s/usr", appdir); ++#if 0 + ret = chdir(usr_in_appdir); + if (ret != 0) + die("Could not cd into %s\n", usr_in_appdir); ++#endif + + // set environment variables + char *old_env;