Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:munix9
celestia
appimage.AppRun
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File appimage.AppRun of Package celestia
#!/bin/bash HERE="$(dirname "$(readlink -f "${0}")")" [[ -z $APPIMAGE ]] && export APPIMAGE="$HERE" [[ -z $APPDIR ]] && export APPDIR="$HERE" [[ -z $ARGV0 ]] && export ARGV0="$0" _app="celestia" _debug="" #_debug="echo" _general_home="$(dirname "$APPIMAGE")/${_app}-@MAIN_VERSION@.home" _extract_dir="${APPIMAGE}.data" # export general home directory [[ -d $_general_home && -w $_general_home ]] && { export HOME="$_general_home" export XDG_DATA_HOME="$HOME/.local/share" } # config _config="$HOME/.${_app}-@MAIN_VERSION@-AppImage" mkdir -p $_config # # taken from https://github.com/AppImage/AppImageKit/blob/master/src/AppRun.c # export PYTHONHOME=${HERE}/usr TMP_PATH="%s/usr/bin:%s/usr/sbin:%s/usr/games:%s/bin:%s/sbin" export PATH="${TMP_PATH//\%s/$HERE}:$PATH" TMP_LD_LIBRARY_PATH="%s/usr/lib:%s/usr/lib/i386-linux-gnu:%s/usr/lib/x86_64-linux-gnu:%s/usr/lib32:%s/usr/lib64:%s/lib" TMP_LD_LIBRARY_PATH+=":%s/lib/i386-linux-gnu:%s/lib/x86_64-linux-gnu:%s/lib32:%s/lib64:%s/usr/lib64/pulseaudio" export LD_LIBRARY_PATH="${TMP_LD_LIBRARY_PATH//\%s/$HERE}:$LD_LIBRARY_PATH" export PYTHONPATH=${HERE}/usr/share/pyshared:$PYTHONPATH export XDG_DATA_DIRS=${HERE}/usr/share:/usr/local/share:/usr/share:$XDG_DATA_DIRS export PERLLIB=${HERE}/usr/share/perl5:${HERE}/usr/lib/perl5:$PERLLIB export GSETTINGS_SCHEMA_DIR=${HERE}/usr/share/glib-2.0/schemas:$GSETTINGS_SCHEMA_DIR TMP_QT_PLUGIN_PATH="%s/usr/lib/qt4/plugins:%s/usr/lib/i386-linux-gnu/qt4/plugins:%s/usr/lib/x86_64-linux-gnu/qt4/plugins" TMP_QT_PLUGIN_PATH+=":%s/usr/lib32/qt4/plugins:%s/usr/lib64/qt4/plugins:%s/usr/lib/qt5/plugins" TMP_QT_PLUGIN_PATH+=":%s/usr/lib/i386-linux-gnu/qt5/plugins:%s/usr/lib/x86_64-linux-gnu/qt5/plugins" TMP_QT_PLUGIN_PATH+=":%s/usr/lib32/qt5/plugins:%s/usr/lib64/qt5/plugins" export QT_PLUGIN_PATH="${TMP_QT_PLUGIN_PATH//\%s/$HERE}:$QT_PLUGIN_PATH" export GST_PLUGIN_SYSTEM_PATH=${HERE}/usr/lib/gstreamer:$GST_PLUGIN_SYSTEM_PATH export GST_PLUGIN_SYSTEM_PATH_1_0=${HERE}/usr/lib/gstreamer-1.0:$GST_PLUGIN_SYSTEM_PATH_1_0 export PYTHONDONTWRITEBYTECODE=1 # # additional settings # # get rid of '(app:...): Gtk-WARNING **: ...: Unable to locate theme engine in module_path: "murrine",' export GTK_PATH64=${HERE}/usr/lib64/gtk-2.0:$GTK_PATH64 # get rid of 'Qt: Session management error: None of the authentication protocols specified are supported' unset SESSION_MANAGER # fix Gtk-WARNING **: ... undefined symbol: rsvg_handle_get_pixbuf_and_error export GDK_PIXBUF_MODULEDIR=${HERE}/usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders cp -p ${GDK_PIXBUF_MODULEDIR}.cache $_config sed -e "s|/usr/lib|${HERE}/usr/lib|g" -i ${_config}/loaders.cache export GDK_PIXBUF_MODULE_FILE=${_config}/loaders.cache r_err () { echo "error: $1" exit 1 } app_extract_data () { local _ai_dir _cel_data _ai_dir="$(dirname "$APPIMAGE")" [[ -w $_ai_dir ]] || r_err "dir '$_ai_dir' is not writable." [[ -d $_extract_dir ]] && r_err "dir '$_extract_dir' already exists." _cel_data="${HERE}/usr/share/celestia" [[ -d $_cel_data ]] || r_err "dir '$_cel_data' does not exists." [[ -n $(ls -A "$_cel_data") ]] || r_err "dir '$_cel_data' is empty." $_debug mkdir -m 0755 "$_extract_dir" || r_err "cannot create dir '$_extract_dir'." $_debug cp -a "${_cel_data}"/* "$_extract_dir"/ || r_err "cannot copy embedded data." echo "embedded data extracted to '$_extract_dir'" echo "start Celestia e.g. with" printf "%q %q\n" "CELESTIA_DATA_DIR=$_extract_dir" "$APPIMAGE" exit 0 } app_create_general_home () { local _up_dir [[ -d $_general_home ]] && { echo "general home dir '$_general_home' already exists." exit 0 } _up_dir="$(dirname "$_general_home")" [[ -w $_up_dir ]] || { echo "parent dir '$_up_dir' is not writable." ; exit 1 ; } $_debug mkdir -p -m 0700 "$_general_home" || { echo "general home dir '$_general_home' could not be created." exit 1 } echo "general home dir '$_general_home' created." exit 0 } app_info () { if command -v less >/dev/null 2>&1 ; then less "${HERE}/.info" elif command -v more >/dev/null 2>&1 ; then more -d "${HERE}/.info" else cat "${HERE}/.info" fi exit 0 } app_help () { cat << EOF Celestia @COMP_VERSION@ - Real-time visual space simulation Usage: $ARGV0 [OPTION]... CELESTIA_DATA_DIR=<dir> $ARGV0 [OPTION]... Celestia options: -c, --conf=<file> Alternate configuration file. -d, --dir=<dir> Alternate installation directory. The same can also be achieved with CELESTIA_DATA_DIR=<dir> $ARGV0 --help Show Celestia help options. --help-all Show all Celestia help options. AppImage options: --celestia-create-general-home Create a general home directory depending on the main version $_general_home --celestia-extract-data Extract the embedded data in the directory $_extract_dir --celestia-info Show information about the Celestia packages used to create this AppImage. -h, --celestia-help Show this help and exit. EOF exit 0 } _args=() while [ $# -ne 0 ] ; do arg="$1" case $arg in --celestia-create-general-home) app_create_general_home shift ;; --celestia-extract-data) app_extract_data shift ;; --celestia-info) app_info shift ;; -h|--celestia-help) app_help shift ;; --dir) _dir="$2" [[ -n $_dir ]] || { echo "data dir missing." ; exit 1 ; } [[ -d $_dir ]] || { echo "data dir '$_dir' not found." ; exit 1 ; } [[ -r $_dir ]] || { echo "data dir '$_dir' not readable." ; exit 1 ; } CELESTIA_DATA_DIR="$_dir" shift shift ;; *) # save it in an array for later use _args+=("$1") shift ;; esac done # restore positional parameters set -- "${_args[@]}" [[ -z $CELESTIA_DATA_DIR ]] && export CELESTIA_DATA_DIR="$APPDIR/usr/share/celestia" echo "Setting \$HOME to $HOME" echo "Setting \$CELESTIA_DATA_DIR to $CELESTIA_DATA_DIR" $_debug cd "${HERE}/usr" $_debug exec "${HERE}/usr/bin/celestia" --dir "$CELESTIA_DATA_DIR" "$@"
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor