]> sigrok.org Git - sigrok-util.git/commitdiff
sigrok-native-appimage: Add bugfix patch for AppImageKit.
authorUwe Hermann <redacted>
Thu, 11 Oct 2018 19:28:40 +0000 (21:28 +0200)
committerUwe Hermann <redacted>
Thu, 11 Oct 2018 20:08:58 +0000 (22:08 +0200)
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.

cross-compile/appimage/README
cross-compile/appimage/chdir.patch [new file with mode: 0644]

index 36c37f135dea6bbcb44de810d6464ce22e9be158..f4c7fa1ab551694960d6099d28b80661e1b57366 100644 (file)
@@ -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 (file)
index 0000000..40a735f
--- /dev/null
@@ -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;