osx-app.sh revision 0627343b67311b4d11932d4f6b5e31a743cc4f3a
3131N/A# osx-app [-s] [-l /path/to/libraries] -py /path/to/python/modules [-l /path/to/libraries] -b /path/to/bin/inkscape -p /path/to/Info.plist
3131N/A# This script attempts to build an Inkscape.app package for OS X, resolving
3131N/A# The Info.plist file can be found in the base inkscape directory once
strip_build=false
add_wrapper=true
add_python=true
# If LIBPREFIX is not already set (by osx-build.sh for example) set it to blank
if [ -z $LIBPREFIX ]; then
$0 [-s] [-l /path/to/libraries] -py /path/to/python/modules -b /path/to/bin/inkscape -p /path/to/Info.plist
specify the path to Info.plist. Info.plist can be found
add_python=true
strip_build=true ;;
-l|--libraries)
-b|--binary)
-p|--plist)
-v|--verbose)
verbose_mode=true ;;
-h|--help)
if [ ! -x "$binary" ]; then
if [ ! -f "$plist" ]; then
if [ -z "$python_dir" ]; then
if [ ! -e "$python_dir" ]; then
if [ ! -e "$LIBPREFIX" ]; then
echo "Missing GTK+ backend -- please install gtk2 and its dependencies with variant '+quartz' and try again." >&2
echo "Missing GTK+ backend -- please install gtk2 and its dependencies with variant '+x11' and try again." >&2
if [ ! -e "$LIBPREFIX/lib/gtk-2.0/$(pkg-config --variable=gtk_binary_version gtk+-2.0)/engines/libmurrine.so" ]; then
if [ ! -e "$LIBPREFIX/lib/gtk-2.0/$(pkg-config --variable=gtk_binary_version gtk+-2.0)/engines/libadwaita.so" ]; then
if [ ! -e "$LIBPREFIX/share/icons/hicolor/index.theme" ]; then
# echo "Missing gnome-icon-theme-symbolic -- please install gnome-icon-theme-symbolic and try again." >&2
unset WITH_GNOME_VFS
WITH_GNOME_VFS=true
if [ ! -e "$LIBPREFIX/lib/aspell-0.60/en.dat" ]; then
if [ -z "$awk_test" ]; then
if [ ! -x "$LIBPREFIX/bin/gawk" ]; then
unset awk_test
x11)
# the Info.plist file which is filled in by the configure script.
if [ -d $package ]; then
echo "Removing previous Inkscape.app"
if [ -z "$custom_res" ] ; then
if [ $verbose_mode ] ; then
x11)
unset CC
# TODO Add a "$verbose" variable and command line switch, which sets wether these commands are verbose or not
#mv "$pkgbin/python-wrapper.sh" "$pkgbin/python"
if [ -z "$python_dir" ]; then
# - ${python_dir}/python2.5/site-packages/lxml
# - ${python_dir}/python2.5/site-packages/nose
# - ${python_dir}/python2.5/site-packages/numpy
# - ${python_dir}/python2.6/site-packages/lxml
# PkgInfo must match bundle type and creator code from Info.plist
# We use a modified fonts.conf file so only need the dtd
(cd $pkgetc/fonts/conf.d && $ln_cmd ../../../share/fontconfig/conf.avail/10-autohint.conf)
(cd $pkgetc/fonts/conf.d && $ln_cmd ../../../share/fontconfig/conf.avail/70-no-bitmaps.conf)
$cp_cmd $LIBPREFIX/lib/gdk-pixbuf-2.0/$gdk_pixbuf_version/loaders/*.so $pkglib/gdk-pixbuf-2.0/$gdk_pixbuf_version/loaders/
#sed -e "s,$LIBPREFIX,@loader_path/..,g" "$LIBPREFIX/etc/pango/pango.modules" > "$pkgetc/pango/pango.modules"
#sed -e "s,$LIBPREFIX,@loader_path/..,g" "$LIBPREFIX/lib/gtk-2.0/$gtk_version/immodules.cache" > "$pkglib/gtk-2.0/$gtk_version/immodules.cache"
#sed -e "s,$LIBPREFIX,@loader_path/..,g" "$LIBPREFIX/lib/gdk-pixbuf-2.0/$gtk_version/loaders.cache" > "$pkglib/gdk-pixbuf-2.0/$gtk_version/loaders.cache"
if [ $WITH_GNOME_VFS ] ; then
# (i.e. $LIBPREFIX), then loop until no changes.
endl=true
while $endl; do
$pkglib/gtk-2.0/$gtk_version/{engines,immodules,printbackends}/*.{dylib,so} \
$binpath \
endl=false
unset to_id
lib)
loader_to_res="$(echo $filePath | $awk_cmd -F/ '{for (i=1;i<NF;i++) sub($i,".."); sub($NF,"",$0); print $0}')"
bin)
if [ $first != /usr/lib -a $first != /usr/X11 -a $first != /opt/X11 -a $first != /System/Library ]; then
unset to_path
lib)
bin)
for file in $extra_bin; do
echo "Inkscape.app created successfully."