<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.inkscape.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Andreb</id>
	<title>Inkscape Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.inkscape.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Andreb"/>
	<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/Special:Contributions/Andreb"/>
	<updated>2026-05-10T02:11:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39824</id>
		<title>CompilingMacOsX</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39824"/>
		<updated>2008-12-02T03:18:23Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Pre-compiling the Python modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= For the impatient =&lt;br /&gt;
&lt;br /&gt;
1. Install [http://developer.apple.com/tools/xcode/ XCode tools] from your OS X installation DVD&lt;br /&gt;
&lt;br /&gt;
2. Download and install [http://www.macports.org/ MacPorts]&lt;br /&gt;
&lt;br /&gt;
3. In Terminal (Applications&amp;gt;Utilities&amp;gt;Terminal) type&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install cairo +pdf boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt poppler boost \ &lt;br /&gt;
 gnome-vfs libgnomeprintui automake autoconf subversion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: subversion is pre-installed on Leopard, so you may be fine leaving subversion out of the port install command chain.&lt;br /&gt;
&lt;br /&gt;
Grab a cup of coffee&lt;br /&gt;
&lt;br /&gt;
4. In Terminal, get and build Inkscape&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape&lt;br /&gt;
cd inkscape/packaging/macosx/&lt;br /&gt;
./osx-build.sh a c b i -s p&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voilà''. If you want to understand what you just did, read on.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
To compile Inkscape from source you need:&lt;br /&gt;
*Mac OS X &amp;gt; 10.3&lt;br /&gt;
*XCode Tools. They are on your installation DVD, in the optional installs, or can be download from [http://developer.apple.com/tools/xcode/ Apple Developer Connection]. You can customize the install to make it smaller (avoir documentation and example software for example). You need at least: gcc, XCode, X11SDK.&lt;br /&gt;
*Inkscape's source code. You can download an [http://www.inkscape.org/download.php official release source code], a [http://inkscape.modevia.com/svn-snap/?M=D development snapshot] or checkout a copy of the current state of the [http://www.inkscape.org/svn.php?lang=en SVN repository] using [http://subversion.tigris.org/ subversion]. Subversion comes pre-installed on Leopard. On previous system, subversion can be installed by package management systems (see point below) or with an OS X installer [http://homepage.mac.com/martinott/ package]&lt;br /&gt;
*A means of getting Inkscape's numerous dependencies: glibmm, gtkmm, lmcs, boehmgc... We recommend the use of [http://www.macports.org/ MacPorts] right now. ([http://www.finkproject.org/ Fink] was used in the past but it no longer meets Inkscape's needs currently.)&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with X11, using MacPorts [Recommended method]=&lt;br /&gt;
&lt;br /&gt;
== Installing dependencies ==&lt;br /&gt;
You can use MacPorts to list Inkscape dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;port deps inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some are mandatory and you can install them with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt boost gsl&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Others provide additional functionality to Inkscape:&lt;br /&gt;
* &amp;lt;code&amp;gt;gnome-vfs&amp;lt;/code&amp;gt; : access to remote servers, in particular import from Open Clipart Library&lt;br /&gt;
* &amp;lt;code&amp;gt;aspell&amp;lt;/code&amp;gt; : check spelling of text elements [Note: I have never seen it working on OS X, though at least it should install fine]&lt;br /&gt;
* &amp;lt;code&amp;gt;libgnomeprintui&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;loudmouth&amp;lt;/code&amp;gt; : jabber library used by InkBoard&lt;br /&gt;
* &amp;lt;code&amp;gt;cairo +pdf&amp;lt;/code&amp;gt; (cairo with the pdf variant) : better pdf export&lt;br /&gt;
* &amp;lt;code&amp;gt;poppler&amp;lt;/code&amp;gt; : better pdf import&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install gnome-vfs aspell libgnomeprintui loudmouth cairo +pdf poppler&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: Cairo was already installed at previous step as a GTK dependency. You need to either deactivate the old version and install this one, or directly write it on the command line above. &lt;br /&gt;
If you're unsure about MacPorts commands, you can find a guide that is easy to skim here: [http://guide.macports.org/ MacPorts Guide]&lt;br /&gt;
&lt;br /&gt;
In addition, Inkscape requires versions of the autotools more recent thant those that ship with OS X. Install them:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install autoconf automake&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More recent (Sep 2008) pre-packaged nightly builds for Mac OS X also feature additional dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install librsvg libwpd libwpg libcroco&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: At the time of editing (2008-12-01) there was a problem fetching &amp;quot;lzmautils&amp;quot; as the URL MacPorts tried to use as download source dies in a timeout. &lt;br /&gt;
As this package is needed as a dependency for one or more packages noted above you need to download the source tarball of lzmautils from somewhere else (for example, from [ftp://sunfreeware.mirrors.tds.net/pub/sunfreeware/SOURCES/lzma-4.32.7.tar.gz here]) and put that into the local MacPorts repository at &amp;quot;/opt/local/var/macports/distfiles/lzmautils&amp;quot;. You should now be able to run the commands above.&lt;br /&gt;
&lt;br /&gt;
Also make sure that you have &amp;quot;libxml2&amp;quot; and &amp;quot;libxslt&amp;quot; installed with MacPorts. This should have been installed previously, either directly or as a dependency.&lt;br /&gt;
You will need those later to compile the &amp;quot;lxml&amp;quot; Python module if you want to use Python effects. First check what's installed and if they are missing from your MacPorts repository install them by doing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;port installed&lt;br /&gt;
sudo port install libxml2 libxslt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pre-compiling the Python modules  ==&lt;br /&gt;
&lt;br /&gt;
If you cannot use the pre-built Python modules from [http://inkscape.modevia.com/macosx-snap/?C=M;O=D Modevia], say, because you're using an unsupported Python version or you just want to install from source you need to pre-compile both modules.&lt;br /&gt;
&lt;br /&gt;
In case you are using a Python version installed through MacPorts do a search for both modules and install the ones suitable for the Python version activated within MacPorts.&lt;br /&gt;
&amp;lt;pre&amp;gt;port search lxml numpy&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using Leopard's default Python 2.5.1 installation or a more recent one (e.g. MacPython 2.6) you will need to compile both modules outside of MacPorts. Download both modules from [http://pypi.python.org PyPI] if they are available there for your Python version. At the time of editing (2008-12-01) both modules were only available through SVN for Python 2.6.&lt;br /&gt;
&lt;br /&gt;
There are lots of tutorials for building and installing the &amp;quot;numpy&amp;quot; module. One good place to start looking is the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] entry referenced at the end of this guide. &lt;br /&gt;
&lt;br /&gt;
Building the &amp;quot;lxml&amp;quot; module deviates a little from the standard way, so if you cannot install it try the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/lxml/source&lt;br /&gt;
sudo python setup.py install \&lt;br /&gt;
--with-xslt-config=/opt/local/bin/xslt-config \&lt;br /&gt;
--with-xml2-config=/opt/local/bin/xml2-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells it to use the libxml2 and libxslt packages we installed earlier with MacPorts instead of Mac OS X' default versions, which have been known to cause problems when trying to build &amp;quot;lxml&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you are compiling the Python modules outside of MacPorts you will need to make a mental note for after running the .app-bundle building script (detailed [[CompilingMacOsX#Creating_an_.app_bundle|later]] in this guide) to copy the &amp;quot;lxml&amp;quot; and &amp;quot;numpy&amp;quot; dirs from the standard installation destination (by default &amp;quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages&amp;quot; for MacPython 2.6 and &amp;quot;/Library/Python/2.5/site-packages/&amp;quot; for Leopard's default Python 2.5.1 installation) to either&lt;br /&gt;
* the &amp;quot;extensions&amp;quot; folder inside the Inkscape.app bundle (&amp;quot;Inkscape.app/Contents/Resources/extensions&amp;quot;) if all you care about is getting the Inkscape build to work with your Python version. This method is more foolproof but supports only one Python version.&lt;br /&gt;
* the &amp;quot;site-packages&amp;quot; folder inside the Inkspace.app bundle. The &amp;quot;site-packages&amp;quot; folder is the right place for putting your pre-compiled Python modules if you want to redistribute your build. Make a subfolder within &amp;quot;site-packages&amp;quot; with the name of your arch (&amp;quot;i386&amp;quot; for Intel, &amp;quot;PPC&amp;quot; for PowerPC or type &amp;lt;code&amp;gt;arch&amp;lt;/code&amp;gt; into a Terminal window) and another subfolder within the arch folder with the name of your Python version (e.g. &amp;quot;2.5&amp;quot; or &amp;quot;2.6&amp;quot; etc.). This allows you to include support for multiple Python versions with your Inkscape build. Note, however, that if someone has multiple Python versions installed they may run into problems with the PATH order exported by the internal script (&amp;quot;Inkspace.app/Contents/Resources/bin/inkscape&amp;quot;) responsible for preparing the Inkscape launch environment. &lt;br /&gt;
&lt;br /&gt;
Armed with this knowledge you should be able to take care of the &amp;quot;...needs the fantastic libxml2 wrapper...&amp;quot; message when executing Python effects. Normally the &amp;lt;code&amp;gt;osx-app.sh&amp;lt;/code&amp;gt; script (detailed [[CompilingMacOsX#Creating_an_.app_bundle|later]])  should take care of this for you, but if for whatever reason it didn't you know how to copy the modules manually.&lt;br /&gt;
&lt;br /&gt;
For further info refer to the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] section of this wiki.&lt;br /&gt;
&lt;br /&gt;
== Setting the build environment ==&lt;br /&gt;
MacPorts's hierarchy (/opt/local/) is not searched for libraries by default. Therefore, before the configuration starts, some environment variables need to be set. The environment variables are presented in bash syntax here. &lt;br /&gt;
&amp;lt;pre&amp;gt;export LIBPREFIX=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$LIBPREFIX/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$LIBPREFIX/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$LIBPREFIX/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;lt;code&amp;gt;[http://en.wikipedia.org/wiki/Ccache ccache]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;sudo port install ccache&amp;lt;/code&amp;gt;) to speed up the compilation a bit. To do so, add compiler variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
If you compile Inkscape for the first time from an svn checkout you need to generate the configure script. Navigate to Inkscape's source directory and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;./autogen.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run configure with the options &amp;lt;code&amp;gt;--disable-static --enable-shared&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; which sets the directory where the build products are placed. It must be somewhere you have write access to.&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I you want to package Inkscape into a double-clickable &amp;lt;code&amp;gt;.app&amp;lt;/code&amp;gt; bundle in order to access it like a regular OS X application (you probably want to), you need to add the option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure {...} --enable-osxapp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have loudmouth installed and you want to enable whiteboard functionality in Inkscape, add &amp;lt;code&amp;gt;--enable-inkboard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other configuration options can be set, check the list of options by issuing:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's an example which covers most options that can be set:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/ --with-xft \&lt;br /&gt;
--with-gnome-vfs --with-python=/path/to/python/modules --enable-osxapp --enable-lcms \&lt;br /&gt;
--enable-poppler-cairo --enable-inkboard&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building and Installing ==&lt;br /&gt;
Just run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .app bundle ==&lt;br /&gt;
Assuming that you have used the &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; option during &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;, navigate to Mac OS X packaging directory in Inkscape source code and use the automated script:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&lt;br /&gt;
./osx-app.sh -s -b /path/to/install/prefix/bin/inkscape -p ../../Info.plist&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script copies Inkscape binary and all its dependencies into the app bundle. The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; options strips libraries from debugging information (the bundle is therefore smaller). Omit this option if you want to keep debugging info.&lt;br /&gt;
&lt;br /&gt;
== Creating a disk image to distribute Inkscape ==&lt;br /&gt;
Inkscape.app created at the previous step is completely independent from the original location of MacPorts libraries and can therefore be distributed. It will only work on your platform though (PPC or Intel) and incompatibilities are known between X11 versions on different major versions of OS X (Panther, Tiger and Leopard). The general rule is that versions are not backward compatible.&lt;br /&gt;
&lt;br /&gt;
The most widespread way of distributing applications on Mac OS X is via .dmg images. You can created a dmg image of Inkscape, with a nice background and all, using the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-dmg.sh -p Inkscape.app&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the packaging directory for Mac OS X (where your app bundle should be, otherwise modify the path to Inkscape.app).&lt;br /&gt;
&lt;br /&gt;
== Automated build script ==&lt;br /&gt;
All essential steps are automated by a build script: &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt;. It has built-in help so to know how to use it just type:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: Excluded steps involve Pre-compiliation of the Python modules and installing the additional nightly build features.&lt;br /&gt;
&lt;br /&gt;
= Compiling a Universal Binary of Inkscape with X11, using MacPorts=&lt;br /&gt;
&lt;br /&gt;
These instructions should work on both 10.4 and 10.5 machines with the latest Xcode version installed.&lt;br /&gt;
&lt;br /&gt;
== Update Macport sources ==&lt;br /&gt;
&lt;br /&gt;
The port descriptions in Macports do not currently all compile properly with their Universal variants.   For this reason, we currently use a modified set of some of the portfiles that will compile a universal libraries.  Work is being done to integrate these changes into Macports itself.&lt;br /&gt;
&lt;br /&gt;
You can use our modified portfiles by adding our ports to your sources:&lt;br /&gt;
&lt;br /&gt;
1. Checkout our ports directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/experimental/trunk/mjwybrow/ports ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit your sources list to include this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo vim /opt/local/etc/macports/sources.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
And add the following line *before* the existing rsync source:&lt;br /&gt;
&amp;lt;pre&amp;gt;file:///Users/YOURUSERNAME/directory/to/ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the portindex command in the checked-out port directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;portindex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run port sync&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal dependencies ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile Inkscape's essential dependencies as Universal libraries on either 10.4 or 10.5,  by giving the &amp;quot;+universal&amp;quot; option for each, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -v install poppler +universal gtk2 +universal ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have non-universal versions of these ports installed you may need to deactivate the port and rebuild it, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -f uninstall cairo&lt;br /&gt;
sudo port clean cairo&lt;br /&gt;
sudo port -v install cairo +universal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal Inkscape ==&lt;br /&gt;
&lt;br /&gt;
First, Set your SDK, 10.5 for Leopard, 10.4u for TIger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.5.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; (For Leopard)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.4u.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp;  (For Tiger)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, set up your environment to point to the Macports libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;export MACPORTS=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
export PATH=$MACPORTS/bin:$MACPORTS/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$MACPORTS/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$MACPORTS/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$MACPORTS/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall -isysroot $SDK -arch ppc -arch i386&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to configure and compile Inkscape.  Inkscape must be configured with the following options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;   Sets the correct path for Inkscape to be used from an .app bundle&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;--disable-dependency-tracking&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; Dependency tracking can't be user when compiling universal binaries.&lt;br /&gt;
&lt;br /&gt;
Inkscape can then be built (with make), installed, and packaged into a Universal .app bundle using the standard .app bundle building instruction above.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using MacPorts [experimental] =&lt;br /&gt;
This process is very similar to compiling an X11 version of Inkscape except for the building of dependencies: need to build native versions of Inkscape dependencies. At the moment (2007-12-17) this process does not produce a usable version of Inkscape but the more people try to use it, the quicker the bugs will be ironed out!&lt;br /&gt;
&lt;br /&gt;
== Native version of Inkscape dependencies ==&lt;br /&gt;
Thanks to the power of port &amp;quot;variants&amp;quot; and port &amp;quot;deactivation&amp;quot; you can install native versions of gtk, cairo, pango and such, alongside the regular X11 ones. To know which ports have a &amp;lt;code&amp;gt;quartz&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_x11&amp;lt;/code&amp;gt; variant, use the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;port list variant:quartz variant:no_x11&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you an idea of what need to be replaced.&lt;br /&gt;
&lt;br /&gt;
Assuming your MacPorts tree has been already used to build regular versions of Inkscape, you first need to deactivate (suppress from the tree without really uninstalling) the X11 versions of gtk, cairo, cairomm and pango:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port deactivate gtk2 cairo cairomm pango&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install native variants:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install cairo +quartz+pdf+no_x11 cairomm +quartz pango +no_x11 poppler +quartz gtk2 +quartz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than deactivating and reactivating ports, you can also keep two MacPorts trees side by side, provided you install the second one from source. Let say I want to install a new tree for native versions in /opt/local/native, I would do&lt;br /&gt;
&amp;lt;pre&amp;gt;export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin&lt;br /&gt;
cd ~/MacPorts-1.x.x/&lt;br /&gt;
./configure --prefix=/opt/local-native --with-tclpackage=/Library/Tcl/macports-native&lt;br /&gt;
make&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you need to have only one version of the port command in the path at any time so you need to setup your .bashrc (or .bash_profile or .profile) accordingly. I use shell aliases to quickly and temporarily switch to the universal version:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias portpathregular=&amp;quot;export PATH=/opt/local/bin:/opt/local/sbin:/Developer/Tools:/usr/local/bin: \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
alias portpathuniv=&amp;quot;export PATH=/opt/local-univ/bin:/opt/local-univ/sbin:/Developer/Tools:/usr/local/bin:  \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: the \ are just to mark line continuation here, suppress them and put everything in one line.&lt;br /&gt;
&lt;br /&gt;
== Install the rest ==&lt;br /&gt;
Eventually, follow the regular install procedure for the rest:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install libxslt boost boehmgc gtkmm lcms intltool popt&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your MacPorts tree was already ready to compile Inkscape, you should not need to reinstall anything, with the possible exception of gtkmm, which may need to be rebuilt against the native version of gtk rather than against the X11 one (please someone confirm this).&lt;br /&gt;
&lt;br /&gt;
Get inkscape source code and go in the mac OS X specific packaging directory&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&amp;lt;/pre&amp;gt;&lt;br /&gt;
There edit &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt; to remove the configure option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; because it puts inkscape in a .app bundle where it is started together with X11, which would defeat the purpose of this native compilation. You can also specify an alternative install prefix if you want. Then&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh u a c b i&amp;lt;/pre&amp;gt;&lt;br /&gt;
and a native version of Inkscape is installed in the prefix you specified or in the &amp;lt;code&amp;gt;Build/bin&amp;lt;/code&amp;gt; directory of Inkscape's source code. You can test it by&lt;br /&gt;
&amp;lt;pre&amp;gt; cd ../../Build/bin/&lt;br /&gt;
./inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: if you compiled a GTK theme engine against your old GTK install (i.e. the one with X11) and try to use it with the new install, it will complain, so edit &amp;lt;code&amp;gt;~/.gtkrc-2.0&amp;lt;/code&amp;gt; to remove the offending theme or recompile it with the new native GTK.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using the all in one build script [experimental] =&lt;br /&gt;
&lt;br /&gt;
To build a native-GTK build of Inkscape, GTK and some of its dependencies must be built with special options. You can do this using the build-gtk.sh script from the Inkscape repository (it's in packaging/macosx/native-gtk/).  This is a modified version of the Imendio native build script, found with instructions on this page:&lt;br /&gt;
http://developer.imendio.com/projects/gtk-macosx/build-instructions&lt;br /&gt;
&lt;br /&gt;
This process is relatively untested. If you have any troubles using this process then please report them to Michael Wybrow (mjwybrow on sourceforge).&lt;br /&gt;
&lt;br /&gt;
The process is:&lt;br /&gt;
&amp;lt;pre&amp;gt;export PREFIX=/your/install/prefix&lt;br /&gt;
./build-gtk bootstrap&lt;br /&gt;
./build-gtk build inkscape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enabling python effects =&lt;br /&gt;
moved to [[GettingEffectsWorking]]. They should work out of the box in the new versions anyway.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
== User Examples ==&lt;br /&gt;
* Adam Strzeleki has outlined some improvements to this process on the Inkscape [http://www.nabble.com/Inkscape-native-Mac-OS-X-build---look-improvements-td14733036.html email list]. See his screenshot from January 10, 2008 [http://www.nabble.com/attachment/14733036/1/Inkscape%20OSX%20PL.gif here].&lt;br /&gt;
* JiHO has a video of his builds [http://jo.irisson.free.fr/?p=34 here] and [http://jo.irisson.free.fr/?p=62 here].&lt;br /&gt;
&lt;br /&gt;
== Apple Documentation ==&lt;br /&gt;
* [http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html Introduction to Runtime Configuration] Covers the Info.plist files, Preferences, Environment variables and has a list of the most important Properties that the Property List should contain.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.sveinbjorn.org/platypus Sveinbjorn Thordarson's Website] The author of Platypus, the Script Exec wrapper that launches the Inkscape binary.&lt;br /&gt;
* [http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html  Creating OS X application bundles step by step] Covers the bundle concepts, copying libraries into the bundle, editing libraries with the install_name_tool, the Info.plist file and adding an icon.&lt;br /&gt;
* [http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ Bringing your Java Application to Mac OS X] I would regard this a little dated, and the detail is (unsurprisingly) Java-related, but it is a gentle introduction to the role of the .app bundle and give a most clear account of how to create one.&lt;br /&gt;
* The [http://gimp-app.sourceforge.net/gimp.app.howto.txt Gimp .app Howto] This is a very bare document, and would be of little help to you if you were new to making packages. Note that it seems to refer to a more mature Clipboard technique and Online help than we currently have; and we ought to move to parity in these areas.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39814</id>
		<title>CompilingMacOsX</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39814"/>
		<updated>2008-12-02T03:17:41Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Pre-compiling the Python modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= For the impatient =&lt;br /&gt;
&lt;br /&gt;
1. Install [http://developer.apple.com/tools/xcode/ XCode tools] from your OS X installation DVD&lt;br /&gt;
&lt;br /&gt;
2. Download and install [http://www.macports.org/ MacPorts]&lt;br /&gt;
&lt;br /&gt;
3. In Terminal (Applications&amp;gt;Utilities&amp;gt;Terminal) type&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install cairo +pdf boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt poppler boost \ &lt;br /&gt;
 gnome-vfs libgnomeprintui automake autoconf subversion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: subversion is pre-installed on Leopard, so you may be fine leaving subversion out of the port install command chain.&lt;br /&gt;
&lt;br /&gt;
Grab a cup of coffee&lt;br /&gt;
&lt;br /&gt;
4. In Terminal, get and build Inkscape&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape&lt;br /&gt;
cd inkscape/packaging/macosx/&lt;br /&gt;
./osx-build.sh a c b i -s p&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voilà''. If you want to understand what you just did, read on.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
To compile Inkscape from source you need:&lt;br /&gt;
*Mac OS X &amp;gt; 10.3&lt;br /&gt;
*XCode Tools. They are on your installation DVD, in the optional installs, or can be download from [http://developer.apple.com/tools/xcode/ Apple Developer Connection]. You can customize the install to make it smaller (avoir documentation and example software for example). You need at least: gcc, XCode, X11SDK.&lt;br /&gt;
*Inkscape's source code. You can download an [http://www.inkscape.org/download.php official release source code], a [http://inkscape.modevia.com/svn-snap/?M=D development snapshot] or checkout a copy of the current state of the [http://www.inkscape.org/svn.php?lang=en SVN repository] using [http://subversion.tigris.org/ subversion]. Subversion comes pre-installed on Leopard. On previous system, subversion can be installed by package management systems (see point below) or with an OS X installer [http://homepage.mac.com/martinott/ package]&lt;br /&gt;
*A means of getting Inkscape's numerous dependencies: glibmm, gtkmm, lmcs, boehmgc... We recommend the use of [http://www.macports.org/ MacPorts] right now. ([http://www.finkproject.org/ Fink] was used in the past but it no longer meets Inkscape's needs currently.)&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with X11, using MacPorts [Recommended method]=&lt;br /&gt;
&lt;br /&gt;
== Installing dependencies ==&lt;br /&gt;
You can use MacPorts to list Inkscape dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;port deps inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some are mandatory and you can install them with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt boost gsl&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Others provide additional functionality to Inkscape:&lt;br /&gt;
* &amp;lt;code&amp;gt;gnome-vfs&amp;lt;/code&amp;gt; : access to remote servers, in particular import from Open Clipart Library&lt;br /&gt;
* &amp;lt;code&amp;gt;aspell&amp;lt;/code&amp;gt; : check spelling of text elements [Note: I have never seen it working on OS X, though at least it should install fine]&lt;br /&gt;
* &amp;lt;code&amp;gt;libgnomeprintui&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;loudmouth&amp;lt;/code&amp;gt; : jabber library used by InkBoard&lt;br /&gt;
* &amp;lt;code&amp;gt;cairo +pdf&amp;lt;/code&amp;gt; (cairo with the pdf variant) : better pdf export&lt;br /&gt;
* &amp;lt;code&amp;gt;poppler&amp;lt;/code&amp;gt; : better pdf import&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install gnome-vfs aspell libgnomeprintui loudmouth cairo +pdf poppler&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: Cairo was already installed at previous step as a GTK dependency. You need to either deactivate the old version and install this one, or directly write it on the command line above. &lt;br /&gt;
If you're unsure about MacPorts commands, you can find a guide that is easy to skim here: [http://guide.macports.org/ MacPorts Guide]&lt;br /&gt;
&lt;br /&gt;
In addition, Inkscape requires versions of the autotools more recent thant those that ship with OS X. Install them:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install autoconf automake&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More recent (Sep 2008) pre-packaged nightly builds for Mac OS X also feature additional dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install librsvg libwpd libwpg libcroco&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: At the time of editing (2008-12-01) there was a problem fetching &amp;quot;lzmautils&amp;quot; as the URL MacPorts tried to use as download source dies in a timeout. &lt;br /&gt;
As this package is needed as a dependency for one or more packages noted above you need to download the source tarball of lzmautils from somewhere else (for example, from [ftp://sunfreeware.mirrors.tds.net/pub/sunfreeware/SOURCES/lzma-4.32.7.tar.gz here]) and put that into the local MacPorts repository at &amp;quot;/opt/local/var/macports/distfiles/lzmautils&amp;quot;. You should now be able to run the commands above.&lt;br /&gt;
&lt;br /&gt;
Also make sure that you have &amp;quot;libxml2&amp;quot; and &amp;quot;libxslt&amp;quot; installed with MacPorts. This should have been installed previously, either directly or as a dependency.&lt;br /&gt;
You will need those later to compile the &amp;quot;lxml&amp;quot; Python module if you want to use Python effects. First check what's installed and if they are missing from your MacPorts repository install them by doing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;port installed&lt;br /&gt;
sudo port install libxml2 libxslt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pre-compiling the Python modules  ==&lt;br /&gt;
&lt;br /&gt;
If you cannot use the pre-built Python modules from [http://inkscape.modevia.com/macosx-snap/?C=M;O=D Modevia], say, because you're using an unsupported Python version or you just want to install from source you need to pre-compile both modules.&lt;br /&gt;
&lt;br /&gt;
In case you are using a Python version installed through MacPorts do a search for both modules and install the ones suitable for the Python version activated within MacPorts.&lt;br /&gt;
&amp;lt;pre&amp;gt;port search lxml numpy&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using Leopard's default Python 2.5.1 installation or a more recent one (e.g. MacPython 2.6) you will need to compile both modules outside of MacPorts. Download both modules from [http://pypi.python.org PyPI] if they are available there for your Python version. At the time of editing (2008-12-01) both modules were only available through SVN for Python 2.6.&lt;br /&gt;
&lt;br /&gt;
There are lots of tutorials for building and installing the &amp;quot;numpy&amp;quot; module. One good place to start looking is the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] entry referenced at the end of this guide. &lt;br /&gt;
&lt;br /&gt;
Building the &amp;quot;lxml&amp;quot; module deviates a little from the standard way, so if you cannot install it try the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/lxml/source&lt;br /&gt;
sudo python setup.py install --with-xslt-config=/opt/local/bin/xslt-config \ &lt;br /&gt;
--with-xml2-config=/opt/local/bin/xml2-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells it to use the libxml2 and libxslt packages we installed earlier with MacPorts instead of Mac OS X' default versions, which have been known to cause problems when trying to build &amp;quot;lxml&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you are compiling the Python modules outside of MacPorts you will need to make a mental note for after running the .app-bundle building script (detailed [[CompilingMacOsX#Creating_an_.app_bundle|later]] in this guide) to copy the &amp;quot;lxml&amp;quot; and &amp;quot;numpy&amp;quot; dirs from the standard installation destination (by default &amp;quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages&amp;quot; for MacPython 2.6 and &amp;quot;/Library/Python/2.5/site-packages/&amp;quot; for Leopard's default Python 2.5.1 installation) to either&lt;br /&gt;
* the &amp;quot;extensions&amp;quot; folder inside the Inkscape.app bundle (&amp;quot;Inkscape.app/Contents/Resources/extensions&amp;quot;) if all you care about is getting the Inkscape build to work with your Python version. This method is more foolproof but supports only one Python version.&lt;br /&gt;
* the &amp;quot;site-packages&amp;quot; folder inside the Inkspace.app bundle. The &amp;quot;site-packages&amp;quot; folder is the right place for putting your pre-compiled Python modules if you want to redistribute your build. Make a subfolder within &amp;quot;site-packages&amp;quot; with the name of your arch (&amp;quot;i386&amp;quot; for Intel, &amp;quot;PPC&amp;quot; for PowerPC or type &amp;lt;code&amp;gt;arch&amp;lt;/code&amp;gt; into a Terminal window) and another subfolder within the arch folder with the name of your Python version (e.g. &amp;quot;2.5&amp;quot; or &amp;quot;2.6&amp;quot; etc.). This allows you to include support for multiple Python versions with your Inkscape build. Note, however, that if someone has multiple Python versions installed they may run into problems with the PATH order exported by the internal script (&amp;quot;Inkspace.app/Contents/Resources/bin/inkscape&amp;quot;) responsible for preparing the Inkscape launch environment. &lt;br /&gt;
&lt;br /&gt;
Armed with this knowledge you should be able to take care of the &amp;quot;...needs the fantastic libxml2 wrapper...&amp;quot; message when executing Python effects. Normally the &amp;lt;code&amp;gt;osx-app.sh&amp;lt;/code&amp;gt; script (detailed [[CompilingMacOsX#Creating_an_.app_bundle|later]])  should take care of this for you, but if for whatever reason it didn't you know how to copy the modules manually.&lt;br /&gt;
&lt;br /&gt;
For further info refer to the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] section of this wiki.&lt;br /&gt;
&lt;br /&gt;
== Setting the build environment ==&lt;br /&gt;
MacPorts's hierarchy (/opt/local/) is not searched for libraries by default. Therefore, before the configuration starts, some environment variables need to be set. The environment variables are presented in bash syntax here. &lt;br /&gt;
&amp;lt;pre&amp;gt;export LIBPREFIX=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$LIBPREFIX/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$LIBPREFIX/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$LIBPREFIX/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;lt;code&amp;gt;[http://en.wikipedia.org/wiki/Ccache ccache]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;sudo port install ccache&amp;lt;/code&amp;gt;) to speed up the compilation a bit. To do so, add compiler variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
If you compile Inkscape for the first time from an svn checkout you need to generate the configure script. Navigate to Inkscape's source directory and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;./autogen.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run configure with the options &amp;lt;code&amp;gt;--disable-static --enable-shared&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; which sets the directory where the build products are placed. It must be somewhere you have write access to.&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I you want to package Inkscape into a double-clickable &amp;lt;code&amp;gt;.app&amp;lt;/code&amp;gt; bundle in order to access it like a regular OS X application (you probably want to), you need to add the option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure {...} --enable-osxapp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have loudmouth installed and you want to enable whiteboard functionality in Inkscape, add &amp;lt;code&amp;gt;--enable-inkboard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other configuration options can be set, check the list of options by issuing:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's an example which covers most options that can be set:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/ --with-xft \&lt;br /&gt;
--with-gnome-vfs --with-python=/path/to/python/modules --enable-osxapp --enable-lcms \&lt;br /&gt;
--enable-poppler-cairo --enable-inkboard&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building and Installing ==&lt;br /&gt;
Just run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .app bundle ==&lt;br /&gt;
Assuming that you have used the &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; option during &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;, navigate to Mac OS X packaging directory in Inkscape source code and use the automated script:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&lt;br /&gt;
./osx-app.sh -s -b /path/to/install/prefix/bin/inkscape -p ../../Info.plist&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script copies Inkscape binary and all its dependencies into the app bundle. The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; options strips libraries from debugging information (the bundle is therefore smaller). Omit this option if you want to keep debugging info.&lt;br /&gt;
&lt;br /&gt;
== Creating a disk image to distribute Inkscape ==&lt;br /&gt;
Inkscape.app created at the previous step is completely independent from the original location of MacPorts libraries and can therefore be distributed. It will only work on your platform though (PPC or Intel) and incompatibilities are known between X11 versions on different major versions of OS X (Panther, Tiger and Leopard). The general rule is that versions are not backward compatible.&lt;br /&gt;
&lt;br /&gt;
The most widespread way of distributing applications on Mac OS X is via .dmg images. You can created a dmg image of Inkscape, with a nice background and all, using the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-dmg.sh -p Inkscape.app&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the packaging directory for Mac OS X (where your app bundle should be, otherwise modify the path to Inkscape.app).&lt;br /&gt;
&lt;br /&gt;
== Automated build script ==&lt;br /&gt;
All essential steps are automated by a build script: &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt;. It has built-in help so to know how to use it just type:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: Excluded steps involve Pre-compiliation of the Python modules and installing the additional nightly build features.&lt;br /&gt;
&lt;br /&gt;
= Compiling a Universal Binary of Inkscape with X11, using MacPorts=&lt;br /&gt;
&lt;br /&gt;
These instructions should work on both 10.4 and 10.5 machines with the latest Xcode version installed.&lt;br /&gt;
&lt;br /&gt;
== Update Macport sources ==&lt;br /&gt;
&lt;br /&gt;
The port descriptions in Macports do not currently all compile properly with their Universal variants.   For this reason, we currently use a modified set of some of the portfiles that will compile a universal libraries.  Work is being done to integrate these changes into Macports itself.&lt;br /&gt;
&lt;br /&gt;
You can use our modified portfiles by adding our ports to your sources:&lt;br /&gt;
&lt;br /&gt;
1. Checkout our ports directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/experimental/trunk/mjwybrow/ports ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit your sources list to include this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo vim /opt/local/etc/macports/sources.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
And add the following line *before* the existing rsync source:&lt;br /&gt;
&amp;lt;pre&amp;gt;file:///Users/YOURUSERNAME/directory/to/ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the portindex command in the checked-out port directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;portindex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run port sync&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal dependencies ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile Inkscape's essential dependencies as Universal libraries on either 10.4 or 10.5,  by giving the &amp;quot;+universal&amp;quot; option for each, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -v install poppler +universal gtk2 +universal ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have non-universal versions of these ports installed you may need to deactivate the port and rebuild it, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -f uninstall cairo&lt;br /&gt;
sudo port clean cairo&lt;br /&gt;
sudo port -v install cairo +universal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal Inkscape ==&lt;br /&gt;
&lt;br /&gt;
First, Set your SDK, 10.5 for Leopard, 10.4u for TIger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.5.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; (For Leopard)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.4u.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp;  (For Tiger)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, set up your environment to point to the Macports libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;export MACPORTS=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
export PATH=$MACPORTS/bin:$MACPORTS/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$MACPORTS/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$MACPORTS/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$MACPORTS/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall -isysroot $SDK -arch ppc -arch i386&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to configure and compile Inkscape.  Inkscape must be configured with the following options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;   Sets the correct path for Inkscape to be used from an .app bundle&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;--disable-dependency-tracking&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; Dependency tracking can't be user when compiling universal binaries.&lt;br /&gt;
&lt;br /&gt;
Inkscape can then be built (with make), installed, and packaged into a Universal .app bundle using the standard .app bundle building instruction above.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using MacPorts [experimental] =&lt;br /&gt;
This process is very similar to compiling an X11 version of Inkscape except for the building of dependencies: need to build native versions of Inkscape dependencies. At the moment (2007-12-17) this process does not produce a usable version of Inkscape but the more people try to use it, the quicker the bugs will be ironed out!&lt;br /&gt;
&lt;br /&gt;
== Native version of Inkscape dependencies ==&lt;br /&gt;
Thanks to the power of port &amp;quot;variants&amp;quot; and port &amp;quot;deactivation&amp;quot; you can install native versions of gtk, cairo, pango and such, alongside the regular X11 ones. To know which ports have a &amp;lt;code&amp;gt;quartz&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_x11&amp;lt;/code&amp;gt; variant, use the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;port list variant:quartz variant:no_x11&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you an idea of what need to be replaced.&lt;br /&gt;
&lt;br /&gt;
Assuming your MacPorts tree has been already used to build regular versions of Inkscape, you first need to deactivate (suppress from the tree without really uninstalling) the X11 versions of gtk, cairo, cairomm and pango:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port deactivate gtk2 cairo cairomm pango&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install native variants:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install cairo +quartz+pdf+no_x11 cairomm +quartz pango +no_x11 poppler +quartz gtk2 +quartz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than deactivating and reactivating ports, you can also keep two MacPorts trees side by side, provided you install the second one from source. Let say I want to install a new tree for native versions in /opt/local/native, I would do&lt;br /&gt;
&amp;lt;pre&amp;gt;export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin&lt;br /&gt;
cd ~/MacPorts-1.x.x/&lt;br /&gt;
./configure --prefix=/opt/local-native --with-tclpackage=/Library/Tcl/macports-native&lt;br /&gt;
make&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you need to have only one version of the port command in the path at any time so you need to setup your .bashrc (or .bash_profile or .profile) accordingly. I use shell aliases to quickly and temporarily switch to the universal version:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias portpathregular=&amp;quot;export PATH=/opt/local/bin:/opt/local/sbin:/Developer/Tools:/usr/local/bin: \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
alias portpathuniv=&amp;quot;export PATH=/opt/local-univ/bin:/opt/local-univ/sbin:/Developer/Tools:/usr/local/bin:  \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: the \ are just to mark line continuation here, suppress them and put everything in one line.&lt;br /&gt;
&lt;br /&gt;
== Install the rest ==&lt;br /&gt;
Eventually, follow the regular install procedure for the rest:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install libxslt boost boehmgc gtkmm lcms intltool popt&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your MacPorts tree was already ready to compile Inkscape, you should not need to reinstall anything, with the possible exception of gtkmm, which may need to be rebuilt against the native version of gtk rather than against the X11 one (please someone confirm this).&lt;br /&gt;
&lt;br /&gt;
Get inkscape source code and go in the mac OS X specific packaging directory&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&amp;lt;/pre&amp;gt;&lt;br /&gt;
There edit &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt; to remove the configure option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; because it puts inkscape in a .app bundle where it is started together with X11, which would defeat the purpose of this native compilation. You can also specify an alternative install prefix if you want. Then&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh u a c b i&amp;lt;/pre&amp;gt;&lt;br /&gt;
and a native version of Inkscape is installed in the prefix you specified or in the &amp;lt;code&amp;gt;Build/bin&amp;lt;/code&amp;gt; directory of Inkscape's source code. You can test it by&lt;br /&gt;
&amp;lt;pre&amp;gt; cd ../../Build/bin/&lt;br /&gt;
./inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: if you compiled a GTK theme engine against your old GTK install (i.e. the one with X11) and try to use it with the new install, it will complain, so edit &amp;lt;code&amp;gt;~/.gtkrc-2.0&amp;lt;/code&amp;gt; to remove the offending theme or recompile it with the new native GTK.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using the all in one build script [experimental] =&lt;br /&gt;
&lt;br /&gt;
To build a native-GTK build of Inkscape, GTK and some of its dependencies must be built with special options. You can do this using the build-gtk.sh script from the Inkscape repository (it's in packaging/macosx/native-gtk/).  This is a modified version of the Imendio native build script, found with instructions on this page:&lt;br /&gt;
http://developer.imendio.com/projects/gtk-macosx/build-instructions&lt;br /&gt;
&lt;br /&gt;
This process is relatively untested. If you have any troubles using this process then please report them to Michael Wybrow (mjwybrow on sourceforge).&lt;br /&gt;
&lt;br /&gt;
The process is:&lt;br /&gt;
&amp;lt;pre&amp;gt;export PREFIX=/your/install/prefix&lt;br /&gt;
./build-gtk bootstrap&lt;br /&gt;
./build-gtk build inkscape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enabling python effects =&lt;br /&gt;
moved to [[GettingEffectsWorking]]. They should work out of the box in the new versions anyway.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
== User Examples ==&lt;br /&gt;
* Adam Strzeleki has outlined some improvements to this process on the Inkscape [http://www.nabble.com/Inkscape-native-Mac-OS-X-build---look-improvements-td14733036.html email list]. See his screenshot from January 10, 2008 [http://www.nabble.com/attachment/14733036/1/Inkscape%20OSX%20PL.gif here].&lt;br /&gt;
* JiHO has a video of his builds [http://jo.irisson.free.fr/?p=34 here] and [http://jo.irisson.free.fr/?p=62 here].&lt;br /&gt;
&lt;br /&gt;
== Apple Documentation ==&lt;br /&gt;
* [http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html Introduction to Runtime Configuration] Covers the Info.plist files, Preferences, Environment variables and has a list of the most important Properties that the Property List should contain.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.sveinbjorn.org/platypus Sveinbjorn Thordarson's Website] The author of Platypus, the Script Exec wrapper that launches the Inkscape binary.&lt;br /&gt;
* [http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html  Creating OS X application bundles step by step] Covers the bundle concepts, copying libraries into the bundle, editing libraries with the install_name_tool, the Info.plist file and adding an icon.&lt;br /&gt;
* [http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ Bringing your Java Application to Mac OS X] I would regard this a little dated, and the detail is (unsurprisingly) Java-related, but it is a gentle introduction to the role of the .app bundle and give a most clear account of how to create one.&lt;br /&gt;
* The [http://gimp-app.sourceforge.net/gimp.app.howto.txt Gimp .app Howto] This is a very bare document, and would be of little help to you if you were new to making packages. Note that it seems to refer to a more mature Clipboard technique and Online help than we currently have; and we ought to move to parity in these areas.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39804</id>
		<title>CompilingMacOsX</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39804"/>
		<updated>2008-12-02T03:15:24Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Pre-compiling the Python modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= For the impatient =&lt;br /&gt;
&lt;br /&gt;
1. Install [http://developer.apple.com/tools/xcode/ XCode tools] from your OS X installation DVD&lt;br /&gt;
&lt;br /&gt;
2. Download and install [http://www.macports.org/ MacPorts]&lt;br /&gt;
&lt;br /&gt;
3. In Terminal (Applications&amp;gt;Utilities&amp;gt;Terminal) type&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install cairo +pdf boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt poppler boost \ &lt;br /&gt;
 gnome-vfs libgnomeprintui automake autoconf subversion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: subversion is pre-installed on Leopard, so you may be fine leaving subversion out of the port install command chain.&lt;br /&gt;
&lt;br /&gt;
Grab a cup of coffee&lt;br /&gt;
&lt;br /&gt;
4. In Terminal, get and build Inkscape&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape&lt;br /&gt;
cd inkscape/packaging/macosx/&lt;br /&gt;
./osx-build.sh a c b i -s p&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voilà''. If you want to understand what you just did, read on.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
To compile Inkscape from source you need:&lt;br /&gt;
*Mac OS X &amp;gt; 10.3&lt;br /&gt;
*XCode Tools. They are on your installation DVD, in the optional installs, or can be download from [http://developer.apple.com/tools/xcode/ Apple Developer Connection]. You can customize the install to make it smaller (avoir documentation and example software for example). You need at least: gcc, XCode, X11SDK.&lt;br /&gt;
*Inkscape's source code. You can download an [http://www.inkscape.org/download.php official release source code], a [http://inkscape.modevia.com/svn-snap/?M=D development snapshot] or checkout a copy of the current state of the [http://www.inkscape.org/svn.php?lang=en SVN repository] using [http://subversion.tigris.org/ subversion]. Subversion comes pre-installed on Leopard. On previous system, subversion can be installed by package management systems (see point below) or with an OS X installer [http://homepage.mac.com/martinott/ package]&lt;br /&gt;
*A means of getting Inkscape's numerous dependencies: glibmm, gtkmm, lmcs, boehmgc... We recommend the use of [http://www.macports.org/ MacPorts] right now. ([http://www.finkproject.org/ Fink] was used in the past but it no longer meets Inkscape's needs currently.)&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with X11, using MacPorts [Recommended method]=&lt;br /&gt;
&lt;br /&gt;
== Installing dependencies ==&lt;br /&gt;
You can use MacPorts to list Inkscape dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;port deps inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some are mandatory and you can install them with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt boost gsl&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Others provide additional functionality to Inkscape:&lt;br /&gt;
* &amp;lt;code&amp;gt;gnome-vfs&amp;lt;/code&amp;gt; : access to remote servers, in particular import from Open Clipart Library&lt;br /&gt;
* &amp;lt;code&amp;gt;aspell&amp;lt;/code&amp;gt; : check spelling of text elements [Note: I have never seen it working on OS X, though at least it should install fine]&lt;br /&gt;
* &amp;lt;code&amp;gt;libgnomeprintui&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;loudmouth&amp;lt;/code&amp;gt; : jabber library used by InkBoard&lt;br /&gt;
* &amp;lt;code&amp;gt;cairo +pdf&amp;lt;/code&amp;gt; (cairo with the pdf variant) : better pdf export&lt;br /&gt;
* &amp;lt;code&amp;gt;poppler&amp;lt;/code&amp;gt; : better pdf import&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install gnome-vfs aspell libgnomeprintui loudmouth cairo +pdf poppler&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: Cairo was already installed at previous step as a GTK dependency. You need to either deactivate the old version and install this one, or directly write it on the command line above. &lt;br /&gt;
If you're unsure about MacPorts commands, you can find a guide that is easy to skim here: [http://guide.macports.org/ MacPorts Guide]&lt;br /&gt;
&lt;br /&gt;
In addition, Inkscape requires versions of the autotools more recent thant those that ship with OS X. Install them:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install autoconf automake&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More recent (Sep 2008) pre-packaged nightly builds for Mac OS X also feature additional dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install librsvg libwpd libwpg libcroco&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: At the time of editing (2008-12-01) there was a problem fetching &amp;quot;lzmautils&amp;quot; as the URL MacPorts tried to use as download source dies in a timeout. &lt;br /&gt;
As this package is needed as a dependency for one or more packages noted above you need to download the source tarball of lzmautils from somewhere else (for example, from [ftp://sunfreeware.mirrors.tds.net/pub/sunfreeware/SOURCES/lzma-4.32.7.tar.gz here]) and put that into the local MacPorts repository at &amp;quot;/opt/local/var/macports/distfiles/lzmautils&amp;quot;. You should now be able to run the commands above.&lt;br /&gt;
&lt;br /&gt;
Also make sure that you have &amp;quot;libxml2&amp;quot; and &amp;quot;libxslt&amp;quot; installed with MacPorts. This should have been installed previously, either directly or as a dependency.&lt;br /&gt;
You will need those later to compile the &amp;quot;lxml&amp;quot; Python module if you want to use Python effects. First check what's installed and if they are missing from your MacPorts repository install them by doing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;port installed&lt;br /&gt;
sudo port install libxml2 libxslt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pre-compiling the Python modules  ==&lt;br /&gt;
&lt;br /&gt;
If you cannot use the pre-built Python modules from [http://inkscape.modevia.com/macosx-snap/?C=M;O=D Modevia], say, because you're using an unsupported Python version or you just want to install from source you need to pre-compile both modules.&lt;br /&gt;
&lt;br /&gt;
In case you are using a Python version installed through MacPorts do a search for both modules and install the ones suitable for the Python version activated within MacPorts.&lt;br /&gt;
&amp;lt;pre&amp;gt;port search lxml numpy&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using Leopard's default Python 2.5.1 installation or a more recent one (e.g. MacPython 2.6) you will need to compile both modules outside of MacPorts. Download both modules from [http://pypi.python.org PyPI] if they are available there for your Python version. At the time of editing (2008-12-01) both modules were only available through SVN for Python 2.6.&lt;br /&gt;
&lt;br /&gt;
There are lots of tutorials for building and installing the &amp;quot;numpy&amp;quot; module. One good place to start looking is the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] entry referenced at the end of this guide. &lt;br /&gt;
&lt;br /&gt;
Building the &amp;quot;lxml&amp;quot; module deviates a little from the standard way, so if you cannot install it try the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/lxml/source&lt;br /&gt;
sudo python setup.py install --with-xslt-config=/opt/local/bin/xslt-config \ &lt;br /&gt;
--with-xml2-config=/opt/local/bin/xml2-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells it to use the libxml2 and libxslt packages we installed earlier with MacPorts instead of Mac OS X' default versions, which have been known to cause problems when trying to build &amp;quot;lxml&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you are compiling the Python modules outside of MacPorts you will need to make a mental note for after running the .app-bundle building script (detailed later in this guide) to copy the &amp;quot;lxml&amp;quot; and &amp;quot;numpy&amp;quot; dirs from the standard installation destination (by default &amp;quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages&amp;quot; for MacPython 2.6 and &amp;quot;/Library/Python/2.5/site-packages/&amp;quot; for Leopard's default Python 2.5.1 installation) to either&lt;br /&gt;
* the &amp;quot;extensions&amp;quot; folder inside the Inkscape.app bundle (&amp;quot;Inkscape.app/Contents/Resources/extensions&amp;quot;) if all you care about is getting the Inkscape build to work with your Python version. This method is more foolproof but supports only one Python version.&lt;br /&gt;
* the &amp;quot;site-packages&amp;quot; folder inside the Inkspace.app bundle. The &amp;quot;site-packages&amp;quot; folder is the right place for putting your pre-compiled Python modules if you want to redistribute your build. Make a subfolder within &amp;quot;site-packages&amp;quot; with the name of your arch (&amp;quot;i386&amp;quot; for Intel, &amp;quot;PPC&amp;quot; for PowerPC or type &amp;lt;code&amp;gt;arch&amp;lt;/code&amp;gt; into a Terminal window) and another subfolder within the arch folder with the name of your Python version (e.g. &amp;quot;2.5&amp;quot; or &amp;quot;2.6&amp;quot; etc.). This allows you to include support for multiple Python versions with your Inkscape build. Note, however, that if someone has multiple Python versions installed they may run into problems with the PATH order exported by the internal script (&amp;quot;Inkspace.app/Contents/Resources/bin/inkscape&amp;quot;) responsible for preparing the Inkscape launch environment. &lt;br /&gt;
&lt;br /&gt;
Armed with this knowledge you should be able to take care of the &amp;quot;...needs the fantastic libxml2 wrapper...&amp;quot; message when executing Python effects. Normally the &amp;lt;code&amp;gt;osx-app.sh&amp;lt;/code&amp;gt; script (detailed later)  should take care of this for you, but if for whatever reason it didn't you know how to copy the modules manually.&lt;br /&gt;
&lt;br /&gt;
For further info refer to the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] section of this wiki.&lt;br /&gt;
&lt;br /&gt;
== Setting the build environment ==&lt;br /&gt;
MacPorts's hierarchy (/opt/local/) is not searched for libraries by default. Therefore, before the configuration starts, some environment variables need to be set. The environment variables are presented in bash syntax here. &lt;br /&gt;
&amp;lt;pre&amp;gt;export LIBPREFIX=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$LIBPREFIX/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$LIBPREFIX/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$LIBPREFIX/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;lt;code&amp;gt;[http://en.wikipedia.org/wiki/Ccache ccache]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;sudo port install ccache&amp;lt;/code&amp;gt;) to speed up the compilation a bit. To do so, add compiler variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
If you compile Inkscape for the first time from an svn checkout you need to generate the configure script. Navigate to Inkscape's source directory and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;./autogen.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run configure with the options &amp;lt;code&amp;gt;--disable-static --enable-shared&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; which sets the directory where the build products are placed. It must be somewhere you have write access to.&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I you want to package Inkscape into a double-clickable &amp;lt;code&amp;gt;.app&amp;lt;/code&amp;gt; bundle in order to access it like a regular OS X application (you probably want to), you need to add the option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure {...} --enable-osxapp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have loudmouth installed and you want to enable whiteboard functionality in Inkscape, add &amp;lt;code&amp;gt;--enable-inkboard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other configuration options can be set, check the list of options by issuing:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's an example which covers most options that can be set:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/ --with-xft \&lt;br /&gt;
--with-gnome-vfs --with-python=/path/to/python/modules --enable-osxapp --enable-lcms \&lt;br /&gt;
--enable-poppler-cairo --enable-inkboard&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building and Installing ==&lt;br /&gt;
Just run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .app bundle ==&lt;br /&gt;
Assuming that you have used the &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; option during &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;, navigate to Mac OS X packaging directory in Inkscape source code and use the automated script:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&lt;br /&gt;
./osx-app.sh -s -b /path/to/install/prefix/bin/inkscape -p ../../Info.plist&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script copies Inkscape binary and all its dependencies into the app bundle. The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; options strips libraries from debugging information (the bundle is therefore smaller). Omit this option if you want to keep debugging info.&lt;br /&gt;
&lt;br /&gt;
== Creating a disk image to distribute Inkscape ==&lt;br /&gt;
Inkscape.app created at the previous step is completely independent from the original location of MacPorts libraries and can therefore be distributed. It will only work on your platform though (PPC or Intel) and incompatibilities are known between X11 versions on different major versions of OS X (Panther, Tiger and Leopard). The general rule is that versions are not backward compatible.&lt;br /&gt;
&lt;br /&gt;
The most widespread way of distributing applications on Mac OS X is via .dmg images. You can created a dmg image of Inkscape, with a nice background and all, using the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-dmg.sh -p Inkscape.app&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the packaging directory for Mac OS X (where your app bundle should be, otherwise modify the path to Inkscape.app).&lt;br /&gt;
&lt;br /&gt;
== Automated build script ==&lt;br /&gt;
All essential steps are automated by a build script: &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt;. It has built-in help so to know how to use it just type:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: Excluded steps involve Pre-compiliation of the Python modules and installing the additional nightly build features.&lt;br /&gt;
&lt;br /&gt;
= Compiling a Universal Binary of Inkscape with X11, using MacPorts=&lt;br /&gt;
&lt;br /&gt;
These instructions should work on both 10.4 and 10.5 machines with the latest Xcode version installed.&lt;br /&gt;
&lt;br /&gt;
== Update Macport sources ==&lt;br /&gt;
&lt;br /&gt;
The port descriptions in Macports do not currently all compile properly with their Universal variants.   For this reason, we currently use a modified set of some of the portfiles that will compile a universal libraries.  Work is being done to integrate these changes into Macports itself.&lt;br /&gt;
&lt;br /&gt;
You can use our modified portfiles by adding our ports to your sources:&lt;br /&gt;
&lt;br /&gt;
1. Checkout our ports directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/experimental/trunk/mjwybrow/ports ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit your sources list to include this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo vim /opt/local/etc/macports/sources.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
And add the following line *before* the existing rsync source:&lt;br /&gt;
&amp;lt;pre&amp;gt;file:///Users/YOURUSERNAME/directory/to/ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the portindex command in the checked-out port directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;portindex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run port sync&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal dependencies ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile Inkscape's essential dependencies as Universal libraries on either 10.4 or 10.5,  by giving the &amp;quot;+universal&amp;quot; option for each, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -v install poppler +universal gtk2 +universal ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have non-universal versions of these ports installed you may need to deactivate the port and rebuild it, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -f uninstall cairo&lt;br /&gt;
sudo port clean cairo&lt;br /&gt;
sudo port -v install cairo +universal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal Inkscape ==&lt;br /&gt;
&lt;br /&gt;
First, Set your SDK, 10.5 for Leopard, 10.4u for TIger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.5.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; (For Leopard)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.4u.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp;  (For Tiger)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, set up your environment to point to the Macports libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;export MACPORTS=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
export PATH=$MACPORTS/bin:$MACPORTS/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$MACPORTS/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$MACPORTS/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$MACPORTS/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall -isysroot $SDK -arch ppc -arch i386&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to configure and compile Inkscape.  Inkscape must be configured with the following options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;   Sets the correct path for Inkscape to be used from an .app bundle&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;--disable-dependency-tracking&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; Dependency tracking can't be user when compiling universal binaries.&lt;br /&gt;
&lt;br /&gt;
Inkscape can then be built (with make), installed, and packaged into a Universal .app bundle using the standard .app bundle building instruction above.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using MacPorts [experimental] =&lt;br /&gt;
This process is very similar to compiling an X11 version of Inkscape except for the building of dependencies: need to build native versions of Inkscape dependencies. At the moment (2007-12-17) this process does not produce a usable version of Inkscape but the more people try to use it, the quicker the bugs will be ironed out!&lt;br /&gt;
&lt;br /&gt;
== Native version of Inkscape dependencies ==&lt;br /&gt;
Thanks to the power of port &amp;quot;variants&amp;quot; and port &amp;quot;deactivation&amp;quot; you can install native versions of gtk, cairo, pango and such, alongside the regular X11 ones. To know which ports have a &amp;lt;code&amp;gt;quartz&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_x11&amp;lt;/code&amp;gt; variant, use the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;port list variant:quartz variant:no_x11&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you an idea of what need to be replaced.&lt;br /&gt;
&lt;br /&gt;
Assuming your MacPorts tree has been already used to build regular versions of Inkscape, you first need to deactivate (suppress from the tree without really uninstalling) the X11 versions of gtk, cairo, cairomm and pango:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port deactivate gtk2 cairo cairomm pango&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install native variants:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install cairo +quartz+pdf+no_x11 cairomm +quartz pango +no_x11 poppler +quartz gtk2 +quartz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than deactivating and reactivating ports, you can also keep two MacPorts trees side by side, provided you install the second one from source. Let say I want to install a new tree for native versions in /opt/local/native, I would do&lt;br /&gt;
&amp;lt;pre&amp;gt;export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin&lt;br /&gt;
cd ~/MacPorts-1.x.x/&lt;br /&gt;
./configure --prefix=/opt/local-native --with-tclpackage=/Library/Tcl/macports-native&lt;br /&gt;
make&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you need to have only one version of the port command in the path at any time so you need to setup your .bashrc (or .bash_profile or .profile) accordingly. I use shell aliases to quickly and temporarily switch to the universal version:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias portpathregular=&amp;quot;export PATH=/opt/local/bin:/opt/local/sbin:/Developer/Tools:/usr/local/bin: \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
alias portpathuniv=&amp;quot;export PATH=/opt/local-univ/bin:/opt/local-univ/sbin:/Developer/Tools:/usr/local/bin:  \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: the \ are just to mark line continuation here, suppress them and put everything in one line.&lt;br /&gt;
&lt;br /&gt;
== Install the rest ==&lt;br /&gt;
Eventually, follow the regular install procedure for the rest:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install libxslt boost boehmgc gtkmm lcms intltool popt&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your MacPorts tree was already ready to compile Inkscape, you should not need to reinstall anything, with the possible exception of gtkmm, which may need to be rebuilt against the native version of gtk rather than against the X11 one (please someone confirm this).&lt;br /&gt;
&lt;br /&gt;
Get inkscape source code and go in the mac OS X specific packaging directory&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&amp;lt;/pre&amp;gt;&lt;br /&gt;
There edit &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt; to remove the configure option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; because it puts inkscape in a .app bundle where it is started together with X11, which would defeat the purpose of this native compilation. You can also specify an alternative install prefix if you want. Then&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh u a c b i&amp;lt;/pre&amp;gt;&lt;br /&gt;
and a native version of Inkscape is installed in the prefix you specified or in the &amp;lt;code&amp;gt;Build/bin&amp;lt;/code&amp;gt; directory of Inkscape's source code. You can test it by&lt;br /&gt;
&amp;lt;pre&amp;gt; cd ../../Build/bin/&lt;br /&gt;
./inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: if you compiled a GTK theme engine against your old GTK install (i.e. the one with X11) and try to use it with the new install, it will complain, so edit &amp;lt;code&amp;gt;~/.gtkrc-2.0&amp;lt;/code&amp;gt; to remove the offending theme or recompile it with the new native GTK.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using the all in one build script [experimental] =&lt;br /&gt;
&lt;br /&gt;
To build a native-GTK build of Inkscape, GTK and some of its dependencies must be built with special options. You can do this using the build-gtk.sh script from the Inkscape repository (it's in packaging/macosx/native-gtk/).  This is a modified version of the Imendio native build script, found with instructions on this page:&lt;br /&gt;
http://developer.imendio.com/projects/gtk-macosx/build-instructions&lt;br /&gt;
&lt;br /&gt;
This process is relatively untested. If you have any troubles using this process then please report them to Michael Wybrow (mjwybrow on sourceforge).&lt;br /&gt;
&lt;br /&gt;
The process is:&lt;br /&gt;
&amp;lt;pre&amp;gt;export PREFIX=/your/install/prefix&lt;br /&gt;
./build-gtk bootstrap&lt;br /&gt;
./build-gtk build inkscape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enabling python effects =&lt;br /&gt;
moved to [[GettingEffectsWorking]]. They should work out of the box in the new versions anyway.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
== User Examples ==&lt;br /&gt;
* Adam Strzeleki has outlined some improvements to this process on the Inkscape [http://www.nabble.com/Inkscape-native-Mac-OS-X-build---look-improvements-td14733036.html email list]. See his screenshot from January 10, 2008 [http://www.nabble.com/attachment/14733036/1/Inkscape%20OSX%20PL.gif here].&lt;br /&gt;
* JiHO has a video of his builds [http://jo.irisson.free.fr/?p=34 here] and [http://jo.irisson.free.fr/?p=62 here].&lt;br /&gt;
&lt;br /&gt;
== Apple Documentation ==&lt;br /&gt;
* [http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html Introduction to Runtime Configuration] Covers the Info.plist files, Preferences, Environment variables and has a list of the most important Properties that the Property List should contain.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.sveinbjorn.org/platypus Sveinbjorn Thordarson's Website] The author of Platypus, the Script Exec wrapper that launches the Inkscape binary.&lt;br /&gt;
* [http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html  Creating OS X application bundles step by step] Covers the bundle concepts, copying libraries into the bundle, editing libraries with the install_name_tool, the Info.plist file and adding an icon.&lt;br /&gt;
* [http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ Bringing your Java Application to Mac OS X] I would regard this a little dated, and the detail is (unsurprisingly) Java-related, but it is a gentle introduction to the role of the .app bundle and give a most clear account of how to create one.&lt;br /&gt;
* The [http://gimp-app.sourceforge.net/gimp.app.howto.txt Gimp .app Howto] This is a very bare document, and would be of little help to you if you were new to making packages. Note that it seems to refer to a more mature Clipboard technique and Online help than we currently have; and we ought to move to parity in these areas.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39794</id>
		<title>CompilingMacOsX</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39794"/>
		<updated>2008-12-02T02:57:59Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Pre-compiling the Python modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= For the impatient =&lt;br /&gt;
&lt;br /&gt;
1. Install [http://developer.apple.com/tools/xcode/ XCode tools] from your OS X installation DVD&lt;br /&gt;
&lt;br /&gt;
2. Download and install [http://www.macports.org/ MacPorts]&lt;br /&gt;
&lt;br /&gt;
3. In Terminal (Applications&amp;gt;Utilities&amp;gt;Terminal) type&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install cairo +pdf boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt poppler boost \ &lt;br /&gt;
 gnome-vfs libgnomeprintui automake autoconf subversion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: subversion is pre-installed on Leopard, so you may be fine leaving subversion out of the port install command chain.&lt;br /&gt;
&lt;br /&gt;
Grab a cup of coffee&lt;br /&gt;
&lt;br /&gt;
4. In Terminal, get and build Inkscape&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape&lt;br /&gt;
cd inkscape/packaging/macosx/&lt;br /&gt;
./osx-build.sh a c b i -s p&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voilà''. If you want to understand what you just did, read on.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
To compile Inkscape from source you need:&lt;br /&gt;
*Mac OS X &amp;gt; 10.3&lt;br /&gt;
*XCode Tools. They are on your installation DVD, in the optional installs, or can be download from [http://developer.apple.com/tools/xcode/ Apple Developer Connection]. You can customize the install to make it smaller (avoir documentation and example software for example). You need at least: gcc, XCode, X11SDK.&lt;br /&gt;
*Inkscape's source code. You can download an [http://www.inkscape.org/download.php official release source code], a [http://inkscape.modevia.com/svn-snap/?M=D development snapshot] or checkout a copy of the current state of the [http://www.inkscape.org/svn.php?lang=en SVN repository] using [http://subversion.tigris.org/ subversion]. Subversion comes pre-installed on Leopard. On previous system, subversion can be installed by package management systems (see point below) or with an OS X installer [http://homepage.mac.com/martinott/ package]&lt;br /&gt;
*A means of getting Inkscape's numerous dependencies: glibmm, gtkmm, lmcs, boehmgc... We recommend the use of [http://www.macports.org/ MacPorts] right now. ([http://www.finkproject.org/ Fink] was used in the past but it no longer meets Inkscape's needs currently.)&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with X11, using MacPorts [Recommended method]=&lt;br /&gt;
&lt;br /&gt;
== Installing dependencies ==&lt;br /&gt;
You can use MacPorts to list Inkscape dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;port deps inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some are mandatory and you can install them with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt boost gsl&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Others provide additional functionality to Inkscape:&lt;br /&gt;
* &amp;lt;code&amp;gt;gnome-vfs&amp;lt;/code&amp;gt; : access to remote servers, in particular import from Open Clipart Library&lt;br /&gt;
* &amp;lt;code&amp;gt;aspell&amp;lt;/code&amp;gt; : check spelling of text elements [Note: I have never seen it working on OS X, though at least it should install fine]&lt;br /&gt;
* &amp;lt;code&amp;gt;libgnomeprintui&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;loudmouth&amp;lt;/code&amp;gt; : jabber library used by InkBoard&lt;br /&gt;
* &amp;lt;code&amp;gt;cairo +pdf&amp;lt;/code&amp;gt; (cairo with the pdf variant) : better pdf export&lt;br /&gt;
* &amp;lt;code&amp;gt;poppler&amp;lt;/code&amp;gt; : better pdf import&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install gnome-vfs aspell libgnomeprintui loudmouth cairo +pdf poppler&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: Cairo was already installed at previous step as a GTK dependency. You need to either deactivate the old version and install this one, or directly write it on the command line above. &lt;br /&gt;
If you're unsure about MacPorts commands, you can find a guide that is easy to skim here: [http://guide.macports.org/ MacPorts Guide]&lt;br /&gt;
&lt;br /&gt;
In addition, Inkscape requires versions of the autotools more recent thant those that ship with OS X. Install them:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install autoconf automake&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More recent (Sep 2008) pre-packaged nightly builds for Mac OS X also feature additional dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install librsvg libwpd libwpg libcroco&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: At the time of editing (2008-12-01) there was a problem fetching &amp;quot;lzmautils&amp;quot; as the URL MacPorts tried to use as download source dies in a timeout. &lt;br /&gt;
As this package is needed as a dependency for one or more packages noted above you need to download the source tarball of lzmautils from somewhere else (for example, from [ftp://sunfreeware.mirrors.tds.net/pub/sunfreeware/SOURCES/lzma-4.32.7.tar.gz here]) and put that into the local MacPorts repository at &amp;quot;/opt/local/var/macports/distfiles/lzmautils&amp;quot;. You should now be able to run the commands above.&lt;br /&gt;
&lt;br /&gt;
Also make sure that you have &amp;quot;libxml2&amp;quot; and &amp;quot;libxslt&amp;quot; installed with MacPorts. This should have been installed previously, either directly or as a dependency.&lt;br /&gt;
You will need those later to compile the &amp;quot;lxml&amp;quot; Python module if you want to use Python effects. First check what's installed and if they are missing from your MacPorts repository install them by doing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;port installed&lt;br /&gt;
sudo port install libxml2 libxslt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pre-compiling the Python modules  ==&lt;br /&gt;
&lt;br /&gt;
If you cannot use the pre-built Python modules from [http://inkscape.modevia.com/macosx-snap/?C=M;O=D Modevia], say, because you're using an unsupported Python version or you just want to install from source you need to pre-compile both modules.&lt;br /&gt;
&lt;br /&gt;
In case you are using a Python version installed through MacPorts do a search for both modules and install the ones suitable for the Python version activated within MacPorts.&lt;br /&gt;
&amp;lt;pre&amp;gt;port search lxml numpy&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using Leopard's default Python 2.5.1 installation or a more recent one (e.g. MacPython 2.6) you will need to compile both modules outside of MacPorts. Download both modules from [http://pypi.python.org PyPI] if they are available there for your Python version. At the time of editing (2008-12-01) both modules were only available through SVN for Python 2.6.&lt;br /&gt;
&lt;br /&gt;
There are lots of tutorials for building and installing the &amp;quot;numpy&amp;quot; module. One good place to start looking is the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] entry referenced at the end of this guide. &lt;br /&gt;
&lt;br /&gt;
Building the &amp;quot;lxml&amp;quot; module deviates a little from the standard way, so if you cannot install it try the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/lxml/source&lt;br /&gt;
sudo python setup.py install --with-xslt-config=/opt/local/bin/xslt-config \ &lt;br /&gt;
--with-xml2-config=/opt/local/bin/xml2-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells it to use the libxml2 and libxslt packages we installed earlier with MacPorts instead of Mac OS X' default versions, which have been known to cause problems when trying to build &amp;quot;lxml&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If you are compiling the Python modules outside of MacPorts you will need to make a mental note for after running the .app-bundle building script (detailed later in this guide) to copy the &amp;quot;lxml&amp;quot; and &amp;quot;numpy&amp;quot; dirs from the standard installation destination (by default &amp;quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages&amp;quot; for MacPython 2.6 and &amp;quot;/Library/Python/2.5/site-packages/&amp;quot; for Leopard's default Python 2.5.1 installation) to the &amp;quot;extensions&amp;quot; folder inside the Inkscape.app bundle (&amp;quot;Inkscape.app/Contents/Resources/extensions&amp;quot;).&lt;br /&gt;
This should take care of the &amp;quot;...needs fantastic libxml2 wrapper...&amp;quot; message when executing Python effects.&lt;br /&gt;
&lt;br /&gt;
For further info refer to the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] section of this wiki.&lt;br /&gt;
&lt;br /&gt;
== Setting the build environment ==&lt;br /&gt;
MacPorts's hierarchy (/opt/local/) is not searched for libraries by default. Therefore, before the configuration starts, some environment variables need to be set. The environment variables are presented in bash syntax here. &lt;br /&gt;
&amp;lt;pre&amp;gt;export LIBPREFIX=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$LIBPREFIX/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$LIBPREFIX/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$LIBPREFIX/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;lt;code&amp;gt;[http://en.wikipedia.org/wiki/Ccache ccache]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;sudo port install ccache&amp;lt;/code&amp;gt;) to speed up the compilation a bit. To do so, add compiler variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
If you compile Inkscape for the first time from an svn checkout you need to generate the configure script. Navigate to Inkscape's source directory and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;./autogen.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run configure with the options &amp;lt;code&amp;gt;--disable-static --enable-shared&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; which sets the directory where the build products are placed. It must be somewhere you have write access to.&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I you want to package Inkscape into a double-clickable &amp;lt;code&amp;gt;.app&amp;lt;/code&amp;gt; bundle in order to access it like a regular OS X application (you probably want to), you need to add the option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure {...} --enable-osxapp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have loudmouth installed and you want to enable whiteboard functionality in Inkscape, add &amp;lt;code&amp;gt;--enable-inkboard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other configuration options can be set, check the list of options by issuing:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's an example which covers most options that can be set:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/ --with-xft \&lt;br /&gt;
--with-gnome-vfs --with-python=/path/to/python/modules --enable-osxapp --enable-lcms \&lt;br /&gt;
--enable-poppler-cairo --enable-inkboard&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building and Installing ==&lt;br /&gt;
Just run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .app bundle ==&lt;br /&gt;
Assuming that you have used the &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; option during &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;, navigate to Mac OS X packaging directory in Inkscape source code and use the automated script:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&lt;br /&gt;
./osx-app.sh -s -b /path/to/install/prefix/bin/inkscape -p ../../Info.plist&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script copies Inkscape binary and all its dependencies into the app bundle. The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; options strips libraries from debugging information (the bundle is therefore smaller). Omit this option if you want to keep debugging info.&lt;br /&gt;
&lt;br /&gt;
== Creating a disk image to distribute Inkscape ==&lt;br /&gt;
Inkscape.app created at the previous step is completely independent from the original location of MacPorts libraries and can therefore be distributed. It will only work on your platform though (PPC or Intel) and incompatibilities are known between X11 versions on different major versions of OS X (Panther, Tiger and Leopard). The general rule is that versions are not backward compatible.&lt;br /&gt;
&lt;br /&gt;
The most widespread way of distributing applications on Mac OS X is via .dmg images. You can created a dmg image of Inkscape, with a nice background and all, using the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-dmg.sh -p Inkscape.app&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the packaging directory for Mac OS X (where your app bundle should be, otherwise modify the path to Inkscape.app).&lt;br /&gt;
&lt;br /&gt;
== Automated build script ==&lt;br /&gt;
All essential steps are automated by a build script: &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt;. It has built-in help so to know how to use it just type:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: Excluded steps involve Pre-compiliation of the Python modules and installing the additional nightly build features.&lt;br /&gt;
&lt;br /&gt;
= Compiling a Universal Binary of Inkscape with X11, using MacPorts=&lt;br /&gt;
&lt;br /&gt;
These instructions should work on both 10.4 and 10.5 machines with the latest Xcode version installed.&lt;br /&gt;
&lt;br /&gt;
== Update Macport sources ==&lt;br /&gt;
&lt;br /&gt;
The port descriptions in Macports do not currently all compile properly with their Universal variants.   For this reason, we currently use a modified set of some of the portfiles that will compile a universal libraries.  Work is being done to integrate these changes into Macports itself.&lt;br /&gt;
&lt;br /&gt;
You can use our modified portfiles by adding our ports to your sources:&lt;br /&gt;
&lt;br /&gt;
1. Checkout our ports directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/experimental/trunk/mjwybrow/ports ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit your sources list to include this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo vim /opt/local/etc/macports/sources.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
And add the following line *before* the existing rsync source:&lt;br /&gt;
&amp;lt;pre&amp;gt;file:///Users/YOURUSERNAME/directory/to/ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the portindex command in the checked-out port directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;portindex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run port sync&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal dependencies ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile Inkscape's essential dependencies as Universal libraries on either 10.4 or 10.5,  by giving the &amp;quot;+universal&amp;quot; option for each, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -v install poppler +universal gtk2 +universal ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have non-universal versions of these ports installed you may need to deactivate the port and rebuild it, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -f uninstall cairo&lt;br /&gt;
sudo port clean cairo&lt;br /&gt;
sudo port -v install cairo +universal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal Inkscape ==&lt;br /&gt;
&lt;br /&gt;
First, Set your SDK, 10.5 for Leopard, 10.4u for TIger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.5.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; (For Leopard)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.4u.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp;  (For Tiger)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, set up your environment to point to the Macports libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;export MACPORTS=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
export PATH=$MACPORTS/bin:$MACPORTS/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$MACPORTS/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$MACPORTS/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$MACPORTS/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall -isysroot $SDK -arch ppc -arch i386&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to configure and compile Inkscape.  Inkscape must be configured with the following options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;   Sets the correct path for Inkscape to be used from an .app bundle&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;--disable-dependency-tracking&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; Dependency tracking can't be user when compiling universal binaries.&lt;br /&gt;
&lt;br /&gt;
Inkscape can then be built (with make), installed, and packaged into a Universal .app bundle using the standard .app bundle building instruction above.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using MacPorts [experimental] =&lt;br /&gt;
This process is very similar to compiling an X11 version of Inkscape except for the building of dependencies: need to build native versions of Inkscape dependencies. At the moment (2007-12-17) this process does not produce a usable version of Inkscape but the more people try to use it, the quicker the bugs will be ironed out!&lt;br /&gt;
&lt;br /&gt;
== Native version of Inkscape dependencies ==&lt;br /&gt;
Thanks to the power of port &amp;quot;variants&amp;quot; and port &amp;quot;deactivation&amp;quot; you can install native versions of gtk, cairo, pango and such, alongside the regular X11 ones. To know which ports have a &amp;lt;code&amp;gt;quartz&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_x11&amp;lt;/code&amp;gt; variant, use the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;port list variant:quartz variant:no_x11&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you an idea of what need to be replaced.&lt;br /&gt;
&lt;br /&gt;
Assuming your MacPorts tree has been already used to build regular versions of Inkscape, you first need to deactivate (suppress from the tree without really uninstalling) the X11 versions of gtk, cairo, cairomm and pango:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port deactivate gtk2 cairo cairomm pango&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install native variants:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install cairo +quartz+pdf+no_x11 cairomm +quartz pango +no_x11 poppler +quartz gtk2 +quartz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than deactivating and reactivating ports, you can also keep two MacPorts trees side by side, provided you install the second one from source. Let say I want to install a new tree for native versions in /opt/local/native, I would do&lt;br /&gt;
&amp;lt;pre&amp;gt;export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin&lt;br /&gt;
cd ~/MacPorts-1.x.x/&lt;br /&gt;
./configure --prefix=/opt/local-native --with-tclpackage=/Library/Tcl/macports-native&lt;br /&gt;
make&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you need to have only one version of the port command in the path at any time so you need to setup your .bashrc (or .bash_profile or .profile) accordingly. I use shell aliases to quickly and temporarily switch to the universal version:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias portpathregular=&amp;quot;export PATH=/opt/local/bin:/opt/local/sbin:/Developer/Tools:/usr/local/bin: \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
alias portpathuniv=&amp;quot;export PATH=/opt/local-univ/bin:/opt/local-univ/sbin:/Developer/Tools:/usr/local/bin:  \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: the \ are just to mark line continuation here, suppress them and put everything in one line.&lt;br /&gt;
&lt;br /&gt;
== Install the rest ==&lt;br /&gt;
Eventually, follow the regular install procedure for the rest:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install libxslt boost boehmgc gtkmm lcms intltool popt&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your MacPorts tree was already ready to compile Inkscape, you should not need to reinstall anything, with the possible exception of gtkmm, which may need to be rebuilt against the native version of gtk rather than against the X11 one (please someone confirm this).&lt;br /&gt;
&lt;br /&gt;
Get inkscape source code and go in the mac OS X specific packaging directory&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&amp;lt;/pre&amp;gt;&lt;br /&gt;
There edit &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt; to remove the configure option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; because it puts inkscape in a .app bundle where it is started together with X11, which would defeat the purpose of this native compilation. You can also specify an alternative install prefix if you want. Then&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh u a c b i&amp;lt;/pre&amp;gt;&lt;br /&gt;
and a native version of Inkscape is installed in the prefix you specified or in the &amp;lt;code&amp;gt;Build/bin&amp;lt;/code&amp;gt; directory of Inkscape's source code. You can test it by&lt;br /&gt;
&amp;lt;pre&amp;gt; cd ../../Build/bin/&lt;br /&gt;
./inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: if you compiled a GTK theme engine against your old GTK install (i.e. the one with X11) and try to use it with the new install, it will complain, so edit &amp;lt;code&amp;gt;~/.gtkrc-2.0&amp;lt;/code&amp;gt; to remove the offending theme or recompile it with the new native GTK.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using the all in one build script [experimental] =&lt;br /&gt;
&lt;br /&gt;
To build a native-GTK build of Inkscape, GTK and some of its dependencies must be built with special options. You can do this using the build-gtk.sh script from the Inkscape repository (it's in packaging/macosx/native-gtk/).  This is a modified version of the Imendio native build script, found with instructions on this page:&lt;br /&gt;
http://developer.imendio.com/projects/gtk-macosx/build-instructions&lt;br /&gt;
&lt;br /&gt;
This process is relatively untested. If you have any troubles using this process then please report them to Michael Wybrow (mjwybrow on sourceforge).&lt;br /&gt;
&lt;br /&gt;
The process is:&lt;br /&gt;
&amp;lt;pre&amp;gt;export PREFIX=/your/install/prefix&lt;br /&gt;
./build-gtk bootstrap&lt;br /&gt;
./build-gtk build inkscape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enabling python effects =&lt;br /&gt;
moved to [[GettingEffectsWorking]]. They should work out of the box in the new versions anyway.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
== User Examples ==&lt;br /&gt;
* Adam Strzeleki has outlined some improvements to this process on the Inkscape [http://www.nabble.com/Inkscape-native-Mac-OS-X-build---look-improvements-td14733036.html email list]. See his screenshot from January 10, 2008 [http://www.nabble.com/attachment/14733036/1/Inkscape%20OSX%20PL.gif here].&lt;br /&gt;
* JiHO has a video of his builds [http://jo.irisson.free.fr/?p=34 here] and [http://jo.irisson.free.fr/?p=62 here].&lt;br /&gt;
&lt;br /&gt;
== Apple Documentation ==&lt;br /&gt;
* [http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html Introduction to Runtime Configuration] Covers the Info.plist files, Preferences, Environment variables and has a list of the most important Properties that the Property List should contain.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.sveinbjorn.org/platypus Sveinbjorn Thordarson's Website] The author of Platypus, the Script Exec wrapper that launches the Inkscape binary.&lt;br /&gt;
* [http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html  Creating OS X application bundles step by step] Covers the bundle concepts, copying libraries into the bundle, editing libraries with the install_name_tool, the Info.plist file and adding an icon.&lt;br /&gt;
* [http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ Bringing your Java Application to Mac OS X] I would regard this a little dated, and the detail is (unsurprisingly) Java-related, but it is a gentle introduction to the role of the .app bundle and give a most clear account of how to create one.&lt;br /&gt;
* The [http://gimp-app.sourceforge.net/gimp.app.howto.txt Gimp .app Howto] This is a very bare document, and would be of little help to you if you were new to making packages. Note that it seems to refer to a more mature Clipboard technique and Online help than we currently have; and we ought to move to parity in these areas.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39704</id>
		<title>CompilingMacOsX</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39704"/>
		<updated>2008-12-01T05:31:22Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Configuring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= For the impatient =&lt;br /&gt;
&lt;br /&gt;
1. Install [http://developer.apple.com/tools/xcode/ XCode tools] from your OS X installation DVD&lt;br /&gt;
&lt;br /&gt;
2. Download and install [http://www.macports.org/ MacPorts]&lt;br /&gt;
&lt;br /&gt;
3. In Terminal (Applications&amp;gt;Utilities&amp;gt;Terminal) type&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install cairo +pdf boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt poppler boost \ &lt;br /&gt;
 gnome-vfs libgnomeprintui automake autoconf subversion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: subversion is pre-installed on Leopard, so you may be fine leaving subversion out of the port install command chain.&lt;br /&gt;
&lt;br /&gt;
Grab a cup of coffee&lt;br /&gt;
&lt;br /&gt;
4. In Terminal, get and build Inkscape&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape&lt;br /&gt;
cd inkscape/packaging/macosx/&lt;br /&gt;
./osx-build.sh a c b i -s p&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voilà''. If you want to understand what you just did, read on.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
To compile Inkscape from source you need:&lt;br /&gt;
*Mac OS X &amp;gt; 10.3&lt;br /&gt;
*XCode Tools. They are on your installation DVD, in the optional installs, or can be download from [http://developer.apple.com/tools/xcode/ Apple Developer Connection]. You can customize the install to make it smaller (avoir documentation and example software for example). You need at least: gcc, XCode, X11SDK.&lt;br /&gt;
*Inkscape's source code. You can download an [http://www.inkscape.org/download.php official release source code], a [http://inkscape.modevia.com/svn-snap/?M=D development snapshot] or checkout a copy of the current state of the [http://www.inkscape.org/svn.php?lang=en SVN repository] using [http://subversion.tigris.org/ subversion]. Subversion comes pre-installed on Leopard. On previous system, subversion can be installed by package management systems (see point below) or with an OS X installer [http://homepage.mac.com/martinott/ package]&lt;br /&gt;
*A means of getting Inkscape's numerous dependencies: glibmm, gtkmm, lmcs, boehmgc... We recommend the use of [http://www.macports.org/ MacPorts] right now. ([http://www.finkproject.org/ Fink] was used in the past but it no longer meets Inkscape's needs currently.)&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with X11, using MacPorts [Recommended method]=&lt;br /&gt;
&lt;br /&gt;
== Installing dependencies ==&lt;br /&gt;
You can use MacPorts to list Inkscape dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;port deps inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some are mandatory and you can install them with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt boost gsl&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Others provide additional functionality to Inkscape:&lt;br /&gt;
* &amp;lt;code&amp;gt;gnome-vfs&amp;lt;/code&amp;gt; : access to remote servers, in particular import from Open Clipart Library&lt;br /&gt;
* &amp;lt;code&amp;gt;aspell&amp;lt;/code&amp;gt; : check spelling of text elements [Note: I have never seen it working on OS X, though at least it should install fine]&lt;br /&gt;
* &amp;lt;code&amp;gt;libgnomeprintui&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;loudmouth&amp;lt;/code&amp;gt; : jabber library used by InkBoard&lt;br /&gt;
* &amp;lt;code&amp;gt;cairo +pdf&amp;lt;/code&amp;gt; (cairo with the pdf variant) : better pdf export&lt;br /&gt;
* &amp;lt;code&amp;gt;poppler&amp;lt;/code&amp;gt; : better pdf import&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install gnome-vfs aspell libgnomeprintui loudmouth cairo +pdf poppler&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: Cairo was already installed at previous step as a GTK dependency. You need to either deactivate the old version and install this one, or directly write it on the command line above. &lt;br /&gt;
If you're unsure about MacPorts commands, you can find a guide that is easy to skim here: [http://guide.macports.org/ MacPorts Guide]&lt;br /&gt;
&lt;br /&gt;
In addition, Inkscape requires versions of the autotools more recent thant those that ship with OS X. Install them:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install autoconf automake&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More recent (Sep 2008) pre-packaged nightly builds for Mac OS X also feature additional dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install librsvg libwpd libwpg libcroco&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: At the time of editing (2008-12-01) there was a problem fetching &amp;quot;lzmautils&amp;quot; as the URL MacPorts tried to use as download source dies in a timeout. &lt;br /&gt;
As this package is needed as a dependency for one or more packages noted above you need to download the source tarball of lzmautils from somewhere else (for example, from [ftp://sunfreeware.mirrors.tds.net/pub/sunfreeware/SOURCES/lzma-4.32.7.tar.gz here]) and put that into the local MacPorts repository at &amp;quot;/opt/local/var/macports/distfiles/lzmautils&amp;quot;. You should now be able to run the commands above.&lt;br /&gt;
&lt;br /&gt;
Also make sure that you have &amp;quot;libxml2&amp;quot; and &amp;quot;libxslt&amp;quot; installed with MacPorts. This should have been installed previously, either directly or as a dependency.&lt;br /&gt;
You will need those later to compile the &amp;quot;lxml&amp;quot; Python module if you want to use Python effects. First check what's installed and if they are missing from your MacPorts repository install them by doing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;port installed&lt;br /&gt;
sudo port install libxml2 libxslt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pre-compiling the Python modules  ==&lt;br /&gt;
&lt;br /&gt;
If you cannot use the pre-built Python modules from [http://inkscape.modevia.com/macosx-snap/?C=M;O=D Modevia], say, because you're using an unsupported Python version or you just want to install from source you need to pre-compile both modules.&lt;br /&gt;
&lt;br /&gt;
In case you are using a Python version installed through MacPorts do a search for both modules and install the ones suitable for the Python version activated within MacPorts.&lt;br /&gt;
&amp;lt;pre&amp;gt;port search lxml numpy&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using Leopard's default Python 2.5.1 installation or a more recent one (e.g. MacPython 2.6) you will need to compile both modules outside of MacPorts. Download both modules from [http://pypi.python.org PyPI] if they are available there for your Python version. At the time of editing (2008-12-01) both modules were only available through SVN for Python 2.6.&lt;br /&gt;
&lt;br /&gt;
There are lots of tutorials for building and installing the &amp;quot;numpy&amp;quot; module. One good place to start looking is the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] entry referenced at the end of this guide. &lt;br /&gt;
&lt;br /&gt;
Building the &amp;quot;lxml&amp;quot; module deviates a little from the standard way, so if you cannot install it try the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/lxml/source&lt;br /&gt;
sudo python setup.py install --with-xslt-config=/opt/local/bin/xslt-config \ &lt;br /&gt;
--with-xml2-config=/opt/local/bin/xml2-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells it to use the libxml2 and libxslt packages we installed earlier with MacPorts.&lt;br /&gt;
&lt;br /&gt;
If you are compiling the Python modules outside of MacPorts you will need to make a mental note for after running the .app-bundle building script (detailed later in this guide) to copy the &amp;quot;lxml&amp;quot; and &amp;quot;numpy&amp;quot; dirs from the standard installation destination (by default &amp;quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages&amp;quot; for MacPython 2.6 and &amp;quot;/Library/Python/2.5/site-packages/&amp;quot; for Leopard's default Python 2.5.1 installation) to the &amp;quot;extensions&amp;quot; folder inside the Inkscape.app bundle (&amp;quot;Inkscape.app/Contents/Resources/extensions&amp;quot;).&lt;br /&gt;
This should take care of the &amp;quot;...needs fantastic libxml2 wrapper...&amp;quot; message when executing Python effects.&lt;br /&gt;
&lt;br /&gt;
For further info refer to the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] section of this wiki.&lt;br /&gt;
&lt;br /&gt;
== Setting the build environment ==&lt;br /&gt;
MacPorts's hierarchy (/opt/local/) is not searched for libraries by default. Therefore, before the configuration starts, some environment variables need to be set. The environment variables are presented in bash syntax here. &lt;br /&gt;
&amp;lt;pre&amp;gt;export LIBPREFIX=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$LIBPREFIX/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$LIBPREFIX/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$LIBPREFIX/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;lt;code&amp;gt;[http://en.wikipedia.org/wiki/Ccache ccache]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;sudo port install ccache&amp;lt;/code&amp;gt;) to speed up the compilation a bit. To do so, add compiler variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
If you compile Inkscape for the first time from an svn checkout you need to generate the configure script. Navigate to Inkscape's source directory and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;./autogen.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run configure with the options &amp;lt;code&amp;gt;--disable-static --enable-shared&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; which sets the directory where the build products are placed. It must be somewhere you have write access to.&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I you want to package Inkscape into a double-clickable &amp;lt;code&amp;gt;.app&amp;lt;/code&amp;gt; bundle in order to access it like a regular OS X application (you probably want to), you need to add the option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure {...} --enable-osxapp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have loudmouth installed and you want to enable whiteboard functionality in Inkscape, add &amp;lt;code&amp;gt;--enable-inkboard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other configuration options can be set, check the list of options by issuing:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's an example which covers most options that can be set:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/ --with-xft \&lt;br /&gt;
--with-gnome-vfs --with-python=/path/to/python/modules --enable-osxapp --enable-lcms \&lt;br /&gt;
--enable-poppler-cairo --enable-inkboard&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building and Installing ==&lt;br /&gt;
Just run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .app bundle ==&lt;br /&gt;
Assuming that you have used the &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; option during &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;, navigate to Mac OS X packaging directory in Inkscape source code and use the automated script:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&lt;br /&gt;
./osx-app.sh -s -b /path/to/install/prefix/bin/inkscape -p ../../Info.plist&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script copies Inkscape binary and all its dependencies into the app bundle. The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; options strips libraries from debugging information (the bundle is therefore smaller). Omit this option if you want to keep debugging info.&lt;br /&gt;
&lt;br /&gt;
== Creating a disk image to distribute Inkscape ==&lt;br /&gt;
Inkscape.app created at the previous step is completely independent from the original location of MacPorts libraries and can therefore be distributed. It will only work on your platform though (PPC or Intel) and incompatibilities are known between X11 versions on different major versions of OS X (Panther, Tiger and Leopard). The general rule is that versions are not backward compatible.&lt;br /&gt;
&lt;br /&gt;
The most widespread way of distributing applications on Mac OS X is via .dmg images. You can created a dmg image of Inkscape, with a nice background and all, using the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-dmg.sh -p Inkscape.app&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the packaging directory for Mac OS X (where your app bundle should be, otherwise modify the path to Inkscape.app).&lt;br /&gt;
&lt;br /&gt;
== Automated build script ==&lt;br /&gt;
All essential steps are automated by a build script: &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt;. It has built-in help so to know how to use it just type:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: Excluded steps involve Pre-compiliation of the Python modules and installing the additional nightly build features.&lt;br /&gt;
&lt;br /&gt;
= Compiling a Universal Binary of Inkscape with X11, using MacPorts=&lt;br /&gt;
&lt;br /&gt;
These instructions should work on both 10.4 and 10.5 machines with the latest Xcode version installed.&lt;br /&gt;
&lt;br /&gt;
== Update Macport sources ==&lt;br /&gt;
&lt;br /&gt;
The port descriptions in Macports do not currently all compile properly with their Universal variants.   For this reason, we currently use a modified set of some of the portfiles that will compile a universal libraries.  Work is being done to integrate these changes into Macports itself.&lt;br /&gt;
&lt;br /&gt;
You can use our modified portfiles by adding our ports to your sources:&lt;br /&gt;
&lt;br /&gt;
1. Checkout our ports directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/experimental/trunk/mjwybrow/ports ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit your sources list to include this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo vim /opt/local/etc/macports/sources.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
And add the following line *before* the existing rsync source:&lt;br /&gt;
&amp;lt;pre&amp;gt;file:///Users/YOURUSERNAME/directory/to/ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the portindex command in the checked-out port directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;portindex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run port sync&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal dependencies ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile Inkscape's essential dependencies as Universal libraries on either 10.4 or 10.5,  by giving the &amp;quot;+universal&amp;quot; option for each, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -v install poppler +universal gtk2 +universal ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have non-universal versions of these ports installed you may need to deactivate the port and rebuild it, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -f uninstall cairo&lt;br /&gt;
sudo port clean cairo&lt;br /&gt;
sudo port -v install cairo +universal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal Inkscape ==&lt;br /&gt;
&lt;br /&gt;
First, Set your SDK, 10.5 for Leopard, 10.4u for TIger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.5.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; (For Leopard)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.4u.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp;  (For Tiger)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, set up your environment to point to the Macports libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;export MACPORTS=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
export PATH=$MACPORTS/bin:$MACPORTS/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$MACPORTS/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$MACPORTS/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$MACPORTS/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall -isysroot $SDK -arch ppc -arch i386&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to configure and compile Inkscape.  Inkscape must be configured with the following options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;   Sets the correct path for Inkscape to be used from an .app bundle&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;--disable-dependency-tracking&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; Dependency tracking can't be user when compiling universal binaries.&lt;br /&gt;
&lt;br /&gt;
Inkscape can then be built (with make), installed, and packaged into a Universal .app bundle using the standard .app bundle building instruction above.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using MacPorts [experimental] =&lt;br /&gt;
This process is very similar to compiling an X11 version of Inkscape except for the building of dependencies: need to build native versions of Inkscape dependencies. At the moment (2007-12-17) this process does not produce a usable version of Inkscape but the more people try to use it, the quicker the bugs will be ironed out!&lt;br /&gt;
&lt;br /&gt;
== Native version of Inkscape dependencies ==&lt;br /&gt;
Thanks to the power of port &amp;quot;variants&amp;quot; and port &amp;quot;deactivation&amp;quot; you can install native versions of gtk, cairo, pango and such, alongside the regular X11 ones. To know which ports have a &amp;lt;code&amp;gt;quartz&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_x11&amp;lt;/code&amp;gt; variant, use the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;port list variant:quartz variant:no_x11&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you an idea of what need to be replaced.&lt;br /&gt;
&lt;br /&gt;
Assuming your MacPorts tree has been already used to build regular versions of Inkscape, you first need to deactivate (suppress from the tree without really uninstalling) the X11 versions of gtk, cairo, cairomm and pango:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port deactivate gtk2 cairo cairomm pango&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install native variants:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install cairo +quartz+pdf+no_x11 cairomm +quartz pango +no_x11 poppler +quartz gtk2 +quartz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than deactivating and reactivating ports, you can also keep two MacPorts trees side by side, provided you install the second one from source. Let say I want to install a new tree for native versions in /opt/local/native, I would do&lt;br /&gt;
&amp;lt;pre&amp;gt;export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin&lt;br /&gt;
cd ~/MacPorts-1.x.x/&lt;br /&gt;
./configure --prefix=/opt/local-native --with-tclpackage=/Library/Tcl/macports-native&lt;br /&gt;
make&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you need to have only one version of the port command in the path at any time so you need to setup your .bashrc (or .bash_profile or .profile) accordingly. I use shell aliases to quickly and temporarily switch to the universal version:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias portpathregular=&amp;quot;export PATH=/opt/local/bin:/opt/local/sbin:/Developer/Tools:/usr/local/bin: \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
alias portpathuniv=&amp;quot;export PATH=/opt/local-univ/bin:/opt/local-univ/sbin:/Developer/Tools:/usr/local/bin:  \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: the \ are just to mark line continuation here, suppress them and put everything in one line.&lt;br /&gt;
&lt;br /&gt;
== Install the rest ==&lt;br /&gt;
Eventually, follow the regular install procedure for the rest:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install libxslt boost boehmgc gtkmm lcms intltool popt&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your MacPorts tree was already ready to compile Inkscape, you should not need to reinstall anything, with the possible exception of gtkmm, which may need to be rebuilt against the native version of gtk rather than against the X11 one (please someone confirm this).&lt;br /&gt;
&lt;br /&gt;
Get inkscape source code and go in the mac OS X specific packaging directory&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&amp;lt;/pre&amp;gt;&lt;br /&gt;
There edit &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt; to remove the configure option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; because it puts inkscape in a .app bundle where it is started together with X11, which would defeat the purpose of this native compilation. You can also specify an alternative install prefix if you want. Then&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh u a c b i&amp;lt;/pre&amp;gt;&lt;br /&gt;
and a native version of Inkscape is installed in the prefix you specified or in the &amp;lt;code&amp;gt;Build/bin&amp;lt;/code&amp;gt; directory of Inkscape's source code. You can test it by&lt;br /&gt;
&amp;lt;pre&amp;gt; cd ../../Build/bin/&lt;br /&gt;
./inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: if you compiled a GTK theme engine against your old GTK install (i.e. the one with X11) and try to use it with the new install, it will complain, so edit &amp;lt;code&amp;gt;~/.gtkrc-2.0&amp;lt;/code&amp;gt; to remove the offending theme or recompile it with the new native GTK.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using the all in one build script [experimental] =&lt;br /&gt;
&lt;br /&gt;
To build a native-GTK build of Inkscape, GTK and some of its dependencies must be built with special options. You can do this using the build-gtk.sh script from the Inkscape repository (it's in packaging/macosx/native-gtk/).  This is a modified version of the Imendio native build script, found with instructions on this page:&lt;br /&gt;
http://developer.imendio.com/projects/gtk-macosx/build-instructions&lt;br /&gt;
&lt;br /&gt;
This process is relatively untested. If you have any troubles using this process then please report them to Michael Wybrow (mjwybrow on sourceforge).&lt;br /&gt;
&lt;br /&gt;
The process is:&lt;br /&gt;
&amp;lt;pre&amp;gt;export PREFIX=/your/install/prefix&lt;br /&gt;
./build-gtk bootstrap&lt;br /&gt;
./build-gtk build inkscape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enabling python effects =&lt;br /&gt;
moved to [[GettingEffectsWorking]]. They should work out of the box in the new versions anyway.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
== User Examples ==&lt;br /&gt;
* Adam Strzeleki has outlined some improvements to this process on the Inkscape [http://www.nabble.com/Inkscape-native-Mac-OS-X-build---look-improvements-td14733036.html email list]. See his screenshot from January 10, 2008 [http://www.nabble.com/attachment/14733036/1/Inkscape%20OSX%20PL.gif here].&lt;br /&gt;
* JiHO has a video of his builds [http://jo.irisson.free.fr/?p=34 here] and [http://jo.irisson.free.fr/?p=62 here].&lt;br /&gt;
&lt;br /&gt;
== Apple Documentation ==&lt;br /&gt;
* [http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html Introduction to Runtime Configuration] Covers the Info.plist files, Preferences, Environment variables and has a list of the most important Properties that the Property List should contain.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.sveinbjorn.org/platypus Sveinbjorn Thordarson's Website] The author of Platypus, the Script Exec wrapper that launches the Inkscape binary.&lt;br /&gt;
* [http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html  Creating OS X application bundles step by step] Covers the bundle concepts, copying libraries into the bundle, editing libraries with the install_name_tool, the Info.plist file and adding an icon.&lt;br /&gt;
* [http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ Bringing your Java Application to Mac OS X] I would regard this a little dated, and the detail is (unsurprisingly) Java-related, but it is a gentle introduction to the role of the .app bundle and give a most clear account of how to create one.&lt;br /&gt;
* The [http://gimp-app.sourceforge.net/gimp.app.howto.txt Gimp .app Howto] This is a very bare document, and would be of little help to you if you were new to making packages. Note that it seems to refer to a more mature Clipboard technique and Online help than we currently have; and we ought to move to parity in these areas.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39694</id>
		<title>CompilingMacOsX</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39694"/>
		<updated>2008-12-01T05:23:12Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Configuring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= For the impatient =&lt;br /&gt;
&lt;br /&gt;
1. Install [http://developer.apple.com/tools/xcode/ XCode tools] from your OS X installation DVD&lt;br /&gt;
&lt;br /&gt;
2. Download and install [http://www.macports.org/ MacPorts]&lt;br /&gt;
&lt;br /&gt;
3. In Terminal (Applications&amp;gt;Utilities&amp;gt;Terminal) type&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install cairo +pdf boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt poppler boost \ &lt;br /&gt;
 gnome-vfs libgnomeprintui automake autoconf subversion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: subversion is pre-installed on Leopard, so you may be fine leaving subversion out of the port install command chain.&lt;br /&gt;
&lt;br /&gt;
Grab a cup of coffee&lt;br /&gt;
&lt;br /&gt;
4. In Terminal, get and build Inkscape&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape&lt;br /&gt;
cd inkscape/packaging/macosx/&lt;br /&gt;
./osx-build.sh a c b i -s p&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voilà''. If you want to understand what you just did, read on.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
To compile Inkscape from source you need:&lt;br /&gt;
*Mac OS X &amp;gt; 10.3&lt;br /&gt;
*XCode Tools. They are on your installation DVD, in the optional installs, or can be download from [http://developer.apple.com/tools/xcode/ Apple Developer Connection]. You can customize the install to make it smaller (avoir documentation and example software for example). You need at least: gcc, XCode, X11SDK.&lt;br /&gt;
*Inkscape's source code. You can download an [http://www.inkscape.org/download.php official release source code], a [http://inkscape.modevia.com/svn-snap/?M=D development snapshot] or checkout a copy of the current state of the [http://www.inkscape.org/svn.php?lang=en SVN repository] using [http://subversion.tigris.org/ subversion]. Subversion comes pre-installed on Leopard. On previous system, subversion can be installed by package management systems (see point below) or with an OS X installer [http://homepage.mac.com/martinott/ package]&lt;br /&gt;
*A means of getting Inkscape's numerous dependencies: glibmm, gtkmm, lmcs, boehmgc... We recommend the use of [http://www.macports.org/ MacPorts] right now. ([http://www.finkproject.org/ Fink] was used in the past but it no longer meets Inkscape's needs currently.)&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with X11, using MacPorts [Recommended method]=&lt;br /&gt;
&lt;br /&gt;
== Installing dependencies ==&lt;br /&gt;
You can use MacPorts to list Inkscape dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;port deps inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some are mandatory and you can install them with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt boost gsl&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Others provide additional functionality to Inkscape:&lt;br /&gt;
* &amp;lt;code&amp;gt;gnome-vfs&amp;lt;/code&amp;gt; : access to remote servers, in particular import from Open Clipart Library&lt;br /&gt;
* &amp;lt;code&amp;gt;aspell&amp;lt;/code&amp;gt; : check spelling of text elements [Note: I have never seen it working on OS X, though at least it should install fine]&lt;br /&gt;
* &amp;lt;code&amp;gt;libgnomeprintui&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;loudmouth&amp;lt;/code&amp;gt; : jabber library used by InkBoard&lt;br /&gt;
* &amp;lt;code&amp;gt;cairo +pdf&amp;lt;/code&amp;gt; (cairo with the pdf variant) : better pdf export&lt;br /&gt;
* &amp;lt;code&amp;gt;poppler&amp;lt;/code&amp;gt; : better pdf import&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install gnome-vfs aspell libgnomeprintui loudmouth cairo +pdf poppler&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: Cairo was already installed at previous step as a GTK dependency. You need to either deactivate the old version and install this one, or directly write it on the command line above. &lt;br /&gt;
If you're unsure about MacPorts commands, you can find a guide that is easy to skim here: [http://guide.macports.org/ MacPorts Guide]&lt;br /&gt;
&lt;br /&gt;
In addition, Inkscape requires versions of the autotools more recent thant those that ship with OS X. Install them:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install autoconf automake&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More recent (Sep 2008) pre-packaged nightly builds for Mac OS X also feature additional dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install librsvg libwpd libwpg libcroco&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: At the time of editing (2008-12-01) there was a problem fetching &amp;quot;lzmautils&amp;quot; as the URL MacPorts tried to use as download source dies in a timeout. &lt;br /&gt;
As this package is needed as a dependency for one or more packages noted above you need to download the source tarball of lzmautils from somewhere else (for example, from [ftp://sunfreeware.mirrors.tds.net/pub/sunfreeware/SOURCES/lzma-4.32.7.tar.gz here]) and put that into the local MacPorts repository at &amp;quot;/opt/local/var/macports/distfiles/lzmautils&amp;quot;. You should now be able to run the commands above.&lt;br /&gt;
&lt;br /&gt;
Also make sure that you have &amp;quot;libxml2&amp;quot; and &amp;quot;libxslt&amp;quot; installed with MacPorts. This should have been installed previously, either directly or as a dependency.&lt;br /&gt;
You will need those later to compile the &amp;quot;lxml&amp;quot; Python module if you want to use Python effects. First check what's installed and if they are missing from your MacPorts repository install them by doing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;port installed&lt;br /&gt;
sudo port install libxml2 libxslt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pre-compiling the Python modules  ==&lt;br /&gt;
&lt;br /&gt;
If you cannot use the pre-built Python modules from [http://inkscape.modevia.com/macosx-snap/?C=M;O=D Modevia], say, because you're using an unsupported Python version or you just want to install from source you need to pre-compile both modules.&lt;br /&gt;
&lt;br /&gt;
In case you are using a Python version installed through MacPorts do a search for both modules and install the ones suitable for the Python version activated within MacPorts.&lt;br /&gt;
&amp;lt;pre&amp;gt;port search lxml numpy&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using Leopard's default Python 2.5.1 installation or a more recent one (e.g. MacPython 2.6) you will need to compile both modules outside of MacPorts. Download both modules from [http://pypi.python.org PyPI] if they are available there for your Python version. At the time of editing (2008-12-01) both modules were only available through SVN for Python 2.6.&lt;br /&gt;
&lt;br /&gt;
There are lots of tutorials for building and installing the &amp;quot;numpy&amp;quot; module. One good place to start looking is the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] entry referenced at the end of this guide. &lt;br /&gt;
&lt;br /&gt;
Building the &amp;quot;lxml&amp;quot; module deviates a little from the standard way, so if you cannot install it try the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/lxml/source&lt;br /&gt;
sudo python setup.py install --with-xslt-config=/opt/local/bin/xslt-config \ &lt;br /&gt;
--with-xml2-config=/opt/local/bin/xml2-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells it to use the libxml2 and libxslt packages we installed earlier with MacPorts.&lt;br /&gt;
&lt;br /&gt;
If you are compiling the Python modules outside of MacPorts you will need to make a mental note for after running the .app-bundle building script (detailed later in this guide) to copy the &amp;quot;lxml&amp;quot; and &amp;quot;numpy&amp;quot; dirs from the standard installation destination (by default &amp;quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages&amp;quot; for MacPython 2.6 and &amp;quot;/Library/Python/2.5/site-packages/&amp;quot; for Leopard's default Python 2.5.1 installation) to the &amp;quot;extensions&amp;quot; folder inside the Inkscape.app bundle (&amp;quot;Inkscape.app/Contents/Resources/extensions&amp;quot;).&lt;br /&gt;
This should take care of the &amp;quot;...needs fantastic libxml2 wrapper...&amp;quot; message when executing Python effects.&lt;br /&gt;
&lt;br /&gt;
For further info refer to the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] section of this wiki.&lt;br /&gt;
&lt;br /&gt;
== Setting the build environment ==&lt;br /&gt;
MacPorts's hierarchy (/opt/local/) is not searched for libraries by default. Therefore, before the configuration starts, some environment variables need to be set. The environment variables are presented in bash syntax here. &lt;br /&gt;
&amp;lt;pre&amp;gt;export LIBPREFIX=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$LIBPREFIX/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$LIBPREFIX/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$LIBPREFIX/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;lt;code&amp;gt;[http://en.wikipedia.org/wiki/Ccache ccache]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;sudo port install ccache&amp;lt;/code&amp;gt;) to speed up the compilation a bit. To do so, add compiler variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
If you compile Inkscape for the first time from an svn checkout you need to generate the configure script. Navigate to Inkscape's source directory and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;./autogen.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run configure with the options &amp;lt;code&amp;gt;--disable-static --enable-shared&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; which sets the directory where the build products are placed. It must be somewhere you have write access to.&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I you want to package Inkscape into a double-clickable &amp;lt;code&amp;gt;.app&amp;lt;/code&amp;gt; bundle in order to access it like a regular OS X application (you probably want to), you need to add the option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure {...} --enable-osxapp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have loudmouth installed and you want to enable whiteboard functionality in Inkscape, add &amp;lt;code&amp;gt;--enable-inkboard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other configuration options can be set, check the list of options by issuing:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's an example which covers most options that can be set:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/ --with-xft \&lt;br /&gt;
--with-gnome-vfs --with-python=/path/to/python/modules --enable-osxapp --enable-lcms --enable-poppler-cairo \&lt;br /&gt;
--enable-inkboard&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building and Installing ==&lt;br /&gt;
Just run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .app bundle ==&lt;br /&gt;
Assuming that you have used the &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; option during &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;, navigate to Mac OS X packaging directory in Inkscape source code and use the automated script:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&lt;br /&gt;
./osx-app.sh -s -b /path/to/install/prefix/bin/inkscape -p ../../Info.plist&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script copies Inkscape binary and all its dependencies into the app bundle. The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; options strips libraries from debugging information (the bundle is therefore smaller). Omit this option if you want to keep debugging info.&lt;br /&gt;
&lt;br /&gt;
== Creating a disk image to distribute Inkscape ==&lt;br /&gt;
Inkscape.app created at the previous step is completely independent from the original location of MacPorts libraries and can therefore be distributed. It will only work on your platform though (PPC or Intel) and incompatibilities are known between X11 versions on different major versions of OS X (Panther, Tiger and Leopard). The general rule is that versions are not backward compatible.&lt;br /&gt;
&lt;br /&gt;
The most widespread way of distributing applications on Mac OS X is via .dmg images. You can created a dmg image of Inkscape, with a nice background and all, using the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-dmg.sh -p Inkscape.app&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the packaging directory for Mac OS X (where your app bundle should be, otherwise modify the path to Inkscape.app).&lt;br /&gt;
&lt;br /&gt;
== Automated build script ==&lt;br /&gt;
All essential steps are automated by a build script: &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt;. It has built-in help so to know how to use it just type:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: Excluded steps involve Pre-compiliation of the Python modules and installing the additional nightly build features.&lt;br /&gt;
&lt;br /&gt;
= Compiling a Universal Binary of Inkscape with X11, using MacPorts=&lt;br /&gt;
&lt;br /&gt;
These instructions should work on both 10.4 and 10.5 machines with the latest Xcode version installed.&lt;br /&gt;
&lt;br /&gt;
== Update Macport sources ==&lt;br /&gt;
&lt;br /&gt;
The port descriptions in Macports do not currently all compile properly with their Universal variants.   For this reason, we currently use a modified set of some of the portfiles that will compile a universal libraries.  Work is being done to integrate these changes into Macports itself.&lt;br /&gt;
&lt;br /&gt;
You can use our modified portfiles by adding our ports to your sources:&lt;br /&gt;
&lt;br /&gt;
1. Checkout our ports directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/experimental/trunk/mjwybrow/ports ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit your sources list to include this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo vim /opt/local/etc/macports/sources.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
And add the following line *before* the existing rsync source:&lt;br /&gt;
&amp;lt;pre&amp;gt;file:///Users/YOURUSERNAME/directory/to/ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the portindex command in the checked-out port directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;portindex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run port sync&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal dependencies ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile Inkscape's essential dependencies as Universal libraries on either 10.4 or 10.5,  by giving the &amp;quot;+universal&amp;quot; option for each, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -v install poppler +universal gtk2 +universal ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have non-universal versions of these ports installed you may need to deactivate the port and rebuild it, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -f uninstall cairo&lt;br /&gt;
sudo port clean cairo&lt;br /&gt;
sudo port -v install cairo +universal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal Inkscape ==&lt;br /&gt;
&lt;br /&gt;
First, Set your SDK, 10.5 for Leopard, 10.4u for TIger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.5.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; (For Leopard)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.4u.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp;  (For Tiger)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, set up your environment to point to the Macports libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;export MACPORTS=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
export PATH=$MACPORTS/bin:$MACPORTS/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$MACPORTS/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$MACPORTS/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$MACPORTS/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall -isysroot $SDK -arch ppc -arch i386&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to configure and compile Inkscape.  Inkscape must be configured with the following options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;   Sets the correct path for Inkscape to be used from an .app bundle&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;--disable-dependency-tracking&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; Dependency tracking can't be user when compiling universal binaries.&lt;br /&gt;
&lt;br /&gt;
Inkscape can then be built (with make), installed, and packaged into a Universal .app bundle using the standard .app bundle building instruction above.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using MacPorts [experimental] =&lt;br /&gt;
This process is very similar to compiling an X11 version of Inkscape except for the building of dependencies: need to build native versions of Inkscape dependencies. At the moment (2007-12-17) this process does not produce a usable version of Inkscape but the more people try to use it, the quicker the bugs will be ironed out!&lt;br /&gt;
&lt;br /&gt;
== Native version of Inkscape dependencies ==&lt;br /&gt;
Thanks to the power of port &amp;quot;variants&amp;quot; and port &amp;quot;deactivation&amp;quot; you can install native versions of gtk, cairo, pango and such, alongside the regular X11 ones. To know which ports have a &amp;lt;code&amp;gt;quartz&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_x11&amp;lt;/code&amp;gt; variant, use the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;port list variant:quartz variant:no_x11&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you an idea of what need to be replaced.&lt;br /&gt;
&lt;br /&gt;
Assuming your MacPorts tree has been already used to build regular versions of Inkscape, you first need to deactivate (suppress from the tree without really uninstalling) the X11 versions of gtk, cairo, cairomm and pango:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port deactivate gtk2 cairo cairomm pango&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install native variants:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install cairo +quartz+pdf+no_x11 cairomm +quartz pango +no_x11 poppler +quartz gtk2 +quartz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than deactivating and reactivating ports, you can also keep two MacPorts trees side by side, provided you install the second one from source. Let say I want to install a new tree for native versions in /opt/local/native, I would do&lt;br /&gt;
&amp;lt;pre&amp;gt;export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin&lt;br /&gt;
cd ~/MacPorts-1.x.x/&lt;br /&gt;
./configure --prefix=/opt/local-native --with-tclpackage=/Library/Tcl/macports-native&lt;br /&gt;
make&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you need to have only one version of the port command in the path at any time so you need to setup your .bashrc (or .bash_profile or .profile) accordingly. I use shell aliases to quickly and temporarily switch to the universal version:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias portpathregular=&amp;quot;export PATH=/opt/local/bin:/opt/local/sbin:/Developer/Tools:/usr/local/bin: \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
alias portpathuniv=&amp;quot;export PATH=/opt/local-univ/bin:/opt/local-univ/sbin:/Developer/Tools:/usr/local/bin:  \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: the \ are just to mark line continuation here, suppress them and put everything in one line.&lt;br /&gt;
&lt;br /&gt;
== Install the rest ==&lt;br /&gt;
Eventually, follow the regular install procedure for the rest:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install libxslt boost boehmgc gtkmm lcms intltool popt&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your MacPorts tree was already ready to compile Inkscape, you should not need to reinstall anything, with the possible exception of gtkmm, which may need to be rebuilt against the native version of gtk rather than against the X11 one (please someone confirm this).&lt;br /&gt;
&lt;br /&gt;
Get inkscape source code and go in the mac OS X specific packaging directory&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&amp;lt;/pre&amp;gt;&lt;br /&gt;
There edit &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt; to remove the configure option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; because it puts inkscape in a .app bundle where it is started together with X11, which would defeat the purpose of this native compilation. You can also specify an alternative install prefix if you want. Then&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh u a c b i&amp;lt;/pre&amp;gt;&lt;br /&gt;
and a native version of Inkscape is installed in the prefix you specified or in the &amp;lt;code&amp;gt;Build/bin&amp;lt;/code&amp;gt; directory of Inkscape's source code. You can test it by&lt;br /&gt;
&amp;lt;pre&amp;gt; cd ../../Build/bin/&lt;br /&gt;
./inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: if you compiled a GTK theme engine against your old GTK install (i.e. the one with X11) and try to use it with the new install, it will complain, so edit &amp;lt;code&amp;gt;~/.gtkrc-2.0&amp;lt;/code&amp;gt; to remove the offending theme or recompile it with the new native GTK.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using the all in one build script [experimental] =&lt;br /&gt;
&lt;br /&gt;
To build a native-GTK build of Inkscape, GTK and some of its dependencies must be built with special options. You can do this using the build-gtk.sh script from the Inkscape repository (it's in packaging/macosx/native-gtk/).  This is a modified version of the Imendio native build script, found with instructions on this page:&lt;br /&gt;
http://developer.imendio.com/projects/gtk-macosx/build-instructions&lt;br /&gt;
&lt;br /&gt;
This process is relatively untested. If you have any troubles using this process then please report them to Michael Wybrow (mjwybrow on sourceforge).&lt;br /&gt;
&lt;br /&gt;
The process is:&lt;br /&gt;
&amp;lt;pre&amp;gt;export PREFIX=/your/install/prefix&lt;br /&gt;
./build-gtk bootstrap&lt;br /&gt;
./build-gtk build inkscape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enabling python effects =&lt;br /&gt;
moved to [[GettingEffectsWorking]]. They should work out of the box in the new versions anyway.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
== User Examples ==&lt;br /&gt;
* Adam Strzeleki has outlined some improvements to this process on the Inkscape [http://www.nabble.com/Inkscape-native-Mac-OS-X-build---look-improvements-td14733036.html email list]. See his screenshot from January 10, 2008 [http://www.nabble.com/attachment/14733036/1/Inkscape%20OSX%20PL.gif here].&lt;br /&gt;
* JiHO has a video of his builds [http://jo.irisson.free.fr/?p=34 here] and [http://jo.irisson.free.fr/?p=62 here].&lt;br /&gt;
&lt;br /&gt;
== Apple Documentation ==&lt;br /&gt;
* [http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html Introduction to Runtime Configuration] Covers the Info.plist files, Preferences, Environment variables and has a list of the most important Properties that the Property List should contain.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.sveinbjorn.org/platypus Sveinbjorn Thordarson's Website] The author of Platypus, the Script Exec wrapper that launches the Inkscape binary.&lt;br /&gt;
* [http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html  Creating OS X application bundles step by step] Covers the bundle concepts, copying libraries into the bundle, editing libraries with the install_name_tool, the Info.plist file and adding an icon.&lt;br /&gt;
* [http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ Bringing your Java Application to Mac OS X] I would regard this a little dated, and the detail is (unsurprisingly) Java-related, but it is a gentle introduction to the role of the .app bundle and give a most clear account of how to create one.&lt;br /&gt;
* The [http://gimp-app.sourceforge.net/gimp.app.howto.txt Gimp .app Howto] This is a very bare document, and would be of little help to you if you were new to making packages. Note that it seems to refer to a more mature Clipboard technique and Online help than we currently have; and we ought to move to parity in these areas.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39684</id>
		<title>CompilingMacOsX</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39684"/>
		<updated>2008-12-01T03:52:23Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Pre-compiling the Python modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= For the impatient =&lt;br /&gt;
&lt;br /&gt;
1. Install [http://developer.apple.com/tools/xcode/ XCode tools] from your OS X installation DVD&lt;br /&gt;
&lt;br /&gt;
2. Download and install [http://www.macports.org/ MacPorts]&lt;br /&gt;
&lt;br /&gt;
3. In Terminal (Applications&amp;gt;Utilities&amp;gt;Terminal) type&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install cairo +pdf boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt poppler boost \ &lt;br /&gt;
 gnome-vfs libgnomeprintui automake autoconf subversion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: subversion is pre-installed on Leopard, so you may be fine leaving subversion out of the port install command chain.&lt;br /&gt;
&lt;br /&gt;
Grab a cup of coffee&lt;br /&gt;
&lt;br /&gt;
4. In Terminal, get and build Inkscape&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape&lt;br /&gt;
cd inkscape/packaging/macosx/&lt;br /&gt;
./osx-build.sh a c b i -s p&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voilà''. If you want to understand what you just did, read on.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
To compile Inkscape from source you need:&lt;br /&gt;
*Mac OS X &amp;gt; 10.3&lt;br /&gt;
*XCode Tools. They are on your installation DVD, in the optional installs, or can be download from [http://developer.apple.com/tools/xcode/ Apple Developer Connection]. You can customize the install to make it smaller (avoir documentation and example software for example). You need at least: gcc, XCode, X11SDK.&lt;br /&gt;
*Inkscape's source code. You can download an [http://www.inkscape.org/download.php official release source code], a [http://inkscape.modevia.com/svn-snap/?M=D development snapshot] or checkout a copy of the current state of the [http://www.inkscape.org/svn.php?lang=en SVN repository] using [http://subversion.tigris.org/ subversion]. Subversion comes pre-installed on Leopard. On previous system, subversion can be installed by package management systems (see point below) or with an OS X installer [http://homepage.mac.com/martinott/ package]&lt;br /&gt;
*A means of getting Inkscape's numerous dependencies: glibmm, gtkmm, lmcs, boehmgc... We recommend the use of [http://www.macports.org/ MacPorts] right now. ([http://www.finkproject.org/ Fink] was used in the past but it no longer meets Inkscape's needs currently.)&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with X11, using MacPorts [Recommended method]=&lt;br /&gt;
&lt;br /&gt;
== Installing dependencies ==&lt;br /&gt;
You can use MacPorts to list Inkscape dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;port deps inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some are mandatory and you can install them with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt boost gsl&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Others provide additional functionality to Inkscape:&lt;br /&gt;
* &amp;lt;code&amp;gt;gnome-vfs&amp;lt;/code&amp;gt; : access to remote servers, in particular import from Open Clipart Library&lt;br /&gt;
* &amp;lt;code&amp;gt;aspell&amp;lt;/code&amp;gt; : check spelling of text elements [Note: I have never seen it working on OS X, though at least it should install fine]&lt;br /&gt;
* &amp;lt;code&amp;gt;libgnomeprintui&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;loudmouth&amp;lt;/code&amp;gt; : jabber library used by InkBoard&lt;br /&gt;
* &amp;lt;code&amp;gt;cairo +pdf&amp;lt;/code&amp;gt; (cairo with the pdf variant) : better pdf export&lt;br /&gt;
* &amp;lt;code&amp;gt;poppler&amp;lt;/code&amp;gt; : better pdf import&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install gnome-vfs aspell libgnomeprintui loudmouth cairo +pdf poppler&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: Cairo was already installed at previous step as a GTK dependency. You need to either deactivate the old version and install this one, or directly write it on the command line above. &lt;br /&gt;
If you're unsure about MacPorts commands, you can find a guide that is easy to skim here: [http://guide.macports.org/ MacPorts Guide]&lt;br /&gt;
&lt;br /&gt;
In addition, Inkscape requires versions of the autotools more recent thant those that ship with OS X. Install them:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install autoconf automake&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More recent (Sep 2008) pre-packaged nightly builds for Mac OS X also feature additional dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install librsvg libwpd libwpg libcroco&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: At the time of editing (2008-12-01) there was a problem fetching &amp;quot;lzmautils&amp;quot; as the URL MacPorts tried to use as download source dies in a timeout. &lt;br /&gt;
As this package is needed as a dependency for one or more packages noted above you need to download the source tarball of lzmautils from somewhere else (for example, from [ftp://sunfreeware.mirrors.tds.net/pub/sunfreeware/SOURCES/lzma-4.32.7.tar.gz here]) and put that into the local MacPorts repository at &amp;quot;/opt/local/var/macports/distfiles/lzmautils&amp;quot;. You should now be able to run the commands above.&lt;br /&gt;
&lt;br /&gt;
Also make sure that you have &amp;quot;libxml2&amp;quot; and &amp;quot;libxslt&amp;quot; installed with MacPorts. This should have been installed previously, either directly or as a dependency.&lt;br /&gt;
You will need those later to compile the &amp;quot;lxml&amp;quot; Python module if you want to use Python effects. First check what's installed and if they are missing from your MacPorts repository install them by doing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;port installed&lt;br /&gt;
sudo port install libxml2 libxslt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pre-compiling the Python modules  ==&lt;br /&gt;
&lt;br /&gt;
If you cannot use the pre-built Python modules from [http://inkscape.modevia.com/macosx-snap/?C=M;O=D Modevia], say, because you're using an unsupported Python version or you just want to install from source you need to pre-compile both modules.&lt;br /&gt;
&lt;br /&gt;
In case you are using a Python version installed through MacPorts do a search for both modules and install the ones suitable for the Python version activated within MacPorts.&lt;br /&gt;
&amp;lt;pre&amp;gt;port search lxml numpy&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using Leopard's default Python 2.5.1 installation or a more recent one (e.g. MacPython 2.6) you will need to compile both modules outside of MacPorts. Download both modules from [http://pypi.python.org PyPI] if they are available there for your Python version. At the time of editing (2008-12-01) both modules were only available through SVN for Python 2.6.&lt;br /&gt;
&lt;br /&gt;
There are lots of tutorials for building and installing the &amp;quot;numpy&amp;quot; module. One good place to start looking is the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] entry referenced at the end of this guide. &lt;br /&gt;
&lt;br /&gt;
Building the &amp;quot;lxml&amp;quot; module deviates a little from the standard way, so if you cannot install it try the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/lxml/source&lt;br /&gt;
sudo python setup.py install --with-xslt-config=/opt/local/bin/xslt-config \ &lt;br /&gt;
--with-xml2-config=/opt/local/bin/xml2-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells it to use the libxml2 and libxslt packages we installed earlier with MacPorts.&lt;br /&gt;
&lt;br /&gt;
If you are compiling the Python modules outside of MacPorts you will need to make a mental note for after running the .app-bundle building script (detailed later in this guide) to copy the &amp;quot;lxml&amp;quot; and &amp;quot;numpy&amp;quot; dirs from the standard installation destination (by default &amp;quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages&amp;quot; for MacPython 2.6 and &amp;quot;/Library/Python/2.5/site-packages/&amp;quot; for Leopard's default Python 2.5.1 installation) to the &amp;quot;extensions&amp;quot; folder inside the Inkscape.app bundle (&amp;quot;Inkscape.app/Contents/Resources/extensions&amp;quot;).&lt;br /&gt;
This should take care of the &amp;quot;...needs fantastic libxml2 wrapper...&amp;quot; message when executing Python effects.&lt;br /&gt;
&lt;br /&gt;
For further info refer to the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] section of this wiki.&lt;br /&gt;
&lt;br /&gt;
== Setting the build environment ==&lt;br /&gt;
MacPorts's hierarchy (/opt/local/) is not searched for libraries by default. Therefore, before the configuration starts, some environment variables need to be set. The environment variables are presented in bash syntax here. &lt;br /&gt;
&amp;lt;pre&amp;gt;export LIBPREFIX=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$LIBPREFIX/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$LIBPREFIX/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$LIBPREFIX/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;lt;code&amp;gt;[http://en.wikipedia.org/wiki/Ccache ccache]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;sudo port install ccache&amp;lt;/code&amp;gt;) to speed up the compilation a bit. To do so, add compiler variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
If you compile Inkscape for the first time from an svn checkout you need to generate the configure script. Navigate to Inkscape's source directory and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;./autogen.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run configure with the options &amp;lt;code&amp;gt;--disable-static --enable-shared&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; which sets the directory where the build products are placed. It must be somewhere you have write access to.&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I you want to package Inkscape into a double-clickable &amp;lt;code&amp;gt;.app&amp;lt;/code&amp;gt; bundle in order to access it like a regular OS X application (you probably want to), you need to add the option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure {...} --enable-osxapp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have loudmouth installed and you want to enable whiteboard functionality in Inkscape, add &amp;lt;code&amp;gt;--enable-inkboard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other configuration options can be set, check the list of options by issuing:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's an example which covers most options that can be set:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/ --with-xft \&lt;br /&gt;
--with-gnome-vfs --with-python --enable-osxapp --enable-lcms --enable-poppler-cairo \&lt;br /&gt;
--enable-inkboard&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building and Installing ==&lt;br /&gt;
Just run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .app bundle ==&lt;br /&gt;
Assuming that you have used the &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; option during &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;, navigate to Mac OS X packaging directory in Inkscape source code and use the automated script:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&lt;br /&gt;
./osx-app.sh -s -b /path/to/install/prefix/bin/inkscape -p ../../Info.plist&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script copies Inkscape binary and all its dependencies into the app bundle. The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; options strips libraries from debugging information (the bundle is therefore smaller). Omit this option if you want to keep debugging info.&lt;br /&gt;
&lt;br /&gt;
== Creating a disk image to distribute Inkscape ==&lt;br /&gt;
Inkscape.app created at the previous step is completely independent from the original location of MacPorts libraries and can therefore be distributed. It will only work on your platform though (PPC or Intel) and incompatibilities are known between X11 versions on different major versions of OS X (Panther, Tiger and Leopard). The general rule is that versions are not backward compatible.&lt;br /&gt;
&lt;br /&gt;
The most widespread way of distributing applications on Mac OS X is via .dmg images. You can created a dmg image of Inkscape, with a nice background and all, using the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-dmg.sh -p Inkscape.app&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the packaging directory for Mac OS X (where your app bundle should be, otherwise modify the path to Inkscape.app).&lt;br /&gt;
&lt;br /&gt;
== Automated build script ==&lt;br /&gt;
All essential steps are automated by a build script: &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt;. It has built-in help so to know how to use it just type:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: Excluded steps involve Pre-compiliation of the Python modules and installing the additional nightly build features.&lt;br /&gt;
&lt;br /&gt;
= Compiling a Universal Binary of Inkscape with X11, using MacPorts=&lt;br /&gt;
&lt;br /&gt;
These instructions should work on both 10.4 and 10.5 machines with the latest Xcode version installed.&lt;br /&gt;
&lt;br /&gt;
== Update Macport sources ==&lt;br /&gt;
&lt;br /&gt;
The port descriptions in Macports do not currently all compile properly with their Universal variants.   For this reason, we currently use a modified set of some of the portfiles that will compile a universal libraries.  Work is being done to integrate these changes into Macports itself.&lt;br /&gt;
&lt;br /&gt;
You can use our modified portfiles by adding our ports to your sources:&lt;br /&gt;
&lt;br /&gt;
1. Checkout our ports directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/experimental/trunk/mjwybrow/ports ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit your sources list to include this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo vim /opt/local/etc/macports/sources.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
And add the following line *before* the existing rsync source:&lt;br /&gt;
&amp;lt;pre&amp;gt;file:///Users/YOURUSERNAME/directory/to/ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the portindex command in the checked-out port directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;portindex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run port sync&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal dependencies ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile Inkscape's essential dependencies as Universal libraries on either 10.4 or 10.5,  by giving the &amp;quot;+universal&amp;quot; option for each, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -v install poppler +universal gtk2 +universal ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have non-universal versions of these ports installed you may need to deactivate the port and rebuild it, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -f uninstall cairo&lt;br /&gt;
sudo port clean cairo&lt;br /&gt;
sudo port -v install cairo +universal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal Inkscape ==&lt;br /&gt;
&lt;br /&gt;
First, Set your SDK, 10.5 for Leopard, 10.4u for TIger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.5.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; (For Leopard)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.4u.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp;  (For Tiger)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, set up your environment to point to the Macports libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;export MACPORTS=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
export PATH=$MACPORTS/bin:$MACPORTS/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$MACPORTS/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$MACPORTS/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$MACPORTS/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall -isysroot $SDK -arch ppc -arch i386&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to configure and compile Inkscape.  Inkscape must be configured with the following options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;   Sets the correct path for Inkscape to be used from an .app bundle&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;--disable-dependency-tracking&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; Dependency tracking can't be user when compiling universal binaries.&lt;br /&gt;
&lt;br /&gt;
Inkscape can then be built (with make), installed, and packaged into a Universal .app bundle using the standard .app bundle building instruction above.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using MacPorts [experimental] =&lt;br /&gt;
This process is very similar to compiling an X11 version of Inkscape except for the building of dependencies: need to build native versions of Inkscape dependencies. At the moment (2007-12-17) this process does not produce a usable version of Inkscape but the more people try to use it, the quicker the bugs will be ironed out!&lt;br /&gt;
&lt;br /&gt;
== Native version of Inkscape dependencies ==&lt;br /&gt;
Thanks to the power of port &amp;quot;variants&amp;quot; and port &amp;quot;deactivation&amp;quot; you can install native versions of gtk, cairo, pango and such, alongside the regular X11 ones. To know which ports have a &amp;lt;code&amp;gt;quartz&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_x11&amp;lt;/code&amp;gt; variant, use the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;port list variant:quartz variant:no_x11&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you an idea of what need to be replaced.&lt;br /&gt;
&lt;br /&gt;
Assuming your MacPorts tree has been already used to build regular versions of Inkscape, you first need to deactivate (suppress from the tree without really uninstalling) the X11 versions of gtk, cairo, cairomm and pango:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port deactivate gtk2 cairo cairomm pango&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install native variants:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install cairo +quartz+pdf+no_x11 cairomm +quartz pango +no_x11 poppler +quartz gtk2 +quartz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than deactivating and reactivating ports, you can also keep two MacPorts trees side by side, provided you install the second one from source. Let say I want to install a new tree for native versions in /opt/local/native, I would do&lt;br /&gt;
&amp;lt;pre&amp;gt;export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin&lt;br /&gt;
cd ~/MacPorts-1.x.x/&lt;br /&gt;
./configure --prefix=/opt/local-native --with-tclpackage=/Library/Tcl/macports-native&lt;br /&gt;
make&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you need to have only one version of the port command in the path at any time so you need to setup your .bashrc (or .bash_profile or .profile) accordingly. I use shell aliases to quickly and temporarily switch to the universal version:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias portpathregular=&amp;quot;export PATH=/opt/local/bin:/opt/local/sbin:/Developer/Tools:/usr/local/bin: \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
alias portpathuniv=&amp;quot;export PATH=/opt/local-univ/bin:/opt/local-univ/sbin:/Developer/Tools:/usr/local/bin:  \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: the \ are just to mark line continuation here, suppress them and put everything in one line.&lt;br /&gt;
&lt;br /&gt;
== Install the rest ==&lt;br /&gt;
Eventually, follow the regular install procedure for the rest:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install libxslt boost boehmgc gtkmm lcms intltool popt&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your MacPorts tree was already ready to compile Inkscape, you should not need to reinstall anything, with the possible exception of gtkmm, which may need to be rebuilt against the native version of gtk rather than against the X11 one (please someone confirm this).&lt;br /&gt;
&lt;br /&gt;
Get inkscape source code and go in the mac OS X specific packaging directory&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&amp;lt;/pre&amp;gt;&lt;br /&gt;
There edit &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt; to remove the configure option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; because it puts inkscape in a .app bundle where it is started together with X11, which would defeat the purpose of this native compilation. You can also specify an alternative install prefix if you want. Then&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh u a c b i&amp;lt;/pre&amp;gt;&lt;br /&gt;
and a native version of Inkscape is installed in the prefix you specified or in the &amp;lt;code&amp;gt;Build/bin&amp;lt;/code&amp;gt; directory of Inkscape's source code. You can test it by&lt;br /&gt;
&amp;lt;pre&amp;gt; cd ../../Build/bin/&lt;br /&gt;
./inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: if you compiled a GTK theme engine against your old GTK install (i.e. the one with X11) and try to use it with the new install, it will complain, so edit &amp;lt;code&amp;gt;~/.gtkrc-2.0&amp;lt;/code&amp;gt; to remove the offending theme or recompile it with the new native GTK.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using the all in one build script [experimental] =&lt;br /&gt;
&lt;br /&gt;
To build a native-GTK build of Inkscape, GTK and some of its dependencies must be built with special options. You can do this using the build-gtk.sh script from the Inkscape repository (it's in packaging/macosx/native-gtk/).  This is a modified version of the Imendio native build script, found with instructions on this page:&lt;br /&gt;
http://developer.imendio.com/projects/gtk-macosx/build-instructions&lt;br /&gt;
&lt;br /&gt;
This process is relatively untested. If you have any troubles using this process then please report them to Michael Wybrow (mjwybrow on sourceforge).&lt;br /&gt;
&lt;br /&gt;
The process is:&lt;br /&gt;
&amp;lt;pre&amp;gt;export PREFIX=/your/install/prefix&lt;br /&gt;
./build-gtk bootstrap&lt;br /&gt;
./build-gtk build inkscape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enabling python effects =&lt;br /&gt;
moved to [[GettingEffectsWorking]]. They should work out of the box in the new versions anyway.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
== User Examples ==&lt;br /&gt;
* Adam Strzeleki has outlined some improvements to this process on the Inkscape [http://www.nabble.com/Inkscape-native-Mac-OS-X-build---look-improvements-td14733036.html email list]. See his screenshot from January 10, 2008 [http://www.nabble.com/attachment/14733036/1/Inkscape%20OSX%20PL.gif here].&lt;br /&gt;
* JiHO has a video of his builds [http://jo.irisson.free.fr/?p=34 here] and [http://jo.irisson.free.fr/?p=62 here].&lt;br /&gt;
&lt;br /&gt;
== Apple Documentation ==&lt;br /&gt;
* [http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html Introduction to Runtime Configuration] Covers the Info.plist files, Preferences, Environment variables and has a list of the most important Properties that the Property List should contain.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.sveinbjorn.org/platypus Sveinbjorn Thordarson's Website] The author of Platypus, the Script Exec wrapper that launches the Inkscape binary.&lt;br /&gt;
* [http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html  Creating OS X application bundles step by step] Covers the bundle concepts, copying libraries into the bundle, editing libraries with the install_name_tool, the Info.plist file and adding an icon.&lt;br /&gt;
* [http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ Bringing your Java Application to Mac OS X] I would regard this a little dated, and the detail is (unsurprisingly) Java-related, but it is a gentle introduction to the role of the .app bundle and give a most clear account of how to create one.&lt;br /&gt;
* The [http://gimp-app.sourceforge.net/gimp.app.howto.txt Gimp .app Howto] This is a very bare document, and would be of little help to you if you were new to making packages. Note that it seems to refer to a more mature Clipboard technique and Online help than we currently have; and we ought to move to parity in these areas.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39674</id>
		<title>CompilingMacOsX</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39674"/>
		<updated>2008-12-01T03:32:50Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Pre-compiling the Python modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= For the impatient =&lt;br /&gt;
&lt;br /&gt;
1. Install [http://developer.apple.com/tools/xcode/ XCode tools] from your OS X installation DVD&lt;br /&gt;
&lt;br /&gt;
2. Download and install [http://www.macports.org/ MacPorts]&lt;br /&gt;
&lt;br /&gt;
3. In Terminal (Applications&amp;gt;Utilities&amp;gt;Terminal) type&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install cairo +pdf boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt poppler boost \ &lt;br /&gt;
 gnome-vfs libgnomeprintui automake autoconf subversion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: subversion is pre-installed on Leopard, so you may be fine leaving subversion out of the port install command chain.&lt;br /&gt;
&lt;br /&gt;
Grab a cup of coffee&lt;br /&gt;
&lt;br /&gt;
4. In Terminal, get and build Inkscape&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape&lt;br /&gt;
cd inkscape/packaging/macosx/&lt;br /&gt;
./osx-build.sh a c b i -s p&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voilà''. If you want to understand what you just did, read on.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
To compile Inkscape from source you need:&lt;br /&gt;
*Mac OS X &amp;gt; 10.3&lt;br /&gt;
*XCode Tools. They are on your installation DVD, in the optional installs, or can be download from [http://developer.apple.com/tools/xcode/ Apple Developer Connection]. You can customize the install to make it smaller (avoir documentation and example software for example). You need at least: gcc, XCode, X11SDK.&lt;br /&gt;
*Inkscape's source code. You can download an [http://www.inkscape.org/download.php official release source code], a [http://inkscape.modevia.com/svn-snap/?M=D development snapshot] or checkout a copy of the current state of the [http://www.inkscape.org/svn.php?lang=en SVN repository] using [http://subversion.tigris.org/ subversion]. Subversion comes pre-installed on Leopard. On previous system, subversion can be installed by package management systems (see point below) or with an OS X installer [http://homepage.mac.com/martinott/ package]&lt;br /&gt;
*A means of getting Inkscape's numerous dependencies: glibmm, gtkmm, lmcs, boehmgc... We recommend the use of [http://www.macports.org/ MacPorts] right now. ([http://www.finkproject.org/ Fink] was used in the past but it no longer meets Inkscape's needs currently.)&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with X11, using MacPorts [Recommended method]=&lt;br /&gt;
&lt;br /&gt;
== Installing dependencies ==&lt;br /&gt;
You can use MacPorts to list Inkscape dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;port deps inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some are mandatory and you can install them with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt boost gsl&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Others provide additional functionality to Inkscape:&lt;br /&gt;
* &amp;lt;code&amp;gt;gnome-vfs&amp;lt;/code&amp;gt; : access to remote servers, in particular import from Open Clipart Library&lt;br /&gt;
* &amp;lt;code&amp;gt;aspell&amp;lt;/code&amp;gt; : check spelling of text elements [Note: I have never seen it working on OS X, though at least it should install fine]&lt;br /&gt;
* &amp;lt;code&amp;gt;libgnomeprintui&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;loudmouth&amp;lt;/code&amp;gt; : jabber library used by InkBoard&lt;br /&gt;
* &amp;lt;code&amp;gt;cairo +pdf&amp;lt;/code&amp;gt; (cairo with the pdf variant) : better pdf export&lt;br /&gt;
* &amp;lt;code&amp;gt;poppler&amp;lt;/code&amp;gt; : better pdf import&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install gnome-vfs aspell libgnomeprintui loudmouth cairo +pdf poppler&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: Cairo was already installed at previous step as a GTK dependency. You need to either deactivate the old version and install this one, or directly write it on the command line above. &lt;br /&gt;
If you're unsure about MacPorts commands, you can find a guide that is easy to skim here: [http://guide.macports.org/ MacPorts Guide]&lt;br /&gt;
&lt;br /&gt;
In addition, Inkscape requires versions of the autotools more recent thant those that ship with OS X. Install them:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install autoconf automake&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More recent (Sep 2008) pre-packaged nightly builds for Mac OS X also feature additional dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install librsvg libwpd libwpg libcroco&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: At the time of editing (2008-12-01) there was a problem fetching &amp;quot;lzmautils&amp;quot; as the URL MacPorts tried to use as download source dies in a timeout. &lt;br /&gt;
As this package is needed as a dependency for one or more packages noted above you need to download the source tarball of lzmautils from somewhere else (for example, from [ftp://sunfreeware.mirrors.tds.net/pub/sunfreeware/SOURCES/lzma-4.32.7.tar.gz here]) and put that into the local MacPorts repository at &amp;quot;/opt/local/var/macports/distfiles/lzmautils&amp;quot;. You should now be able to run the commands above.&lt;br /&gt;
&lt;br /&gt;
Also make sure that you have &amp;quot;libxml2&amp;quot; and &amp;quot;libxslt&amp;quot; installed with MacPorts. This should have been installed previously, either directly or as a dependency.&lt;br /&gt;
You will need those later to compile the &amp;quot;lxml&amp;quot; Python module if you want to use Python effects. First check what's installed and if they are missing from your MacPorts repository install them by doing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;port installed&lt;br /&gt;
sudo port install libxml2 libxslt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pre-compiling the Python modules  ==&lt;br /&gt;
&lt;br /&gt;
If you cannot use the pre-built Python modules from [http://inkscape.modevia.com/macosx-snap/?C=M;O=D Modevia] (say, because you're using a different MacPorts Python version) you need to search MacPorts for both &amp;quot;numpy&amp;quot; and &amp;quot;lxml&amp;quot; and install the ones suitable for the Python version active within MacPorts.&lt;br /&gt;
&amp;lt;pre&amp;gt;port search lxml numpy&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using Leopard's default Python 2.5.1 installation or a more recent one (e.g. MacPython 2.6) you will need to compile both modules outside of MacPorts. Download both modules from [http://pypi.python.org PyPI] if they are available there for your Python version. At the time of editing (2008-12-01) both modules were only available through SVN for Python 2.6.&lt;br /&gt;
&lt;br /&gt;
There are lots of tutorials for building and installing the &amp;quot;numpy&amp;quot; module. One good place to start looking is the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] entry referenced at the end of this guide. &lt;br /&gt;
&lt;br /&gt;
Building the &amp;quot;lxml&amp;quot; module deviates a little from the standard way, so here is the command you need:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/lxml/source&lt;br /&gt;
sudo python setup.py install --with-xslt-config=/opt/local/bin/xslt-config \ &lt;br /&gt;
--with-xml2-config=/opt/local/bin/xml2-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells it to use the libxml2 and libxslt packages we installed earlier with MacPorts.&lt;br /&gt;
&lt;br /&gt;
If you are compiling the Python modules outside of MacPorts you will need to make a mental note for after running the .app-bundle building script (detailed later in this guide) to copy both the &amp;quot;lxml&amp;quot; and &amp;quot;numpy&amp;quot; dirs from the standard installation destination (by default &amp;quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages&amp;quot; for MacPython 2.6 and &amp;quot;/Library/Python/2.5/site-packages/&amp;quot; for Leopard's default Python 2.5.1 installation) to the &amp;quot;extensions&amp;quot; folder inside the Inkscape.app bundle (&amp;quot;Inkscape.app/Contents/Resources/extensions&amp;quot;).&lt;br /&gt;
This should take care of the &amp;quot;...needs fantastic libxml2 wrapper...&amp;quot; message when executing Python effects.&lt;br /&gt;
&lt;br /&gt;
For further info refer to the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] section of this wiki.&lt;br /&gt;
&lt;br /&gt;
== Setting the build environment ==&lt;br /&gt;
MacPorts's hierarchy (/opt/local/) is not searched for libraries by default. Therefore, before the configuration starts, some environment variables need to be set. The environment variables are presented in bash syntax here. &lt;br /&gt;
&amp;lt;pre&amp;gt;export LIBPREFIX=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$LIBPREFIX/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$LIBPREFIX/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$LIBPREFIX/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;lt;code&amp;gt;[http://en.wikipedia.org/wiki/Ccache ccache]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;sudo port install ccache&amp;lt;/code&amp;gt;) to speed up the compilation a bit. To do so, add compiler variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
If you compile Inkscape for the first time from an svn checkout you need to generate the configure script. Navigate to Inkscape's source directory and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;./autogen.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run configure with the options &amp;lt;code&amp;gt;--disable-static --enable-shared&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; which sets the directory where the build products are placed. It must be somewhere you have write access to.&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I you want to package Inkscape into a double-clickable &amp;lt;code&amp;gt;.app&amp;lt;/code&amp;gt; bundle in order to access it like a regular OS X application (you probably want to), you need to add the option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure {...} --enable-osxapp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have loudmouth installed and you want to enable whiteboard functionality in Inkscape, add &amp;lt;code&amp;gt;--enable-inkboard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other configuration options can be set, check the list of options by issuing:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's an example which covers most options that can be set:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/ --with-xft \&lt;br /&gt;
--with-gnome-vfs --with-python --enable-osxapp --enable-lcms --enable-poppler-cairo \&lt;br /&gt;
--enable-inkboard&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building and Installing ==&lt;br /&gt;
Just run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .app bundle ==&lt;br /&gt;
Assuming that you have used the &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; option during &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;, navigate to Mac OS X packaging directory in Inkscape source code and use the automated script:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&lt;br /&gt;
./osx-app.sh -s -b /path/to/install/prefix/bin/inkscape -p ../../Info.plist&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script copies Inkscape binary and all its dependencies into the app bundle. The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; options strips libraries from debugging information (the bundle is therefore smaller). Omit this option if you want to keep debugging info.&lt;br /&gt;
&lt;br /&gt;
== Creating a disk image to distribute Inkscape ==&lt;br /&gt;
Inkscape.app created at the previous step is completely independent from the original location of MacPorts libraries and can therefore be distributed. It will only work on your platform though (PPC or Intel) and incompatibilities are known between X11 versions on different major versions of OS X (Panther, Tiger and Leopard). The general rule is that versions are not backward compatible.&lt;br /&gt;
&lt;br /&gt;
The most widespread way of distributing applications on Mac OS X is via .dmg images. You can created a dmg image of Inkscape, with a nice background and all, using the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-dmg.sh -p Inkscape.app&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the packaging directory for Mac OS X (where your app bundle should be, otherwise modify the path to Inkscape.app).&lt;br /&gt;
&lt;br /&gt;
== Automated build script ==&lt;br /&gt;
All essential steps are automated by a build script: &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt;. It has built-in help so to know how to use it just type:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: Excluded steps involve Pre-compiliation of the Python modules and installing the additional nightly build features.&lt;br /&gt;
&lt;br /&gt;
= Compiling a Universal Binary of Inkscape with X11, using MacPorts=&lt;br /&gt;
&lt;br /&gt;
These instructions should work on both 10.4 and 10.5 machines with the latest Xcode version installed.&lt;br /&gt;
&lt;br /&gt;
== Update Macport sources ==&lt;br /&gt;
&lt;br /&gt;
The port descriptions in Macports do not currently all compile properly with their Universal variants.   For this reason, we currently use a modified set of some of the portfiles that will compile a universal libraries.  Work is being done to integrate these changes into Macports itself.&lt;br /&gt;
&lt;br /&gt;
You can use our modified portfiles by adding our ports to your sources:&lt;br /&gt;
&lt;br /&gt;
1. Checkout our ports directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/experimental/trunk/mjwybrow/ports ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit your sources list to include this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo vim /opt/local/etc/macports/sources.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
And add the following line *before* the existing rsync source:&lt;br /&gt;
&amp;lt;pre&amp;gt;file:///Users/YOURUSERNAME/directory/to/ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the portindex command in the checked-out port directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;portindex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run port sync&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal dependencies ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile Inkscape's essential dependencies as Universal libraries on either 10.4 or 10.5,  by giving the &amp;quot;+universal&amp;quot; option for each, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -v install poppler +universal gtk2 +universal ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have non-universal versions of these ports installed you may need to deactivate the port and rebuild it, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -f uninstall cairo&lt;br /&gt;
sudo port clean cairo&lt;br /&gt;
sudo port -v install cairo +universal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal Inkscape ==&lt;br /&gt;
&lt;br /&gt;
First, Set your SDK, 10.5 for Leopard, 10.4u for TIger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.5.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; (For Leopard)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.4u.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp;  (For Tiger)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, set up your environment to point to the Macports libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;export MACPORTS=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
export PATH=$MACPORTS/bin:$MACPORTS/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$MACPORTS/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$MACPORTS/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$MACPORTS/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall -isysroot $SDK -arch ppc -arch i386&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to configure and compile Inkscape.  Inkscape must be configured with the following options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;   Sets the correct path for Inkscape to be used from an .app bundle&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;--disable-dependency-tracking&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; Dependency tracking can't be user when compiling universal binaries.&lt;br /&gt;
&lt;br /&gt;
Inkscape can then be built (with make), installed, and packaged into a Universal .app bundle using the standard .app bundle building instruction above.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using MacPorts [experimental] =&lt;br /&gt;
This process is very similar to compiling an X11 version of Inkscape except for the building of dependencies: need to build native versions of Inkscape dependencies. At the moment (2007-12-17) this process does not produce a usable version of Inkscape but the more people try to use it, the quicker the bugs will be ironed out!&lt;br /&gt;
&lt;br /&gt;
== Native version of Inkscape dependencies ==&lt;br /&gt;
Thanks to the power of port &amp;quot;variants&amp;quot; and port &amp;quot;deactivation&amp;quot; you can install native versions of gtk, cairo, pango and such, alongside the regular X11 ones. To know which ports have a &amp;lt;code&amp;gt;quartz&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_x11&amp;lt;/code&amp;gt; variant, use the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;port list variant:quartz variant:no_x11&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you an idea of what need to be replaced.&lt;br /&gt;
&lt;br /&gt;
Assuming your MacPorts tree has been already used to build regular versions of Inkscape, you first need to deactivate (suppress from the tree without really uninstalling) the X11 versions of gtk, cairo, cairomm and pango:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port deactivate gtk2 cairo cairomm pango&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install native variants:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install cairo +quartz+pdf+no_x11 cairomm +quartz pango +no_x11 poppler +quartz gtk2 +quartz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than deactivating and reactivating ports, you can also keep two MacPorts trees side by side, provided you install the second one from source. Let say I want to install a new tree for native versions in /opt/local/native, I would do&lt;br /&gt;
&amp;lt;pre&amp;gt;export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin&lt;br /&gt;
cd ~/MacPorts-1.x.x/&lt;br /&gt;
./configure --prefix=/opt/local-native --with-tclpackage=/Library/Tcl/macports-native&lt;br /&gt;
make&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you need to have only one version of the port command in the path at any time so you need to setup your .bashrc (or .bash_profile or .profile) accordingly. I use shell aliases to quickly and temporarily switch to the universal version:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias portpathregular=&amp;quot;export PATH=/opt/local/bin:/opt/local/sbin:/Developer/Tools:/usr/local/bin: \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
alias portpathuniv=&amp;quot;export PATH=/opt/local-univ/bin:/opt/local-univ/sbin:/Developer/Tools:/usr/local/bin:  \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: the \ are just to mark line continuation here, suppress them and put everything in one line.&lt;br /&gt;
&lt;br /&gt;
== Install the rest ==&lt;br /&gt;
Eventually, follow the regular install procedure for the rest:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install libxslt boost boehmgc gtkmm lcms intltool popt&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your MacPorts tree was already ready to compile Inkscape, you should not need to reinstall anything, with the possible exception of gtkmm, which may need to be rebuilt against the native version of gtk rather than against the X11 one (please someone confirm this).&lt;br /&gt;
&lt;br /&gt;
Get inkscape source code and go in the mac OS X specific packaging directory&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&amp;lt;/pre&amp;gt;&lt;br /&gt;
There edit &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt; to remove the configure option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; because it puts inkscape in a .app bundle where it is started together with X11, which would defeat the purpose of this native compilation. You can also specify an alternative install prefix if you want. Then&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh u a c b i&amp;lt;/pre&amp;gt;&lt;br /&gt;
and a native version of Inkscape is installed in the prefix you specified or in the &amp;lt;code&amp;gt;Build/bin&amp;lt;/code&amp;gt; directory of Inkscape's source code. You can test it by&lt;br /&gt;
&amp;lt;pre&amp;gt; cd ../../Build/bin/&lt;br /&gt;
./inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: if you compiled a GTK theme engine against your old GTK install (i.e. the one with X11) and try to use it with the new install, it will complain, so edit &amp;lt;code&amp;gt;~/.gtkrc-2.0&amp;lt;/code&amp;gt; to remove the offending theme or recompile it with the new native GTK.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using the all in one build script [experimental] =&lt;br /&gt;
&lt;br /&gt;
To build a native-GTK build of Inkscape, GTK and some of its dependencies must be built with special options. You can do this using the build-gtk.sh script from the Inkscape repository (it's in packaging/macosx/native-gtk/).  This is a modified version of the Imendio native build script, found with instructions on this page:&lt;br /&gt;
http://developer.imendio.com/projects/gtk-macosx/build-instructions&lt;br /&gt;
&lt;br /&gt;
This process is relatively untested. If you have any troubles using this process then please report them to Michael Wybrow (mjwybrow on sourceforge).&lt;br /&gt;
&lt;br /&gt;
The process is:&lt;br /&gt;
&amp;lt;pre&amp;gt;export PREFIX=/your/install/prefix&lt;br /&gt;
./build-gtk bootstrap&lt;br /&gt;
./build-gtk build inkscape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enabling python effects =&lt;br /&gt;
moved to [[GettingEffectsWorking]]. They should work out of the box in the new versions anyway.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
== User Examples ==&lt;br /&gt;
* Adam Strzeleki has outlined some improvements to this process on the Inkscape [http://www.nabble.com/Inkscape-native-Mac-OS-X-build---look-improvements-td14733036.html email list]. See his screenshot from January 10, 2008 [http://www.nabble.com/attachment/14733036/1/Inkscape%20OSX%20PL.gif here].&lt;br /&gt;
* JiHO has a video of his builds [http://jo.irisson.free.fr/?p=34 here] and [http://jo.irisson.free.fr/?p=62 here].&lt;br /&gt;
&lt;br /&gt;
== Apple Documentation ==&lt;br /&gt;
* [http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html Introduction to Runtime Configuration] Covers the Info.plist files, Preferences, Environment variables and has a list of the most important Properties that the Property List should contain.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.sveinbjorn.org/platypus Sveinbjorn Thordarson's Website] The author of Platypus, the Script Exec wrapper that launches the Inkscape binary.&lt;br /&gt;
* [http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html  Creating OS X application bundles step by step] Covers the bundle concepts, copying libraries into the bundle, editing libraries with the install_name_tool, the Info.plist file and adding an icon.&lt;br /&gt;
* [http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ Bringing your Java Application to Mac OS X] I would regard this a little dated, and the detail is (unsurprisingly) Java-related, but it is a gentle introduction to the role of the .app bundle and give a most clear account of how to create one.&lt;br /&gt;
* The [http://gimp-app.sourceforge.net/gimp.app.howto.txt Gimp .app Howto] This is a very bare document, and would be of little help to you if you were new to making packages. Note that it seems to refer to a more mature Clipboard technique and Online help than we currently have; and we ought to move to parity in these areas.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Extension_requirements&amp;diff=39664</id>
		<title>Extension requirements</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Extension_requirements&amp;diff=39664"/>
		<updated>2008-12-01T03:26:10Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Binary packages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Setting Up Effects in Inkscape ==&lt;br /&gt;
&lt;br /&gt;
For effects to work you need to be using inkscape .42 or later.&lt;br /&gt;
&lt;br /&gt;
For info about what effects can do, screenshots, and how to make your own go to [http://www.ekips.org/comp/inkscape/ Aarons Site]&lt;br /&gt;
&lt;br /&gt;
If you are interested in opening special file formats through extensions, see  [[GettingExtensionsWorking]].&lt;br /&gt;
&lt;br /&gt;
=== Unhide the Effects menu ===&lt;br /&gt;
&lt;br /&gt;
This is only necessary in verions .41+CVS to .45.&lt;br /&gt;
&lt;br /&gt;
On the &amp;quot;Misc&amp;quot; tab of the &amp;quot;Inkscape Preferences&amp;quot; dialog check the box labeled &amp;quot;Enable script effects&amp;quot;. Close and reopen Inkscape&lt;br /&gt;
&lt;br /&gt;
== Python Effects ==&lt;br /&gt;
=== on Debian GNU / Linux ===&lt;br /&gt;
    apt-get install python python-xml&lt;br /&gt;
&lt;br /&gt;
=== on Microsoft Windows ===&lt;br /&gt;
&amp;lt;b&amp;gt;Important note: From version .44 onwards, Inkscape now includes python in the download, and has effects &amp;lt;i&amp;gt;enabled&amp;lt;/i&amp;gt; by default. Therefore these steps are outdated and no longer needed.&amp;lt;/b&amp;gt; &lt;br /&gt;
&lt;br /&gt;
# Download [http://www.python.org/download/ Python]&lt;br /&gt;
# Install  python and remember the directory you set it to install to. (e.g. C:\Python24 )&lt;br /&gt;
# Set your path variable in Windows. For Windows 2000 or XP read [http://support.microsoft.com/default.aspx?scid=kb;en-us;310519&amp;amp;sd=tech Microsofts instructions] or do&lt;br /&gt;
## Right Click My Computer&lt;br /&gt;
## Properties&lt;br /&gt;
## Advanced Tab&lt;br /&gt;
## Environment Variables&lt;br /&gt;
## In the system variables section select the one named PATH and hit edit.&lt;br /&gt;
## Find the end of all the values in there and add &amp;quot;;*path to python*&amp;quot; where *path to python* is the directory you told python to install to (ie c:\program files\python24)&lt;br /&gt;
## hit Ok, Ok, Apply&lt;br /&gt;
For more general instructions (including instructions for Windows 95,98,ME,NT,2000 and XP) look at the [http://www.chem.gla.ac.uk/%7Elouis/software/faq/q1.html University of Glasgow's] instructions, just remember that you want to set the PATH varable to the python directory. If there is already a path variable, don't delete it, but just add a semicolon and then the full path to the python directory at the end (e.g. PATH = C:\somthing else ; C:\python_directory)&lt;br /&gt;
# Reboot&lt;br /&gt;
# Download and Install [http://sourceforge.net/project/showfiles.php?group_id=6473 PyXML] for whatever version Python you chose to install&lt;br /&gt;
&lt;br /&gt;
To get the effects menu showing up:&lt;br /&gt;
# Load Inscape&lt;br /&gt;
# Go to File &amp;gt; Inkscape Preferences (Shift+Ctrl+P)&lt;br /&gt;
# Select the &amp;quot;Misc&amp;quot; tab and tick &amp;quot;Enable script effects...&amp;quot;&lt;br /&gt;
# Restart Inkscape &lt;br /&gt;
&lt;br /&gt;
If that didn't work, you may like to try to edit the preferences manually:&lt;br /&gt;
# Go to your preferences.xml file (Documents and Settings/USERNAME/Application Data/Inkscape/preferences.xml) &lt;br /&gt;
# Search for &amp;quot;id=&amp;quot;extensions&amp;quot;. &lt;br /&gt;
# If you find it: Add the following line above that &amp;quot;show-effects-menu=&amp;quot;1&amp;quot;. &lt;br /&gt;
# If you can't find it just add&lt;br /&gt;
     &amp;lt;group&lt;br /&gt;
     show-effects-menu=&amp;quot;1&amp;quot;&lt;br /&gt;
     id=&amp;quot;extensions&amp;quot; /&amp;gt;&lt;br /&gt;
Save the file, start up inkscape and use those sweet effects&lt;br /&gt;
&lt;br /&gt;
=== on Mac OS X ===&lt;br /&gt;
&lt;br /&gt;
Starting with version 0.46, Inkscape contains the python packages needed for the extension system. All python extensions should work out of the box. However in case you still have trouble you can install them in their regular location.&lt;br /&gt;
&lt;br /&gt;
==== Binary packages ====&lt;br /&gt;
&lt;br /&gt;
# Download and open http://inkscape.modevia.com/macosx-snap/Python-packages.dmg&lt;br /&gt;
# Browse the disk image to find the packages corresponding to your architecture and Python version &lt;br /&gt;
#* Your architecture is ppc if you have a G4-G5 based Mac, i386 if you have an Intel Mac&lt;br /&gt;
#* By default Panther and Tiger have Python 2.3 and Leopard has Python 2.5. If you have installed a newer version of Python we also provide packages for 2.4&lt;br /&gt;
# Copy all the files and folder from the appropriate location to your Python site-packages directory. By default the site-packages directory is /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages  on Panther and Tiger, /Library/Python/2.5/site-packages on Leopard. Otherwise it is somewhere in your custom install of python (/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/ for an install of Python 2.4 via MacPorts for example)&lt;br /&gt;
&lt;br /&gt;
==== Compiling from source ====&lt;br /&gt;
If you prefer, you can install them from source, it is really easy.&lt;br /&gt;
&lt;br /&gt;
# download the source code for [http://sourceforge.net/project/showfiles.php?group_id=1369&amp;amp;package_id=175103 sourceforge numpy repository] and/or [http://codespeak.net/lxml/index.html#download lxml download section]&lt;br /&gt;
# unpack the &amp;lt;code&amp;gt;.tar.gz&amp;lt;/code&amp;gt; file &amp;lt;pre&amp;gt;tar -xzf numpy***.tar.gz lxml***.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# for each one &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the newly created directory&lt;br /&gt;
# build C extensions and install (the install is system wide so you need administrator privileges)&amp;lt;pre&amp;gt;sudo python setup.py install&amp;lt;/pre&amp;gt;and type your password.&lt;br /&gt;
&lt;br /&gt;
The packages are installed in the site-packages directory of your Python install. This is /Library/Python/2.*/site-packages for the stock install of Python on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
== Perl Effects ==&lt;br /&gt;
=== on Debian GNU / Linux ===&lt;br /&gt;
    apt-get install perl libxml-xql-perl&lt;br /&gt;
&lt;br /&gt;
=== on Gentoo GNU / Linux ===&lt;br /&gt;
    emerge -a XML-XQL&lt;br /&gt;
&lt;br /&gt;
=== on Microsoft Windows ===&lt;br /&gt;
    install [http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl [[ActivePerl]]]&lt;br /&gt;
    install XML::XQL::DOM (perhaps like this?)&lt;br /&gt;
        1: install prereqs with ppm:&lt;br /&gt;
 	    install xml-dom&lt;br /&gt;
 	    install parse-yapp&lt;br /&gt;
 	    install datemanip&lt;br /&gt;
        2: download xml-xql from:&lt;br /&gt;
 	    http://www.cpan.org/authors/id/T/TJ/TJMATHER/XML-XQL-0.68.tar.gz&lt;br /&gt;
        3: open command prompt and locate perl&amp;quot;s lib directory with:&lt;br /&gt;
 	    perl -e &amp;quot;print qq(@INC)&amp;quot;    (mine was C:[[/Perl/site/lib]])&lt;br /&gt;
        4: unpack xml-xql archive&lt;br /&gt;
        5: copy contents of XML-XQL-*\lib\XML into C:\Perl\site\lib\XML&lt;br /&gt;
        6: copy XML-XQL-*\XQLParser\Parser.pm to C:\Perl\site\lib\XML\XQL&lt;br /&gt;
&lt;br /&gt;
== Plugin Effects ==&lt;br /&gt;
I have absolutely no idea. Please record your success here. :)&lt;br /&gt;
&lt;br /&gt;
== What if it doesn't work? ==&lt;br /&gt;
Run Inkscape from the console&lt;br /&gt;
&lt;br /&gt;
Use the error messges printed to the console to diagnose the problem (very often missing dependencies)&lt;br /&gt;
&lt;br /&gt;
On Windows you will have to redirect output to a text file like this: &amp;quot;inkscape &amp;gt; output.txt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Extensions]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=Extension_requirements&amp;diff=39654</id>
		<title>Extension requirements</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=Extension_requirements&amp;diff=39654"/>
		<updated>2008-12-01T03:22:51Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Compiling from source */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Setting Up Effects in Inkscape ==&lt;br /&gt;
&lt;br /&gt;
For effects to work you need to be using inkscape .42 or later.&lt;br /&gt;
&lt;br /&gt;
For info about what effects can do, screenshots, and how to make your own go to [http://www.ekips.org/comp/inkscape/ Aarons Site]&lt;br /&gt;
&lt;br /&gt;
If you are interested in opening special file formats through extensions, see  [[GettingExtensionsWorking]].&lt;br /&gt;
&lt;br /&gt;
=== Unhide the Effects menu ===&lt;br /&gt;
&lt;br /&gt;
This is only necessary in verions .41+CVS to .45.&lt;br /&gt;
&lt;br /&gt;
On the &amp;quot;Misc&amp;quot; tab of the &amp;quot;Inkscape Preferences&amp;quot; dialog check the box labeled &amp;quot;Enable script effects&amp;quot;. Close and reopen Inkscape&lt;br /&gt;
&lt;br /&gt;
== Python Effects ==&lt;br /&gt;
=== on Debian GNU / Linux ===&lt;br /&gt;
    apt-get install python python-xml&lt;br /&gt;
&lt;br /&gt;
=== on Microsoft Windows ===&lt;br /&gt;
&amp;lt;b&amp;gt;Important note: From version .44 onwards, Inkscape now includes python in the download, and has effects &amp;lt;i&amp;gt;enabled&amp;lt;/i&amp;gt; by default. Therefore these steps are outdated and no longer needed.&amp;lt;/b&amp;gt; &lt;br /&gt;
&lt;br /&gt;
# Download [http://www.python.org/download/ Python]&lt;br /&gt;
# Install  python and remember the directory you set it to install to. (e.g. C:\Python24 )&lt;br /&gt;
# Set your path variable in Windows. For Windows 2000 or XP read [http://support.microsoft.com/default.aspx?scid=kb;en-us;310519&amp;amp;sd=tech Microsofts instructions] or do&lt;br /&gt;
## Right Click My Computer&lt;br /&gt;
## Properties&lt;br /&gt;
## Advanced Tab&lt;br /&gt;
## Environment Variables&lt;br /&gt;
## In the system variables section select the one named PATH and hit edit.&lt;br /&gt;
## Find the end of all the values in there and add &amp;quot;;*path to python*&amp;quot; where *path to python* is the directory you told python to install to (ie c:\program files\python24)&lt;br /&gt;
## hit Ok, Ok, Apply&lt;br /&gt;
For more general instructions (including instructions for Windows 95,98,ME,NT,2000 and XP) look at the [http://www.chem.gla.ac.uk/%7Elouis/software/faq/q1.html University of Glasgow's] instructions, just remember that you want to set the PATH varable to the python directory. If there is already a path variable, don't delete it, but just add a semicolon and then the full path to the python directory at the end (e.g. PATH = C:\somthing else ; C:\python_directory)&lt;br /&gt;
# Reboot&lt;br /&gt;
# Download and Install [http://sourceforge.net/project/showfiles.php?group_id=6473 PyXML] for whatever version Python you chose to install&lt;br /&gt;
&lt;br /&gt;
To get the effects menu showing up:&lt;br /&gt;
# Load Inscape&lt;br /&gt;
# Go to File &amp;gt; Inkscape Preferences (Shift+Ctrl+P)&lt;br /&gt;
# Select the &amp;quot;Misc&amp;quot; tab and tick &amp;quot;Enable script effects...&amp;quot;&lt;br /&gt;
# Restart Inkscape &lt;br /&gt;
&lt;br /&gt;
If that didn't work, you may like to try to edit the preferences manually:&lt;br /&gt;
# Go to your preferences.xml file (Documents and Settings/USERNAME/Application Data/Inkscape/preferences.xml) &lt;br /&gt;
# Search for &amp;quot;id=&amp;quot;extensions&amp;quot;. &lt;br /&gt;
# If you find it: Add the following line above that &amp;quot;show-effects-menu=&amp;quot;1&amp;quot;. &lt;br /&gt;
# If you can't find it just add&lt;br /&gt;
     &amp;lt;group&lt;br /&gt;
     show-effects-menu=&amp;quot;1&amp;quot;&lt;br /&gt;
     id=&amp;quot;extensions&amp;quot; /&amp;gt;&lt;br /&gt;
Save the file, start up inkscape and use those sweet effects&lt;br /&gt;
&lt;br /&gt;
=== on Mac OS X ===&lt;br /&gt;
&lt;br /&gt;
Starting with version 0.46, Inkscape contains the python packages needed for the extension system. All python extensions should work out of the box. However in case you still have trouble you can install them in their regular location.&lt;br /&gt;
&lt;br /&gt;
==== Binary packages ====&lt;br /&gt;
&lt;br /&gt;
# Download and open http://inkscape.modevia.com/macosx-snap/Python-packages.dmg&lt;br /&gt;
# Browse the disk image to find the packages corresponding to your architecture and Python version &lt;br /&gt;
#* Your architecture is ppc if you have a G4-G5 based Mac, i386 if you have an Intel Mac&lt;br /&gt;
#* By default Panther and Tiger have Python 2.3 and Leopard has Python 2.5. If you have installed a newer version of Python we also provide packages for 2.4&lt;br /&gt;
# Copy all the files and folder from the appropriate location to your Python site-packages directory. By default the site-packages directory is /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages  on Panther and Tiger, /Library/Python/2.5/site-packages on Leopard. Otherwise it is somewhere in your custom install of python (/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/ for and install of Python 2.4 via MacPorts for example)&lt;br /&gt;
&lt;br /&gt;
==== Compiling from source ====&lt;br /&gt;
If you prefer, you can install them from source, it is really easy.&lt;br /&gt;
&lt;br /&gt;
# download the source code for [http://sourceforge.net/project/showfiles.php?group_id=1369&amp;amp;package_id=175103 sourceforge numpy repository] and/or [http://codespeak.net/lxml/index.html#download lxml download section]&lt;br /&gt;
# unpack the &amp;lt;code&amp;gt;.tar.gz&amp;lt;/code&amp;gt; file &amp;lt;pre&amp;gt;tar -xzf numpy***.tar.gz lxml***.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
# for each one &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; into the newly created directory&lt;br /&gt;
# build C extensions and install (the install is system wide so you need administrator privileges)&amp;lt;pre&amp;gt;sudo python setup.py install&amp;lt;/pre&amp;gt;and type your password.&lt;br /&gt;
&lt;br /&gt;
The packages are installed in the site-packages directory of your Python install. This is /Library/Python/2.*/site-packages for the stock install of Python on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
== Perl Effects ==&lt;br /&gt;
=== on Debian GNU / Linux ===&lt;br /&gt;
    apt-get install perl libxml-xql-perl&lt;br /&gt;
&lt;br /&gt;
=== on Gentoo GNU / Linux ===&lt;br /&gt;
    emerge -a XML-XQL&lt;br /&gt;
&lt;br /&gt;
=== on Microsoft Windows ===&lt;br /&gt;
    install [http://www.activestate.com/Products/Download/Download.plex?id=ActivePerl [[ActivePerl]]]&lt;br /&gt;
    install XML::XQL::DOM (perhaps like this?)&lt;br /&gt;
        1: install prereqs with ppm:&lt;br /&gt;
 	    install xml-dom&lt;br /&gt;
 	    install parse-yapp&lt;br /&gt;
 	    install datemanip&lt;br /&gt;
        2: download xml-xql from:&lt;br /&gt;
 	    http://www.cpan.org/authors/id/T/TJ/TJMATHER/XML-XQL-0.68.tar.gz&lt;br /&gt;
        3: open command prompt and locate perl&amp;quot;s lib directory with:&lt;br /&gt;
 	    perl -e &amp;quot;print qq(@INC)&amp;quot;    (mine was C:[[/Perl/site/lib]])&lt;br /&gt;
        4: unpack xml-xql archive&lt;br /&gt;
        5: copy contents of XML-XQL-*\lib\XML into C:\Perl\site\lib\XML&lt;br /&gt;
        6: copy XML-XQL-*\XQLParser\Parser.pm to C:\Perl\site\lib\XML\XQL&lt;br /&gt;
&lt;br /&gt;
== Plugin Effects ==&lt;br /&gt;
I have absolutely no idea. Please record your success here. :)&lt;br /&gt;
&lt;br /&gt;
== What if it doesn't work? ==&lt;br /&gt;
Run Inkscape from the console&lt;br /&gt;
&lt;br /&gt;
Use the error messges printed to the console to diagnose the problem (very often missing dependencies)&lt;br /&gt;
&lt;br /&gt;
On Windows you will have to redirect output to a text file like this: &amp;quot;inkscape &amp;gt; output.txt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Extensions]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39644</id>
		<title>CompilingMacOsX</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39644"/>
		<updated>2008-12-01T03:20:34Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Pre-compiling the Python modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= For the impatient =&lt;br /&gt;
&lt;br /&gt;
1. Install [http://developer.apple.com/tools/xcode/ XCode tools] from your OS X installation DVD&lt;br /&gt;
&lt;br /&gt;
2. Download and install [http://www.macports.org/ MacPorts]&lt;br /&gt;
&lt;br /&gt;
3. In Terminal (Applications&amp;gt;Utilities&amp;gt;Terminal) type&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install cairo +pdf boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt poppler boost \ &lt;br /&gt;
 gnome-vfs libgnomeprintui automake autoconf subversion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: subversion is pre-installed on Leopard, so you may be fine leaving subversion out of the port install command chain.&lt;br /&gt;
&lt;br /&gt;
Grab a cup of coffee&lt;br /&gt;
&lt;br /&gt;
4. In Terminal, get and build Inkscape&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape&lt;br /&gt;
cd inkscape/packaging/macosx/&lt;br /&gt;
./osx-build.sh a c b i -s p&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voilà''. If you want to understand what you just did, read on.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
To compile Inkscape from source you need:&lt;br /&gt;
*Mac OS X &amp;gt; 10.3&lt;br /&gt;
*XCode Tools. They are on your installation DVD, in the optional installs, or can be download from [http://developer.apple.com/tools/xcode/ Apple Developer Connection]. You can customize the install to make it smaller (avoir documentation and example software for example). You need at least: gcc, XCode, X11SDK.&lt;br /&gt;
*Inkscape's source code. You can download an [http://www.inkscape.org/download.php official release source code], a [http://inkscape.modevia.com/svn-snap/?M=D development snapshot] or checkout a copy of the current state of the [http://www.inkscape.org/svn.php?lang=en SVN repository] using [http://subversion.tigris.org/ subversion]. Subversion comes pre-installed on Leopard. On previous system, subversion can be installed by package management systems (see point below) or with an OS X installer [http://homepage.mac.com/martinott/ package]&lt;br /&gt;
*A means of getting Inkscape's numerous dependencies: glibmm, gtkmm, lmcs, boehmgc... We recommend the use of [http://www.macports.org/ MacPorts] right now. ([http://www.finkproject.org/ Fink] was used in the past but it no longer meets Inkscape's needs currently.)&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with X11, using MacPorts [Recommended method]=&lt;br /&gt;
&lt;br /&gt;
== Installing dependencies ==&lt;br /&gt;
You can use MacPorts to list Inkscape dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;port deps inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some are mandatory and you can install them with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt boost gsl&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Others provide additional functionality to Inkscape:&lt;br /&gt;
* &amp;lt;code&amp;gt;gnome-vfs&amp;lt;/code&amp;gt; : access to remote servers, in particular import from Open Clipart Library&lt;br /&gt;
* &amp;lt;code&amp;gt;aspell&amp;lt;/code&amp;gt; : check spelling of text elements [Note: I have never seen it working on OS X, though at least it should install fine]&lt;br /&gt;
* &amp;lt;code&amp;gt;libgnomeprintui&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;loudmouth&amp;lt;/code&amp;gt; : jabber library used by InkBoard&lt;br /&gt;
* &amp;lt;code&amp;gt;cairo +pdf&amp;lt;/code&amp;gt; (cairo with the pdf variant) : better pdf export&lt;br /&gt;
* &amp;lt;code&amp;gt;poppler&amp;lt;/code&amp;gt; : better pdf import&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install gnome-vfs aspell libgnomeprintui loudmouth cairo +pdf poppler&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: Cairo was already installed at previous step as a GTK dependency. You need to either deactivate the old version and install this one, or directly write it on the command line above. &lt;br /&gt;
If you're unsure about MacPorts commands, you can find a guide that is easy to skim here: [http://guide.macports.org/ MacPorts Guide]&lt;br /&gt;
&lt;br /&gt;
In addition, Inkscape requires versions of the autotools more recent thant those that ship with OS X. Install them:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install autoconf automake&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More recent (Sep 2008) pre-packaged nightly builds for Mac OS X also feature additional dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install librsvg libwpd libwpg libcroco&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: At the time of editing (2008-12-01) there was a problem fetching &amp;quot;lzmautils&amp;quot; as the URL MacPorts tried to use as download source dies in a timeout. &lt;br /&gt;
As this package is needed as a dependency for one or more packages noted above you need to download the source tarball of lzmautils from somewhere else (for example, from [ftp://sunfreeware.mirrors.tds.net/pub/sunfreeware/SOURCES/lzma-4.32.7.tar.gz here]) and put that into the local MacPorts repository at &amp;quot;/opt/local/var/macports/distfiles/lzmautils&amp;quot;. You should now be able to run the commands above.&lt;br /&gt;
&lt;br /&gt;
Also make sure that you have &amp;quot;libxml2&amp;quot; and &amp;quot;libxslt&amp;quot; installed with MacPorts. This should have been installed previously, either directly or as a dependency.&lt;br /&gt;
You will need those later to compile the &amp;quot;lxml&amp;quot; Python module if you want to use Python effects. First check what's installed and if they are missing from your MacPorts repository install them by doing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;port installed&lt;br /&gt;
sudo port install libxml2 libxslt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pre-compiling the Python modules  ==&lt;br /&gt;
&lt;br /&gt;
If you cannot use the pre-built Python modules from [http://inkscape.modevia.com/macosx-snap/?C=M;O=D Modevia] (say, because you're using a different Python version) you need to search MacPorts for both &amp;quot;numpy&amp;quot; and &amp;quot;lxml&amp;quot; and install the ones suitable for the Python version active within MacPorts.&lt;br /&gt;
&amp;lt;pre&amp;gt;port search lxml numpy&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using a more recent Python version (say, MacPython 2.6) you will need to compile both modules outside of MacPorts. Download both modules from [http://pypi.python.org PyPI] if they are available there for Python 2.6. At the time of editing (2008-12-01) however both modules were only available through SVN for Python 2.6.&lt;br /&gt;
&lt;br /&gt;
There are lots of tutorials for building and installing the &amp;quot;numpy&amp;quot; module. One good place to start looking is the [[GettingEffectsWorking#on_Mac_OS_X|Getting Effects Working]] entry referenced at the end of this guide. &lt;br /&gt;
&lt;br /&gt;
Building the &amp;quot;lxml&amp;quot; module deviates a little from the standard way, so here is the command you need:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/lxml/source&lt;br /&gt;
sudo python setup.py install --with-xslt-config=/opt/local/bin/xslt-config \ &lt;br /&gt;
--with-xml2-config=/opt/local/bin/xml2-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells it to use the libxml2 and libxslt packages we installed earlier with MacPorts.&lt;br /&gt;
&lt;br /&gt;
If you are compiling the Python modules outside of MacPorts you will need to make a mental note for after running the .app-bundle building script (detailed later in this guide) to copy both the &amp;quot;lxml&amp;quot; and &amp;quot;numpy&amp;quot; dir from the standard installation destination (normally &amp;quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages&amp;quot; for MacPython 2.6 and &amp;quot;/System/Library/Frameworks/Python.framework/Versions/Current/Extras/lib/python&amp;quot; for Leopards default Python installation) to the extensions folder inside the Inkscape.app bundle (&amp;quot;Inkscape.app/Contents/Resources/extensions&amp;quot;).&lt;br /&gt;
This should take care of the &amp;quot;...needs fantastic libxml2 wrapper...&amp;quot; message when executing Python effects.&lt;br /&gt;
&lt;br /&gt;
== Setting the build environment ==&lt;br /&gt;
MacPorts's hierarchy (/opt/local/) is not searched for libraries by default. Therefore, before the configuration starts, some environment variables need to be set. The environment variables are presented in bash syntax here. &lt;br /&gt;
&amp;lt;pre&amp;gt;export LIBPREFIX=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$LIBPREFIX/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$LIBPREFIX/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$LIBPREFIX/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;lt;code&amp;gt;[http://en.wikipedia.org/wiki/Ccache ccache]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;sudo port install ccache&amp;lt;/code&amp;gt;) to speed up the compilation a bit. To do so, add compiler variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
If you compile Inkscape for the first time from an svn checkout you need to generate the configure script. Navigate to Inkscape's source directory and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;./autogen.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run configure with the options &amp;lt;code&amp;gt;--disable-static --enable-shared&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; which sets the directory where the build products are placed. It must be somewhere you have write access to.&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I you want to package Inkscape into a double-clickable &amp;lt;code&amp;gt;.app&amp;lt;/code&amp;gt; bundle in order to access it like a regular OS X application (you probably want to), you need to add the option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure {...} --enable-osxapp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have loudmouth installed and you want to enable whiteboard functionality in Inkscape, add &amp;lt;code&amp;gt;--enable-inkboard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other configuration options can be set, check the list of options by issuing:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's an example which covers most options that can be set:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/ --with-xft \&lt;br /&gt;
--with-gnome-vfs --with-python --enable-osxapp --enable-lcms --enable-poppler-cairo \&lt;br /&gt;
--enable-inkboard&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building and Installing ==&lt;br /&gt;
Just run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .app bundle ==&lt;br /&gt;
Assuming that you have used the &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; option during &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;, navigate to Mac OS X packaging directory in Inkscape source code and use the automated script:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&lt;br /&gt;
./osx-app.sh -s -b /path/to/install/prefix/bin/inkscape -p ../../Info.plist&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script copies Inkscape binary and all its dependencies into the app bundle. The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; options strips libraries from debugging information (the bundle is therefore smaller). Omit this option if you want to keep debugging info.&lt;br /&gt;
&lt;br /&gt;
== Creating a disk image to distribute Inkscape ==&lt;br /&gt;
Inkscape.app created at the previous step is completely independent from the original location of MacPorts libraries and can therefore be distributed. It will only work on your platform though (PPC or Intel) and incompatibilities are known between X11 versions on different major versions of OS X (Panther, Tiger and Leopard). The general rule is that versions are not backward compatible.&lt;br /&gt;
&lt;br /&gt;
The most widespread way of distributing applications on Mac OS X is via .dmg images. You can created a dmg image of Inkscape, with a nice background and all, using the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-dmg.sh -p Inkscape.app&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the packaging directory for Mac OS X (where your app bundle should be, otherwise modify the path to Inkscape.app).&lt;br /&gt;
&lt;br /&gt;
== Automated build script ==&lt;br /&gt;
All essential steps are automated by a build script: &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt;. It has built-in help so to know how to use it just type:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: Excluded steps involve Pre-compiliation of the Python modules and installing the additional nightly build features.&lt;br /&gt;
&lt;br /&gt;
= Compiling a Universal Binary of Inkscape with X11, using MacPorts=&lt;br /&gt;
&lt;br /&gt;
These instructions should work on both 10.4 and 10.5 machines with the latest Xcode version installed.&lt;br /&gt;
&lt;br /&gt;
== Update Macport sources ==&lt;br /&gt;
&lt;br /&gt;
The port descriptions in Macports do not currently all compile properly with their Universal variants.   For this reason, we currently use a modified set of some of the portfiles that will compile a universal libraries.  Work is being done to integrate these changes into Macports itself.&lt;br /&gt;
&lt;br /&gt;
You can use our modified portfiles by adding our ports to your sources:&lt;br /&gt;
&lt;br /&gt;
1. Checkout our ports directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/experimental/trunk/mjwybrow/ports ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit your sources list to include this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo vim /opt/local/etc/macports/sources.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
And add the following line *before* the existing rsync source:&lt;br /&gt;
&amp;lt;pre&amp;gt;file:///Users/YOURUSERNAME/directory/to/ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the portindex command in the checked-out port directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;portindex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run port sync&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal dependencies ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile Inkscape's essential dependencies as Universal libraries on either 10.4 or 10.5,  by giving the &amp;quot;+universal&amp;quot; option for each, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -v install poppler +universal gtk2 +universal ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have non-universal versions of these ports installed you may need to deactivate the port and rebuild it, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -f uninstall cairo&lt;br /&gt;
sudo port clean cairo&lt;br /&gt;
sudo port -v install cairo +universal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal Inkscape ==&lt;br /&gt;
&lt;br /&gt;
First, Set your SDK, 10.5 for Leopard, 10.4u for TIger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.5.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; (For Leopard)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.4u.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp;  (For Tiger)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, set up your environment to point to the Macports libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;export MACPORTS=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
export PATH=$MACPORTS/bin:$MACPORTS/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$MACPORTS/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$MACPORTS/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$MACPORTS/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall -isysroot $SDK -arch ppc -arch i386&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to configure and compile Inkscape.  Inkscape must be configured with the following options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;   Sets the correct path for Inkscape to be used from an .app bundle&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;--disable-dependency-tracking&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; Dependency tracking can't be user when compiling universal binaries.&lt;br /&gt;
&lt;br /&gt;
Inkscape can then be built (with make), installed, and packaged into a Universal .app bundle using the standard .app bundle building instruction above.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using MacPorts [experimental] =&lt;br /&gt;
This process is very similar to compiling an X11 version of Inkscape except for the building of dependencies: need to build native versions of Inkscape dependencies. At the moment (2007-12-17) this process does not produce a usable version of Inkscape but the more people try to use it, the quicker the bugs will be ironed out!&lt;br /&gt;
&lt;br /&gt;
== Native version of Inkscape dependencies ==&lt;br /&gt;
Thanks to the power of port &amp;quot;variants&amp;quot; and port &amp;quot;deactivation&amp;quot; you can install native versions of gtk, cairo, pango and such, alongside the regular X11 ones. To know which ports have a &amp;lt;code&amp;gt;quartz&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_x11&amp;lt;/code&amp;gt; variant, use the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;port list variant:quartz variant:no_x11&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you an idea of what need to be replaced.&lt;br /&gt;
&lt;br /&gt;
Assuming your MacPorts tree has been already used to build regular versions of Inkscape, you first need to deactivate (suppress from the tree without really uninstalling) the X11 versions of gtk, cairo, cairomm and pango:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port deactivate gtk2 cairo cairomm pango&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install native variants:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install cairo +quartz+pdf+no_x11 cairomm +quartz pango +no_x11 poppler +quartz gtk2 +quartz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than deactivating and reactivating ports, you can also keep two MacPorts trees side by side, provided you install the second one from source. Let say I want to install a new tree for native versions in /opt/local/native, I would do&lt;br /&gt;
&amp;lt;pre&amp;gt;export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin&lt;br /&gt;
cd ~/MacPorts-1.x.x/&lt;br /&gt;
./configure --prefix=/opt/local-native --with-tclpackage=/Library/Tcl/macports-native&lt;br /&gt;
make&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you need to have only one version of the port command in the path at any time so you need to setup your .bashrc (or .bash_profile or .profile) accordingly. I use shell aliases to quickly and temporarily switch to the universal version:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias portpathregular=&amp;quot;export PATH=/opt/local/bin:/opt/local/sbin:/Developer/Tools:/usr/local/bin: \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
alias portpathuniv=&amp;quot;export PATH=/opt/local-univ/bin:/opt/local-univ/sbin:/Developer/Tools:/usr/local/bin:  \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: the \ are just to mark line continuation here, suppress them and put everything in one line.&lt;br /&gt;
&lt;br /&gt;
== Install the rest ==&lt;br /&gt;
Eventually, follow the regular install procedure for the rest:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install libxslt boost boehmgc gtkmm lcms intltool popt&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your MacPorts tree was already ready to compile Inkscape, you should not need to reinstall anything, with the possible exception of gtkmm, which may need to be rebuilt against the native version of gtk rather than against the X11 one (please someone confirm this).&lt;br /&gt;
&lt;br /&gt;
Get inkscape source code and go in the mac OS X specific packaging directory&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&amp;lt;/pre&amp;gt;&lt;br /&gt;
There edit &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt; to remove the configure option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; because it puts inkscape in a .app bundle where it is started together with X11, which would defeat the purpose of this native compilation. You can also specify an alternative install prefix if you want. Then&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh u a c b i&amp;lt;/pre&amp;gt;&lt;br /&gt;
and a native version of Inkscape is installed in the prefix you specified or in the &amp;lt;code&amp;gt;Build/bin&amp;lt;/code&amp;gt; directory of Inkscape's source code. You can test it by&lt;br /&gt;
&amp;lt;pre&amp;gt; cd ../../Build/bin/&lt;br /&gt;
./inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: if you compiled a GTK theme engine against your old GTK install (i.e. the one with X11) and try to use it with the new install, it will complain, so edit &amp;lt;code&amp;gt;~/.gtkrc-2.0&amp;lt;/code&amp;gt; to remove the offending theme or recompile it with the new native GTK.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using the all in one build script [experimental] =&lt;br /&gt;
&lt;br /&gt;
To build a native-GTK build of Inkscape, GTK and some of its dependencies must be built with special options. You can do this using the build-gtk.sh script from the Inkscape repository (it's in packaging/macosx/native-gtk/).  This is a modified version of the Imendio native build script, found with instructions on this page:&lt;br /&gt;
http://developer.imendio.com/projects/gtk-macosx/build-instructions&lt;br /&gt;
&lt;br /&gt;
This process is relatively untested. If you have any troubles using this process then please report them to Michael Wybrow (mjwybrow on sourceforge).&lt;br /&gt;
&lt;br /&gt;
The process is:&lt;br /&gt;
&amp;lt;pre&amp;gt;export PREFIX=/your/install/prefix&lt;br /&gt;
./build-gtk bootstrap&lt;br /&gt;
./build-gtk build inkscape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enabling python effects =&lt;br /&gt;
moved to [[GettingEffectsWorking]]. They should work out of the box in the new versions anyway.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
== User Examples ==&lt;br /&gt;
* Adam Strzeleki has outlined some improvements to this process on the Inkscape [http://www.nabble.com/Inkscape-native-Mac-OS-X-build---look-improvements-td14733036.html email list]. See his screenshot from January 10, 2008 [http://www.nabble.com/attachment/14733036/1/Inkscape%20OSX%20PL.gif here].&lt;br /&gt;
* JiHO has a video of his builds [http://jo.irisson.free.fr/?p=34 here] and [http://jo.irisson.free.fr/?p=62 here].&lt;br /&gt;
&lt;br /&gt;
== Apple Documentation ==&lt;br /&gt;
* [http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html Introduction to Runtime Configuration] Covers the Info.plist files, Preferences, Environment variables and has a list of the most important Properties that the Property List should contain.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.sveinbjorn.org/platypus Sveinbjorn Thordarson's Website] The author of Platypus, the Script Exec wrapper that launches the Inkscape binary.&lt;br /&gt;
* [http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html  Creating OS X application bundles step by step] Covers the bundle concepts, copying libraries into the bundle, editing libraries with the install_name_tool, the Info.plist file and adding an icon.&lt;br /&gt;
* [http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ Bringing your Java Application to Mac OS X] I would regard this a little dated, and the detail is (unsurprisingly) Java-related, but it is a gentle introduction to the role of the .app bundle and give a most clear account of how to create one.&lt;br /&gt;
* The [http://gimp-app.sourceforge.net/gimp.app.howto.txt Gimp .app Howto] This is a very bare document, and would be of little help to you if you were new to making packages. Note that it seems to refer to a more mature Clipboard technique and Online help than we currently have; and we ought to move to parity in these areas.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39634</id>
		<title>CompilingMacOsX</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39634"/>
		<updated>2008-12-01T03:09:11Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Pre-compiling the Python modules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= For the impatient =&lt;br /&gt;
&lt;br /&gt;
1. Install [http://developer.apple.com/tools/xcode/ XCode tools] from your OS X installation DVD&lt;br /&gt;
&lt;br /&gt;
2. Download and install [http://www.macports.org/ MacPorts]&lt;br /&gt;
&lt;br /&gt;
3. In Terminal (Applications&amp;gt;Utilities&amp;gt;Terminal) type&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install cairo +pdf boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt poppler boost \ &lt;br /&gt;
 gnome-vfs libgnomeprintui automake autoconf subversion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: subversion is pre-installed on Leopard, so you may be fine leaving subversion out of the port install command chain.&lt;br /&gt;
&lt;br /&gt;
Grab a cup of coffee&lt;br /&gt;
&lt;br /&gt;
4. In Terminal, get and build Inkscape&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape&lt;br /&gt;
cd inkscape/packaging/macosx/&lt;br /&gt;
./osx-build.sh a c b i -s p&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voilà''. If you want to understand what you just did, read on.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
To compile Inkscape from source you need:&lt;br /&gt;
*Mac OS X &amp;gt; 10.3&lt;br /&gt;
*XCode Tools. They are on your installation DVD, in the optional installs, or can be download from [http://developer.apple.com/tools/xcode/ Apple Developer Connection]. You can customize the install to make it smaller (avoir documentation and example software for example). You need at least: gcc, XCode, X11SDK.&lt;br /&gt;
*Inkscape's source code. You can download an [http://www.inkscape.org/download.php official release source code], a [http://inkscape.modevia.com/svn-snap/?M=D development snapshot] or checkout a copy of the current state of the [http://www.inkscape.org/svn.php?lang=en SVN repository] using [http://subversion.tigris.org/ subversion]. Subversion comes pre-installed on Leopard. On previous system, subversion can be installed by package management systems (see point below) or with an OS X installer [http://homepage.mac.com/martinott/ package]&lt;br /&gt;
*A means of getting Inkscape's numerous dependencies: glibmm, gtkmm, lmcs, boehmgc... We recommend the use of [http://www.macports.org/ MacPorts] right now. ([http://www.finkproject.org/ Fink] was used in the past but it no longer meets Inkscape's needs currently.)&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with X11, using MacPorts [Recommended method]=&lt;br /&gt;
&lt;br /&gt;
== Installing dependencies ==&lt;br /&gt;
You can use MacPorts to list Inkscape dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;port deps inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some are mandatory and you can install them with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt boost gsl&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Others provide additional functionality to Inkscape:&lt;br /&gt;
* &amp;lt;code&amp;gt;gnome-vfs&amp;lt;/code&amp;gt; : access to remote servers, in particular import from Open Clipart Library&lt;br /&gt;
* &amp;lt;code&amp;gt;aspell&amp;lt;/code&amp;gt; : check spelling of text elements [Note: I have never seen it working on OS X, though at least it should install fine]&lt;br /&gt;
* &amp;lt;code&amp;gt;libgnomeprintui&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;loudmouth&amp;lt;/code&amp;gt; : jabber library used by InkBoard&lt;br /&gt;
* &amp;lt;code&amp;gt;cairo +pdf&amp;lt;/code&amp;gt; (cairo with the pdf variant) : better pdf export&lt;br /&gt;
* &amp;lt;code&amp;gt;poppler&amp;lt;/code&amp;gt; : better pdf import&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install gnome-vfs aspell libgnomeprintui loudmouth cairo +pdf poppler&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: Cairo was already installed at previous step as a GTK dependency. You need to either deactivate the old version and install this one, or directly write it on the command line above. &lt;br /&gt;
If you're unsure about MacPorts commands, you can find a guide that is easy to skim here: [http://guide.macports.org/ MacPorts Guide]&lt;br /&gt;
&lt;br /&gt;
In addition, Inkscape requires versions of the autotools more recent thant those that ship with OS X. Install them:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install autoconf automake&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More recent (Sep 2008) pre-packaged nightly builds for Mac OS X also feature additional dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install librsvg libwpd libwpg libcroco&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: At the time of editing (2008-12-01) there was a problem fetching &amp;quot;lzmautils&amp;quot; as the URL MacPorts tried to use as download source dies in a timeout. &lt;br /&gt;
As this package is needed as a dependency for one or more packages noted above you need to download the source tarball of lzmautils from somewhere else (for example, from [ftp://sunfreeware.mirrors.tds.net/pub/sunfreeware/SOURCES/lzma-4.32.7.tar.gz here]) and put that into the local MacPorts repository at &amp;quot;/opt/local/var/macports/distfiles/lzmautils&amp;quot;. You should now be able to run the commands above.&lt;br /&gt;
&lt;br /&gt;
Also make sure that you have &amp;quot;libxml2&amp;quot; and &amp;quot;libxslt&amp;quot; installed with MacPorts. This should have been installed previously, either directly or as a dependency.&lt;br /&gt;
You will need those later to compile the &amp;quot;lxml&amp;quot; Python module if you want to use Python effects. First check what's installed and if they are missing from your MacPorts repository install them by doing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;port installed&lt;br /&gt;
sudo port install libxml2 libxslt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pre-compiling the Python modules  ==&lt;br /&gt;
&lt;br /&gt;
If you cannot use the pre-built Python modules from [http://inkscape.modevia.com/macosx-snap/?C=M;O=D Modevia] (say, because you're using a different Python version) you need to search MacPorts for both &amp;quot;numpy&amp;quot; and &amp;quot;lxml&amp;quot; and install the ones suitable for the Python version active within MacPorts.&lt;br /&gt;
&amp;lt;pre&amp;gt;port search lxml numpy&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using a more recent Python version (say, MacPython 2.6) you will need to compile both modules outside of MacPorts. Download both modules from [http://pypi.python.org PyPI] if they are available there for Python 2.6. At the time of editing (2008-12-01) however both modules were only available through SVN for Python 2.6.&lt;br /&gt;
&lt;br /&gt;
There are enough tutorials for building and installing the &amp;quot;numpy&amp;quot; module but building the &amp;quot;lxml&amp;quot; module deviates a little from the standard way, so here is the command you need:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/lxml/source&lt;br /&gt;
sudo python setup.py install --with-xslt-config=/opt/local/bin/xslt-config \ &lt;br /&gt;
--with-xml2-config=/opt/local/bin/xml2-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells it to use the libxml2 and libxslt packages we installed earlier with MacPorts.&lt;br /&gt;
&lt;br /&gt;
If you are compiling the Python modules outside of MacPorts you will need to make a mental note for after running the Inkscape.app building script (detailed later in this guide) to copy both the &amp;quot;lxml&amp;quot; and &amp;quot;numpy&amp;quot; dir from the standard installation destination (normally &amp;quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages&amp;quot; for MacPython 2.6 and &amp;quot;/System/Library/Frameworks/Python.framework/Versions/Current/Extras/lib/python&amp;quot; for Leopards default Python installation) to the extensions folder inside the Inkscape.app bundle (&amp;quot;Inkscape.app/Contents/Resources/extensions&amp;quot;).&lt;br /&gt;
This should take care of the &amp;quot;...needs fantastic libxml2 wrapper...&amp;quot; message when executing Python effects.&lt;br /&gt;
&lt;br /&gt;
== Setting the build environment ==&lt;br /&gt;
MacPorts's hierarchy (/opt/local/) is not searched for libraries by default. Therefore, before the configuration starts, some environment variables need to be set. The environment variables are presented in bash syntax here. &lt;br /&gt;
&amp;lt;pre&amp;gt;export LIBPREFIX=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$LIBPREFIX/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$LIBPREFIX/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$LIBPREFIX/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;lt;code&amp;gt;[http://en.wikipedia.org/wiki/Ccache ccache]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;sudo port install ccache&amp;lt;/code&amp;gt;) to speed up the compilation a bit. To do so, add compiler variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
If you compile Inkscape for the first time from an svn checkout you need to generate the configure script. Navigate to Inkscape's source directory and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;./autogen.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run configure with the options &amp;lt;code&amp;gt;--disable-static --enable-shared&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; which sets the directory where the build products are placed. It must be somewhere you have write access to.&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I you want to package Inkscape into a double-clickable &amp;lt;code&amp;gt;.app&amp;lt;/code&amp;gt; bundle in order to access it like a regular OS X application (you probably want to), you need to add the option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure {...} --enable-osxapp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have loudmouth installed and you want to enable whiteboard functionality in Inkscape, add &amp;lt;code&amp;gt;--enable-inkboard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other configuration options can be set, check the list of options by issuing:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's an example which covers most options that can be set:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/ --with-xft \&lt;br /&gt;
--with-gnome-vfs --with-python --enable-osxapp --enable-lcms --enable-poppler-cairo \&lt;br /&gt;
--enable-inkboard&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building and Installing ==&lt;br /&gt;
Just run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .app bundle ==&lt;br /&gt;
Assuming that you have used the &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; option during &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;, navigate to Mac OS X packaging directory in Inkscape source code and use the automated script:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&lt;br /&gt;
./osx-app.sh -s -b /path/to/install/prefix/bin/inkscape -p ../../Info.plist&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script copies Inkscape binary and all its dependencies into the app bundle. The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; options strips libraries from debugging information (the bundle is therefore smaller). Omit this option if you want to keep debugging info.&lt;br /&gt;
&lt;br /&gt;
== Creating a disk image to distribute Inkscape ==&lt;br /&gt;
Inkscape.app created at the previous step is completely independent from the original location of MacPorts libraries and can therefore be distributed. It will only work on your platform though (PPC or Intel) and incompatibilities are known between X11 versions on different major versions of OS X (Panther, Tiger and Leopard). The general rule is that versions are not backward compatible.&lt;br /&gt;
&lt;br /&gt;
The most widespread way of distributing applications on Mac OS X is via .dmg images. You can created a dmg image of Inkscape, with a nice background and all, using the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-dmg.sh -p Inkscape.app&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the packaging directory for Mac OS X (where your app bundle should be, otherwise modify the path to Inkscape.app).&lt;br /&gt;
&lt;br /&gt;
== Automated build script ==&lt;br /&gt;
All essential steps are automated by a build script: &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt;. It has built-in help so to know how to use it just type:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: Excluded steps involve Pre-compiliation of the Python modules and installing the additional nightly build features.&lt;br /&gt;
&lt;br /&gt;
= Compiling a Universal Binary of Inkscape with X11, using MacPorts=&lt;br /&gt;
&lt;br /&gt;
These instructions should work on both 10.4 and 10.5 machines with the latest Xcode version installed.&lt;br /&gt;
&lt;br /&gt;
== Update Macport sources ==&lt;br /&gt;
&lt;br /&gt;
The port descriptions in Macports do not currently all compile properly with their Universal variants.   For this reason, we currently use a modified set of some of the portfiles that will compile a universal libraries.  Work is being done to integrate these changes into Macports itself.&lt;br /&gt;
&lt;br /&gt;
You can use our modified portfiles by adding our ports to your sources:&lt;br /&gt;
&lt;br /&gt;
1. Checkout our ports directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/experimental/trunk/mjwybrow/ports ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit your sources list to include this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo vim /opt/local/etc/macports/sources.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
And add the following line *before* the existing rsync source:&lt;br /&gt;
&amp;lt;pre&amp;gt;file:///Users/YOURUSERNAME/directory/to/ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the portindex command in the checked-out port directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;portindex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run port sync&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal dependencies ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile Inkscape's essential dependencies as Universal libraries on either 10.4 or 10.5,  by giving the &amp;quot;+universal&amp;quot; option for each, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -v install poppler +universal gtk2 +universal ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have non-universal versions of these ports installed you may need to deactivate the port and rebuild it, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -f uninstall cairo&lt;br /&gt;
sudo port clean cairo&lt;br /&gt;
sudo port -v install cairo +universal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal Inkscape ==&lt;br /&gt;
&lt;br /&gt;
First, Set your SDK, 10.5 for Leopard, 10.4u for TIger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.5.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; (For Leopard)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.4u.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp;  (For Tiger)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, set up your environment to point to the Macports libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;export MACPORTS=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
export PATH=$MACPORTS/bin:$MACPORTS/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$MACPORTS/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$MACPORTS/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$MACPORTS/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall -isysroot $SDK -arch ppc -arch i386&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to configure and compile Inkscape.  Inkscape must be configured with the following options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;   Sets the correct path for Inkscape to be used from an .app bundle&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;--disable-dependency-tracking&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; Dependency tracking can't be user when compiling universal binaries.&lt;br /&gt;
&lt;br /&gt;
Inkscape can then be built (with make), installed, and packaged into a Universal .app bundle using the standard .app bundle building instruction above.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using MacPorts [experimental] =&lt;br /&gt;
This process is very similar to compiling an X11 version of Inkscape except for the building of dependencies: need to build native versions of Inkscape dependencies. At the moment (2007-12-17) this process does not produce a usable version of Inkscape but the more people try to use it, the quicker the bugs will be ironed out!&lt;br /&gt;
&lt;br /&gt;
== Native version of Inkscape dependencies ==&lt;br /&gt;
Thanks to the power of port &amp;quot;variants&amp;quot; and port &amp;quot;deactivation&amp;quot; you can install native versions of gtk, cairo, pango and such, alongside the regular X11 ones. To know which ports have a &amp;lt;code&amp;gt;quartz&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_x11&amp;lt;/code&amp;gt; variant, use the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;port list variant:quartz variant:no_x11&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you an idea of what need to be replaced.&lt;br /&gt;
&lt;br /&gt;
Assuming your MacPorts tree has been already used to build regular versions of Inkscape, you first need to deactivate (suppress from the tree without really uninstalling) the X11 versions of gtk, cairo, cairomm and pango:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port deactivate gtk2 cairo cairomm pango&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install native variants:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install cairo +quartz+pdf+no_x11 cairomm +quartz pango +no_x11 poppler +quartz gtk2 +quartz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than deactivating and reactivating ports, you can also keep two MacPorts trees side by side, provided you install the second one from source. Let say I want to install a new tree for native versions in /opt/local/native, I would do&lt;br /&gt;
&amp;lt;pre&amp;gt;export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin&lt;br /&gt;
cd ~/MacPorts-1.x.x/&lt;br /&gt;
./configure --prefix=/opt/local-native --with-tclpackage=/Library/Tcl/macports-native&lt;br /&gt;
make&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you need to have only one version of the port command in the path at any time so you need to setup your .bashrc (or .bash_profile or .profile) accordingly. I use shell aliases to quickly and temporarily switch to the universal version:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias portpathregular=&amp;quot;export PATH=/opt/local/bin:/opt/local/sbin:/Developer/Tools:/usr/local/bin: \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
alias portpathuniv=&amp;quot;export PATH=/opt/local-univ/bin:/opt/local-univ/sbin:/Developer/Tools:/usr/local/bin:  \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: the \ are just to mark line continuation here, suppress them and put everything in one line.&lt;br /&gt;
&lt;br /&gt;
== Install the rest ==&lt;br /&gt;
Eventually, follow the regular install procedure for the rest:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install libxslt boost boehmgc gtkmm lcms intltool popt&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your MacPorts tree was already ready to compile Inkscape, you should not need to reinstall anything, with the possible exception of gtkmm, which may need to be rebuilt against the native version of gtk rather than against the X11 one (please someone confirm this).&lt;br /&gt;
&lt;br /&gt;
Get inkscape source code and go in the mac OS X specific packaging directory&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&amp;lt;/pre&amp;gt;&lt;br /&gt;
There edit &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt; to remove the configure option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; because it puts inkscape in a .app bundle where it is started together with X11, which would defeat the purpose of this native compilation. You can also specify an alternative install prefix if you want. Then&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh u a c b i&amp;lt;/pre&amp;gt;&lt;br /&gt;
and a native version of Inkscape is installed in the prefix you specified or in the &amp;lt;code&amp;gt;Build/bin&amp;lt;/code&amp;gt; directory of Inkscape's source code. You can test it by&lt;br /&gt;
&amp;lt;pre&amp;gt; cd ../../Build/bin/&lt;br /&gt;
./inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: if you compiled a GTK theme engine against your old GTK install (i.e. the one with X11) and try to use it with the new install, it will complain, so edit &amp;lt;code&amp;gt;~/.gtkrc-2.0&amp;lt;/code&amp;gt; to remove the offending theme or recompile it with the new native GTK.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using the all in one build script [experimental] =&lt;br /&gt;
&lt;br /&gt;
To build a native-GTK build of Inkscape, GTK and some of its dependencies must be built with special options. You can do this using the build-gtk.sh script from the Inkscape repository (it's in packaging/macosx/native-gtk/).  This is a modified version of the Imendio native build script, found with instructions on this page:&lt;br /&gt;
http://developer.imendio.com/projects/gtk-macosx/build-instructions&lt;br /&gt;
&lt;br /&gt;
This process is relatively untested. If you have any troubles using this process then please report them to Michael Wybrow (mjwybrow on sourceforge).&lt;br /&gt;
&lt;br /&gt;
The process is:&lt;br /&gt;
&amp;lt;pre&amp;gt;export PREFIX=/your/install/prefix&lt;br /&gt;
./build-gtk bootstrap&lt;br /&gt;
./build-gtk build inkscape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enabling python effects =&lt;br /&gt;
moved to [[GettingEffectsWorking]]. They should work out of the box in the new versions anyway.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
== User Examples ==&lt;br /&gt;
* Adam Strzeleki has outlined some improvements to this process on the Inkscape [http://www.nabble.com/Inkscape-native-Mac-OS-X-build---look-improvements-td14733036.html email list]. See his screenshot from January 10, 2008 [http://www.nabble.com/attachment/14733036/1/Inkscape%20OSX%20PL.gif here].&lt;br /&gt;
* JiHO has a video of his builds [http://jo.irisson.free.fr/?p=34 here] and [http://jo.irisson.free.fr/?p=62 here].&lt;br /&gt;
&lt;br /&gt;
== Apple Documentation ==&lt;br /&gt;
* [http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html Introduction to Runtime Configuration] Covers the Info.plist files, Preferences, Environment variables and has a list of the most important Properties that the Property List should contain.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.sveinbjorn.org/platypus Sveinbjorn Thordarson's Website] The author of Platypus, the Script Exec wrapper that launches the Inkscape binary.&lt;br /&gt;
* [http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html  Creating OS X application bundles step by step] Covers the bundle concepts, copying libraries into the bundle, editing libraries with the install_name_tool, the Info.plist file and adding an icon.&lt;br /&gt;
* [http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ Bringing your Java Application to Mac OS X] I would regard this a little dated, and the detail is (unsurprisingly) Java-related, but it is a gentle introduction to the role of the .app bundle and give a most clear account of how to create one.&lt;br /&gt;
* The [http://gimp-app.sourceforge.net/gimp.app.howto.txt Gimp .app Howto] This is a very bare document, and would be of little help to you if you were new to making packages. Note that it seems to refer to a more mature Clipboard technique and Online help than we currently have; and we ought to move to parity in these areas.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39624</id>
		<title>CompilingMacOsX</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39624"/>
		<updated>2008-12-01T03:02:22Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Configuring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= For the impatient =&lt;br /&gt;
&lt;br /&gt;
1. Install [http://developer.apple.com/tools/xcode/ XCode tools] from your OS X installation DVD&lt;br /&gt;
&lt;br /&gt;
2. Download and install [http://www.macports.org/ MacPorts]&lt;br /&gt;
&lt;br /&gt;
3. In Terminal (Applications&amp;gt;Utilities&amp;gt;Terminal) type&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install cairo +pdf boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt poppler boost \ &lt;br /&gt;
 gnome-vfs libgnomeprintui automake autoconf subversion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: subversion is pre-installed on Leopard, so you may be fine leaving subversion out of the port install command chain.&lt;br /&gt;
&lt;br /&gt;
Grab a cup of coffee&lt;br /&gt;
&lt;br /&gt;
4. In Terminal, get and build Inkscape&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape&lt;br /&gt;
cd inkscape/packaging/macosx/&lt;br /&gt;
./osx-build.sh a c b i -s p&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voilà''. If you want to understand what you just did, read on.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
To compile Inkscape from source you need:&lt;br /&gt;
*Mac OS X &amp;gt; 10.3&lt;br /&gt;
*XCode Tools. They are on your installation DVD, in the optional installs, or can be download from [http://developer.apple.com/tools/xcode/ Apple Developer Connection]. You can customize the install to make it smaller (avoir documentation and example software for example). You need at least: gcc, XCode, X11SDK.&lt;br /&gt;
*Inkscape's source code. You can download an [http://www.inkscape.org/download.php official release source code], a [http://inkscape.modevia.com/svn-snap/?M=D development snapshot] or checkout a copy of the current state of the [http://www.inkscape.org/svn.php?lang=en SVN repository] using [http://subversion.tigris.org/ subversion]. Subversion comes pre-installed on Leopard. On previous system, subversion can be installed by package management systems (see point below) or with an OS X installer [http://homepage.mac.com/martinott/ package]&lt;br /&gt;
*A means of getting Inkscape's numerous dependencies: glibmm, gtkmm, lmcs, boehmgc... We recommend the use of [http://www.macports.org/ MacPorts] right now. ([http://www.finkproject.org/ Fink] was used in the past but it no longer meets Inkscape's needs currently.)&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with X11, using MacPorts [Recommended method]=&lt;br /&gt;
&lt;br /&gt;
== Installing dependencies ==&lt;br /&gt;
You can use MacPorts to list Inkscape dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;port deps inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some are mandatory and you can install them with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt boost gsl&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Others provide additional functionality to Inkscape:&lt;br /&gt;
* &amp;lt;code&amp;gt;gnome-vfs&amp;lt;/code&amp;gt; : access to remote servers, in particular import from Open Clipart Library&lt;br /&gt;
* &amp;lt;code&amp;gt;aspell&amp;lt;/code&amp;gt; : check spelling of text elements [Note: I have never seen it working on OS X, though at least it should install fine]&lt;br /&gt;
* &amp;lt;code&amp;gt;libgnomeprintui&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;loudmouth&amp;lt;/code&amp;gt; : jabber library used by InkBoard&lt;br /&gt;
* &amp;lt;code&amp;gt;cairo +pdf&amp;lt;/code&amp;gt; (cairo with the pdf variant) : better pdf export&lt;br /&gt;
* &amp;lt;code&amp;gt;poppler&amp;lt;/code&amp;gt; : better pdf import&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install gnome-vfs aspell libgnomeprintui loudmouth cairo +pdf poppler&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: Cairo was already installed at previous step as a GTK dependency. You need to either deactivate the old version and install this one, or directly write it on the command line above. &lt;br /&gt;
If you're unsure about MacPorts commands, you can find a guide that is easy to skim here: [http://guide.macports.org/ MacPorts Guide]&lt;br /&gt;
&lt;br /&gt;
In addition, Inkscape requires versions of the autotools more recent thant those that ship with OS X. Install them:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install autoconf automake&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More recent (Sep 2008) pre-packaged nightly builds for Mac OS X also feature additional dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install librsvg libwpd libwpg libcroco&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: At the time of editing (2008-12-01) there was a problem fetching &amp;quot;lzmautils&amp;quot; as the URL MacPorts tried to use as download source dies in a timeout. &lt;br /&gt;
As this package is needed as a dependency for one or more packages noted above you need to download the source tarball of lzmautils from somewhere else (for example, from [ftp://sunfreeware.mirrors.tds.net/pub/sunfreeware/SOURCES/lzma-4.32.7.tar.gz here]) and put that into the local MacPorts repository at &amp;quot;/opt/local/var/macports/distfiles/lzmautils&amp;quot;. You should now be able to run the commands above.&lt;br /&gt;
&lt;br /&gt;
Also make sure that you have &amp;quot;libxml2&amp;quot; and &amp;quot;libxslt&amp;quot; installed with MacPorts. This should have been installed previously, either directly or as a dependency.&lt;br /&gt;
You will need those later to compile the &amp;quot;lxml&amp;quot; Python module if you want to use Python effects. First check what's installed and if they are missing from your MacPorts repository install them by doing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;port installed&lt;br /&gt;
sudo port install libxml2 libxslt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pre-compiling the Python modules  ==&lt;br /&gt;
&lt;br /&gt;
If you cannot use the pre-built Python modules from [http://inkscape.modevia.com/macosx-snap/?C=M;O=D Modevia] (say, because you're using a different Python version) you need to search MacPorts for both &amp;quot;numpy&amp;quot; and &amp;quot;lxml&amp;quot; and install the ones suitable for the Python version active within MacPorts.&lt;br /&gt;
&amp;lt;pre&amp;gt;port search lxml numpy&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using a more recent Python version (say, MacPython 2.6) you will need to compile both modules outside of MacPorts. Download both modules from [http://pypi.python.org PyPI] if they are available there for Python 2.6. At the time of editing (2008-12-01) however both modules were only available through SVN for Python 2.6.&lt;br /&gt;
&lt;br /&gt;
There are enough tutorials for building and installing the &amp;quot;numpy&amp;quot; module but building the &amp;quot;lxml&amp;quot; module deviates a little from the standard way, so here is the command you need:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/lxml/source&lt;br /&gt;
sudo python setup.py install --with-xslt-config=/opt/local/bin/xslt-config \ &lt;br /&gt;
--with-xml2-config=/opt/local/bin/xml2-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells it to use the libxml2 and libxslt packages we installed earlier with MacPorts.&lt;br /&gt;
&lt;br /&gt;
If you are compiling the Python modules outside of MacPorts you will need to make a mental note for after running the Inkscape.app building script (detailed later in this guide) to copy both the &amp;quot;lxml&amp;quot; and &amp;quot;numpy&amp;quot; dir from the standard installation destination (normally &amp;quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages&amp;quot;) to the extensions folder inside the Inkscape.app bundle (&amp;quot;Inkscape.app/Contents/Resources/extensions&amp;quot;).&lt;br /&gt;
This should take care of the &amp;quot;...needs fantastic libxml2 wrapper...&amp;quot; message when executing Python effects.&lt;br /&gt;
&lt;br /&gt;
== Setting the build environment ==&lt;br /&gt;
MacPorts's hierarchy (/opt/local/) is not searched for libraries by default. Therefore, before the configuration starts, some environment variables need to be set. The environment variables are presented in bash syntax here. &lt;br /&gt;
&amp;lt;pre&amp;gt;export LIBPREFIX=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$LIBPREFIX/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$LIBPREFIX/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$LIBPREFIX/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;lt;code&amp;gt;[http://en.wikipedia.org/wiki/Ccache ccache]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;sudo port install ccache&amp;lt;/code&amp;gt;) to speed up the compilation a bit. To do so, add compiler variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
If you compile Inkscape for the first time from an svn checkout you need to generate the configure script. Navigate to Inkscape's source directory and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;./autogen.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run configure with the options &amp;lt;code&amp;gt;--disable-static --enable-shared&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; which sets the directory where the build products are placed. It must be somewhere you have write access to.&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I you want to package Inkscape into a double-clickable &amp;lt;code&amp;gt;.app&amp;lt;/code&amp;gt; bundle in order to access it like a regular OS X application (you probably want to), you need to add the option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure {...} --enable-osxapp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have loudmouth installed and you want to enable whiteboard functionality in Inkscape, add &amp;lt;code&amp;gt;--enable-inkboard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other configuration options can be set, check the list of options by issuing:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here's an example which covers most options that can be set:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/ --with-xft \&lt;br /&gt;
--with-gnome-vfs --with-python --enable-osxapp --enable-lcms --enable-poppler-cairo \&lt;br /&gt;
--enable-inkboard&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building and Installing ==&lt;br /&gt;
Just run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .app bundle ==&lt;br /&gt;
Assuming that you have used the &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; option during &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;, navigate to Mac OS X packaging directory in Inkscape source code and use the automated script:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&lt;br /&gt;
./osx-app.sh -s -b /path/to/install/prefix/bin/inkscape -p ../../Info.plist&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script copies Inkscape binary and all its dependencies into the app bundle. The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; options strips libraries from debugging information (the bundle is therefore smaller). Omit this option if you want to keep debugging info.&lt;br /&gt;
&lt;br /&gt;
== Creating a disk image to distribute Inkscape ==&lt;br /&gt;
Inkscape.app created at the previous step is completely independent from the original location of MacPorts libraries and can therefore be distributed. It will only work on your platform though (PPC or Intel) and incompatibilities are known between X11 versions on different major versions of OS X (Panther, Tiger and Leopard). The general rule is that versions are not backward compatible.&lt;br /&gt;
&lt;br /&gt;
The most widespread way of distributing applications on Mac OS X is via .dmg images. You can created a dmg image of Inkscape, with a nice background and all, using the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-dmg.sh -p Inkscape.app&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the packaging directory for Mac OS X (where your app bundle should be, otherwise modify the path to Inkscape.app).&lt;br /&gt;
&lt;br /&gt;
== Automated build script ==&lt;br /&gt;
All essential steps are automated by a build script: &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt;. It has built-in help so to know how to use it just type:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: Excluded steps involve Pre-compiliation of the Python modules and installing the additional nightly build features.&lt;br /&gt;
&lt;br /&gt;
= Compiling a Universal Binary of Inkscape with X11, using MacPorts=&lt;br /&gt;
&lt;br /&gt;
These instructions should work on both 10.4 and 10.5 machines with the latest Xcode version installed.&lt;br /&gt;
&lt;br /&gt;
== Update Macport sources ==&lt;br /&gt;
&lt;br /&gt;
The port descriptions in Macports do not currently all compile properly with their Universal variants.   For this reason, we currently use a modified set of some of the portfiles that will compile a universal libraries.  Work is being done to integrate these changes into Macports itself.&lt;br /&gt;
&lt;br /&gt;
You can use our modified portfiles by adding our ports to your sources:&lt;br /&gt;
&lt;br /&gt;
1. Checkout our ports directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/experimental/trunk/mjwybrow/ports ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit your sources list to include this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo vim /opt/local/etc/macports/sources.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
And add the following line *before* the existing rsync source:&lt;br /&gt;
&amp;lt;pre&amp;gt;file:///Users/YOURUSERNAME/directory/to/ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the portindex command in the checked-out port directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;portindex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run port sync&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal dependencies ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile Inkscape's essential dependencies as Universal libraries on either 10.4 or 10.5,  by giving the &amp;quot;+universal&amp;quot; option for each, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -v install poppler +universal gtk2 +universal ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have non-universal versions of these ports installed you may need to deactivate the port and rebuild it, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -f uninstall cairo&lt;br /&gt;
sudo port clean cairo&lt;br /&gt;
sudo port -v install cairo +universal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal Inkscape ==&lt;br /&gt;
&lt;br /&gt;
First, Set your SDK, 10.5 for Leopard, 10.4u for TIger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.5.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; (For Leopard)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.4u.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp;  (For Tiger)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, set up your environment to point to the Macports libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;export MACPORTS=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
export PATH=$MACPORTS/bin:$MACPORTS/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$MACPORTS/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$MACPORTS/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$MACPORTS/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall -isysroot $SDK -arch ppc -arch i386&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to configure and compile Inkscape.  Inkscape must be configured with the following options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;   Sets the correct path for Inkscape to be used from an .app bundle&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;--disable-dependency-tracking&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; Dependency tracking can't be user when compiling universal binaries.&lt;br /&gt;
&lt;br /&gt;
Inkscape can then be built (with make), installed, and packaged into a Universal .app bundle using the standard .app bundle building instruction above.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using MacPorts [experimental] =&lt;br /&gt;
This process is very similar to compiling an X11 version of Inkscape except for the building of dependencies: need to build native versions of Inkscape dependencies. At the moment (2007-12-17) this process does not produce a usable version of Inkscape but the more people try to use it, the quicker the bugs will be ironed out!&lt;br /&gt;
&lt;br /&gt;
== Native version of Inkscape dependencies ==&lt;br /&gt;
Thanks to the power of port &amp;quot;variants&amp;quot; and port &amp;quot;deactivation&amp;quot; you can install native versions of gtk, cairo, pango and such, alongside the regular X11 ones. To know which ports have a &amp;lt;code&amp;gt;quartz&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_x11&amp;lt;/code&amp;gt; variant, use the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;port list variant:quartz variant:no_x11&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you an idea of what need to be replaced.&lt;br /&gt;
&lt;br /&gt;
Assuming your MacPorts tree has been already used to build regular versions of Inkscape, you first need to deactivate (suppress from the tree without really uninstalling) the X11 versions of gtk, cairo, cairomm and pango:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port deactivate gtk2 cairo cairomm pango&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install native variants:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install cairo +quartz+pdf+no_x11 cairomm +quartz pango +no_x11 poppler +quartz gtk2 +quartz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than deactivating and reactivating ports, you can also keep two MacPorts trees side by side, provided you install the second one from source. Let say I want to install a new tree for native versions in /opt/local/native, I would do&lt;br /&gt;
&amp;lt;pre&amp;gt;export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin&lt;br /&gt;
cd ~/MacPorts-1.x.x/&lt;br /&gt;
./configure --prefix=/opt/local-native --with-tclpackage=/Library/Tcl/macports-native&lt;br /&gt;
make&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you need to have only one version of the port command in the path at any time so you need to setup your .bashrc (or .bash_profile or .profile) accordingly. I use shell aliases to quickly and temporarily switch to the universal version:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias portpathregular=&amp;quot;export PATH=/opt/local/bin:/opt/local/sbin:/Developer/Tools:/usr/local/bin: \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
alias portpathuniv=&amp;quot;export PATH=/opt/local-univ/bin:/opt/local-univ/sbin:/Developer/Tools:/usr/local/bin:  \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: the \ are just to mark line continuation here, suppress them and put everything in one line.&lt;br /&gt;
&lt;br /&gt;
== Install the rest ==&lt;br /&gt;
Eventually, follow the regular install procedure for the rest:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install libxslt boost boehmgc gtkmm lcms intltool popt&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your MacPorts tree was already ready to compile Inkscape, you should not need to reinstall anything, with the possible exception of gtkmm, which may need to be rebuilt against the native version of gtk rather than against the X11 one (please someone confirm this).&lt;br /&gt;
&lt;br /&gt;
Get inkscape source code and go in the mac OS X specific packaging directory&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&amp;lt;/pre&amp;gt;&lt;br /&gt;
There edit &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt; to remove the configure option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; because it puts inkscape in a .app bundle where it is started together with X11, which would defeat the purpose of this native compilation. You can also specify an alternative install prefix if you want. Then&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh u a c b i&amp;lt;/pre&amp;gt;&lt;br /&gt;
and a native version of Inkscape is installed in the prefix you specified or in the &amp;lt;code&amp;gt;Build/bin&amp;lt;/code&amp;gt; directory of Inkscape's source code. You can test it by&lt;br /&gt;
&amp;lt;pre&amp;gt; cd ../../Build/bin/&lt;br /&gt;
./inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: if you compiled a GTK theme engine against your old GTK install (i.e. the one with X11) and try to use it with the new install, it will complain, so edit &amp;lt;code&amp;gt;~/.gtkrc-2.0&amp;lt;/code&amp;gt; to remove the offending theme or recompile it with the new native GTK.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using the all in one build script [experimental] =&lt;br /&gt;
&lt;br /&gt;
To build a native-GTK build of Inkscape, GTK and some of its dependencies must be built with special options. You can do this using the build-gtk.sh script from the Inkscape repository (it's in packaging/macosx/native-gtk/).  This is a modified version of the Imendio native build script, found with instructions on this page:&lt;br /&gt;
http://developer.imendio.com/projects/gtk-macosx/build-instructions&lt;br /&gt;
&lt;br /&gt;
This process is relatively untested. If you have any troubles using this process then please report them to Michael Wybrow (mjwybrow on sourceforge).&lt;br /&gt;
&lt;br /&gt;
The process is:&lt;br /&gt;
&amp;lt;pre&amp;gt;export PREFIX=/your/install/prefix&lt;br /&gt;
./build-gtk bootstrap&lt;br /&gt;
./build-gtk build inkscape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enabling python effects =&lt;br /&gt;
moved to [[GettingEffectsWorking]]. They should work out of the box in the new versions anyway.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
== User Examples ==&lt;br /&gt;
* Adam Strzeleki has outlined some improvements to this process on the Inkscape [http://www.nabble.com/Inkscape-native-Mac-OS-X-build---look-improvements-td14733036.html email list]. See his screenshot from January 10, 2008 [http://www.nabble.com/attachment/14733036/1/Inkscape%20OSX%20PL.gif here].&lt;br /&gt;
* JiHO has a video of his builds [http://jo.irisson.free.fr/?p=34 here] and [http://jo.irisson.free.fr/?p=62 here].&lt;br /&gt;
&lt;br /&gt;
== Apple Documentation ==&lt;br /&gt;
* [http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html Introduction to Runtime Configuration] Covers the Info.plist files, Preferences, Environment variables and has a list of the most important Properties that the Property List should contain.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.sveinbjorn.org/platypus Sveinbjorn Thordarson's Website] The author of Platypus, the Script Exec wrapper that launches the Inkscape binary.&lt;br /&gt;
* [http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html  Creating OS X application bundles step by step] Covers the bundle concepts, copying libraries into the bundle, editing libraries with the install_name_tool, the Info.plist file and adding an icon.&lt;br /&gt;
* [http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ Bringing your Java Application to Mac OS X] I would regard this a little dated, and the detail is (unsurprisingly) Java-related, but it is a gentle introduction to the role of the .app bundle and give a most clear account of how to create one.&lt;br /&gt;
* The [http://gimp-app.sourceforge.net/gimp.app.howto.txt Gimp .app Howto] This is a very bare document, and would be of little help to you if you were new to making packages. Note that it seems to refer to a more mature Clipboard technique and Online help than we currently have; and we ought to move to parity in these areas.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39614</id>
		<title>CompilingMacOsX</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39614"/>
		<updated>2008-12-01T01:19:04Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Automated build script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= For the impatient =&lt;br /&gt;
&lt;br /&gt;
1. Install [http://developer.apple.com/tools/xcode/ XCode tools] from your OS X installation DVD&lt;br /&gt;
&lt;br /&gt;
2. Download and install [http://www.macports.org/ MacPorts]&lt;br /&gt;
&lt;br /&gt;
3. In Terminal (Applications&amp;gt;Utilities&amp;gt;Terminal) type&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install cairo +pdf boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt poppler boost \ &lt;br /&gt;
 gnome-vfs libgnomeprintui automake autoconf subversion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: subversion is pre-installed on Leopard, so you may be fine leaving subversion out of the port install command chain.&lt;br /&gt;
&lt;br /&gt;
Grab a cup of coffee&lt;br /&gt;
&lt;br /&gt;
4. In Terminal, get and build Inkscape&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape&lt;br /&gt;
cd inkscape/packaging/macosx/&lt;br /&gt;
./osx-build.sh a c b i -s p&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voilà''. If you want to understand what you just did, read on.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
To compile Inkscape from source you need:&lt;br /&gt;
*Mac OS X &amp;gt; 10.3&lt;br /&gt;
*XCode Tools. They are on your installation DVD, in the optional installs, or can be download from [http://developer.apple.com/tools/xcode/ Apple Developer Connection]. You can customize the install to make it smaller (avoir documentation and example software for example). You need at least: gcc, XCode, X11SDK.&lt;br /&gt;
*Inkscape's source code. You can download an [http://www.inkscape.org/download.php official release source code], a [http://inkscape.modevia.com/svn-snap/?M=D development snapshot] or checkout a copy of the current state of the [http://www.inkscape.org/svn.php?lang=en SVN repository] using [http://subversion.tigris.org/ subversion]. Subversion comes pre-installed on Leopard. On previous system, subversion can be installed by package management systems (see point below) or with an OS X installer [http://homepage.mac.com/martinott/ package]&lt;br /&gt;
*A means of getting Inkscape's numerous dependencies: glibmm, gtkmm, lmcs, boehmgc... We recommend the use of [http://www.macports.org/ MacPorts] right now. ([http://www.finkproject.org/ Fink] was used in the past but it no longer meets Inkscape's needs currently.)&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with X11, using MacPorts [Recommended method]=&lt;br /&gt;
&lt;br /&gt;
== Installing dependencies ==&lt;br /&gt;
You can use MacPorts to list Inkscape dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;port deps inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some are mandatory and you can install them with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt boost gsl&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Others provide additional functionality to Inkscape:&lt;br /&gt;
* &amp;lt;code&amp;gt;gnome-vfs&amp;lt;/code&amp;gt; : access to remote servers, in particular import from Open Clipart Library&lt;br /&gt;
* &amp;lt;code&amp;gt;aspell&amp;lt;/code&amp;gt; : check spelling of text elements [Note: I have never seen it working on OS X, though at least it should install fine]&lt;br /&gt;
* &amp;lt;code&amp;gt;libgnomeprintui&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;loudmouth&amp;lt;/code&amp;gt; : jabber library used by InkBoard&lt;br /&gt;
* &amp;lt;code&amp;gt;cairo +pdf&amp;lt;/code&amp;gt; (cairo with the pdf variant) : better pdf export&lt;br /&gt;
* &amp;lt;code&amp;gt;poppler&amp;lt;/code&amp;gt; : better pdf import&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install gnome-vfs aspell libgnomeprintui loudmouth cairo +pdf poppler&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: Cairo was already installed at previous step as a GTK dependency. You need to either deactivate the old version and install this one, or directly write it on the command line above. &lt;br /&gt;
If you're unsure about MacPorts commands, you can find a guide that is easy to skim here: [http://guide.macports.org/ MacPorts Guide]&lt;br /&gt;
&lt;br /&gt;
In addition, Inkscape requires versions of the autotools more recent thant those that ship with OS X. Install them:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install autoconf automake&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More recent (Sep 2008) pre-packaged nightly builds for Mac OS X also feature additional dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install librsvg libwpd libwpg libcroco&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: At the time of editing (2008-12-01) there was a problem fetching &amp;quot;lzmautils&amp;quot; as the URL MacPorts tried to use as download source dies in a timeout. &lt;br /&gt;
As this package is needed as a dependency for one or more packages noted above you need to download the source tarball of lzmautils from somewhere else (for example, from [ftp://sunfreeware.mirrors.tds.net/pub/sunfreeware/SOURCES/lzma-4.32.7.tar.gz here]) and put that into the local MacPorts repository at &amp;quot;/opt/local/var/macports/distfiles/lzmautils&amp;quot;. You should now be able to run the commands above.&lt;br /&gt;
&lt;br /&gt;
Also make sure that you have &amp;quot;libxml2&amp;quot; and &amp;quot;libxslt&amp;quot; installed with MacPorts. This should have been installed previously, either directly or as a dependency.&lt;br /&gt;
You will need those later to compile the &amp;quot;lxml&amp;quot; Python module if you want to use Python effects. First check what's installed and if they are missing from your MacPorts repository install them by doing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;port installed&lt;br /&gt;
sudo port install libxml2 libxslt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pre-compiling the Python modules  ==&lt;br /&gt;
&lt;br /&gt;
If you cannot use the pre-built Python modules from [http://inkscape.modevia.com/macosx-snap/?C=M;O=D Modevia] (say, because you're using a different Python version) you need to search MacPorts for both &amp;quot;numpy&amp;quot; and &amp;quot;lxml&amp;quot; and install the ones suitable for the Python version active within MacPorts.&lt;br /&gt;
&amp;lt;pre&amp;gt;port search lxml numpy&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using a more recent Python version (say, MacPython 2.6) you will need to compile both modules outside of MacPorts. Download both modules from [http://pypi.python.org PyPI] if they are available there for Python 2.6. At the time of editing (2008-12-01) however both modules were only available through SVN for Python 2.6.&lt;br /&gt;
&lt;br /&gt;
There are enough tutorials for building and installing the &amp;quot;numpy&amp;quot; module but building the &amp;quot;lxml&amp;quot; module deviates a little from the standard way, so here is the command you need:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/lxml/source&lt;br /&gt;
sudo python setup.py install --with-xslt-config=/opt/local/bin/xslt-config \ &lt;br /&gt;
--with-xml2-config=/opt/local/bin/xml2-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells it to use the libxml2 and libxslt packages we installed earlier with MacPorts.&lt;br /&gt;
&lt;br /&gt;
If you are compiling the Python modules outside of MacPorts you will need to make a mental note for after running the Inkscape.app building script (detailed later in this guide) to copy both the &amp;quot;lxml&amp;quot; and &amp;quot;numpy&amp;quot; dir from the standard installation destination (normally &amp;quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages&amp;quot;) to the extensions folder inside the Inkscape.app bundle (&amp;quot;Inkscape.app/Contents/Resources/extensions&amp;quot;).&lt;br /&gt;
This should take care of the &amp;quot;...needs fantastic libxml2 wrapper...&amp;quot; message when executing Python effects.&lt;br /&gt;
&lt;br /&gt;
== Setting the build environment ==&lt;br /&gt;
MacPorts's hierarchy (/opt/local/) is not searched for libraries by default. Therefore, before the configuration starts, some environment variables need to be set. The environment variables are presented in bash syntax here. &lt;br /&gt;
&amp;lt;pre&amp;gt;export LIBPREFIX=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$LIBPREFIX/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$LIBPREFIX/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$LIBPREFIX/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;lt;code&amp;gt;[http://en.wikipedia.org/wiki/Ccache ccache]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;sudo port install ccache&amp;lt;/code&amp;gt;) to speed up the compilation a bit. To do so, add compiler variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
If you compile Inkscape for the first time from an svn checkout you need to generate the configure script. Navigate to Inkscape's source directory and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;./autogen.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run configure with the options &amp;lt;code&amp;gt;--disable-static --enable-shared&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; which sets the directory where the build products are placed. It must be somewhere you have write access to.&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I you want to package Inkscape into a double-clickable &amp;lt;code&amp;gt;.app&amp;lt;/code&amp;gt; bundle in order to access it like a regular OS X application (you probably want to), you need to add the option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure {...} --enable-osxapp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have loudmouth installed and you want to enable whiteboard functionality in Inkscape, add &amp;lt;code&amp;gt;--enable-inkboard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other configuration options can be set, check the list of options by issuing:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building and Installing ==&lt;br /&gt;
Just run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .app bundle ==&lt;br /&gt;
Assuming that you have used the &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; option during &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;, navigate to Mac OS X packaging directory in Inkscape source code and use the automated script:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&lt;br /&gt;
./osx-app.sh -s -b /path/to/install/prefix/bin/inkscape -p ../../Info.plist&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script copies Inkscape binary and all its dependencies into the app bundle. The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; options strips libraries from debugging information (the bundle is therefore smaller). Omit this option if you want to keep debugging info.&lt;br /&gt;
&lt;br /&gt;
== Creating a disk image to distribute Inkscape ==&lt;br /&gt;
Inkscape.app created at the previous step is completely independent from the original location of MacPorts libraries and can therefore be distributed. It will only work on your platform though (PPC or Intel) and incompatibilities are known between X11 versions on different major versions of OS X (Panther, Tiger and Leopard). The general rule is that versions are not backward compatible.&lt;br /&gt;
&lt;br /&gt;
The most widespread way of distributing applications on Mac OS X is via .dmg images. You can created a dmg image of Inkscape, with a nice background and all, using the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-dmg.sh -p Inkscape.app&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the packaging directory for Mac OS X (where your app bundle should be, otherwise modify the path to Inkscape.app).&lt;br /&gt;
&lt;br /&gt;
== Automated build script ==&lt;br /&gt;
All essential steps are automated by a build script: &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt;. It has built-in help so to know how to use it just type:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: Excluded steps involve Pre-compiliation of the Python modules and installing the additional nightly build features.&lt;br /&gt;
&lt;br /&gt;
= Compiling a Universal Binary of Inkscape with X11, using MacPorts=&lt;br /&gt;
&lt;br /&gt;
These instructions should work on both 10.4 and 10.5 machines with the latest Xcode version installed.&lt;br /&gt;
&lt;br /&gt;
== Update Macport sources ==&lt;br /&gt;
&lt;br /&gt;
The port descriptions in Macports do not currently all compile properly with their Universal variants.   For this reason, we currently use a modified set of some of the portfiles that will compile a universal libraries.  Work is being done to integrate these changes into Macports itself.&lt;br /&gt;
&lt;br /&gt;
You can use our modified portfiles by adding our ports to your sources:&lt;br /&gt;
&lt;br /&gt;
1. Checkout our ports directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/experimental/trunk/mjwybrow/ports ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit your sources list to include this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo vim /opt/local/etc/macports/sources.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
And add the following line *before* the existing rsync source:&lt;br /&gt;
&amp;lt;pre&amp;gt;file:///Users/YOURUSERNAME/directory/to/ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the portindex command in the checked-out port directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;portindex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run port sync&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal dependencies ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile Inkscape's essential dependencies as Universal libraries on either 10.4 or 10.5,  by giving the &amp;quot;+universal&amp;quot; option for each, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -v install poppler +universal gtk2 +universal ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have non-universal versions of these ports installed you may need to deactivate the port and rebuild it, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -f uninstall cairo&lt;br /&gt;
sudo port clean cairo&lt;br /&gt;
sudo port -v install cairo +universal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal Inkscape ==&lt;br /&gt;
&lt;br /&gt;
First, Set your SDK, 10.5 for Leopard, 10.4u for TIger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.5.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; (For Leopard)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.4u.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp;  (For Tiger)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, set up your environment to point to the Macports libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;export MACPORTS=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
export PATH=$MACPORTS/bin:$MACPORTS/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$MACPORTS/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$MACPORTS/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$MACPORTS/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall -isysroot $SDK -arch ppc -arch i386&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to configure and compile Inkscape.  Inkscape must be configured with the following options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;   Sets the correct path for Inkscape to be used from an .app bundle&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;--disable-dependency-tracking&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; Dependency tracking can't be user when compiling universal binaries.&lt;br /&gt;
&lt;br /&gt;
Inkscape can then be built (with make), installed, and packaged into a Universal .app bundle using the standard .app bundle building instruction above.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using MacPorts [experimental] =&lt;br /&gt;
This process is very similar to compiling an X11 version of Inkscape except for the building of dependencies: need to build native versions of Inkscape dependencies. At the moment (2007-12-17) this process does not produce a usable version of Inkscape but the more people try to use it, the quicker the bugs will be ironed out!&lt;br /&gt;
&lt;br /&gt;
== Native version of Inkscape dependencies ==&lt;br /&gt;
Thanks to the power of port &amp;quot;variants&amp;quot; and port &amp;quot;deactivation&amp;quot; you can install native versions of gtk, cairo, pango and such, alongside the regular X11 ones. To know which ports have a &amp;lt;code&amp;gt;quartz&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_x11&amp;lt;/code&amp;gt; variant, use the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;port list variant:quartz variant:no_x11&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you an idea of what need to be replaced.&lt;br /&gt;
&lt;br /&gt;
Assuming your MacPorts tree has been already used to build regular versions of Inkscape, you first need to deactivate (suppress from the tree without really uninstalling) the X11 versions of gtk, cairo, cairomm and pango:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port deactivate gtk2 cairo cairomm pango&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install native variants:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install cairo +quartz+pdf+no_x11 cairomm +quartz pango +no_x11 poppler +quartz gtk2 +quartz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than deactivating and reactivating ports, you can also keep two MacPorts trees side by side, provided you install the second one from source. Let say I want to install a new tree for native versions in /opt/local/native, I would do&lt;br /&gt;
&amp;lt;pre&amp;gt;export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin&lt;br /&gt;
cd ~/MacPorts-1.x.x/&lt;br /&gt;
./configure --prefix=/opt/local-native --with-tclpackage=/Library/Tcl/macports-native&lt;br /&gt;
make&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you need to have only one version of the port command in the path at any time so you need to setup your .bashrc (or .bash_profile or .profile) accordingly. I use shell aliases to quickly and temporarily switch to the universal version:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias portpathregular=&amp;quot;export PATH=/opt/local/bin:/opt/local/sbin:/Developer/Tools:/usr/local/bin: \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
alias portpathuniv=&amp;quot;export PATH=/opt/local-univ/bin:/opt/local-univ/sbin:/Developer/Tools:/usr/local/bin:  \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: the \ are just to mark line continuation here, suppress them and put everything in one line.&lt;br /&gt;
&lt;br /&gt;
== Install the rest ==&lt;br /&gt;
Eventually, follow the regular install procedure for the rest:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install libxslt boost boehmgc gtkmm lcms intltool popt&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your MacPorts tree was already ready to compile Inkscape, you should not need to reinstall anything, with the possible exception of gtkmm, which may need to be rebuilt against the native version of gtk rather than against the X11 one (please someone confirm this).&lt;br /&gt;
&lt;br /&gt;
Get inkscape source code and go in the mac OS X specific packaging directory&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&amp;lt;/pre&amp;gt;&lt;br /&gt;
There edit &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt; to remove the configure option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; because it puts inkscape in a .app bundle where it is started together with X11, which would defeat the purpose of this native compilation. You can also specify an alternative install prefix if you want. Then&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh u a c b i&amp;lt;/pre&amp;gt;&lt;br /&gt;
and a native version of Inkscape is installed in the prefix you specified or in the &amp;lt;code&amp;gt;Build/bin&amp;lt;/code&amp;gt; directory of Inkscape's source code. You can test it by&lt;br /&gt;
&amp;lt;pre&amp;gt; cd ../../Build/bin/&lt;br /&gt;
./inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: if you compiled a GTK theme engine against your old GTK install (i.e. the one with X11) and try to use it with the new install, it will complain, so edit &amp;lt;code&amp;gt;~/.gtkrc-2.0&amp;lt;/code&amp;gt; to remove the offending theme or recompile it with the new native GTK.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using the all in one build script [experimental] =&lt;br /&gt;
&lt;br /&gt;
To build a native-GTK build of Inkscape, GTK and some of its dependencies must be built with special options. You can do this using the build-gtk.sh script from the Inkscape repository (it's in packaging/macosx/native-gtk/).  This is a modified version of the Imendio native build script, found with instructions on this page:&lt;br /&gt;
http://developer.imendio.com/projects/gtk-macosx/build-instructions&lt;br /&gt;
&lt;br /&gt;
This process is relatively untested. If you have any troubles using this process then please report them to Michael Wybrow (mjwybrow on sourceforge).&lt;br /&gt;
&lt;br /&gt;
The process is:&lt;br /&gt;
&amp;lt;pre&amp;gt;export PREFIX=/your/install/prefix&lt;br /&gt;
./build-gtk bootstrap&lt;br /&gt;
./build-gtk build inkscape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enabling python effects =&lt;br /&gt;
moved to [[GettingEffectsWorking]]. They should work out of the box in the new versions anyway.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
== User Examples ==&lt;br /&gt;
* Adam Strzeleki has outlined some improvements to this process on the Inkscape [http://www.nabble.com/Inkscape-native-Mac-OS-X-build---look-improvements-td14733036.html email list]. See his screenshot from January 10, 2008 [http://www.nabble.com/attachment/14733036/1/Inkscape%20OSX%20PL.gif here].&lt;br /&gt;
* JiHO has a video of his builds [http://jo.irisson.free.fr/?p=34 here] and [http://jo.irisson.free.fr/?p=62 here].&lt;br /&gt;
&lt;br /&gt;
== Apple Documentation ==&lt;br /&gt;
* [http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html Introduction to Runtime Configuration] Covers the Info.plist files, Preferences, Environment variables and has a list of the most important Properties that the Property List should contain.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.sveinbjorn.org/platypus Sveinbjorn Thordarson's Website] The author of Platypus, the Script Exec wrapper that launches the Inkscape binary.&lt;br /&gt;
* [http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html  Creating OS X application bundles step by step] Covers the bundle concepts, copying libraries into the bundle, editing libraries with the install_name_tool, the Info.plist file and adding an icon.&lt;br /&gt;
* [http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ Bringing your Java Application to Mac OS X] I would regard this a little dated, and the detail is (unsurprisingly) Java-related, but it is a gentle introduction to the role of the .app bundle and give a most clear account of how to create one.&lt;br /&gt;
* The [http://gimp-app.sourceforge.net/gimp.app.howto.txt Gimp .app Howto] This is a very bare document, and would be of little help to you if you were new to making packages. Note that it seems to refer to a more mature Clipboard technique and Online help than we currently have; and we ought to move to parity in these areas.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39604</id>
		<title>CompilingMacOsX</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39604"/>
		<updated>2008-12-01T01:13:31Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* Installing dependencies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= For the impatient =&lt;br /&gt;
&lt;br /&gt;
1. Install [http://developer.apple.com/tools/xcode/ XCode tools] from your OS X installation DVD&lt;br /&gt;
&lt;br /&gt;
2. Download and install [http://www.macports.org/ MacPorts]&lt;br /&gt;
&lt;br /&gt;
3. In Terminal (Applications&amp;gt;Utilities&amp;gt;Terminal) type&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install cairo +pdf boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt poppler boost \ &lt;br /&gt;
 gnome-vfs libgnomeprintui automake autoconf subversion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: subversion is pre-installed on Leopard, so you may be fine leaving subversion out of the port install command chain.&lt;br /&gt;
&lt;br /&gt;
Grab a cup of coffee&lt;br /&gt;
&lt;br /&gt;
4. In Terminal, get and build Inkscape&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape&lt;br /&gt;
cd inkscape/packaging/macosx/&lt;br /&gt;
./osx-build.sh a c b i -s p&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voilà''. If you want to understand what you just did, read on.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
To compile Inkscape from source you need:&lt;br /&gt;
*Mac OS X &amp;gt; 10.3&lt;br /&gt;
*XCode Tools. They are on your installation DVD, in the optional installs, or can be download from [http://developer.apple.com/tools/xcode/ Apple Developer Connection]. You can customize the install to make it smaller (avoir documentation and example software for example). You need at least: gcc, XCode, X11SDK.&lt;br /&gt;
*Inkscape's source code. You can download an [http://www.inkscape.org/download.php official release source code], a [http://inkscape.modevia.com/svn-snap/?M=D development snapshot] or checkout a copy of the current state of the [http://www.inkscape.org/svn.php?lang=en SVN repository] using [http://subversion.tigris.org/ subversion]. Subversion comes pre-installed on Leopard. On previous system, subversion can be installed by package management systems (see point below) or with an OS X installer [http://homepage.mac.com/martinott/ package]&lt;br /&gt;
*A means of getting Inkscape's numerous dependencies: glibmm, gtkmm, lmcs, boehmgc... We recommend the use of [http://www.macports.org/ MacPorts] right now. ([http://www.finkproject.org/ Fink] was used in the past but it no longer meets Inkscape's needs currently.)&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with X11, using MacPorts [Recommended method]=&lt;br /&gt;
&lt;br /&gt;
== Installing dependencies ==&lt;br /&gt;
You can use MacPorts to list Inkscape dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;port deps inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some are mandatory and you can install them with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt boost gsl&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Others provide additional functionality to Inkscape:&lt;br /&gt;
* &amp;lt;code&amp;gt;gnome-vfs&amp;lt;/code&amp;gt; : access to remote servers, in particular import from Open Clipart Library&lt;br /&gt;
* &amp;lt;code&amp;gt;aspell&amp;lt;/code&amp;gt; : check spelling of text elements [Note: I have never seen it working on OS X, though at least it should install fine]&lt;br /&gt;
* &amp;lt;code&amp;gt;libgnomeprintui&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;loudmouth&amp;lt;/code&amp;gt; : jabber library used by InkBoard&lt;br /&gt;
* &amp;lt;code&amp;gt;cairo +pdf&amp;lt;/code&amp;gt; (cairo with the pdf variant) : better pdf export&lt;br /&gt;
* &amp;lt;code&amp;gt;poppler&amp;lt;/code&amp;gt; : better pdf import&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install gnome-vfs aspell libgnomeprintui loudmouth cairo +pdf poppler&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: Cairo was already installed at previous step as a GTK dependency. You need to either deactivate the old version and install this one, or directly write it on the command line above. &lt;br /&gt;
If you're unsure about MacPorts commands, you can find a guide that is easy to skim here: [http://guide.macports.org/ MacPorts Guide]&lt;br /&gt;
&lt;br /&gt;
In addition, Inkscape requires versions of the autotools more recent thant those that ship with OS X. Install them:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install autoconf automake&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More recent (Sep 2008) pre-packaged nightly builds for Mac OS X also feature additional dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install librsvg libwpd libwpg libcroco&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: At the time of editing (2008-12-01) there was a problem fetching &amp;quot;lzmautils&amp;quot; as the URL MacPorts tried to use as download source dies in a timeout. &lt;br /&gt;
As this package is needed as a dependency for one or more packages noted above you need to download the source tarball of lzmautils from somewhere else (for example, from [ftp://sunfreeware.mirrors.tds.net/pub/sunfreeware/SOURCES/lzma-4.32.7.tar.gz here]) and put that into the local MacPorts repository at &amp;quot;/opt/local/var/macports/distfiles/lzmautils&amp;quot;. You should now be able to run the commands above.&lt;br /&gt;
&lt;br /&gt;
Also make sure that you have &amp;quot;libxml2&amp;quot; and &amp;quot;libxslt&amp;quot; installed with MacPorts. This should have been installed previously, either directly or as a dependency.&lt;br /&gt;
You will need those later to compile the &amp;quot;lxml&amp;quot; Python module if you want to use Python effects. First check what's installed and if they are missing from your MacPorts repository install them by doing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;port installed&lt;br /&gt;
sudo port install libxml2 libxslt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pre-compiling the Python modules  ==&lt;br /&gt;
&lt;br /&gt;
If you cannot use the pre-built Python modules from [http://inkscape.modevia.com/macosx-snap/?C=M;O=D Modevia] (say, because you're using a different Python version) you need to search MacPorts for both &amp;quot;numpy&amp;quot; and &amp;quot;lxml&amp;quot; and install the ones suitable for the Python version active within MacPorts.&lt;br /&gt;
&amp;lt;pre&amp;gt;port search lxml numpy&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using a more recent Python version (say, MacPython 2.6) you will need to compile both modules outside of MacPorts. Download both modules from [http://pypi.python.org PyPI] if they are available there for Python 2.6. At the time of editing (2008-12-01) however both modules were only available through SVN for Python 2.6.&lt;br /&gt;
&lt;br /&gt;
There are enough tutorials for building and installing the &amp;quot;numpy&amp;quot; module but building the &amp;quot;lxml&amp;quot; module deviates a little from the standard way, so here is the command you need:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/lxml/source&lt;br /&gt;
sudo python setup.py install --with-xslt-config=/opt/local/bin/xslt-config \ &lt;br /&gt;
--with-xml2-config=/opt/local/bin/xml2-config&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells it to use the libxml2 and libxslt packages we installed earlier with MacPorts.&lt;br /&gt;
&lt;br /&gt;
If you are compiling the Python modules outside of MacPorts you will need to make a mental note for after running the Inkscape.app building script (detailed later in this guide) to copy both the &amp;quot;lxml&amp;quot; and &amp;quot;numpy&amp;quot; dir from the standard installation destination (normally &amp;quot;/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages&amp;quot;) to the extensions folder inside the Inkscape.app bundle (&amp;quot;Inkscape.app/Contents/Resources/extensions&amp;quot;).&lt;br /&gt;
This should take care of the &amp;quot;...needs fantastic libxml2 wrapper...&amp;quot; message when executing Python effects.&lt;br /&gt;
&lt;br /&gt;
== Setting the build environment ==&lt;br /&gt;
MacPorts's hierarchy (/opt/local/) is not searched for libraries by default. Therefore, before the configuration starts, some environment variables need to be set. The environment variables are presented in bash syntax here. &lt;br /&gt;
&amp;lt;pre&amp;gt;export LIBPREFIX=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$LIBPREFIX/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$LIBPREFIX/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$LIBPREFIX/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;lt;code&amp;gt;[http://en.wikipedia.org/wiki/Ccache ccache]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;sudo port install ccache&amp;lt;/code&amp;gt;) to speed up the compilation a bit. To do so, add compiler variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
If you compile Inkscape for the first time from an svn checkout you need to generate the configure script. Navigate to Inkscape's source directory and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;./autogen.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run configure with the options &amp;lt;code&amp;gt;--disable-static --enable-shared&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; which sets the directory where the build products are placed. It must be somewhere you have write access to.&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I you want to package Inkscape into a double-clickable &amp;lt;code&amp;gt;.app&amp;lt;/code&amp;gt; bundle in order to access it like a regular OS X application (you probably want to), you need to add the option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure {...} --enable-osxapp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have loudmouth installed and you want to enable whiteboard functionality in Inkscape, add &amp;lt;code&amp;gt;--enable-inkboard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other configuration options can be set, check the list of options by issuing:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building and Installing ==&lt;br /&gt;
Just run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .app bundle ==&lt;br /&gt;
Assuming that you have used the &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; option during &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;, navigate to Mac OS X packaging directory in Inkscape source code and use the automated script:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&lt;br /&gt;
./osx-app.sh -s -b /path/to/install/prefix/bin/inkscape -p ../../Info.plist&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script copies Inkscape binary and all its dependencies into the app bundle. The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; options strips libraries from debugging information (the bundle is therefore smaller). Omit this option if you want to keep debugging info.&lt;br /&gt;
&lt;br /&gt;
== Creating a disk image to distribute Inkscape ==&lt;br /&gt;
Inkscape.app created at the previous step is completely independent from the original location of MacPorts libraries and can therefore be distributed. It will only work on your platform though (PPC or Intel) and incompatibilities are known between X11 versions on different major versions of OS X (Panther, Tiger and Leopard). The general rule is that versions are not backward compatible.&lt;br /&gt;
&lt;br /&gt;
The most widespread way of distributing applications on Mac OS X is via .dmg images. You can created a dmg image of Inkscape, with a nice background and all, using the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-dmg.sh -p Inkscape.app&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the packaging directory for Mac OS X (where your app bundle should be, otherwise modify the path to Inkscape.app).&lt;br /&gt;
&lt;br /&gt;
== Automated build script ==&lt;br /&gt;
All these steps are automated by a build script: &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt;. It has built-in help so to known how to use it just type:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Compiling a Universal Binary of Inkscape with X11, using MacPorts=&lt;br /&gt;
&lt;br /&gt;
These instructions should work on both 10.4 and 10.5 machines with the latest Xcode version installed.&lt;br /&gt;
&lt;br /&gt;
== Update Macport sources ==&lt;br /&gt;
&lt;br /&gt;
The port descriptions in Macports do not currently all compile properly with their Universal variants.   For this reason, we currently use a modified set of some of the portfiles that will compile a universal libraries.  Work is being done to integrate these changes into Macports itself.&lt;br /&gt;
&lt;br /&gt;
You can use our modified portfiles by adding our ports to your sources:&lt;br /&gt;
&lt;br /&gt;
1. Checkout our ports directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/experimental/trunk/mjwybrow/ports ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit your sources list to include this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo vim /opt/local/etc/macports/sources.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
And add the following line *before* the existing rsync source:&lt;br /&gt;
&amp;lt;pre&amp;gt;file:///Users/YOURUSERNAME/directory/to/ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the portindex command in the checked-out port directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;portindex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run port sync&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal dependencies ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile Inkscape's essential dependencies as Universal libraries on either 10.4 or 10.5,  by giving the &amp;quot;+universal&amp;quot; option for each, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -v install poppler +universal gtk2 +universal ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have non-universal versions of these ports installed you may need to deactivate the port and rebuild it, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -f uninstall cairo&lt;br /&gt;
sudo port clean cairo&lt;br /&gt;
sudo port -v install cairo +universal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal Inkscape ==&lt;br /&gt;
&lt;br /&gt;
First, Set your SDK, 10.5 for Leopard, 10.4u for TIger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.5.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; (For Leopard)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.4u.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp;  (For Tiger)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, set up your environment to point to the Macports libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;export MACPORTS=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
export PATH=$MACPORTS/bin:$MACPORTS/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$MACPORTS/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$MACPORTS/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$MACPORTS/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall -isysroot $SDK -arch ppc -arch i386&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to configure and compile Inkscape.  Inkscape must be configured with the following options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;   Sets the correct path for Inkscape to be used from an .app bundle&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;--disable-dependency-tracking&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; Dependency tracking can't be user when compiling universal binaries.&lt;br /&gt;
&lt;br /&gt;
Inkscape can then be built (with make), installed, and packaged into a Universal .app bundle using the standard .app bundle building instruction above.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using MacPorts [experimental] =&lt;br /&gt;
This process is very similar to compiling an X11 version of Inkscape except for the building of dependencies: need to build native versions of Inkscape dependencies. At the moment (2007-12-17) this process does not produce a usable version of Inkscape but the more people try to use it, the quicker the bugs will be ironed out!&lt;br /&gt;
&lt;br /&gt;
== Native version of Inkscape dependencies ==&lt;br /&gt;
Thanks to the power of port &amp;quot;variants&amp;quot; and port &amp;quot;deactivation&amp;quot; you can install native versions of gtk, cairo, pango and such, alongside the regular X11 ones. To know which ports have a &amp;lt;code&amp;gt;quartz&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_x11&amp;lt;/code&amp;gt; variant, use the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;port list variant:quartz variant:no_x11&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you an idea of what need to be replaced.&lt;br /&gt;
&lt;br /&gt;
Assuming your MacPorts tree has been already used to build regular versions of Inkscape, you first need to deactivate (suppress from the tree without really uninstalling) the X11 versions of gtk, cairo, cairomm and pango:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port deactivate gtk2 cairo cairomm pango&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install native variants:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install cairo +quartz+pdf+no_x11 cairomm +quartz pango +no_x11 poppler +quartz gtk2 +quartz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than deactivating and reactivating ports, you can also keep two MacPorts trees side by side, provided you install the second one from source. Let say I want to install a new tree for native versions in /opt/local/native, I would do&lt;br /&gt;
&amp;lt;pre&amp;gt;export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin&lt;br /&gt;
cd ~/MacPorts-1.x.x/&lt;br /&gt;
./configure --prefix=/opt/local-native --with-tclpackage=/Library/Tcl/macports-native&lt;br /&gt;
make&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you need to have only one version of the port command in the path at any time so you need to setup your .bashrc (or .bash_profile or .profile) accordingly. I use shell aliases to quickly and temporarily switch to the universal version:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias portpathregular=&amp;quot;export PATH=/opt/local/bin:/opt/local/sbin:/Developer/Tools:/usr/local/bin: \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
alias portpathuniv=&amp;quot;export PATH=/opt/local-univ/bin:/opt/local-univ/sbin:/Developer/Tools:/usr/local/bin:  \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: the \ are just to mark line continuation here, suppress them and put everything in one line.&lt;br /&gt;
&lt;br /&gt;
== Install the rest ==&lt;br /&gt;
Eventually, follow the regular install procedure for the rest:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install libxslt boost boehmgc gtkmm lcms intltool popt&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your MacPorts tree was already ready to compile Inkscape, you should not need to reinstall anything, with the possible exception of gtkmm, which may need to be rebuilt against the native version of gtk rather than against the X11 one (please someone confirm this).&lt;br /&gt;
&lt;br /&gt;
Get inkscape source code and go in the mac OS X specific packaging directory&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&amp;lt;/pre&amp;gt;&lt;br /&gt;
There edit &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt; to remove the configure option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; because it puts inkscape in a .app bundle where it is started together with X11, which would defeat the purpose of this native compilation. You can also specify an alternative install prefix if you want. Then&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh u a c b i&amp;lt;/pre&amp;gt;&lt;br /&gt;
and a native version of Inkscape is installed in the prefix you specified or in the &amp;lt;code&amp;gt;Build/bin&amp;lt;/code&amp;gt; directory of Inkscape's source code. You can test it by&lt;br /&gt;
&amp;lt;pre&amp;gt; cd ../../Build/bin/&lt;br /&gt;
./inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: if you compiled a GTK theme engine against your old GTK install (i.e. the one with X11) and try to use it with the new install, it will complain, so edit &amp;lt;code&amp;gt;~/.gtkrc-2.0&amp;lt;/code&amp;gt; to remove the offending theme or recompile it with the new native GTK.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using the all in one build script [experimental] =&lt;br /&gt;
&lt;br /&gt;
To build a native-GTK build of Inkscape, GTK and some of its dependencies must be built with special options. You can do this using the build-gtk.sh script from the Inkscape repository (it's in packaging/macosx/native-gtk/).  This is a modified version of the Imendio native build script, found with instructions on this page:&lt;br /&gt;
http://developer.imendio.com/projects/gtk-macosx/build-instructions&lt;br /&gt;
&lt;br /&gt;
This process is relatively untested. If you have any troubles using this process then please report them to Michael Wybrow (mjwybrow on sourceforge).&lt;br /&gt;
&lt;br /&gt;
The process is:&lt;br /&gt;
&amp;lt;pre&amp;gt;export PREFIX=/your/install/prefix&lt;br /&gt;
./build-gtk bootstrap&lt;br /&gt;
./build-gtk build inkscape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enabling python effects =&lt;br /&gt;
moved to [[GettingEffectsWorking]]. They should work out of the box in the new versions anyway.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
== User Examples ==&lt;br /&gt;
* Adam Strzeleki has outlined some improvements to this process on the Inkscape [http://www.nabble.com/Inkscape-native-Mac-OS-X-build---look-improvements-td14733036.html email list]. See his screenshot from January 10, 2008 [http://www.nabble.com/attachment/14733036/1/Inkscape%20OSX%20PL.gif here].&lt;br /&gt;
* JiHO has a video of his builds [http://jo.irisson.free.fr/?p=34 here] and [http://jo.irisson.free.fr/?p=62 here].&lt;br /&gt;
&lt;br /&gt;
== Apple Documentation ==&lt;br /&gt;
* [http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html Introduction to Runtime Configuration] Covers the Info.plist files, Preferences, Environment variables and has a list of the most important Properties that the Property List should contain.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.sveinbjorn.org/platypus Sveinbjorn Thordarson's Website] The author of Platypus, the Script Exec wrapper that launches the Inkscape binary.&lt;br /&gt;
* [http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html  Creating OS X application bundles step by step] Covers the bundle concepts, copying libraries into the bundle, editing libraries with the install_name_tool, the Info.plist file and adding an icon.&lt;br /&gt;
* [http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ Bringing your Java Application to Mac OS X] I would regard this a little dated, and the detail is (unsurprisingly) Java-related, but it is a gentle introduction to the role of the .app bundle and give a most clear account of how to create one.&lt;br /&gt;
* The [http://gimp-app.sourceforge.net/gimp.app.howto.txt Gimp .app Howto] This is a very bare document, and would be of little help to you if you were new to making packages. Note that it seems to refer to a more mature Clipboard technique and Online help than we currently have; and we ought to move to parity in these areas.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39594</id>
		<title>CompilingMacOsX</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=CompilingMacOsX&amp;diff=39594"/>
		<updated>2008-11-30T23:57:46Z</updated>

		<summary type="html">&lt;p&gt;Andreb: /* For the impatient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= For the impatient =&lt;br /&gt;
&lt;br /&gt;
1. Install [http://developer.apple.com/tools/xcode/ XCode tools] from your OS X installation DVD&lt;br /&gt;
&lt;br /&gt;
2. Download and install [http://www.macports.org/ MacPorts]&lt;br /&gt;
&lt;br /&gt;
3. In Terminal (Applications&amp;gt;Utilities&amp;gt;Terminal) type&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install cairo +pdf boehmgc gtkmm gtk-engines2 intltool libxslt lcms popt poppler boost \ &lt;br /&gt;
 gnome-vfs libgnomeprintui automake autoconf subversion&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: subversion is pre-installed on Leopard, so you may be fine leaving subversion out of the port install command chain.&lt;br /&gt;
&lt;br /&gt;
Grab a cup of coffee&lt;br /&gt;
&lt;br /&gt;
4. In Terminal, get and build Inkscape&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/inkscape/trunk inkscape&lt;br /&gt;
cd inkscape/packaging/macosx/&lt;br /&gt;
./osx-build.sh a c b i -s p&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Et voilà''. If you want to understand what you just did, read on.&lt;br /&gt;
&lt;br /&gt;
= Requirements =&lt;br /&gt;
To compile Inkscape from source you need:&lt;br /&gt;
*Mac OS X &amp;gt; 10.3&lt;br /&gt;
*XCode Tools. They are on your installation DVD, in the optional installs, or can be download from [http://developer.apple.com/tools/xcode/ Apple Developer Connection]. You can customize the install to make it smaller (avoir documentation and example software for example). You need at least: gcc, XCode, X11SDK.&lt;br /&gt;
*Inkscape's source code. You can download an [http://www.inkscape.org/download.php official release source code], a [http://inkscape.modevia.com/svn-snap/?M=D development snapshot] or checkout a copy of the current state of the [http://www.inkscape.org/svn.php?lang=en SVN repository] using [http://subversion.tigris.org/ subversion]. Subversion comes pre-installed on Leopard. On previous system, subversion can be installed by package management systems (see point below) or with an OS X installer [http://homepage.mac.com/martinott/ package]&lt;br /&gt;
*A means of getting Inkscape's numerous dependencies: glibmm, gtkmm, lmcs, boehmgc... We recommend the use of [http://www.macports.org/ MacPorts] right now. ([http://www.finkproject.org/ Fink] was used in the past but it no longer meets Inkscape's needs currently.)&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with X11, using MacPorts [Recommended method]=&lt;br /&gt;
&lt;br /&gt;
== Installing dependencies ==&lt;br /&gt;
You can use MacPorts to list Inkscape dependencies:&lt;br /&gt;
&amp;lt;pre&amp;gt;port deps inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some are mandatory and you can install them with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install boehmgc gtkmm intltool libxslt lcms popt boost gsl&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Others provide additional functionality to Inkscape:&lt;br /&gt;
* &amp;lt;code&amp;gt;gnome-vfs&amp;lt;/code&amp;gt; : access to remote servers, in particular import from Open Clipart Library&lt;br /&gt;
* &amp;lt;code&amp;gt;aspell&amp;lt;/code&amp;gt; : check spelling of text elements [Note: I have never seen it working on OS X]&lt;br /&gt;
* &amp;lt;code&amp;gt;libgnomeprintui&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;loudmouth&amp;lt;/code&amp;gt; : jabber library used by InkBoard&lt;br /&gt;
* &amp;lt;code&amp;gt;cairo +pdf&amp;lt;/code&amp;gt; (cairo with the pdf variant) : better pdf export&lt;br /&gt;
* &amp;lt;code&amp;gt;poppler&amp;lt;/code&amp;gt; : better pdf import&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install gnome-vfs aspell libgnomeprintui loudmouth cairo +pdf poppler&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: Cairo was already installed at previous step as a GTK dependency. You need to either deactivate the old version and install this one, or directly write it on the command line above.&lt;br /&gt;
&lt;br /&gt;
In addition, Inkscape requires versions of the autotools more recent thant those that ship with OS X. Install them:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install autoconf automake&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting the build environment ==&lt;br /&gt;
MacPorts's hierarchy (/opt/local/) is not searched for libraries by default. Therefore, before the configuration starts, some environment variables need to be set. The environment variables are presented in bash syntax here. &lt;br /&gt;
&amp;lt;pre&amp;gt;export LIBPREFIX=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$LIBPREFIX/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$LIBPREFIX/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$LIBPREFIX/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use &amp;lt;code&amp;gt;[http://en.wikipedia.org/wiki/Ccache ccache]&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;sudo port install ccache&amp;lt;/code&amp;gt;) to speed up the compilation a bit. To do so, add compiler variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
If you compile Inkscape for the first time from an svn checkout you need to generate the configure script. Navigate to Inkscape's source directory and run:&lt;br /&gt;
&amp;lt;pre&amp;gt;./autogen.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then run configure with the options &amp;lt;code&amp;gt;--disable-static --enable-shared&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; which sets the directory where the build products are placed. It must be somewhere you have write access to.&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --disable-static --enable-shared --prefix=/path/to/build/products/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I you want to package Inkscape into a double-clickable &amp;lt;code&amp;gt;.app&amp;lt;/code&amp;gt; bundle in order to access it like a regular OS X application (you probably want to), you need to add the option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure {...} --enable-osxapp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have loudmouth installed and you want to enable whiteboard functionality in Inkscape, add &amp;lt;code&amp;gt;--enable-inkboard&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Other configuration options can be set, check the list of options by issuing:&lt;br /&gt;
&amp;lt;pre&amp;gt;./configure --help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Building and Installing ==&lt;br /&gt;
Just run:&lt;br /&gt;
&amp;lt;pre&amp;gt;make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .app bundle ==&lt;br /&gt;
Assuming that you have used the &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; option during &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt;, navigate to Mac OS X packaging directory in Inkscape source code and use the automated script:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&lt;br /&gt;
./osx-app.sh -s -b /path/to/install/prefix/bin/inkscape -p ../../Info.plist&amp;lt;/pre&amp;gt;&lt;br /&gt;
The script copies Inkscape binary and all its dependencies into the app bundle. The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; options strips libraries from debugging information (the bundle is therefore smaller). Omit this option if you want to keep debugging info.&lt;br /&gt;
&lt;br /&gt;
== Creating a disk image to distribute Inkscape ==&lt;br /&gt;
Inkscape.app created at the previous step is completely independent from the original location of MacPorts libraries and can therefore be distributed. It will only work on your platform though (PPC or Intel) and incompatibilities are known between X11 versions on different major versions of OS X (Panther, Tiger and Leopard). The general rule is that versions are not backward compatible.&lt;br /&gt;
&lt;br /&gt;
The most widespread way of distributing applications on Mac OS X is via .dmg images. You can created a dmg image of Inkscape, with a nice background and all, using the script:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-dmg.sh -p Inkscape.app&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the packaging directory for Mac OS X (where your app bundle should be, otherwise modify the path to Inkscape.app).&lt;br /&gt;
&lt;br /&gt;
== Automated build script ==&lt;br /&gt;
All these steps are automated by a build script: &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt;. It has built-in help so to known how to use it just type:&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh help&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Compiling a Universal Binary of Inkscape with X11, using MacPorts=&lt;br /&gt;
&lt;br /&gt;
These instructions should work on both 10.4 and 10.5 machines with the latest Xcode version installed.&lt;br /&gt;
&lt;br /&gt;
== Update Macport sources ==&lt;br /&gt;
&lt;br /&gt;
The port descriptions in Macports do not currently all compile properly with their Universal variants.   For this reason, we currently use a modified set of some of the portfiles that will compile a universal libraries.  Work is being done to integrate these changes into Macports itself.&lt;br /&gt;
&lt;br /&gt;
You can use our modified portfiles by adding our ports to your sources:&lt;br /&gt;
&lt;br /&gt;
1. Checkout our ports directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;svn co https://inkscape.svn.sourceforge.net/svnroot/inkscape/experimental/trunk/mjwybrow/ports ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit your sources list to include this directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo vim /opt/local/etc/macports/sources.conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
And add the following line *before* the existing rsync source:&lt;br /&gt;
&amp;lt;pre&amp;gt;file:///Users/YOURUSERNAME/directory/to/ports&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the portindex command in the checked-out port directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;portindex&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. Run port sync&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port sync&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal dependencies ==&lt;br /&gt;
&lt;br /&gt;
You should now be able to compile Inkscape's essential dependencies as Universal libraries on either 10.4 or 10.5,  by giving the &amp;quot;+universal&amp;quot; option for each, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -v install poppler +universal gtk2 +universal ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you already have non-universal versions of these ports installed you may need to deactivate the port and rebuild it, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port -f uninstall cairo&lt;br /&gt;
sudo port clean cairo&lt;br /&gt;
sudo port -v install cairo +universal&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Universal Inkscape ==&lt;br /&gt;
&lt;br /&gt;
First, Set your SDK, 10.5 for Leopard, 10.4u for TIger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.5.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; (For Leopard)&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;CODE&amp;gt;export SDK=/Developer/SDKs/MacOSX10.4u.sdk&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp;  (For Tiger)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, set up your environment to point to the Macports libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;export MACPORTS=&amp;quot;/opt/local&amp;quot;&lt;br /&gt;
export PATH=$MACPORTS/bin:$MACPORTS/sbin:/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin&lt;br /&gt;
#  automake seach path&lt;br /&gt;
export CPATH=&amp;quot;$MACPORTS/include&amp;quot;&lt;br /&gt;
#  configure search path&lt;br /&gt;
export CPPFLAGS=&amp;quot;-I$MACPORTS/include&amp;quot;&lt;br /&gt;
export LDFLAGS=&amp;quot;-L$MACPORTS/lib&amp;quot;&lt;br /&gt;
#  compiler arguments&lt;br /&gt;
export CFLAGS=&amp;quot;-O3 -Wall -isysroot $SDK -arch ppc -arch i386&amp;quot;&lt;br /&gt;
export CXXFLAGS=&amp;quot;$CFLAGS&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to configure and compile Inkscape.  Inkscape must be configured with the following options:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; &amp;amp;nbsp; &amp;amp;nbsp;   Sets the correct path for Inkscape to be used from an .app bundle&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;--disable-dependency-tracking&amp;lt;/code&amp;gt;  &amp;amp;nbsp; &amp;amp;nbsp; Dependency tracking can't be user when compiling universal binaries.&lt;br /&gt;
&lt;br /&gt;
Inkscape can then be built (with make), installed, and packaged into a Universal .app bundle using the standard .app bundle building instruction above.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using MacPorts [experimental] =&lt;br /&gt;
This process is very similar to compiling an X11 version of Inkscape except for the building of dependencies: need to build native versions of Inkscape dependencies. At the moment (2007-12-17) this process does not produce a usable version of Inkscape but the more people try to use it, the quicker the bugs will be ironed out!&lt;br /&gt;
&lt;br /&gt;
== Native version of Inkscape dependencies ==&lt;br /&gt;
Thanks to the power of port &amp;quot;variants&amp;quot; and port &amp;quot;deactivation&amp;quot; you can install native versions of gtk, cairo, pango and such, alongside the regular X11 ones. To know which ports have a &amp;lt;code&amp;gt;quartz&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;no_x11&amp;lt;/code&amp;gt; variant, use the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;port list variant:quartz variant:no_x11&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you an idea of what need to be replaced.&lt;br /&gt;
&lt;br /&gt;
Assuming your MacPorts tree has been already used to build regular versions of Inkscape, you first need to deactivate (suppress from the tree without really uninstalling) the X11 versions of gtk, cairo, cairomm and pango:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port deactivate gtk2 cairo cairomm pango&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install native variants:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install cairo +quartz+pdf+no_x11 cairomm +quartz pango +no_x11 poppler +quartz gtk2 +quartz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than deactivating and reactivating ports, you can also keep two MacPorts trees side by side, provided you install the second one from source. Let say I want to install a new tree for native versions in /opt/local/native, I would do&lt;br /&gt;
&amp;lt;pre&amp;gt;export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin&lt;br /&gt;
cd ~/MacPorts-1.x.x/&lt;br /&gt;
./configure --prefix=/opt/local-native --with-tclpackage=/Library/Tcl/macports-native&lt;br /&gt;
make&lt;br /&gt;
sudo make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then you need to have only one version of the port command in the path at any time so you need to setup your .bashrc (or .bash_profile or .profile) accordingly. I use shell aliases to quickly and temporarily switch to the universal version:&lt;br /&gt;
&amp;lt;pre&amp;gt;alias portpathregular=&amp;quot;export PATH=/opt/local/bin:/opt/local/sbin:/Developer/Tools:/usr/local/bin: \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&lt;br /&gt;
alias portpathuniv=&amp;quot;export PATH=/opt/local-univ/bin:/opt/local-univ/sbin:/Developer/Tools:/usr/local/bin:  \&lt;br /&gt;
/usr/X11R6/bin:/bin:/sbin:/usr/bin:/usr/sbin&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
NB: the \ are just to mark line continuation here, suppress them and put everything in one line.&lt;br /&gt;
&lt;br /&gt;
== Install the rest ==&lt;br /&gt;
Eventually, follow the regular install procedure for the rest:&lt;br /&gt;
&amp;lt;pre&amp;gt;sudo port install libxslt boost boehmgc gtkmm lcms intltool popt&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your MacPorts tree was already ready to compile Inkscape, you should not need to reinstall anything, with the possible exception of gtkmm, which may need to be rebuilt against the native version of gtk rather than against the X11 one (please someone confirm this).&lt;br /&gt;
&lt;br /&gt;
Get inkscape source code and go in the mac OS X specific packaging directory&lt;br /&gt;
&amp;lt;pre&amp;gt;cd packaging/macosx&amp;lt;/pre&amp;gt;&lt;br /&gt;
There edit &amp;lt;code&amp;gt;osx-build.sh&amp;lt;/code&amp;gt; to remove the configure option &amp;lt;code&amp;gt;--enable-osxapp&amp;lt;/code&amp;gt; because it puts inkscape in a .app bundle where it is started together with X11, which would defeat the purpose of this native compilation. You can also specify an alternative install prefix if you want. Then&lt;br /&gt;
&amp;lt;pre&amp;gt;./osx-build.sh u a c b i&amp;lt;/pre&amp;gt;&lt;br /&gt;
and a native version of Inkscape is installed in the prefix you specified or in the &amp;lt;code&amp;gt;Build/bin&amp;lt;/code&amp;gt; directory of Inkscape's source code. You can test it by&lt;br /&gt;
&amp;lt;pre&amp;gt; cd ../../Build/bin/&lt;br /&gt;
./inkscape&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: if you compiled a GTK theme engine against your old GTK install (i.e. the one with X11) and try to use it with the new install, it will complain, so edit &amp;lt;code&amp;gt;~/.gtkrc-2.0&amp;lt;/code&amp;gt; to remove the offending theme or recompile it with the new native GTK.&lt;br /&gt;
&lt;br /&gt;
= Compiling Inkscape with native GTK using the all in one build script [experimental] =&lt;br /&gt;
&lt;br /&gt;
To build a native-GTK build of Inkscape, GTK and some of its dependencies must be built with special options. You can do this using the build-gtk.sh script from the Inkscape repository (it's in packaging/macosx/native-gtk/).  This is a modified version of the Imendio native build script, found with instructions on this page:&lt;br /&gt;
http://developer.imendio.com/projects/gtk-macosx/build-instructions&lt;br /&gt;
&lt;br /&gt;
This process is relatively untested. If you have any troubles using this process then please report them to Michael Wybrow (mjwybrow on sourceforge).&lt;br /&gt;
&lt;br /&gt;
The process is:&lt;br /&gt;
&amp;lt;pre&amp;gt;export PREFIX=/your/install/prefix&lt;br /&gt;
./build-gtk bootstrap&lt;br /&gt;
./build-gtk build inkscape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enabling python effects =&lt;br /&gt;
moved to [[GettingEffectsWorking]]. They should work out of the box in the new versions anyway.&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
== User Examples ==&lt;br /&gt;
* Adam Strzeleki has outlined some improvements to this process on the Inkscape [http://www.nabble.com/Inkscape-native-Mac-OS-X-build---look-improvements-td14733036.html email list]. See his screenshot from January 10, 2008 [http://www.nabble.com/attachment/14733036/1/Inkscape%20OSX%20PL.gif here].&lt;br /&gt;
* JiHO has a video of his builds [http://jo.irisson.free.fr/?p=34 here] and [http://jo.irisson.free.fr/?p=62 here].&lt;br /&gt;
&lt;br /&gt;
== Apple Documentation ==&lt;br /&gt;
* [http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/BPRuntimeConfig.html Introduction to Runtime Configuration] Covers the Info.plist files, Preferences, Environment variables and has a list of the most important Properties that the Property List should contain.&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.sveinbjorn.org/platypus Sveinbjorn Thordarson's Website] The author of Platypus, the Script Exec wrapper that launches the Inkscape binary.&lt;br /&gt;
* [http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html  Creating OS X application bundles step by step] Covers the bundle concepts, copying libraries into the bundle, editing libraries with the install_name_tool, the Info.plist file and adding an icon.&lt;br /&gt;
* [http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/ Bringing your Java Application to Mac OS X] I would regard this a little dated, and the detail is (unsurprisingly) Java-related, but it is a gentle introduction to the role of the .app bundle and give a most clear account of how to create one.&lt;br /&gt;
* The [http://gimp-app.sourceforge.net/gimp.app.howto.txt Gimp .app Howto] This is a very bare document, and would be of little help to you if you were new to making packages. Note that it seems to refer to a more mature Clipboard technique and Online help than we currently have; and we ought to move to parity in these areas.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer Documentation]]&lt;/div&gt;</summary>
		<author><name>Andreb</name></author>
	</entry>
</feed>