Thursday, December 10, 2009

Building Mono for Moonlight on Ubuntu 9.10

In this post we are going to build and install the version of mono that works with the Beta 9 of moonlight. To make things easy we are going to be building on Ubuntu 9.10 Karmic. There are a number of reasons for this, the package manager makes it easy to install the various dependencies we need but mainly it's the distro I am most familiar with.

First thing we need to do is to get the dependencies installed for building Mono 2.6. The current version of mono is 2.4 and Moonlight 2.0 will not work with that version so until 2.6 gets released and makes it's way into ubuntu we'll have to build it ourselves.
sudo apt-get install build-essential mono-mcs bison gettext libglib2.0-dev
This will get everything we need to build Mono, you will probably have some of those packages installed already. I did those on a minimal install machine so I had to install all of these packages.

now run the following commands, this will download the latest moonlight beta 9 version of the mono framework.
wget http://ftp.novell.com/pub/mono/sources/moon/1.99.9/mono-2.6.tar.bz2
wget http://ftp.novell.com/pub/mono/sources/moon/1.99.9/mono-basic-2.6.tar.bz2
tar -xjvf mono-2.6.tar.bz2
tar -xjvf mono-basic-2.6.tar.bz2
once this is done cd into the mono-2.6 directory and type
./configure --prefix=/usr  --with-moonlight=yes
This sets up the build environment. The --prefix part is something I do when installing on ubuntu. By default Mono will build to /usr/local however in more ubuntu systems mono is installed in /usr, now you can (and are advised to) setup a parallel build environment when using mono, but I prefer to use the latest stuff and just refresh my local build as and when new stuff comes out.

Now that configure has done it's stuff you can just type
make
the go a do something else for a while. Once it's finished you should be able to
sudo make install
and that should install the Mono 2.6 system. You can verify that by typing
mono --version
We now need to build mono-basic-2.6, just follow the same procedure
cd mono-basic-2.6
./configure --prefix=/usr
make
sudo make install
That should be all you need to do. You should now have a working Mono 2.6 installation.

Tuesday, December 8, 2009

Moonlight 2 preview is almost here


The title says it all... For those of you who don't know Moonlight is the open source implementation of Silverlight. It runs on linux machines and will allow developers to bring silverlight applications to linux not only in browsers but also on the Desktop.

It's this Desktop capability that has me interested. One of the cool things about developing using Silverlight (and WPF it's desktop version ) is the ability to create stylish user interfaces easily and quickly. Before Moonlight these user interfaces were for Windows and Mac OSX only, but not anymore.

I started looking at this stuff a couple of months ago, and while there was some information about Moonlight Desklets, there was very little information on how to get them working. So what we are going to do to start with in this blog is to get moonlight working from scratch, then develop our own application.