Re: Gnumeric on Mac OS X



Hi Adrian

That's strange cos' it works well for me.
The script creates a link in /tmp/skl/Gnumeric at launch and the remove it.
Making Gnumeric launchable from everywhere.

I copied de application on a USB key and renamed it to Gnumeric-app.app and
then launched it directly from the USB key on another computer, it did work.

I compiled it with Yosemite. Maybe that's the reason.

#!/bin/sh
#
# (c) 2008, Simone Karin Lehmann, simone at lisanet dot de
# GPL version 2 or later
# script 1.3 Leo
# adapted for Gnumeric by Aymeric GILLAIZEAU m.rick.mac at gmail dot com

set -e

name=$(basename "$0")
DIR=`dirname "$0"`
cd "$DIR/../.."
APPDIR=`pwd`
cd - > /dev/null
# edit the next line to match version file
VERSION=1.12.31-20160630
LNDIR=/tmp/skl
bundle_res="$APPDIR/Contents/Resources"

rm -rf "$LNDIR/Gnumeric" || true
mkdir -p /tmp/skl
chmod a+w /tmp/skl
ln -s "$bundle_res" "$LNDIR/Gnumeric"


bundle=$(cd "$DIR/../../" && pwd)

bundle_lib="$bundle_res/lib"
bundle_bin="$bundle_res/bin"
bundle_data="$bundle_res/share"
bundle_etc="$bundle_res/etc"


# Setting application directories
bundle_appsup="$HOME/Library/Application Support/Gnumeric"
if [ ! -d "/$bundle_appsup" ]
then
    mkdir -p "$bundle_appsup"
fi
# Setting cache files
cp "$bundle_res/etc/fonts/fonts.conf" "$bundle_appsup"

# Setting caches directories
bundle_temp="$HOME/Library/Caches/org.gnome.gnumeric"
if [ ! -d "/$bundle_temp" ]
then
    mkdir "$bundle_temp"
fi
# Fontconfig cache directory
fontconfig_cache="$HOME/Library/Caches/org.gnome.gnumeric/fontconfig"
if [ ! -d "/$fontconfig_cache" ]
then
    mkdir "$fontconfig_cache"
fi
if [ ! -d "/$fontconfig_cache" ]
then
    ln -s "$fontconfig_cache $HOME/.cache/fontconfig"
fi
# Setting cache files
if [ ! -d "/$fontconfig_cache" ]
then
    cp "$bundle_lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" "$bundle_temp"
fi


# Setup charset
if test -f "$bundle_lib/charset.alias"; then
        export CHARSETALIASDIR="$bundle_lib"
fi


# Set up Python path variable
export
PYTHONPATH="$bundle_lib/python2.7/site-packages${PYTHONPATH:+:$PYTHONPATH}"


# Set up general path variables
#export DYLD_LIBRARY_PATH="$bundle_lib:$DYLD_LIBRARY_PATH"
export
DYLD_FALLBACK_LIBRARY_PATH="$bundle_res/lib:$DYLD_FALLBACK_LIBRARY_PATH"
export LD_LIBRARY_PATH="$bundle_lib:$LD_LIBRARY_PATH:$LD_LIBRARY_PATH"
#export PANGO_RC_FILE="$bundle_etc/pango/pangorc"
export PANGO_LIBDIR="$bundle_lib"
export PANGO_SYSCONFDIR="$bundle_etc"
export GTK_PATH="$bundle_res"
export GTK_EXE_PREFIX="$bundle_res"
export GTK_DATA_PREFIX="$bundle_res"

export GDK_PIXBUF_MODULEDIR"=$bundle_lib/gdk-pixbuf-2.0/2.10.0/loaders/"
#export GDK_PIXBUF_MODULE_FILE="$bundle_lib/loaders.cache"

export XDG_CONFIG_DIRS="$bundle_etc:$XDG_CONFIG_DIRS"
export XDG_DATA_DIRS="$bundle_data:$XDG_DATA_DIRS"

export DBUS_REPLACE_INSTALL_PREFIX="$bundle_res"


# Specify fonconfig configuration file
export FONTCONFIG_PATH="$bundle_res/etc/fonts"
#export FONTCONFIG_FILE="$bundle_res/etc/fonts/fonts.conf"
export FONTCONFIG_FILE="$bundle_appsup/fonts.conf"


# Set up path variable
export PATH="$bundle_bin:$bundle_res/sbin:$bundle/MacOS:/usr/bin:$PATH"
export PATH


# Strip out the argument added by the OS.
if [ x`echo "x$1" | sed -e "s/^x-psn_.*//"` == x ]; then
        shift 1
fi


# Launch dbus if needed
#dbusenv="$TMPDIR/gedit-$USER.dbus"
#
#if [ -f "$dbusenv" ]; then
#       source "$dbusenv"
#fi
#
#if [ -z "$DBUS_SESSION_BUS_PID" ] || ! ps -p "$DBUS_SESSION_BUS_PID"
/dev/null; then
#       "$bundle_bin/dbus-launch" --config-file "$bundle_etc/dbus-1/session.conf"
#"$dbusenv"
#
#       source "$dbusenv"
#fi

#export DBUS_SESSION_BUS_PID
#export DBUS_SESSION_BUS_ADDRESS


# Set locales
LC_NUMERIC=$LANG
LC_ALL=$LANG
LANGUAGE=$LANG
export LANG LC_NUMERIC LC_ALL LANGUAGE


cd ~/ > /dev/null
$EXEC "$bundle_bin/gnumeric" "$@" $EXTRA_ARGS

rm -f "$LNDIR/Gnumeric" || true





--
View this message in context: http://gnome-apps.13852.n7.nabble.com/Gnumeric-on-Mac-OS-X-tp68555p68562.html
Sent from the GnuMeric mailing list archive at Nabble.com.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]