Xiphos Bible

Hacking Xiphos

This document will hopefully give you a little overview of what you need to start hacking Xiphos and how the code is laid out. It is not an introduction how to use your shell or compiler.


You need development tools like the C and C++ compiler, make, autoconf, automake and of course all the header files for the libraries required by Xiphos. If you run into any trouble, your system likely misses some of the required tools or header files. Make sure to have a complete installation for development. Most distributions split Gnome into packages for the normal user and packages for development, mostly recognizable with a package name ending with -devel.

Source code

If you just want to take a look at the source code, download it from the Xiphos GitHub page.

There you will find the latest source for the latest official release. If you have time and want to contribute to the development, you should consider using GitHub.

Retrieving source code from GitHub

One-stop retrieval of the Xiphos tree, for the current release:

 git clone https://github.com/crosswire/xiphos.git 


Get general information on git usage on your system with

    git help 

Configuration and build

From this point on, whether you use git or a tar file, we use "waf" to configure, build, and install:

    ./waf configure --prefix=/usr/local --debug-level=optimized --gtk=3 --enable-webkit2
    ./waf build

If you now want to install Xiphos, you may have to become root...

    sudo ./waf install 

...to let Xiphos install under /usr/local. Compile while not running as the root user, as you can screw up your whole system if something goes wrong. Use a normal user account.

If you do not have root right on your system, you can configure Xiphos with another prefix. For example, your home directory is /home/user. Type...

    ./waf configure --prefix=/home/user ... 

...and Xiphos can be installed in your home directory after the make process.

Hacking the code

The choice of editor or IDE you is up to you. Please read Coding Conventions to understand indention and formatting choices.

Xiphos is separated into three parts:

Main is the glue between backend and gnome2 + gui and contains all the code that does not belong to the others. ("gnome2" is a bit of a misnomer today, since gtk3 is current.)

The backend is strictly for communicating with the sword library. It should not contain anything else.

The gui with its interface to gnome is, speaking for itself, just for the gui. The aim is, to keep all gui relevant code out of main and backend, to make it possible to switch between different guis.

The gui is split into the gui header files in the gui directoy which only provides the exported functions for inclusion, plus the gui C files in the gnome2 directory.