Getting started with Alexandria development
Alexandria is a GNOME application written in Ruby. It is free software developed primarily for GNU/Linux systems, and is also developed on GNU/Linux. Almost everything you need for developing Alexandria will be available for easy installation on most distributions. This is a guide to setting up your system so you can work with the Alexandria source code.
If you just want to have a look at the code, you could simply download the latest tar.gz package. However, if you want to keep up to date with the developers as they work, you should do a check-out of the Subversion repository. If you don’t know anything about Subversion, there is an excellent introduction in the free book Version Control with Subversion. But, to begin with, you can just install the subversion package and issue the following command from the terminal (all on one line):
svn checkout svn://rubyforge.org/var/svn/alexandria/trunk/alexandria alexandria
This will create a new alexandria directory containing the current source of the main development branch of Alexandria, we often call this alexandria SVN for short.. If you just unpacked the tar.gz archive, the directory will be called alexandria-0.6.2 but in any case I shall refer to it as the alexandria directory.
Move into that directory and look around. In particular, the INSTALL file describes the various dependencies of Alexandria. The main requirements are, of course ruby (Ruby 1.8 in particular) and ruby-gnome2 (the bindings library which allows us to use Ruby with GTK+ and GNOME). Also required is ruby-gettext which allows the program interface to be translated into multiple human languages. Make sure you have these packages installed. If you’ve installed the binary of Alexandria already, most of the dependencies listed will have been installed automatically.
If you are on a Debian or Ubuntu-based system you should also install irb the Interactive Ruby shell (for experimenting with small fragments of Ruby code quickly).
Also in the alexandria directory is a Rakefile for building the code. Rake is the Ruby equivalent of make, install it with the rake package. Because Ruby is still very much a scripting language, the source files are not compiled. The building of the software only involves two stages: automatically generating some Ruby files and compiling the gettext translation files. For the latter task, you will need gettext and intltool packages, as described in the INSTALL file. Running the simple command rake in the alexandria directory will build the software.
To install the development version of Alexandria, run the command rake install as root: either quickly su to root and issue the command, run su -c ‘rake install’ or, more usually, run sudo rake install.
You should now be able to see the Ruby files, program resources and documentation being installed. Note that if you’re on a Debian or Ubuntu-based system, rake install will install the Ruby files in /usr/local/lib/site_ruby/1.8/ which is different from the location used by the deb installation. This is because of the way Debian handles Ruby. It means that you may end up with two competing copies of Alexandria on your system, and the development version will usually be detected first. Unfortunately, there is no rake uninstall task, but you can just remove all the alexandria files from /usr/local/lib/site_ruby/1.8/ by hand with: sudo rm -rf /usr/local/lib/site_ruby/1.8/alexandria* if you want to remove the development version.
Once you have installed Alexandria, you can launch it with the command alexandria or using alexandria --debug if you want to see more logging information. To see what another translation of the Alexandria looks like you can set the LANG environment variable as you launch the program: LANG=nl_NL.utf8 alexandria
You are now working with the development version of Alexandria.
Leave a comment
You must be logged in to post a comment.