Contents

Getting Started with Inkscape Development

Code Link: lp:inkscape

This is intended to be a quick reference, to getting started with Inkscape development. For the details, take a look at the Inkscape Wiki and other specific documentation.

Setting up a Launchpad account

To report bugs and help with technical subjects you will need a Launchpad account. To commit source code, you will additionally need to set up SSH keys for your account. Detailed instructions for setting up an account are available in the Launchpad user tutorial.

Fetching the source code

The first step is to obtain the source code. Just downloading the "Release" source code files is not enough, as you will need to get the latest bleeding-edge sources in order to develop Inkscape.

Inkscape uses the Bazaar version control system. Platform-specific installation instructions are available here. On Debian and related systems (e.g. Ubuntu), you need to install the bzr package. On Windows, you'll need to download and execute the installer.

We recommend to set up a Launchpad account (see above) before obtaining the source code, since that way it is easier to commit later once you get commit access. Once you set up your Launchpad account, execute the following commands:

bzr whoami "Real Name <e-mail@domain.tld>"
bzr launchpad-login username

where Real Name is your real name or a pseudonym you want to use (it should be recognizable to people on the mailing list), e-mail@domain.tld is your e-mail for Inkscape-related correspondence (it can be obfuscated if you want), and username is you Launchpad user name. With this setup, you will be able to commit once you are approved as a member of the Inkscape Developers team on Launchpad.

To obtain the latest source code, use the following command:

bzr checkout lp:inkscape

To update this code later, use:

bzr update

Using Git

If you want to use Git instead of Bazaar, you can easily do this via the git-bzr adapter. Check out our guide for Git users.

Building inside a Virtual Box VM

Possibly the simplest way to build Inkscape is using inkup, which provides you with a Vagrantfile capable of building a virtual machine, which build Inkscape from sources. It requires you to have VirtualBox and Vagrant installed on your machine.

Building Inkscape on Linux

Install build dependencies

To build Inkscape, you will need to install the GCC compiler and the development files for all the libraries it uses. The easiest way to do this on Debian and related system is to use the command:

sudo apt-get build-dep inkscape

Note: If you are using the PPA for the latest builds on Debian, you can use this alternative command to get a more accurate set of build dependencies:

sudo apt-get build-dep inkscape-trunk

Note that this will install the build dependencies of the Inkscape package available in your repositories. If the package is old, you might need to install some additional dependencies; the output of the configure script should give you hints on what else is required.

From 0.92 onwards

In Inkscape 0.92, we support two build systems in parallel: the above-mentioned autotools, and CMake.

To compile with CMake, do the following:

mkdir build
cd build
cmake [-DCMAKE_INSTALL_PREFIX=/usr] ..
make [-j8]
sudo make install

Square brackets indicate optional arguments.

The optional -j8 argument to make tells it to run 8 jobs in parallel. Feel free to adjust this to the number of hardware threads (physical cores) available on your computer. The optional -DCMAKE_INSTALL_PREFIX argument allows you to install a second Inkscape version in parallel, into a different folder (/usr in the example). It will still use all the files (including the preferences.xml) that reside in the ~/.config/inkscape directory.

Versions <= 0.92

Once you have the dependencies installed, use the following commands in the Inkscape source directory:

./autogen.sh
./configure [--prefix=/usr]
make [-j8]
sudo make install

Square brackets indicate optional arguments.

The optional -j8 argument to make tells it to run 8 jobs in parallel. Feel free to adjust this to the number of hardware threads (physical cores) available on your computer. The optional --prefix argument allows you to install a second Inkscape version in parallel, into a different folder (/usr in the example). It will still use all the files (including the preferences.xml) that reside in the ~/.config/inkscape directory.

Building Inkscape on Windows

Building Inkscape on Windows is a bit less straightforward since the necessary tools and libraries are not included in the operating system. Therefore you'll need to download separately:

  • the version control system Bazaar which is used for managing the Inkscape source as well as the devlibs code (not strictly required for a single build but highly recommended, especially if you want to do regular builds or contribute code);
  • the build system CMake (used since Inkscape 0.92);
  • MinGW (aka "Minimalist GNU for Windows") which includes the necessary compiler and command line tools (see note below!);
  • a copy of the "Inkscape Devlibs", see inkscape-devlibs (for 32-bit builds) or inkscape-devlibs64 (for 64-bit builds). Those contain pre-built versions of the programming libraries Inkscape needs to run.
    You can use Bazaar to download devlibs, e.g. by running:
    bzr checkout --lightweight lp:inkscape-devlibs C:\devlibs
    (the "--lightweight" switch makes Bazaar only download the latest revision, saving you a lot of download time and disk space).

Since the version of the MinGW compiler you need depends on if you're building a 32-bit or 64-bit executable and on the compiler version used for building the devlibs it's highly recommended to check out the more detailed articles on Compiling Inkscape for Windows and Compiling Inkscape for Windows 64-bit to determine the exact requirements before proceeding.

After you have downloaded the Inkscape source as well as all requirements you're ready to build. First set up paths in the file "mingwenv.bat" (located in the root of the Inkscape source directory) to match folder locations on your system. Then open a command line window, navigate to your Inkscape source directory and execute the following commands:

mingwenv.bat
set-up environment variables
mkdir build
cd build
set-up a build directory (if you should ever happen to run into serious problems try to delete this directory and start over)
cmake -G "MinGW Makefiles" ..
create makefiles
mingw32-make -j 2
start the actual compilation process (the -j option sets the number of compilation threads and can be used to significantly speed up the compilation process)
mingw32-make install

create the distribution directory (i.e. copy all required files into one subdirectory, by default "builds\inkscape", from where you can run your brand-new build of Inkscape)

Building Inkscape on Mac

Install the dependencies listed on the wiki:

port install cairo boehmgc gtkmm3 intltool libxslt lcms2 gdl3 \
popt poppler boost gsl gnome-vfs libgnomeprintui bzr cmake potrace

Get Inkscape:

bzr branch lp:inkscape trunk

Build it:

mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/../inst && make -j8 && make install

Run it:

inst/bin/inkscape

Developer workflow

Bazaar

As the Inkscape project uses Bazaar as a VCS, you'll need to use it to contribute to the project. More detailed information about Bazaar can be found on the Inkscape Wiki and in the official Bazaar documentation.

Debugging with GDB

Inkscape should be built with the -g flags for g++ so that it can be debugged with GDB.

Inkscape Development

The Inkscape Codebase

Inkscape started as a fork of Sodipodi, a GNOME application based on GObject. Inkscape is written in a mixture of C and C++, due to historical reasons. We hope to eventually migrate it to C++. There is still however, a lot of GObject-based code, so some knowledge of GObject is necessary to work with Inkscape.

Inkscape uses the GTK+ widget toolkit and the Glib support library. We are in the process of migrating from GTK+ 2.0 to GTK+ 3.0. We also use the header-only parts of Boost (i.e. it is a compile-time dependency, but not a runtime dependency). The geometry library lib2geom, written in C++, is intended to eventually become a separate project. You can get the latest version of lib2geom from its Launchpad repository.

Knowing how to program in C++, and use GTK is essential for contributing to Inkscape. Fortunately, these aren't that difficult to learn, so do read relevant tutorials.

The Inkscape project uses Doxygen to automatically generate source code documentation (including diagrams of the program structure). You can quickly get an overview about the part of the program you'd like to work on here.

Programming Style

Inkscape's programming style guidelines can be found here.

Community

  • Mailing list: inkscape-devel@lists.sourceforge.net. Most of the developers are subscribed to the mailing list.

  • IRC: #inkscape-devel on Freenode.

  • Inkscape bugtracker: Fixing some easy bugs is a great way to get started with Inkscape development.