From: mjwybrow Date: Thu, 15 Mar 2007 03:34:35 +0000 (+0000) Subject: * Makefile.am, packaging/macosx/inkscape_python.ds_store, X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3890ae27a0e3b764353c8674c65ba2ae5a365cfa;p=inkscape.git * Makefile.am, packaging/macosx/inkscape_python.ds_store, packaging/macosx/osx-build.sh, packaging/macosx/osx-app.sh, packaging/macosx/dmg_background.svg, packaging/macosx/osx-dmg.sh, packaging/macosx/dmg_background.png, packaging/macosx/dmg_set_style.scpt, packaging/macosx/inkscape.ds_store: Updates to the Mac OS X packaging scripts by Jean-Olivier Irisson to improve support for building DMGs with python bundled, as well as making everything less Fink-centric so DarwinPorts can be used as an alternative. Submitted as patch #1673087. --- diff --git a/Makefile.am b/Makefile.am index 90b00606c..b91a7f4b6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -87,10 +87,12 @@ EXTRA_DIST = \ cxxtest/cxxtest/X11Gui.h \ cxxtest/cxxtest/YesNoRunner.h \ packaging/autopackage/default.apspec.in \ - packaging/osx-app.sh \ packaging/macosx/dmg_background.png \ packaging/macosx/inkscape.ds_store \ + packaging/macosx/inkscape_python.ds_store \ + packaging/macosx/osx-app.sh \ packaging/macosx/osx-dmg.sh \ + packaging/macosx/osx-build.sh \ packaging/macosx/Resources/MenuBar.nib/classes.nib \ packaging/macosx/Resources/MenuBar.nib/info.nib \ packaging/macosx/Resources/MenuBar.nib/objects.xib \ diff --git a/packaging/macosx/dmg_background.png b/packaging/macosx/dmg_background.png index 66d532f6d..65b7964f8 100644 Binary files a/packaging/macosx/dmg_background.png and b/packaging/macosx/dmg_background.png differ diff --git a/packaging/macosx/dmg_background.svg b/packaging/macosx/dmg_background.svg index 6c69e511b..8bd97119e 100644 --- a/packaging/macosx/dmg_background.svg +++ b/packaging/macosx/dmg_background.svg @@ -10,37 +10,20 @@ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="624.54108" - height="297.78" + height="350" id="svg2" sodipodi:version="0.32" - inkscape:version="0.44+devel" + inkscape:version="0.45" sodipodi:docname="dmg_background.svg" - sodipodi:docbase="/Volumes/files/softwares/inkscape/packaging/macosx" + sodipodi:docbase="/Volumes/files/softwares/inkscape/trunk_devel/packaging/macosx" version="1.0" - inkscape:export-filename="/Volumes/files/softwares/inkscape/packaging/macosx/dmg_background.png" + inkscape:export-filename="/Volumes/files/softwares/inkscape/trunk_devel/packaging/macosx/dmg_background.png" inkscape:export-xdpi="90" - inkscape:export-ydpi="90"> + inkscape:export-ydpi="90" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + sodipodi:modified="TRUE"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + height="350px" + width="624.54108px" + units="px" /> @@ -708,204 +172,194 @@ id="layer1" transform="translate(-48.8794,-125.0409)"> - + id="g4050" + transform="matrix(0.8110502,0,0,0.8110502,325.88989,77.589726)"> + id="path572" + d="M 248.84375,54.96875 C 237.742,54.96875 226.66325,59.21175 218.15625,67.71875 L 66.96875,218.90625 C 58.630237,227.24477 54.41517,238.08767 54.25,248.96875 L 54.1875,248.96875 C 54.1875,249.01083 54.247774,249.05157 54.25,249.09375 C 54.247803,249.27213 54.1875,249.44661 54.1875,249.625 L 54.46875,249.625 C 57.375,260.6352 132.09566,274.68942 140.4375,283.03125 C 153.0365,295.63025 92.1512,304.86976 104.75,317.46875 C 117.349,330.06775 180.9,341.8385 193.5,354.4375 C 206.099,367.0365 167.74476,380.46351 180.34375,393.0625 C 192.94275,405.6615 235.25875,389.88699 227.59375,422.75 C 244.60775,439.764 280.10701,431.67026 303.875,414.65625 C 316.474,402.05725 279.71349,403.16149 292.3125,390.5625 C 304.9115,377.9635 336.703,377.888 363.5,347.75 C 352.714,330.975 317.40101,323.81774 330,311.21875 C 342.599,298.61975 367.0855,305.03324 419.9375,281.03125 C 445.74027,269.3126 443.5984,260.41677 443.5,249.625 C 443.49794,249.39905 443.5,249.19642 443.5,248.96875 L 443.4375,248.96875 C 443.27232,238.08775 439.08845,227.2447 430.75,218.90625 L 279.5625,67.71875 C 271.05549,59.211749 259.9455,54.96875 248.84375,54.96875 z " + style="font-size:12px;fill:#c0c0c0;fill-opacity:1;fill-rule:evenodd;stroke-width:1pt" /> + id="path580" + d="M 364.356,366.845 C 382.828,370.539 386.524,383.47 382.828,387.164 C 379.135,390.859 369.899,394.553 362.51,389.011 C 355.119,383.47 355.119,370.539 364.356,366.845 z " + style="font-size:12px;fill:#c0c0c0;fill-opacity:1;fill-rule:evenodd;stroke-width:1pt" /> + id="path582" + d="M 177.423,368.079 C 175.623,368.559 160.586,355.601 148.678,361.607 C 136.773,367.612 128.781,381.059 139.903,386.577 C 151.026,392.095 158.977,385.732 168.728,378.885 C 178.48,372.039 178.128,370.72 177.423,368.079 z " + style="font-size:12px;fill:#c0c0c0;fill-opacity:1;fill-rule:evenodd;stroke-width:1pt" /> + id="path583" + d="M 397.131,335.205 C 407.177,332.693 430.383,335.205 426.687,349.981 C 422.994,364.761 391.592,359.217 371.27,351.831 C 369.423,337.052 392.396,336.388 397.131,335.205 z " + style="font-size:12px;fill:#c0c0c0;fill-opacity:1;fill-rule:evenodd;stroke-width:1pt" /> - + id="path568" + d="M 204.84,101.661 C 187.477,110.476 158.953,147.511 158.953,152.8 L 158.412,174.823 L 207.87,169.863 L 225.583,128.395 L 239.327,175.816 L 275.293,151.808 L 298.561,162.72 L 302.782,130.776 L 345.097,151.212 C 345.097,150.551 345.049,149.89 344.951,149.231 C 344.853,148.573 344.707,147.916 344.511,147.265 C 344.316,146.613 344.072,145.967 343.779,145.327 C 343.486,144.688 343.144,144.056 342.753,143.433 C 342.363,142.811 341.923,142.198 341.435,141.597 C 340.946,140.996 340.409,140.408 339.823,139.834 C 339.237,139.259 338.602,138.7 337.918,138.157 C 337.234,137.614 336.501,137.088 335.719,136.581 L 264.28,83.5998 C 251.775,75.4938 249.101,70.7318 236.596,78.8378 L 204.84,101.661 z " + style="font-size:12px;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1pt" /> + + + + + + + + + + id="path5001" + d="M 96.6875,160.96875 C 92.787255,160.12272 89.338676,166.71986 94.4375,167.625 C 98.127844,169.64513 105.11906,165.50747 100.90625,161.84375 C 99.656522,161.05111 98.140071,160.87759 96.6875,160.96875 z " + style="font-size:12px;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1pt;filter:url(#filter6370)" /> + id="path5003" + d="M 78.90625,130.0625 C 71.574069,132.72813 68.195911,140.7692 62.0625,145.25 C 60.185026,147.42322 54.784698,150.53213 57.25,153.90625 C 59.730284,154.72534 65.594263,155.98382 63.34061,159.34427 C 59.717471,163.33418 70.334693,162.45891 71.59375,165.46875 C 73.006345,167.48699 68.928159,170.12348 72.71875,170.65625 C 75.274013,170.82156 76.509875,171.42143 77.15625,173.71875 C 79.798879,175.53189 84.935097,174.59678 86.375,171.65625 C 84.032653,167.37236 91.803417,168.05515 93.09375,164.40625 C 90.163883,162.96743 90.537912,158.77419 94.09375,158.75 C 97.839433,158.38307 104.15352,156.07034 102.125,151.15625 C 95.808038,143.61829 88.597124,136.46857 81.03125,130.28125 C 80.359155,130.04775 79.615042,129.96607 78.90625,130.0625 z M 80.375,133.28125 C 82.853723,134.6375 88.132191,138.59859 83.90625,140.96875 C 81.669601,143.5713 77.157842,142.78439 76.6875,139.0625 C 76.528868,140.88754 72.618484,146.33606 70.0625,142.5 C 68.712832,139.23213 74.807932,134.16459 76.5,138.125 C 75.943839,135.93126 77.766171,131.42089 80.375,133.28125 z " + style="font-size:12px;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:1pt;filter:url(#filter6366)" /> + + - - - - + id="g3996" + transform="matrix(5.8837e-2,0,0,5.8837e-2,-4.768899,-3.296641)"> + style="font-size:12px;fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:0.47950168pt" + d="M 397.64309,320.25301 L 280.39197,282.517 L 250.74227,124.83447 L 345.08225,29.146783 L 393.59996,46.667064 L 483.89679,135.61619 L 397.64309,320.25301 z " + id="path3998" /> + style="font-size:12px;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke-width:1pt" + d="M 476.95792,339.17168 C 495.78197,342.93607 499.54842,356.11361 495.78197,359.87802 C 492.01856,363.6434 482.6065,367.40781 475.07663,361.76014 C 467.54478,356.11361 467.54478,342.93607 476.95792,339.17168 z " + id="path4000" /> + style="font-size:12px;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke-width:1pt" + d="M 286.46194,340.42914 C 284.6277,340.91835 269.30405,327.71337 257.16909,333.8338 C 245.03722,339.95336 236.89276,353.65666 248.22676,359.27982 C 259.56184,364.90298 267.66433,358.41867 277.60113,351.44119 C 287.53903,344.46477 287.18046,343.1206 286.46194,340.42914 z " + id="path4002" /> + style="font-size:12px;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke-width:1pt" + d="M 510.35756,306.92856 C 520.59494,304.36879 544.24333,306.92856 540.47688,321.98634 C 536.71354,337.04806 504.71297,331.39827 484.00371,323.87156 C 482.12141,308.81083 505.53237,308.13423 510.35756,306.92856 z " + id="path4004" /> - - - - - - - - + style="font-size:12px;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke-width:1pt" + d="M 359.2403,21.362537 C 347.92693,21.362537 336.6347,25.683095 327.96556,34.35223 L 173.87387,188.41466 C 165.37697,196.9114 161.1116,207.95813 160.94269,219.04577 L 160.88418,219.04577 C 160.88418,219.08524 160.94076,219.12322 160.94269,219.16279 C 160.94033,219.34888 160.88418,219.53256 160.88418,219.71865 L 161.14748,219.71865 C 164.0966,230.93917 240.29699,245.24198 248.79866,253.74346 C 261.63771,266.58263 199.5652,276.01151 212.4041,288.85074 C 225.24316,301.68979 289.99433,313.6933 302.8346,326.53254 C 315.67368,339.37161 276.5961,353.04289 289.43532,365.88196 C 302.27439,378.72118 345.40201,362.67257 337.5908,396.16198 C 354.92909,413.50026 391.10302,405.2208 415.32417,387.88252 C 428.16323,375.04345 390.6948,376.17577 403.53397,363.33668 C 416.37304,350.49745 448.78128,350.4282 476.08902,319.71589 C 465.09739,302.62116 429.10801,295.34136 441.94719,282.50217 C 454.78625,269.66311 479.74708,276.18423 533.60644,251.72479 C 559.89837,239.78398 557.72636,230.71459 557.62567,219.71865 C 557.62356,219.48727 557.62567,219.27892 557.62567,219.04577 L 557.56716,219.04577 C 557.3983,207.95812 553.10345,196.9114 544.60673,188.41466 L 390.54428,34.35223 C 381.87515,25.683095 370.55366,21.362537 359.2403,21.362537 z M 357.92378,41.402939 C 362.95327,41.533963 367.01541,45.368018 374.98006,50.530832 L 447.76915,104.50827 C 448.56596,105.02498 449.32484,105.564 450.02187,106.11735 C 450.7189,106.67062 451.3556,107.25745 451.95277,107.84347 C 452.54997,108.42842 453.09281,109.01553 453.59111,109.62808 C 454.08837,110.24052 454.53956,110.86661 454.93688,111.50048 C 455.33532,112.13538 455.69164,112.78029 455.9901,113.43137 C 456.28877,114.08363 456.52291,114.75639 456.7215,115.42078 C 456.92126,116.08419 457.08982,116.73973 457.18961,117.41019 C 457.28949,118.08184 457.33588,118.75535 457.33588,119.42886 L 414.21245,98.598549 L 409.9118,131.16055 L 386.18512,120.04324 L 349.55654,144.50131 L 335.54288,96.1703 L 317.4919,138.4453 L 267.08369,143.47735 L 267.63956,121.03795 C 267.63956,115.64823 296.69685,77.915899 314.39075,68.932902 L 346.77721,45.674327 C 351.55594,42.576634 354.90608,41.324327 357.92378,41.402939 z M 290.92738,261.61333 C 313.87149,267.56365 339.40299,275.37038 359.88393,275.50997 L 360.76161,284.72563 C 343.2235,282.91785 306.11346,274.45012 297.36372,269.98057 L 290.92738,261.61333 z " + id="path4006" /> + + + + + + This tutorial covers copy/paste, node editing, freehand and bezier drawing, path manipulation, booleans, offsets, simplification, and text tool. + - - - - - This tutorial covers copy/paste, node editing, freehand and bezier drawing, path manipulation, booleans, offsets, simplification, and text tool. + Inkscape + Inkscape + + + + + Python + Python + diff --git a/packaging/macosx/dmg_set_style.scpt b/packaging/macosx/dmg_set_style.scpt index e25279d99..dd2572ae0 100755 Binary files a/packaging/macosx/dmg_set_style.scpt and b/packaging/macosx/dmg_set_style.scpt differ diff --git a/packaging/macosx/inkscape.ds_store b/packaging/macosx/inkscape.ds_store index 394b40ec6..2b53ff56d 100644 Binary files a/packaging/macosx/inkscape.ds_store and b/packaging/macosx/inkscape.ds_store differ diff --git a/packaging/macosx/inkscape_python.ds_store b/packaging/macosx/inkscape_python.ds_store new file mode 100644 index 000000000..005a13587 Binary files /dev/null and b/packaging/macosx/inkscape_python.ds_store differ diff --git a/packaging/macosx/osx-app.sh b/packaging/macosx/osx-app.sh index e8e597c75..cdd4359cc 100755 --- a/packaging/macosx/osx-app.sh +++ b/packaging/macosx/osx-app.sh @@ -1,19 +1,27 @@ #! /bin/bash -# Copyright 2005, Kees Cook -# Licensed under GNU General Public License # # Usage: osx-app [-s] /path/to/bin/inkscape Info.plist # -# This attempts to build an Inkscape.app package for OSX, resolving -# Dynamic libraries, etc. Strips the executable and libraries if +# This script attempts to build an Inkscape.app package for OS X, resolving +# dynamic libraries, etc. It strips the executable and libraries if # '-s' is given. # +# +# Authors: +# Kees Cook +# Michael Wybrow +# Jean-Olivier Irisson +# +# Copyright (C) 2005 Kees Cook +# Copyright (C) 2005-2007 Michael Wybrow +# Copyright (C) 2007 Jean-Olivier Irisson +# +# +# Released under GNU GPL, read the file 'COPYING' for more information +# # Thanks to GNUnet's "build_app" script for help with library dep resolution. # https://gnunet.org/svn/GNUnet/contrib/OSX/build_app # -# Fixes and modifications to use Gimp.app style launcher: -# Michael Wybrow -# # # Notes: # The Info.plist file can be found in the base inkscape directory once @@ -24,8 +32,8 @@ # files inside the app bundle. # # Thus, the usual use of this file would be to run it from the within the -# inkscape/packaging directory, substituting in the inkscape binary path: -# ./osx-app.sh /path/to/bin/inkscape ../Info.plist +# inkscape/packaging/macosx directory, substituting in the inkscape binary path: +# ./osx-app.sh /path/to/bin/inkscape ../../Info.plist @@ -39,7 +47,10 @@ if [ "$VERSION" -ge "4" ]; then # libXinerama.1.dylib is not installed as part of X11 on Panther but # is introduced as a dependency if Inkscape is compiled on Tiger or # later. Thus, add the library to the bundle for Panther users - EXTRALIBS="/usr/X11R6/lib/libXinerama.1.dylib" + # Building on Tiger gives app bundles incompatible with Panther anyway + # so we do not need to add this now + # EXTRALIBS="/usr/X11R6/lib/libXinerama.1.dylib" + EXTRALIBS="" else # Panther (10.3) or earlier. XCODEFLAGS="-buildstyle Deployment" @@ -47,11 +58,12 @@ else EXTRALIBS="" fi - -SW="$HOME/ws-fat" - -pangover=1.5.0 -gtkver=2.10.0 +# set LIBPREFIX only if it has not been set before +# (by osx-build.sh for example) +if [ -z $LIBPREFIX ] +then + export LIBPREFIX="$HOME/ws-fat" +fi # Package always has the same name. Version information is stored in @@ -81,6 +93,7 @@ if [ ! -f "$plist" ]; then fi shift +# Set the 'macosx' directory, usually the current directory. resdir=`pwd` # Fix a given executable or library to be relocatable @@ -146,9 +159,9 @@ echo "APPLInks" > $package/Contents/PkgInfo # Pull in extra requirements. pkgetc="$package/Contents/Resources/etc" mkdir -p $pkgetc/pango -cp $SW/etc/pango/pangox.aliases $pkgetc/pango/ +cp $LIBPREFIX/etc/pango/pangox.aliases $pkgetc/pango/ # Need to adjust path and quote incase of spaces in path. -sed -e "s,$SW,\"\${CWD},g" -e 's,\.so ,.so" ,g' $SW/etc/pango/pango.modules > $pkgetc/pango/pango.modules +sed -e "s,$LIBPREFIX,\"\${CWD},g" -e 's,\.so ,.so" ,g' $LIBPREFIX/etc/pango/pango.modules > $pkgetc/pango/pango.modules cat > $pkgetc/pango/pangorc < $pkgetc/gtk-2.0/gdk-pixbuf.loaders -sed -e "s,$SW,\${CWD},g" $SW/etc/gtk-2.0/gtk.immodules > $pkgetc/gtk-2.0/gtk.immodules +sed -e "s,$LIBPREFIX,\${CWD},g" $LIBPREFIX/etc/gtk-2.0/gdk-pixbuf.loaders > $pkgetc/gtk-2.0/gdk-pixbuf.loaders +sed -e "s,$LIBPREFIX,\${CWD},g" $LIBPREFIX/etc/gtk-2.0/gtk.immodules > $pkgetc/gtk-2.0/gtk.immodules for item in gnome-vfs-mime-magic gnome-vfs-2.0 do - cp -r $SW/etc/$item $pkgetc/ + cp -r $LIBPREFIX/etc/$item $pkgetc/ done pkglib="$package/Contents/Resources/lib" +pangover=`ls $LIBPREFIX/lib/pango/` mkdir -p $pkglib/pango/$pangover/modules -cp $SW/lib/pango/$pangover/modules/*.so $pkglib/pango/$pangover/modules/ - +cp $LIBPREFIX/lib/pango/$pangover/modules/*.so $pkglib/pango/$pangover/modules/ +gtkver=`ls $LIBPREFIX/lib/gtk-2.0/ | grep "2\."` mkdir -p $pkglib/gtk-2.0/$gtkver/{engines,immodules,loaders} -cp -r $SW/lib/gtk-2.0/$gtkver/engines/* $pkglib/gtk-2.0/$gtkver/engines/ -cp $SW/lib/gtk-2.0/$gtkver/immodules/*.so $pkglib/gtk-2.0/$gtkver/immodules/ -cp $SW/lib/gtk-2.0/$gtkver/loaders/*.so $pkglib/gtk-2.0/$gtkver/loaders/ +cp -r $LIBPREFIX/lib/gtk-2.0/$gtkver/engines/* $pkglib/gtk-2.0/$gtkver/engines/ +cp $LIBPREFIX/lib/gtk-2.0/$gtkver/immodules/*.so $pkglib/gtk-2.0/$gtkver/immodules/ +cp $LIBPREFIX/lib/gtk-2.0/$gtkver/loaders/*.so $pkglib/gtk-2.0/$gtkver/loaders/ mkdir -p $pkglib/gnome-vfs-2.0/modules -cp $SW/lib/gnome-vfs-2.0/modules/*.so $pkglib/gnome-vfs-2.0/modules/ +cp $LIBPREFIX/lib/gnome-vfs-2.0/modules/*.so $pkglib/gnome-vfs-2.0/modules/ -# Find out libs we need from fink (e.g. $SW) - loop until no changes +# Find out libs we need from fink, darwinports, or from a custom install +# (e.g. $LIBPREFIX), then loop until no changes. a=1 nfiles=0 endl=true while $endl; do echo "Looking for dependencies. Round " $a - libs="`otool -L $pkglib/gtk-2.0/$gtkver/loaders/* $pkglib/gtk-2.0/$gtkver/immodules/* $pkglib/gtk-2.0/$gtkver/engines/*.so $pkglib/pango/$pangover/modules/* $pkglib/gnome-vfs-2.0/modules/* $package/Contents/Resources/lib/* $binary 2>/dev/null | fgrep compatibility | cut -d\( -f1 | grep $SW | sort | uniq`" + libs="`otool -L $pkglib/gtk-2.0/$gtkver/loaders/* $pkglib/gtk-2.0/$gtkver/immodules/* $pkglib/gtk-2.0/$gtkver/engines/*.so $pkglib/pango/$pangover/modules/* $pkglib/gnome-vfs-2.0/modules/* $package/Contents/Resources/lib/* $binary 2>/dev/null | fgrep compatibility | cut -d\( -f1 | grep $LIBPREFIX | sort | uniq`" cp -f $libs $package/Contents/Resources/lib let "a+=1" nnfiles=`ls $package/Contents/Resources/lib | wc -l` @@ -230,7 +245,6 @@ fi # Get all the icons and the rest of the script framework rsync -av $resdir/Resources/* $package/Contents/Resources/ - # Make an image #/usr/bin/hdiutil create -srcfolder "$pkg.app" "$pkg.dmg" -./osx-dmg.sh +# ./osx-dmg.sh diff --git a/packaging/macosx/osx-build.sh b/packaging/macosx/osx-build.sh new file mode 100755 index 000000000..dcbb654db --- /dev/null +++ b/packaging/macosx/osx-build.sh @@ -0,0 +1,231 @@ +#!/bin/bash +# +# Inkscape compilation and packaging script for Mac OS X +# +# Please see +# http://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX +# for more complete information +# +# Author: +# Jean-Olivier Irisson +# with information from +# Kees Cook +# Michael Wybrow +# +# Copyright 2006 +# Licensed under GNU General Public License +# + +############################################################ + +# User modifiable parameters +#---------------------------------------------------------- +# Configure flags +CONFFLAGS="--disable-static --enable-shared --enable-osxapp" +# Libraries prefix +LIBPREFIX="/opt/local" + +############################################################ + +# Help message +#---------------------------------------------------------- +help() +{ + +echo -e " +Compilation script for Inkscape on Mac OS X. + +\033[1mUSAGE\033[0m + $0 [options] action[s] + +\033[1mACTIONS & OPTIONS\033[0m + \033[1mh,help\033[0m + display this help message + \033[1mu,up,update\033[0m + update an existing checkout from svn (run svn up) + \033[1ma,auto,autogen\033[0m + prepare configure script (run autogen.sh). This is only necessary + for a fresh svn checkout or after make distclean. + \033[1mc,conf,configure\033[0m + configure the build (run configure). Edit your configuration + options in $0 + \033[1m-p,--prefix\033[0m specify install prefix (configure step only) + \033[1mb,build\033[0m + build Inkscape (run make) + \033[1mi,install\033[0m + install the build products locally, inside the source + directory (run make install) + \033[1mp,pack,package\033[0m + package Inkscape in a double clickable .app bundle and + store it in a .dmg image for distribution + \033[1m-s,--strip\033[0m remove debugging information in Inkscape package + \033[1m-py,--with-python\033[0m specify python packages path for inclusion into the dmg image + +\033[1mEXAMPLES\033[0m + \033[1m$0 conf build install\033[0m + configure, build and install a dowloaded version of Inkscape in the default + directory, keeping debugging information. + \033[1m$0 -p ~ -s -py ~/pyxml/ u a c b i p\033[0m + update an svn checkout, prepare configure script, configure, + build and install Inkscape in the user home directory. + Then package Inkscape withouth debugging information, + with python packages from ~/pyxml/ and prepare it for + distribution." +} + +# Parameters +#---------------------------------------------------------- +# Paths +HERE=`pwd` +SRCROOT=$HERE/../.. # we are currently in packaging/macosx + +# Defaults +INSTALLPREFIX=$SRCROOT/Build/ +SVNUPDATE="f" +AUTOGEN="f" +CONFIGURE="f" +BUILD="f" +INSTALL="f" +PACKAGE="f" + +STRIP="f" +PYTHON="f" + +# Parse command line options +#---------------------------------------------------------- +while [ "$1" != "" ] +do + case $1 in + h|help) + help + exit 1 ;; + u|up|update) + SVNUPDATE="t" ;; + a|auto|autogen) + AUTOGEN="t" ;; + c|conf|configure) + CONFIGURE="t" ;; + b|build) + BUILD="t" ;; + i|install) + INSTALL="t" ;; + p|pack|package) + PACKAGE="t" ;; + # -p|--prefix) + # INSTALLPREFIX=$2 + # shift 1 ;; + -s|-strip) + STRIP="t" ;; + -py|--with-python) + PYTHON="t" + PYTHONDIR=$2 + shift 1 ;; + esac + shift 1 +done + + +# Set environment variables +# ---------------------------------------------------------- +export LIBPREFIX + +# Specific environment variables +# automake seach path +export CPATH="$LIBPREFIX/include" +# configure search path +export CPPFLAGS="-I$LIBPREFIX/include" +export LDFLAGS="-L$LIBPREFIX/lib" +# compiler arguments +export CFLAGS="-O3 -Wall" +export CXXFLAGS="$CFLAGS" +# add X11 executables and libraries [does not seem to be required now] +# export PATH="/usr/X11R6/bin:$PATH" +# export LIBRARY_PATH="/usr/X11R6/lib:$LIBPREFIX/lib" +# pkgconfig path [does not seem to be required either] +# export PKG_CONFIG_PATH="$LIBPREFIX/lib/pkgconfig" + + +# Actions +# ---------------------------------------------------------- +if [[ "$SVNUPDATE" == "t" ]] +then + cd $SRCROOT + svn up + cd $HERE +fi + +if [[ "$AUTOGEN" == "t" ]] +then + cd $SRCROOT + ./autogen.sh + cd $HERE +fi + +if [[ "$CONFIGURE" == "t" ]] +then + ALLCONFFLAGS=`echo "$CONFFLAGS --prefix=$INSTALLPREFIX"` + cd $SRCROOT + ./configure $ALLCONFFLAGS + cd $HERE +fi + +if [[ "$BUILD" == "t" ]] +then + cd $SRCROOT + make + cd $HERE +fi + +if [[ "$INSTALL" == "t" ]] +then + cd $SRCROOT + make install + cd $HERE +fi + +if [[ "$PACKAGE" == "t" ]]; then + if [[ "$STRIP" == "t" ]]; then + STRIPPARAM="-s" + else + STRIPPARAM="" + fi + ./osx-app.sh $STRIPPARAM $INSTALLPREFIX/bin/inkscape $SRCROOT/Info.plist + + if [[ "PYTHON" == "t" ]]; then + ./osx-dmg.sh -py "$PYTHONDIR" + else + ./osx-dmg.sh + fi + + DATE=`date "+%Y%m%d"` + mv Inkscape.dmg Inkscape_$DATE.dmg + + # Prepare information file + INFOFILE=Inkscape_$DATE-info.txt + echo "Version information on $DATE for `whoami`: + OS X `/usr/bin/sw_vers | grep ProductVersion | cut -f2 -d \:` + DarwinPorts `port version | cut -f2 -d \ ` + GCC `gcc --version | grep GCC` + GTK `pkg-config --modversion gtk+-2.0` + GTKmm `pkg-config --modversion gtkmm-2.4` + Cairo `pkg-config --modversion cairo` + Cairomm `pkg-config --modversion cairomm-1.0` + CairoPDF `pkg-config --modversion cairo-pdf` + Pango `pkg-config --modversion pango` +Configure options: + $CONFFLAGS" > $INFOFILE + + if [[ "$STRIP" == "t" ]]; then + echo "Debug info + no" >> $INFOFILE + else + echo "Debug info + yes" >> $INFOFILE + fi + + # open a Finder window here + open . +fi + +exit 0 + diff --git a/packaging/macosx/osx-dmg.sh b/packaging/macosx/osx-dmg.sh index b89a0fc91..d1645344d 100755 --- a/packaging/macosx/osx-dmg.sh +++ b/packaging/macosx/osx-dmg.sh @@ -3,8 +3,9 @@ # Inkscape packaging script for Mac OS X # # The script creates a read-write disk image, -# copies Inkscape in it, customizes its appearance using a -# previously created .DS_Store file (inkscape.ds_store), +# copies Inkscape in it, copies additional python packages +# if needed, customizes its appearance using a +# previously created .DS_Store file (inkscape*.ds_store), # and then compresses the disk image for distribution. # # Authors: @@ -25,16 +26,35 @@ # # Run this script with the '-s' option. It will apply the # 'dmg_set_style.scpt' AppleScript file, and then prompt the -# user to check the window size # and position before writing +# user to check the window size and position before writing # a new 'inkscape.ds_store' file to work around a bug in Finder # and AppleScript. The updated 'inkscape.ds_store' will need # to be commited to the repository when this is done. # +# Defaults set_ds_store=false -if [ "$1" = "-s" ]; then - set_ds_store=true - shift +add_python=false +ds_store_file="inkscape.ds_store" + +# Parse command line arguments +while [ "$1" != "" ] +do + case $1 in + -s) + set_ds_store=true ;; + -py|--with-python) + add_python=true + python_dir=$2 + ds_store_file="inkscape_python.ds_store" + shift 1 ;; + esac + shift 1 +done +# some checks +if [ ! -e $python_dir ]; then + echo "Cannot find your python packages directory" + exit 1 fi RWNAME="RWinkscape.dmg" @@ -48,11 +68,18 @@ mkdir "$TMPDIR" echo "Copying files to temp directory..." # Copy Inkscape.app folder. -cp -rf ../Inkscape.app "$TMPDIR"/ +cp -rf Inkscape.app "$TMPDIR"/ # link to Applications in order to drag and drop inkscape onto it. ln -sf /Applications "$TMPDIR"/ +if [ ${add_python} = "true" ]; then + # Copy python libraries + cp -rf $python_dir/* "$TMPDIR"/ + # link python environment in order to drag and drop inkscape onto it + ln -sf /Library/Python/2.3/site-packages "$TMPDIR"/Python\ site-packages +fi + # Copy a background image inside a hidden directory so the image # file itself won't be shown. mkdir "$TMPDIR/.background" @@ -62,9 +89,9 @@ AUTOOPENOPT= if [ ${set_ds_store} = "false" ]; then # Copy the .DS_Store file which contains information about # window size, appearance, etc. Most of this can be set - # with Apple script but involves # user intervention so we + # with Apple script but involves user intervention so we # just keep a copy of the correct settings and use that instead. - cp inkscape.ds_store "$TMPDIR/.DS_Store" + cp $ds_store_file "$TMPDIR/.DS_Store" AUTOOPENOPT=-noautoopen fi @@ -105,8 +132,9 @@ if [ ${set_ds_store} = "true" ]; then AUTOOPENOPT=-noautoopen DEV_NAME=`/usr/bin/hdiutil attach -readwrite -noverify $AUTOOPENOPT "$RWNAME" | egrep '^/dev/' | sed 1q | awk '{print $1}'` echo - echo "New inkscape.ds_store file written." - cp /Volumes/$VOLNAME/.DS_Store ./inkscape.ds_store + echo "New $ds_store_file file written." + cp /Volumes/$VOLNAME/.DS_Store ./$ds_store_file + SetFile -a v ./$ds_store_file # Unmount the disk image. hdiutil detach "$DEV_NAME" @@ -119,7 +147,6 @@ fi hdiutil detach "$DEV_NAME" # Create the offical release image by compressing the RW one. -DATE=`date "+%Y%m%d"` -/usr/bin/hdiutil convert "$RWNAME" -format UDZO -imagekey zlib-level=9 -o "../Inkscape_$DATE.dmg" +/usr/bin/hdiutil convert "$RWNAME" -format UDZO -imagekey zlib-level=9 -o "Inkscape.dmg" rm -f "$RWNAME"