script revision b82b7a319831c374cbbee3fbe16ddf527dd9ecf7
#
# Author: Aaron Voisine <aaron@voisine.org>
# Inkscape Modifications: Michael Wybrow <mjwybrow@users.sourceforge.net>
# Inkscape Modifications: ~suv <suv-sf@users.sourceforge.net>
if test "x$GTK_DEBUG_LAUNCHER" != x; then
set -x
fi
if test "x$GTK_DEBUG_GDB" != x; then
EXEC="gdb --args"
elif test "x$GTK_DEBUG_LLDB" != x; then
EXEC="lldb -- "
elif test "x$GTK_DEBUG_DTRUSS" != x; then
EXEC="dtruss"
else
EXEC=exec
fi
# store absolute path to current script
# read xdg user configuration
source "${CWD}/xdg_setup.sh"
# if this is the main script, check if this is the first run for current user
source "${CWD}/alert_fccache.sh"
fi
# set prefix for bundled libs and resources
# change into path prefix (top-level app dir) for osxapp-enabled binary
cd "$BASE"
# Brutally add many things to the PATH. If the directories do not exist, they won't be used anyway.
# the 'classic' PATH additions:
# Fink
# MacPorts (former DarwinPorts)
# LaTeX distribution for Mac OS X
# over one that may be installed be Macports, Fink or some other means.
# to inkscape don't pull in other inkscape binaries with different setup
# also allows to override system python with custom wrapper script
# Set up PYTHONPATH to use python modules bundled with Inkscape
export VERSIONER_PYTHON_VERSION=2.6
else # if [ $OSXMINORNO -ge "7" ]; then
export VERSIONER_PYTHON_VERSION=2.7
fi
if [ $build_arch = "i386" ]; then
else # build & runtime arch x86_64
export VERSIONER_PYTHON_PREFER_32_BIT=no
fi
fi
export PYTHONPATH="$TOP/lib/python$PYTHON_VERS/site-packages/"
# fallback for missing $INK_CACHE_DIR
if [ -z "$INK_CACHE_DIR" ]; then
INK_CACHE_DIR="${HOME}/.cache/inkscape"
mkdir -p "$INK_CACHE_DIR"
[ $_DEBUG ] && echo "INK_CACHE_DIR: falling back to $INK_CACHE_DIR"
fi
export FONTCONFIG_PATH="$TOP/etc/fonts"
export PANGO_RC_FILE="${INK_CACHE_DIR}/pangorc"
export GTK_IM_MODULE_FILE="${INK_CACHE_DIR}/immodules.cache"
export GDK_PIXBUF_MODULE_FILE="${INK_CACHE_DIR}/loaders.cache"
export GTK_DATA_PREFIX="$TOP"
export GTK_EXE_PREFIX="$TOP"
export GNOME_VFS_MODULE_PATH="$TOP/lib/gnome-vfs-2.0/modules"
export XDG_DATA_DIRS="$TOP/share"
export ASPELL_CONF="prefix $TOP;"
export POPPLER_DATADIR="$TOP/share/poppler"
# Note: This requires the path with the exact ImageMagic version number.
# Also, that ImageMagick will only work if it does not find a
# version installed into the same PREFIX as it was originally
# installed. Luckily, this is very unlikely given the extra long
# and strangely named install prefix we use.
# The actual version is inserted by the packaging script.
export MAGICK_CONFIGURE_PATH="$TOP/lib/ImageMagick-IMAGEMAGICKVER/config:$TOP/share/ImageMagick-IMAGEMAGICKVER_MAJOR/config"
export INKSCAPE_SHAREDIR="$TOP/share/inkscape"
export INKSCAPE_PLUGINDIR="$TOP/lib/inkscape"
export INKSCAPE_LOCALEDIR="$TOP/share/locale"
# Handle the case where the directory storing Inkscape has special characters
# ('#', '&', '|') in the name. These need to be escaped to work properly for
# various configuration files.
# Set GTK theme (only if there is no .gtkrc-2.0 in the user's home)
if [[ ! -e "$HOME/.gtkrc-2.0" ]]; then
export GTK2_RC_FILES="$ESCAPEDTOP/etc/gtk-2.0/gtkrc"
fi
# If the AppleCollationOrder preference doesn't exist, we fall back to using
# the AppleLocale preference.
LANGSTR=`defaults read .GlobalPreferences AppleCollationOrder 2>/dev/null`
then
LANGSTR=`defaults read .GlobalPreferences AppleLocale 2>/dev/null | \
else
fi
# NOTE: Have to add ".UTF-8" to the LANG since omitting causes Inkscape
# to crash on startup in locale_from_utf8().
if [ "x$LANGSTR" == "x" ]
then
# override broken script
else
if [ "x$tmpLANG" == "x" ]
then
# override broken script
else
fi
fi
> "${INK_CACHE_DIR}/pango.modules"
> "${INK_CACHE_DIR}/immodules.cache"
> "${INK_CACHE_DIR}/loaders.cache"
if [ "x$GTK_DEBUG_SHELL" != "x" ]; then
exec bash
else
fi
# eof