osx-app.sh revision 3ac1e6421484e82274e011f86fab097f7a5ffded
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=false
add_python=true
# If LIBPREFIX is not already set (by osx-build.sh for example) set it to blank (one should use the command line argument to set it correctly)
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=true ;;
-l|--libraries)
-b|--binary)
-p|--plist)
-h|--help)
if [ ! -x "$binary" ]; then
if [ ! -f "$plist" ]; then
if [ -z "$python_dir" ]; then
if [ ! -e "$python_dir" ]; then
echo "Python modules will be copied from $python_dir."
if [ ! -e "$LIBPREFIX" ]; then
if [ ! -e "$LIBPREFIX/lib/aspell-0.60/en.dat" ]; then
if [ -z "$awk_test" ]; then
if [ ! -x "$LIBPREFIX/bin/gawk" ]; then
unset awk_test
# 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
#pkgpython="$package/Contents/Resources/python/site-packages/"
if [ $verbose_mode ] ; then
unset CC
# TODO Add a "$verbose" variable and command line switch, which sets wether these commands are verbose or not
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
sed -e "s,$LIBPREFIX,\"\${CWD},g" -e 's,\.so ,.so" ,g' $LIBPREFIX/etc/pango/pango.modules > $pkgetc/pango/pango.modules
# We use a modified fonts.conf file so only need the dtd
(cd $pkgetc/fonts/conf.d && ln -s ../../../share/fontconfig/conf.avail/10-autohint.conf)
(cd $pkgetc/fonts/conf.d && ln -s ../../../share/fontconfig/conf.avail/70-no-bitmaps.conf)
cp $LIBPREFIX/lib/gdk-pixbuf-2.0/$gdk_pixbuf_version/loaders/*.so $pkglib/gdk-pixbuf-2.0/$gdk_pixbuf_version/loaders/
sed -e "s,$LIBPREFIX,\${CWD},g" $LIBPREFIX/lib/gtk-2.0/$gtk_version/immodules.cache > $pkglib/gtk-2.0/$gtk_version/immodules.cache
sed -e "s,$LIBPREFIX,\${CWD},g" $LIBPREFIX/lib/gdk-pixbuf-2.0/$gdk_pixbuf_version/loaders.cache > $pkglib/gdk-pixbuf-2.0/$gdk_pixbuf_version/loaders.cache
# (i.e. $LIBPREFIX), then loop until no changes.
endl=true
while $endl; do
$pkglib/gtk-2.0/$gtk_version/{engines,immodules,printbackends}/*.{dylib,so} \
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