Development

From MyPaint

Revision as of 03:00, 7 July 2012 by DementedSnake (Talk | contribs)
Jump to: navigation, search

So you want to help with MyPaint development? This is the place to start.

Contents

Coding

Interested in hacking and/or contributing to MyPaint?

MyPaint is mainly written in Python (using the GTK toolkit), with a brush engine in C++. More information about the code can be found in the developer documentation. In general, the codebase is quite simple and easy to get into.

We use git for code maintenance and the main repository is located on gitorious.org.

Finding tasks

If you don't know exactly what you want to do, here are some ideas:

Getting in touch

If you have any questions, don't hesitate to ask!

You can subscribe to our mailing list or join our IRC channel #mypaint @ irc.freenode.org. And feel free to comment on wiki pages and on bug items when appropriate.

There is also a list of MyPaint developers, but try the communication channels mentioned above first.

Getting contributions into MyPaint

Please follow these best practices when writing code. It will make it easier for maintainers to review your code, increasing the chance that it will be included into mainline MyPaint significantly.

  • Follow the code conventions of the files you are editing.
  • Document your code
    • Write docstrings describing what a function or class does
    • When it is not obvious, add comments to explain why you are doing something
  • Keep commits/patches atomic, containing only one logical change
  • Keep commit history clean, use a separate branch which contains only the relevant commits
  • Let your commits or patches apply cleanly to the latest git version
  • Tell us about your work and bug us to look at it. The bug tracker or mailing list is the most reliable way.
  • Make sure your code or artwork is licensed so that we, and others, can redistribute it. See the Licensing policy for more.

Non-coding tasks

Bug Reporting

Anyone can help out by reporting bugs when you find them. Fixing bugs makes MyPaint better for everyone. Just go to our GNA.org bug reporting page

When reporting a bug, try to be specific.

First, try to make sure it is a bug. A mistake installing, corrupt files, problems with other software, and unintuitive functions can all seem like bugs in MyPaint. Try to be able to replicate the bug on demand. Make sure to include detailed information which can help in pinpointing and fixing the bug. Try to include a concise overview without speculating too much. Include the steps you know of to reproduce the bug. Include what happens when the bug appears. In-program bug reports, error messages, and strange program behavior are all good info to provide. Share what you expect to happen and what actually happens. Include the version of MyPaint, your operating system, and whatever other information (such as your tablet brand and model) that is related to the bug.

Here's an example of a helpful bug report.

Packaging

Want to help making easy-to-install packages for your favorite platform/distribution? Check out this page.

Translating

Want to translate MyPaint into your language?

MyPaint uses GNU gettext to allow translation. The translations can be found in the po/ directory in the source code (online browser). This directory also contains a README which has some info on how to contribute fixes or new translations.

Brushes and backgrounds

Have you created some cool brushes or backgrounds for MyPaint? Share them with others!

Documentation

Know how to use MyPaint? Perhaps you have some nice painting tricks to show? Help teach others by contributing to our documentation.

Brainstorming

Got good ideas? Every user can help with the brainstorming process and have an influence on future development of MyPaint!

Quick Setup

If you are running a relatively modern distribution of Linux, you can probably use the following bash script to quickly set up MyPaint's development version on a new machine for immediate testing. Run as a normal user, not as root. The script installs the dev version in its own prefix, so your stable version shouldn't be broken.

This script assumes you have a deb-based packing system. You may need to adjust it for other systems.

#!/bin/bash
# Installs MyPaint's dependencies.
echo "Enter password to install dependencies..."
if [ -f /etc/debian_version ]; then
  sudo apt-get update && sudo apt-get install git scons python-numpy swig libglib2.0-dev python-dev python-cairo-dev libpng12-dev g++ gettext liblcms2-dev libjson0-dev
else
  sudo yum install git scons numpy swig glib2-devel python-devel pycairo-devel libpng-devel gcc-c++ gettext liblcms2-devel libjson0-devel
fi

# Makes two folders, one to store GIT clones, and one in which MyPaint will be installed.
mkdir ~/mypaintdev
git clone git://gitorious.org/mypaint/mypaint.git ~/mypaint-src
cd ~/mypaint-src
scons prefix=~/mypaintdev/ install

ln -s ~/mypaintdev/lib/libmypaint-brushlib.so ~/mypaintdev/lib/mypaint/libmypaint-brushlib.so  # see next comment

scons prefix=~/mypaintdev/ install  # not ideal, but making a symlink for a 'missing' lib, then running scons again

# Just lets you know that you've installed MyPaint into this folder.
echo "MyPaint is now installed in the mypaintdev folder in your home directory."


# wait three seconds so the user can see the above message
sleep 3

# Launches the MyPaint installation.
~/mypaintdev/bin/mypaint

This is a simple update (bash) script you can use.

#!/bin/bash
cd ~/mypaint-src/
git pull
scons prefix=~/mypaintdev/ install
~/mypaintdev/bin/mypaint



Personal tools