Difference between revisions of "CompilingMacOsX"

From Inkscape Wiki
Jump to navigation Jump to search
(slight refactoring of the page to add --enable-osxapp)
 
(Moved to GitLab)
Tag: Replaced
 
(230 intermediate revisions by 39 users not shown)
Line 1: Line 1:
= Compiling and Packaging Inkscape under Mac OS X =
{{MovedToOtherSite|topic=compiling Inkscape|new_url=https://gitlab.com/inkscape/inkscape/-/blob/master/doc/building/mac.md|new_site=GitLab}}
 
== Before you start ==
If you want an Official Release, note that from version 0.42 of Inkscape a Mac OS X package (in .dmg form) will be available. In addition, regular Development Versions will be build. Both can be downloaded from Inkscape's downloads page:
 
:http://www.inkscape.org/download.php
 
Inkscape for Mac OS X is an X client: it runs under the [http://en.wikipedia.org/wiki/X_Window_System X Windows System]. You will need an X Windows Server installed for it to work. You can get Apple's X Server (requires Mac OS X 10.3 or above) here:
 
:http://www.apple.com/downloads/macosx/apple/x11formacosx.html
 
----
 
== Compiling How To ==
 
'''Note''': You could use the [http://fink.sourceforge.net/pdb/package.php/inkscape Inkscape package] from the [http://fink.sourceforge.net Fink project] to install Inkscape from source but this package is usally older that the precompiled Development Versions and even that the Official Release so this does not seem useful.
 
'''Requirements''':
#Mac OS X 10.3 of higher
#A full [http://fink.sourceforge.net/faq/usage-fink.php?phpLang=en#unstable unstable fink] installation
#Inkscape's source code. You can get the [http://www.inkscape.org/download.php official release source code], a [http://www.inkscape.org/cvs-snap/ CVS snapshot] or a copy of the [http://sourceforge.net/cvs/?group_id=93438 cvs repository] (the module name is "inkscape")
 
'''Installing dependencies''':
 
In a Terminal type:
<pre>
fink install �
        intltool �
        glib2 glib2-dev glib2-shlibs �
        gtk+2 gtk+2-shlibs gtk+2-dev �
        libpng3 libpng3-shlibs �
        libsigc++2 libsigc++2-shlibs �
        gtkmm2.4 gtkmm2.4-dev gtkmm2.4-shlibs �
        libtool14 libtool14-shlibs �
        libxml2 libxml2-shlibs �
        popt popt-shlibs �
        gc gc-shlibs automake1.8
</pre>
 
You need automake 1.8 and not the latest in fink (1.9.6-1). Fink installs many packages from source so this is usually long.
 
'''Setting the build environment''':
 
You need set the following environment variables (taken right out of fink's <code>.info</code> file) for the compilation to work. They are in bash syntax. You can create a file named <code>set_variables</code> for example and copy/paste this inside:
<pre>
#!/bin/bash
FINK="/sw"
export LIBRARY_PATH="/usr/X11R6/lib:$FINK/lib"
export CPATH="$FINK/include"
export PATH="/usr/X11R6/bin:$PATH"
export CC="gcc"
export CXX="g++"
export CPPFLAGS="-I$FINK/include"
export LDFLAGS="-L$FINK/lib"
export CFLAGS="-O3 -Wall"
export CXXFLAGS="$CFLAGS"
</pre>
 
Optionaly, to speed up the compilation a bit you could use <code>ccache</code> if you have it installed:
<pre>
export CC="ccache gcc"
export CXX="ccache g++"
</pre>
 
'''Note''': Inkscape won't link properly on OS X 10.4.x using gcc 4 (the default) since many of the libraries it needs in fink are still built with gcc-3.3.  Thus, Tiger users will probably want to modify a couple of lines:
<pre>
export CC="gcc-3.3"
export CXX="g++-3.3"
</pre>
 
Then, open a Terminal and, in the directory where you created the file <code>set_variables</code>, type:
<pre>
bash
source set_variables
</pre>
 
Then you need to build the configure script. Cd to Inkscape's source directory and run:
<pre>
autogen.sh
</pre>
 
'''Configuring''':
 
Cd to Inkscape's sources directory and type
<pre>
./configure --prefix=/path/to/build/products/ --enable-osxapp
</pre>
The <code>--prefix</code> option sets the directory where the build products are placed. It must be somwhere you have write access to. The option --enable-osxapp allows you to package Inkscape into an <code>.app</code> bundle in order to access it like a regular OS X application. Remove this option if you only want to build Inskscape, not to package it afterwards.
 
'''Building''':
<pre>
make
make install
</pre>
 
'''Packaging''':
 
Assuming that you have used the <code>--enable-osxapp</code> option during <code>configure</code>, the process is fully automatized. You just have to open a Terminal, cd to Inkscape's sources directory and type:
<pre>
cd packaging
./osx-app.sh /path/to/build/products/bin/inkscape ../Info.plist macosx
</pre>
 
You will end up with two files in current directory: Inkscape.app that you can copy to your Applications directory and Inkscape.dmg for distribution.
 
-- Kees Cook, Michael Wybrow, Jean-Olivier Irisson
 
----
 
== Interesting links ==
 
Some packaging links:
http://freespace.ausgamers.com/2005/02/creating-os-x-application-bundles-step.html
http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/
http://gimp-app.sourceforge.net/gimp.app.howto.txt

Latest revision as of 17:53, 14 June 2025

The Inkscape Wiki is no longer used to host information about compiling Inkscape.

You can now find related information at GitLab.

This page is kept for historical reasons, e.g. to document specific decisions in Inkscape development.