@@ -182,16 +182,6 @@ cat > "$HOOKFILE" <<\EOF
182
182
gsettings get org.gnome.desktop.interface gtk-theme 2> /dev/null | grep -qi "dark" && GTK_THEME_VARIANT="dark" || GTK_THEME_VARIANT="light"
183
183
APPIMAGE_GTK_THEME="${APPIMAGE_GTK_THEME:- " Adwaita:$GTK_THEME_VARIANT " } " # Allow user to override theme (discouraged)
184
184
185
- # in case we run from an AppImage, we use the $APPDIR environment variable as a template for the temporary directory that should be created
186
- # this allows users to attribute the tempdir to the running AppImage
187
- if [ "$APPDIR " != "" ]; then
188
- tempdir_template="$APPDIR ".ld-p-gtk-tmp-XXXXXX
189
- else
190
- tempdir_template=/tmp/.ld-p-gtk-tmp-XXXXXX
191
- fi
192
-
193
- export CACHEDIR="$( mktemp -d " $tempdir_template " ) "
194
-
195
185
export APPDIR="${APPDIR:- " $( dirname " $( realpath " $0 " ) " ) " } " # Workaround to run extracted AppImage
196
186
export GTK_DATA_PREFIX="$APPDIR "
197
187
export GTK_THEME="$APPIMAGE_GTK_THEME " # Custom themes are broken
@@ -222,12 +212,12 @@ case "$DEPLOY_GTK_VERSION" in
222
212
gtk3_immodules_cache_file=" $( dirname " $gtk3_immodulesdir " ) /immodules.cache"
223
213
gtk3_immodules_query=" $( search_tool " gtk-query-immodules-3.0" " libgtk-3-0" ) "
224
214
copy_tree " $gtk3_libdir " " $APPDIR /"
215
+ sed -i " s|$gtk3_libdir /||g" " $APPDIR /$gtk3_immodules_cache_file "
225
216
cat >> " $HOOKFILE " << EOF
226
217
export GTK_EXE_PREFIX="\$ APPDIR/$gtk3_exec_prefix "
227
218
export GTK_PATH="\$ APPDIR/$gtk3_path "
228
- export GTK_IM_MODULE_DIR="\$ APPDIR/$gtk3_immodulesdir "
229
- export GTK_IM_MODULE_FILE="\$ CACHEDIR/immodules.cache"
230
- sed "s|$gtk3_libdir |\$ APPDIR/$gtk3_libdir |g" "\$ APPDIR/$gtk3_immodules_cache_file " > "\$ GTK_IM_MODULE_FILE"
219
+ export GTK_IM_MODULE_FILE="\$ APPDIR/$gtk3_immodules_cache_file "
220
+
231
221
EOF
232
222
if [ -x " $gtk3_immodules_query " ]; then
233
223
echo " Updating immodules cache in $APPDIR /$gtk3_immodules_cache_file "
@@ -264,10 +254,9 @@ gdk_pixbuf_moduledir="$(get_pkgconf_variable "gdk_pixbuf_moduledir" "gdk-pixbuf-
264
254
# Note: gdk_pixbuf_query_loaders variable is not defined on some systems
265
255
gdk_pixbuf_query=" $( search_tool " gdk-pixbuf-query-loaders" " gdk-pixbuf-2.0" ) "
266
256
copy_tree " $gdk_pixbuf_binarydir " " $APPDIR /"
257
+ sed -i " s|$gdk_pixbuf_moduledir /||g" " $APPDIR /$gdk_pixbuf_cache_file "
267
258
cat >> " $HOOKFILE " << EOF
268
- export GDK_PIXBUF_MODULEDIR="\$ APPDIR/$gdk_pixbuf_moduledir "
269
- export GDK_PIXBUF_MODULE_FILE="\$ CACHEDIR/loaders.cache"
270
- sed "s|$gdk_pixbuf_moduledir |\$ APPDIR/$gdk_pixbuf_moduledir |g" "\$ APPDIR/$gdk_pixbuf_cache_file " > "\$ GDK_PIXBUF_MODULE_FILE"
259
+ export GDK_PIXBUF_MODULE_FILE="\$ APPDIR/$gdk_pixbuf_cache_file "
271
260
EOF
272
261
if [ -x " $gdk_pixbuf_query " ]; then
273
262
echo " Updating pixbuf cache in $APPDIR /$gdk_pixbuf_cache_file "
@@ -315,6 +304,7 @@ PATCH_ARRAY=(
315
304
for directory in " ${PATCH_ARRAY[@]} " ; do
316
305
while IFS= read -r -d ' ' file; do
317
306
# shellcheck disable=SC2016
318
- patchelf --set-rpath ' $ORIGIN/../../../..' " $APPDIR /$file "
307
+ patchelf --set-rpath ' $ORIGIN' " $APPDIR /$file "
308
+ ln $verbose -s " ${file/ \/ usr\/ lib\/ / } " " $APPDIR /usr/lib"
319
309
done < <( find " $directory " -name ' *.so' -print0)
320
310
done
0 commit comments