Blame env-builder-data/build/script/packet/ufraw-appimage.files/launch.sh

f08c03
#!/bin/bash
f08c03
f08c03
SCRIPT_DIR=$(cd `dirname "$0"`; pwd)
f08c03
BASE_DIR=`dirname "$SCRIPT_DIR"`
f08c03
f08c03
export USER_CONFIG_DIR=$HOME/.config/ufraw
f08c03
f08c03
export LD_LIBRARY_PATH="${BASE_DIR}/lib:${BASE_DIR}/lib64:$LD_LIBRARY_PATH"
f08c03
export XDG_DATA_DIRS="${BASE_DIR}/share:$XDG_DATA_DIRS:/usr/local/share/:/usr/share/"
f08c03
export XDG_CONFIG_DIRS="$HOME/.config/synfig:$XDG_CONFIG_DIRS"
f08c03
export XCURSOR_PATH="${BASE_DIR}/share/icons:$XCURSOR_PATH:/usr/local/share/icons:/usr/share/icons"
f08c03
export GSETTINGS_SCHEMA_DIR="${BASE_DIR}/share/glib-2.0/schemas/"
f08c03
export QT_XKB_CONFIG_ROOT=$QT_XKB_CONFIG_ROOT:/usr/local/share/X11/xkb:/usr/share/X11/xkb
f08c03
export FONTCONFIG_PATH="${BASE_DIR}/etc/fonts"
f08c03
f08c03
f08c03
# Create install-location-dependent config files for Pango and GDK image loaders
f08c03
# We have to do this every time because its possible that SYSPREFIX has changed
f08c03
f08c03
[ -e "$USER_CONFIG_DIR" ] || mkdir -p "$USER_CONFIG_DIR"
f08c03
f08c03
#sed "s?@ROOTDIR@/modules?${BASE_DIR}/lib/pango/1.6.0/modules?" < $ETC_DIR/pango/pango.modules.in > $USER_CONFIG_DIR/pango/pango.modules
f08c03
if [ -e ${BASE_DIR}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache.in ]; then
f08c03
	export GDK_PIXBUF_MODULE_FILE="${USER_CONFIG_DIR}/gdk-pixbuf.loaders"
f08c03
	sed "s?@ROOTDIR@/loaders?${BASE_DIR}/lib/gdk-pixbuf-2.0/2.10.0/loaders?" < ${BASE_DIR}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache.in > $GDK_PIXBUF_MODULE_FILE
f08c03
fi
f08c03
f08c03
export APPIMAGE_ROOT="$BASE_DIR"
f08c03
if [ ! -z "$APPIMAGE_WORKDIR" ]; then
f08c03
	if ! cd "$APPIMAGE_WORKDIR"; then
f08c03
		echo "Cannot change directory to \"$APPIMAGE_WORKDIR\" (APPIMAGE_WORKDIR)"
f08c03
		exit 1
f08c03
	fi
f08c03
fi
f08c03
f08c03
if [ "$1" = "--appimage-exec" ]; then
f08c03
	if ! "${@:2}"; then
f08c03
		exit 1
f08c03
	fi
f08c03
elif [ -z "$2" ]; then
f08c03
	if [ -x /usr/bin/zenity ] ; then
f08c03
	  "$BASE_DIR/bin/fc-cache" |tee >(LD_LIBRARY_PATH="" zenity --progress --pulsate --title="Fontconfig" --no-cancel --auto-close --text="Please wait, generating font cache...")
f08c03
	fi
f08c03
	if ! "$BASE_DIR/bin/ufraw.wrapper" "$@"; then
f08c03
		exit 1
f08c03
	fi
f08c03
else
f08c03
	if ! "$BASE_DIR/bin/ufraw" "$@"; then
f08c03
		exit 1
f08c03
	fi
f08c03
fi