Installing and Building Gnumeric for Python

This section describes how to obtain the Gnumeric source code, configure it for Python and build it. This section will eventually be removed as Python becomes supported by default.

18.3.1.1. Preliminaries

I'm going to define some variables here so that you can insert the appropriate command or item for your system when they occur. I'll prefix them all with '$'.

  • $root: Do whatever you do to become root. The usual options are:
    • su - and hit Enter
    • sudo
    • fakeroot (works in some situations, but not all)
  • $version: Whatever your current Gnumeric version is. Some examples:
    • 1.4.20
    • 1.6.20
    • 1.7.90

18.3.1.2. In the Beginning (Installing and Building)

You need to get Python and Gnumeric, and the Python plugin for Gnumeric. You can get the binaries, the packaged source, or the developing edge sources from Git.

18.3.1.2.1. Getting the binaries (Debian)

I've only tested this on sid (unstable). The version you get from stable (woody) may not act quite the same.

  • $root apt-get install gnumeric gnumeric-python python

18.3.1.2.2.  Getting and building the current Debianized source

If you have Debian, and don't need the bleeding edge, this is by far the easiest way to get and build the source.

  1. Change to a directory where you want to hang the source directory.

  2. $root apt-get build-dep gnumeric

  3. apt-get source gnumeric

  4. cd gnumeric-$version

  5. debian/rules build

  6. To make the .deb packages: $root ./debian/rules binary

  7. To install those .deb packages:

    1. cd .. to change to that directory.

    2. $root dpkg -i gnum*deb (presuming you don't have other .deb packages beginning with "gnum" lying around here.

  8. You may or may not want to remove those .deb files now: $root rm gnum*deb)

18.3.1.2.3. Getting and building the source from Git

Remember that this is the developing edge. Things may not work. Generally don't do this unless you are subscribed to the mail list and possibly also on the IRC channel.

You will need a few things for this to work at all:

  1. gnome-common

  2. libgsf (see below)

  3. pygtk2 (On Debian, make sure to get python-gtk2 and python-gtk2-dev)

  4. gnumeric (see below, obviously)

And although the following will build in the main build space, it's probably better to build in a temporary space. But I can't be bothered to learn how to fiddle the build pathways.

  1. Change to a directory where you want to hang the source directory for Gnumeric and a few other GNOME things.

  2. Getting and building libgsf:

    1. git clone git://git.gnome.org/libgsf

    2. cd libgsf

    3. Red Hat: ./autogen.sh

    4. Debian: ./autogen.sh --prefix=/usr --with-gconf-schema-file-dir=/etc/gconf/schemas

    5. make

    6. $root make install

    7. If you find that this didn't work, try make clean and then repeat from the autogen step.

  3. Getting and building libgal No longer necessary! (13 June 2003)

  4. Getting and building goffice:

    1. git clone git://git.gnome.org/goffice

    2. cd goffice

    3. Red Hat: ./autogen.sh

    4. Debian: ./autogen.sh --prefix=/usr --with-gconf-schema-file-dir=/etc/gconf/schemas

    5. make

    6. $root make install

    7. If you find that this didn't work, try make clean and then repeat from the autogen step.

  5. Getting and building gnumeric:

    1. git clone git://git.gnome.org/gnumeric gnumeric-head

    2. cd gnumeric-head

    3. Red Hat: ./autogen.sh and wait while it compiles

    4. Debian: ./autogen.sh --prefix=/usr --with-gconf-schema-file-dir=/etc/gconf/schemas

    5. make

    6. Optional: $root make install

    7. If you find that this didn't work, try make clean and then repeat from the autogen step. For example, sometimes I've had it not create the python-loader.

OK, you should now have gnumeric! Test it! If you installed the Debianized version via apt-get, or did "make install", it should be installed to /usr/bin (or /usr/local/bin on Red Hat?) and you can just type gnumeric. Otherwise you will find it in gnumeric-head/src/ and you will have to run it from there.