PyGI Hackfest Modules

Here are a list of modules you will need to get started hacking on the PyGI codebase and the options you will need to enable.

GLib, GTK+

These are listed here for completeness. You should be able to get a recent versions directly from your distribution. No special flags are needed.

gobject-introspection

Git Browse: http://git.gnome.org/browse/gobject-introspection/

Some distributions already have this packaged. It is suggested that you build from git to get bug fixes that affect the rest of the modules.

gir-repository

Git Browse: http://git.gnome.org/browse/gir-repository

Some distributions already have this packaged or you can grab it from GNOME git. This is being deprecated and if you have more recent versions of GTK+ compiled with introspection you won't need this package.

pygobject

Git Browse:

configure flag(s): --enable-pygi

If you care about hacking on python3 support you should get jpe's patched version on github otherwise git head on gnome.org works fine. The py3k branch does not yet compile under py3k but most of the infrastructure is there.

pygi

Git Browse:

The callback branch is being developed to add support for callbacks (Bug #603095 and Bug #602736. It should be moved to an upstream branch soon.

Getting up and running with JHBuild

Note there are many ways to get things running. These instructions are how I went about setting up a JHBuild environment. One can use a stock JHBuild tree or the OLPC Sugar tree but some things may be slightly different. For simplicity sake and since the gnome-shell tree already contains the introspection bits by default I will describe how to build using that.

To start, download and run the setup script:

curl -O http://git.gnome.org/browse/gnome-shell/plain/tools/build/gnome-shell-build-setup.sh
/bin/bash gnome-shell-build-setup.sh

Download my modules file and place it somewhere convenient:

curl -O http://fedorapeople.org/~johnp/gnome-shell-pygi.modules

Edit the ~/.jhbuild-custom file to point to the modules file and add your own configuration. Here is mine for reference.

# -*- mode: python -*-

#override the moduleset
moduleset = '/home/johnp/devel/gnome-shell/gnome-shell-pygi.modules'

# build pygi
modules = [ 'pygi-full' ]

# The username for repositories can be overridden.
#
repos["git.gnome.org"] = "ssh://johnp@git.gnome.org/git/"

# Directory where to check sources out
#
checkoutroot = '/home/johnp/devel/gnome-shell/source'

# Directory where to install
#
prefix = '/home/johnp/devel/gnome-shell/install'

# Work around https://bugzilla.gnome.org/show_bug.cgi?id=571240 if
# your 'install' program is somewhere other than /usr/bin/install
# (affects: Arch Linux)
#installprog = 'bin/install'

You can now run jhbuild build to build your environment.

After it is done you can run python by running

> jhbuild shell
> python

Check that everything is ok by trying to import gi

import gi

On 64 bit OS's you may need to set the Python path before running python. For instance I have to invoke python this way:

PYTHONPATH="/home/johnp/devel/gnome-shell/install/lib64/python2.6/site-packages/:/home/johnp/devel/gnome-shell/install/lib64/python2.6/site-packages/gtk-2.0/" python

Editing the modules file

You may edit the modules file to grab different branches and repos for each of the modules as well as change the configure switch. Please refer to the jhbuild manual for complete instructions. What follows is some basic tips on modifying the modules file.

For most of our modules you can grab them from the main gnome repository but sometime you want to check out someone else's fork or develop on your own before merging with mainline. TO do this you must first add a repository. The main repo is defined like so:

<repository type="git" name="git.gnome.org"
      href="git://git.gnome.org/"/>

For pygobject I wanted to try out jpe's py3k fork so I added his repository:

<repository type="git" name="pygobject-py3k-github"
      href="git://github.com/jpe/"/>

I then needed to add build instructions:

 <autotools id="pygobject-py3k" autogenargs="--enable-pygi">
   <branch repo="pygobject-py3k-github" module="pygobject-py3k" revision="py3k"/>
    <dependencies>
      <dep package="glib"/>
    </dependencies>
  </autotools>

You will notice that including using the new pygobject-py3k-github repo that we configured above we also specified the branch with the "revision" attribute. We also added the build switch "--enable-pygi" to the build.

You can also skip editing the modules file and just compile modules by hand inside the JHBuild shell. However, adding them to the modules file means it is easy to rebuild the whole stack quickly.

Attic/PyGI/Hackfest2010/Modules (last edited 2013-11-23 00:12:54 by WilliamJonMcCann)