X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=osxapp%2FXBoard.gtklauncher;fp=osxapp%2FXBoard.gtklauncher;h=d448c4e6b3f8c3aa0c13acacc2484c99670b03d1;hb=e6fd287ffbf67a41aff2e615c6cb62555a29f5c2;hp=0000000000000000000000000000000000000000;hpb=50bc241d1d9c026d128eb29c7f3bdc2ba5525c46;p=xboard.git diff --git a/osxapp/XBoard.gtklauncher b/osxapp/XBoard.gtklauncher new file mode 100755 index 0000000..d448c4e --- /dev/null +++ b/osxapp/XBoard.gtklauncher @@ -0,0 +1,74 @@ +#!/bin/bash + +# Inherited from gtk-mac-bundler example launcher script +# Where we get the paths from +name=$(basename "$0") +echo $name + +dirn=$(dirname "$0") +echo $dirn + +bundle=$(cd "$dirn/../../" && pwd) +bundle_contents="$bundle"/Contents +bundle_res="$bundle_contents"/Resources +bundle_lib="$bundle_res"/lib +bundle_bin="$bundle_res"/bin +bundle_data="$bundle_res"/share +bundle_etc="$bundle_res"/etc + +export PATH="$bundle_bin:$PATH" + +export PATH="$bundle_contents/MacOS/:$PATH" + +chmod -R +x $bundle_bin + +# Use fallback instead of normal dlyd path, may not be required +export DYLD_FALLBACK_LIBRARY_PATH="$bundle_lib:$DYLD_FALLBACK_LIBRARY_PATH" + +# Help fontconfig find its configuration file +export FONTCONFIG_FILE="$bundle_etc/fonts/fonts.conf" + +# Help gdk find its loader modules +export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders" + +# Fix for the theme engine paths +export GTK_PATH="$bundle_lib/gtk-2.0/2.10.0" + +# GTK path no longer required + export GTK_IM_MODULE_FILE="$bundle_etc/gtk-2.0/gtk.immodules" + +# Pango path no longer required + export PANGO_RC_FILE="$bundle_etc/pango/pangorc" + +# Fix the gegl path issue +export GEGL_PATH="$bundle_lib/gegl-0.2" + +# Define gtkrc file +export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc" + +# set as absolute directory to find GTK resources internally, thanks GIMP. +LNDIR=/tmp/skl/XBoard.app +if [ ! -e "$LNDIR/Contents/Resources/launcher_rc" ]; then +rm -f "$LNDIR" +mkdir -p /tmp/skl +chmod a+w /tmp/skl +ln -s "$bundle" "$LNDIR" +fi + +# set the working directory to users home +cd ~/ > /dev/null + + +# Strip out arguments added by the OS +if [ x`echo "x$1" | sed -e "s/^x-psn_.*//"` == x ]; then + shift 1 +fi + +if [ "x$GTK_DEBUG_SHELL" != "x" ]; then + exec bash + +else + $EXEC "$bundle_contents/MacOS/$name-bin" "$@" +fi + +