Monday, February 25, 2008

GARMONO #1

One of hard things of cross-platform development with WinForms is that you always need to test in both Linux and Windows. My second development environment is Cygwin running on Windows but when I need to travel somewhere, I also need to have this Cygwin environment available on my Windows Virtual Machine.

Andreia made a very good tutorial about how to create a Mono+Cygwin Installation and Compilation, and I've used it for years. However, sometimes I lose my environment or have problems when trying to compile a new Mono version and I need to install it over and over.

When I noticed that Gnome had GARNOME (a build tool that allows users to build the GNOME Desktop), I thought that it would be nice if we had one tool like this not only to build Mono but also to install some dependencies on environments like Cygwin. That is how GARMONO was born. GARMONO is based on GAR software and if you need moreinformation about it a good place is to check is this article in Linux Journal.

We can use GARMONO to build Mono on Cygwin, Linux, Maemo and also use it to generate packages (.deb for Nokia N810). So, I will start a series of blog entries about this, but today let us talk about Cygwin.

Compiling and installing Mono on Cygwin can be a hard task but I believe it is much easier using GARMONO. First, you must get your Cygwin environment installed and working. Also, make sure that you have installed automake, bison, gcc, gdb and libtool. These packages are necessary if you want to build anything.

So, now let us download and unpack GARMONO. For this, log into your Cygwin environment and type:

# wget http://anonsvn.mono-project.com/viewcvs/trunk/release/garmono.tar.gz
# tar -xzvf garmono.tar.gz
# cd garmono

Now we just need to build Mono:

# make cygwin/build

And that is all! GARMONO will download and install all dependencies and later will download and install Mono in your ~/mono. It will also create a bash script with all environment vars needed to use Mono. To call this script just type:

# source ~/mono/bin/monoenv

You could also put this line in your .profile or .bash_profile script.

Over the next several blog entries, I will give more tips about GARMONO and how use it in Maemo and Linux environments.