Sunday, April 08, 2007

Beginners guide to Gnome Python games

In Gnome games we need more help to squash some bugs. I've been bogged down squashing Sudoku bugs which aren't too difficult - just time consuming. It's a great opportunity for you to get involved. I think it's hard to jump into development so here is a step by step entry guide to fixing bugs. Note the following instructions work fine for glChess too.

First install Gnome games. You can install this anywhere but I usually make a subversion directory:

$ mkdir svn
$ cd svn

Check out the development version:

$ svn co http://svn.gnome.org/svn/gnome-games/trunk gnome-games
$ cd gnome-games

Configure the package:

$ ./autogen.sh --prefix=/tmp

This will get the software installed in /tmp, you might want to use ~/build or something similar instead.

For the above you will need the appropriate development tools installed. This will be distribution specific so unfortunately you're on your own here... If I remember which ones I installed on Ubuntu I'll state it here. Oh and on Ubuntu Edgy edit configure.in and change GNOME_PYTHON_DESKTOP_REQUIRED=2.17.3 to 2.16.0 because it works fine with the old (installable) version.

Install Sudoku:

$ cd gnome-sudoku
$ make install

To run:

$ PYTHONPATH=/tmp/lib/python2.4/site-packages/ /tmp/bin/gnome-sudoku

Now here's the cool part - because Sudoku is written in Python you don't need to recompile to make changes... What I do is edit the files in /tmp/lib/python2.4/site-packages/gnome-sudoku and run again. You can add print statements, make radical changes, whatever you like. And if things get too broken overwrite the install with another make install.

When you've fixed the change you need to make a patch to attach to a bug report. To do this you need to update the files in ~/svn/gnome-games. What I use is Meld:

$ meld ~/svn/gnome-games/gnome-sudoku /tmp/lib/python2.4/site-packages/gnome-sudoku

Once you've got the changes merged into the checked out copy make a patch:

$ cd ~/svn/gnome-games/gnome-sudoku
$ svn diff > your_changes_description.patch

And send that in.

Don't worry about the patch being perfect, the developers who know the codebase better will look it over and modify/suggest changes to you. It may take time to get a response because we're all volunteers but we do appreciate the work - We need more help and you're the right person for the job! The first patch is always the hardest too :)

Feedback very welcome.
Post a Comment