フォローはこちらから:

Home » 開発者向け » 始める

Getting Started with Inkscape Development

This 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 Inkscape on Linux

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 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. Once you have the dependencies installed, use the following commands in the Inkscape source directory:

./autogen.sh
./configure
make -j8
sudo make install

The -j8 argument to make tells it to run 8 jobs in parallel. Feel free to adjust this to the number of hardware threads available on your computer.

Building Inkscape on Windows

For Windows, the development files are kept in the Inskcape Devlibs repository. It is recommended to check them out to the default directory C:\devlibs. In addition to the contents of this repository, you will need the MinGW compiler (the devlibs are known to work with TDM-GCC 4.6.1), Bazaar, PuTTY and NSIS, which you will need to install separately.

bzr checkout --lightweight lp:inkscape-devlibs C:\devlibs

To build Inkscape, use the btool utility.

mingwenv
g++ buildtool.cpp -o btool
btool

Inkscape, being a large project, can take a significant amount of time for to build on some older processors. You can use ccache like this to save some building time.

Building Inkscape on Mac

Instructions coming soon. See wiki page.

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.

Programming Style

Inkscape's programming style guidelines can be found here

Community