Setting Up a Linux Build Environment

lylejohnson edited this page Sep 13, 2010 · 16 revisions

If you’d like to be able to build FXRuby from source on Linux, you’re going to need to set up a build environment. This page describes how to set up an FXRuby build environment under Ubuntu Linux 9.04. If you’re working with a different Linux distribution, some of the instructions will obviously be different.

Install Ruby

So, you’re going to need a Ruby installation, and it’s not included in the stock Ubuntu distribution. One straightforward solution is to install the ruby-full package for Ubuntu by typing

sudo aptitude install ruby-full

This pulls in most everything you’d need, including Rake and RubyGems. But if you’re like most Ruby hackers and want to build and install Ruby from source, please see the Ruby downloads page for information on how to do that.

Install FOX Dependencies

To build FOX from source, you’re going to need a lot of dependencies that Ubuntu doesn’t install by default. First, you want to install the various image library development packages (for PNG, JPEG and TIFF image support):

sudo aptitude install zlib1g-dev libbz2-dev libpng12-dev libjpeg62-dev libtiff4-dev

Then, you want to install the various X11 and OpenGL dependency development packages:

sudo aptitude install libx11-dev libglu1-xorg-dev libxcursor-dev libxext-dev libxrandr-dev libxft2-dev

Install G++

To my surprise, the C++ compiler wasn’t included in the stock Ubuntu distribution (only the C compiler). You’re going to need to install that too:

sudo aptitude install g++

Download, Build and Install FOX

Ubuntu does include a pre-built FOX package, but it’s based on FOX 1.6.25 (a fairly old release). I recommend that you download the latest FOX source code and build it from scratch.

You can download the latest source code tarball for FOX from the FOX home page. As of this writing, the latest stable version is version 1.6.36. Note that the latest developer version is 1.7.20 (or so), but that version is incompatible with FXRuby.

tar xzf fox-1.6.36.tar.gz
cd fox-1.6.36
./configure --disable-shared
make install

If you run into trouble building FOX, please consult the installation instructions at the FOX web site, and follow up on the FOX mailing list if necessary.

Install FXScintilla

This step is optional, but if you want to be able to use the FXScintilla widget in your FXRuby programs, you’ll need to get the FXScintilla library installed. As was the case with FOX, I recommend downloading the source code and building this one from source instead of installing the out-of-date package that Ubuntu provides.

tar xzf fxscintilla-1.71.tar.gz
cd fxscintilla-1.71
sudo make install

Install FXRuby

Finally, you should be able to install FXRuby from the source gem.

sudo gem install fxruby