Contents
Getting Started with Inkscape Development
Code Link: https://gitlab.com/inkscape/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 GitLab account
To report bugs and help with technical subjects you will need a GitLab 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 Gitlab 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 git version control system. Platform-specific installation instructions are available here. On Debian and related systems (e.g. Ubuntu), you need to install the git package.
We recommend to set up a GitLab 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 GitLab account, execute the following commands:
git config --global user.name "Real Name" git config --global user.email "[email protected]"
where Real Name is your real name or a pseudonym you want to use (it should be recognizable to people on the mailing list) and [email protected] is your e-mail for Inkscape-related correspondence (it can be obfuscated if you want - but the obfuscated email address must be added at gitlab as one of your email addresses, so your commits can be associated with your account). With this setup, you will be able to commit once you are approved as a member of the Inkscape Developers team on GitLab.
To obtain the latest source code, use the following command:
git clone --recurse-submodules [email protected]:inkscape/inkscape.git
To update this code later, use:
git pull --recurse-submodules && git submodule update
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 systems is to use the command:
sudo apt build-dep inkscape
Note:
For development you should start with a daily build, as found in the inkscape trunk PPA:
sudo add-apt-repository -s ppa:inkscape.dev/trunk sudo apt update sudo apt install inkscape-trunk
You can use this alternative command to get a more accurate set of build dependencies:
sudo apt 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=$(pwd)/../inst [-DCMAKE_CXX_COMPILER_LAUNCHER=ccache]
make [-j8]
make install
Run it from the build directory:
../inst/bin/inkscape
Notes:
- Square brackets indicate optional arguments to speed up compilation.
- The optional
-j8argument tomaketells 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_PREFIXargument 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] 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
The latest instructions are always available on the Inkscape Wiki, see Compiling Inkscape for Windows.
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 cmake potrace libsoup
Get Inkscape:
git clone --recurse-submodules [email protected]:inkscape/inkscape.git
Build it:
mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/../inst && make -j8 && make install
Run it from the build directory:
../inst/bin/inkscape
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 for the upcoming 1.0 release. 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 Gitlab 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.
Links
Community
-
Mailing list:
[email protected]. Most of the developers are subscribed to the mailing list. -
IRC:
#inkscape-develon Freenode. -
Inkscape bugtracker: Fixing some easy bugs is a great way to get started with Inkscape development.