Files
UltraGrid/data/scripts/Linux-AppImage/AppRun
Martin Pulec 55e06c8f8f AppRun: unset LD_LIBRARY_PATH
To avoid mixing of UG and update tool libraries

+ missing quotes around $@
2021-03-02 11:58:00 +01:00

63 lines
1.9 KiB
Bash
Executable File

#!/bin/sh -eu
DIR=`dirname $0`
export LD_LIBRARY_PATH=$DIR/lib${LD_LIBRARY_PATH:+":$LD_LIBRARY_PATH"}
# there is an issue with running_from_path() which evaluates this executable
# as being system-installed
#export PATH=$DIR/bin:$PATH
export QT_QPA_FONTDIR=$DIR/lib/fonts
export QT_PLUGIN_PATH=$DIR/lib/qt5/plugins
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_PLUGIN_PATH/platforms
usage() {
printf "usage:\n"
printf "\tUltraGrid [--gui [args]]\n"
printf "\t\tinvokes GUI\n"
printf "\n"
printf "\tUltraGrid --help\n"
printf "\t\tprints this help\n"
printf "\n"
printf "\tUltraGrid --appimage-help\n"
printf "\t\tprints AppImage related options\n"
printf "\n"
printf "\tUltraGrid --update [args]\n"
printf "\t\tupdates AppImage (args will be passed to appimageupdatetool)\n"
printf "\n"
printf "\tUltraGrid --tool uv --help\n"
printf "\t\tprints command-line UltraGrid help\n"
printf "\n"
printf "\tUltraGrid --tool <t> [args]\n"
printf "\t\tinvokes specified tool\n"
printf "\t\ttool may be: $(ls $DIR/bin | tr '\n' ' ')\n"
printf "\n"
printf "\tUltraGrid args\n"
printf "\t\tinvokes command-line UltraGrid\n"
printf "\n"
}
if [ $# -eq 0 ]; then
usage
if [ -f $DIR/bin/uv-qt ]; then
$DIR/bin/uv-qt --with-uv $DIR/uv-wrapper.sh
fi
elif [ x"$1" = x"--tool" ]; then
TOOL=$2
shift 2
$DIR/bin/$TOOL "$@"
elif [ x"$1" = x"--gui" ]; then
shift
$DIR/bin/uv-qt --with-uv $DIR/uv-wrapper.sh "$@"
elif [ x"$1" = x"-h" -o x"$1" = x"--help" ]; then
usage
exit 0
elif [ x"$1" = x"-u" -o x"$1" = x"--update" ]; then
shift
unset LD_LIBRARY_PATH
$DIR/appimageupdatetool ${1+"$@" }$APPIMAGE
exit 0
else
$DIR/uv-wrapper.sh "$@"
fi
exit $?