From: mjwybrow Date: Fri, 11 Sep 2009 04:45:57 +0000 (+0000) Subject: - Check that poppler iis included in the App bundle. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d165792baff42d669ce38fc3631c0f4d5f2fbd21;p=inkscape.git - Check that poppler iis included in the App bundle. - Discover the ImageMagick version at packaging time rather than it being hardcoded. - Move the theme related gtkrc file into the user's $HOME/.inkscape-etc directory, rather than the modified version getting written into the App bundle. Fixes bug #169013. --- diff --git a/packaging/macosx/Resources/bin/inkscape b/packaging/macosx/Resources/bin/inkscape index f36865117..83c46536d 100755 --- a/packaging/macosx/Resources/bin/inkscape +++ b/packaging/macosx/Resources/bin/inkscape @@ -32,6 +32,7 @@ export PYTHONPATH="$TOP/python/site-packages/$ARCH/$PYTHON_VERS" # No longer required if path rewriting has been conducted. # export DYLD_LIBRARY_PATH="$TOP/lib" +mkdir -p "${HOME}/.inkscape-etc" export FONTCONFIG_PATH="$TOP/etc/fonts" export PANGO_RC_FILE="$HOME/.inkscape-etc/pangorc" @@ -45,14 +46,14 @@ export XDG_DATA_DIRS="$TOP/share" export ASPELL_CONF="prefix $TOP;" # Note: This requires the path with the exact ImageMagic version number. -# FIXME: Make the osx-app.sh script write the version into this file when -# building the package. Note, 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. -export MAGICK_CONFIGURE_PATH="$TOP/lib/ImageMagick-6.5.5/config:$TOP/share/ImageMagick-6.5.5/config" -export MAGICK_CODER_FILTER_PATH="$TOP/lib/ImageMagick-6.5.5/modules-Q16/filters" -export MAGICK_CODER_MODULE_PATH="$TOP/lib/ImageMagick-6.5.5/modules-Q16/coders" +# 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/config" +export MAGICK_CODER_FILTER_PATH="$TOP/lib/ImageMagick-IMAGEMAGICKVER/modules-Q16/filters" +export MAGICK_CODER_MODULE_PATH="$TOP/lib/ImageMagick-IMAGEMAGICKVER/modules-Q16/coders" export INKSCAPE_SHAREDIR="$TOP" # TODO: move the share directory to a its own folder to make things a bit cleaner in the app bundle @@ -61,13 +62,38 @@ export INKSCAPE_LOCALEDIR="$TOP/locale" # Set GTK theme (only if there is no .gtkrc-2.0 in the user's home) if [[ ! -e "$HOME/.gtkrc-2.0" ]]; then - # prepare the theme depending on OS X appearance settings - ( - cd "$INKSCAPE_SHAREDIR/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/" - ./sync_osx_look.sh - # TODO: make this more robust, probably by integrating this script directly inline here - ) - export GTK2_RC_FILES="$INKSCAPE_SHAREDIR/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/gtkrc" + # Appearance setting + aquaStyle=`defaults read "Apple Global Domain" AppleAquaColorVariant 2>/dev/null` + # 1 for aqua, 6 for graphite, inexistant if the default color was never changed + if [[ "$aquaStyle" == "" ]]; then + aquaStyle=1 # set aqua as default + fi + + # Highlight Color setting + hiliColor=`defaults read "Apple Global Domain" AppleHighlightColor 2>/dev/null` + # a RGB value, with components between 0 and 1, also inexistant if it was not changed + if [[ "$hiliColor" == "" ]]; then + hiliColor="0.709800 0.835300 1.000000" # set blue as default + fi + + # Menu items color + if [[ aquaStyle -eq 1 ]]; then + menuColor="#4a76cd" # blue + else + menuColor="#7c8da4" # graphite + fi + # Format highlight color as a GTK rgb value + hiliColorFormated=`echo $hiliColor | awk -F " " '{print "\\\{"$1","$2","$3"\\\}"}'` + + # echo $menuColor + # echo $hiliColorFormated + + # Modify the gtkrc + # - with the correct colors + # - to point to the correct scrollbars folder + sed 's/OSX_HILI_COLOR_PLACEHOLDER/'$hiliColorFormated'/g' "$INKSCAPE_SHAREDIR/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/pre_gtkrc" | sed 's/OSX_MENU_COLOR_PLACEHOLDER/\"'$menuColor'\"/g' | sed 's/AQUASTYLE_PLACEHOLDER/'$aquaStyle'/g' | sed 's|${THEMEDIR}|'"$TOP/themes/Clearlooks-Quicksilver-OSX/gtk-2.0|g" > "${HOME}/.inkscape-etc/gtkrc" + + export GTK2_RC_FILES="$HOME/.inkscape-etc/gtkrc" fi # If the AppleCollationOrder preference doesn't exist, we fall back to using @@ -90,7 +116,6 @@ echo "Setting Language: $LANG" # This '#' needs to be escaped in pango.modules for Pango to work properly. ESCAPEDTOP=`echo $TOP | sed 's/#/\\\\\\\\#/'` -mkdir -p "${HOME}/.inkscape-etc" sed 's|${HOME}|'"$HOME|g" "$TOP/etc/pango/pangorc" > "${HOME}/.inkscape-etc/pangorc" sed 's|${CWD}|'"$ESCAPEDTOP|g" "$TOP/etc/pango/pango.modules" \ > "${HOME}/.inkscape-etc/pango.modules" diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/pre_gtkrc b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/pre_gtkrc index 531a6a56f..a8b3d4c4c 100644 --- a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/pre_gtkrc +++ b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/pre_gtkrc @@ -8,6 +8,8 @@ # GNU General Public License http://www.gnu.org/copyleft/gpl.html # +pixmap_path "${THEMEDIR}" + style "clearlooks-default" { GtkButton ::default_border = { 0, 0, 0, 0 } diff --git a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/sync_osx_look.sh b/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/sync_osx_look.sh deleted file mode 100755 index a44fb2f6a..000000000 --- a/packaging/macosx/Resources/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/sync_osx_look.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# -# Reads defaults from Apple preferences and modifies GTK accordingly -# -# (c) 2007 JiHO -# GNU General Public License http://www.gnu.org/copyleft/gpl.html -# - -# Appearance setting -aquaStyle=`defaults read "Apple Global Domain" AppleAquaColorVariant 2>/dev/null` -# 1 for aqua, 6 for graphite, inexistant if the default color was never changed -if [[ "$aquaStyle" == "" ]]; then - aquaStyle=1 # set aqua as default -fi - -# Highlight Color setting -hiliColor=`defaults read "Apple Global Domain" AppleHighlightColor 2>/dev/null` -# a RGB value, with components between 0 and 1, also inexistant if it was not changed -if [[ "$hiliColor" == "" ]]; then - hiliColor="0.709800 0.835300 1.000000" # set blue as default -fi - -# Menu items color -if [[ aquaStyle -eq 1 ]]; then - menuColor="#4a76cd" # blue -else - menuColor="#7c8da4" # graphite -fi -# Format highlight color as a GTK rgb value -hiliColorFormated=`echo $hiliColor | awk -F " " '{print "\\\{"$1","$2","$3"\\\}"}'` - -# echo $menuColor -# echo $hiliColorFormated - -# Modify the gtkrc -# - with the correct colors -# - to point to the correct scrollbars folder -sed 's/OSX_HILI_COLOR_PLACEHOLDER/'$hiliColorFormated'/g' pre_gtkrc | sed 's/OSX_MENU_COLOR_PLACEHOLDER/\"'$menuColor'\"/g' | sed 's/AQUASTYLE_PLACEHOLDER/'$aquaStyle'/g' > gtkrc diff --git a/packaging/macosx/osx-app.sh b/packaging/macosx/osx-app.sh index 251fc1289..027715758 100755 --- a/packaging/macosx/osx-app.sh +++ b/packaging/macosx/osx-app.sh @@ -163,6 +163,11 @@ if [ ! -e "$LIBPREFIX/lib/gnome-vfs-2.0" ]; then exit 1 fi +if ! pkg-config --exists poppler; then + echo "Missing poppler -- please install poppler and try again." >&2 + exit 1 +fi + if ! pkg-config --modversion ImageMagick >/dev/null 2>&1; then echo "Missing ImageMagick -- please install ImageMagick and try again." >&2 exit 1 @@ -268,6 +273,10 @@ cp -rp "$LIBPREFIX/share/mime" "$pkgresources/share/" # Icons and the rest of the script framework rsync -av --exclude ".svn" "$resdir"/Resources/* "$pkgresources/" +# Update the ImageMagick path in startup script. +IMAGEMAGICKVER=`pkg-config --modversion ImageMagick` +sed -e "s,IMAGEMAGICKVER,$IMAGEMAGICKVER,g" -i "" $pkgbin/inkscape + # Add python modules if requested if [ ${add_python} = "true" ]; then # copy python site-packages. They need to be organized in a hierarchical set of directories, by architecture and python major+minor version, e.g. i386/2.3/ for Ptyhon 2.3 on Intel; ppc/2.4/ for Python 2.4 on PPC