From db387835f1414858c3e1fb8be88ffc2c1a0c9ed3 Mon Sep 17 00:00:00 2001 From: su_v Date: Fri, 5 Sep 2014 14:56:31 +0200 Subject: work around breakages due to current implementation of OS X relocation support (bzr r13506.1.58) --- packaging/macosx/Resources/bin/inkscape | 16 ++++++++++++++-- packaging/macosx/Resources/openDoc | 2 -- packaging/macosx/Resources/script | 5 ++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/packaging/macosx/Resources/bin/inkscape b/packaging/macosx/Resources/bin/inkscape index 0b7e85ce8..511bd6768 100755 --- a/packaging/macosx/Resources/bin/inkscape +++ b/packaging/macosx/Resources/bin/inkscape @@ -21,11 +21,23 @@ else EXEC=exec fi -CWD="`(cd \"\`dirname \\\"$0\\\"\`\"; echo \"$PWD\")`" +CWD="$(cd "$(dirname "$0")" && pwd)" # e.g. /Applications/Inkscape.app/Contents/Resources/bin -TOP="`dirname \"$CWD\"`" +TOP="$(dirname "$CWD")" # e.g. /Applications/Inkscape.app/Contents/Resources +BASE="$(echo "$CWD" | sed -e 's/\/Contents\/Resources.*$//')" +# e.g. /Applications/Inkscape.app +# FIXME: Inkscape needs better relocation support for OS X (get rid of the relative +# path hack in src/path-prefix.h for osxapp-enabled builds). Until then, below change +# of working directory is required: +# +# Due to changes after 0.48, we have change working directory in the script named 'inkscape': +# recursive calls to inkscape from python-based extensions otherwise cause the app to hang or +# fail (for python-based extensions, inkscape changes the working directory to the +# script's directory, and inkscape launched by python script thus can't find resources +# like the now essential 'units.xml' in INKSCAPE_UIDIR relative to the working directory). +cd "$BASE" # Brutally add many things to the PATH. If the directories do not exist, they won't be used anyway. # People should really use ~/.macosx/environment.plist to set environment variables as explained by Apple: diff --git a/packaging/macosx/Resources/openDoc b/packaging/macosx/Resources/openDoc index 63e803540..c2740c9b5 100644 --- a/packaging/macosx/Resources/openDoc +++ b/packaging/macosx/Resources/openDoc @@ -8,6 +8,4 @@ CWD="$(cd "$(dirname "$0")" && pwd)" source "${CWD}/xdg_setup.sh" -BASE="$(echo "$0" | sed -e 's/\/Contents\/Resources\/openDoc/\//')" -cd "$BASE" exec "$CWD/bin/inkscape" "$@" diff --git a/packaging/macosx/Resources/script b/packaging/macosx/Resources/script index de839484d..a97d02486 100755 --- a/packaging/macosx/Resources/script +++ b/packaging/macosx/Resources/script @@ -11,12 +11,11 @@ CWD="$(cd "$(dirname "$0")" && pwd)" source "${CWD}/xdg_setup.sh" source "${CWD}/alert_fccache.sh" -BASE="$(echo "$0" | sed -e 's/\/Contents\/Resources\/script/\//')" -cd "$BASE" - # TODO examine whether it would be wisest to move the code from inkscape shell # script and getdisplay.sh to here and only keep the real binary in bin. This # may make things easier on Leopard and may also help using Inkscape on the # command line. +# +# See related FIXME in bin/inkscape for requirements to merge the two scripts. exec "$CWD/bin/inkscape" "$@" -- cgit v1.2.3