From c0de13c02731af72d7d34dc803989de15b577d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Tue, 12 Jan 2021 22:20:20 +0100 Subject: [PATCH] fix: appimage: adjust docdir for help menu --- CHANGELOG | 2 +- contrib/AppRun.sh | 1 + src/closure.c | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 8094021..0c1cd5d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,7 +4,7 @@ fix: don't error on blank media in medium-info (#19), bug present upstream since 0.79.5 fix: gui: fix the 'SetLabelText() failed' error caption on the medium-info window (#19), bug present upstream since 0.72.3 fix: add CHANGELOG, TODO, CREDITS to dist for the Help menu -chore: appimage: add missing gtk engines +chore: appimage: add missing gtk engines and adjust docdir for help menu chore: enhance packaging, update locales, changelog et al. 0.79.6.patchlevel-4 04-09-2020 *UNOFFICIAL* diff --git a/contrib/AppRun.sh b/contrib/AppRun.sh index 378acd9..00d6733 100755 --- a/contrib/AppRun.sh +++ b/contrib/AppRun.sh @@ -1,4 +1,5 @@ #!/bin/sh DIR="$(readlink -f "$(dirname "$0")")" export GTK_PATH="$DIR/usr/lib/gtk-2.0" +export DVDISASTER_DOCDIR="$DIR/usr/share/doc/dvdisaster" exec "$DIR/usr/bin/dvdisaster" "$@" diff --git a/src/closure.c b/src/closure.c index fbaca4f..96543cc 100644 --- a/src/closure.c +++ b/src/closure.c @@ -91,6 +91,12 @@ static void get_base_dirs() Verbose("Using path from get_exe_path() = %s\n", Closure->binDir); #endif + /* for AppImage, get docdir from env if there */ + if (g_getenv("DVDISASTER_DOCDIR")) + { if (Closure->docDir) + g_free(Closure->docDir); + Closure->docDir = g_strdup(g_getenv("DVDISASTER_DOCDIR")); + } /*** The location of the dotfile depends on the operating system. Under Unix the users home directory is used. */