Zack's Website

My Egotistic and Esoteric Website

Linux - Installing Mono from Source

How To Install Mono from Source

What is Mono?  The Mono project was started back in 2001 when some open source Linux guys got together and wanted to create an ECMA compatible version of Microsoft's .NET Framework.  Microsoft had published to the ECMA commission some basic specifications and these guys ran with it.  It was one of the primary reasons I choose the C# platform to move all our future business source code development.  As I knew then I could eventually run applications on Windows and Linux (without having to re-write the code).  You have the ability of "writing once and running everywhere" (a promise of Java that never really happened).  It has been the best decision I ever made!

Anyway, since I do develop and run some .Net applications on our Linux servers at work, here are instructions for compiling the Mono framework on Linux and also the MonoDevelop IDE as well.

Some of the following may change as of 2011 the Attachmate corporation has purchased Novell's Mono development team and then fired them.  So they went off the create Xamarin to work on the Mono project and development tools as of May 15, 2011.  So the FTP site that hosts the Mono source code may change.  BTW - Attachmate's software has ALWAYS sucked!  They are pretty much now just an Intellectual Property house and producing nothing beneficial.

Building Mono for Slackware (or for any disro that can compile from source)

1.) Login as root
2.) Download Mono Sources from ftp.novell.com/pub/mono/sources-stable
       mono-x.yy.z.tar.bz2
       libgdiplus-x.yy.tar.bz2
3.) If doing web development, then also download xsp and mod_mono
       xsp-x.yy.z.tar.bz2
       mod_mono-x.yy.tar.bz2
4.) If you want monodevelop IDE download
       gtk-sharp-x.yy.zz.tar.bz2
       gnome-sharp-x.yy.z.tar.bz2
       gtksourceview-sharp-x.y.z.tar.bz2
       mono-addins-x.y.tar.bz2
       monodevelop-x.y.z.tar.bz2
5.) tar -xvf sources you downloaded before from above
6.) ./configure then make then make install and repeat from above

 

 

Want an even easier way?  I wrote a shell script for installing Mono on a Slackware system (should work for any other system also)....

#!/bin/bash

#
# Install from Source Build Script
# Written by Zachary Burns - developer@zackburns.com
#
# USAGE - Make sure following versions are correct
#
# RUNNING - chmod +x SCRIPT_NAME.sh
#

USERBINDIR="/home/zburns/bin/mono"
USERSRCDIR="/home/zburns/src/mono"
DOWNLOADSOURCE="http://ftp.novell.com/pub/mono/sources"
MONOVERSION="2.10"
MONOBUILD="2.10.2"
GLUEZILLA="2.6"
GECKOSHARP="2.0-0.13"
GTKSOURCEVIEW="2.0-0.12"
BOO="0.9.3.3457"
IKVM="0.42.0.6"
COCOASHARP="0.9.5"
NANT="0.90"
MONOADDINS="0.5"
GTKSHARP="2.12.10"
GNOMESHARP="2.24.1"
GNOMEDESKTOPSHARP="2.24.0"

MONODEVELOPVERSION="2.4"
MONODEVELOPBUILD="2.4.2"
WEBKITSHARP="0.3"

if [ -d "$USERSRCDIR" ] && [ -d "$USERBINDIR" ]; then


echo -e "Getting Mono Sources"
cd $USERSRCDIR
wget $DOWNLOADSOURCE/mono/mono-$MONOBUILD.tar.bz2 $USERSRCDIR
wget $DOWNLOADSOURCE/mono-basic/mono-basic-$MONOVERSION.tar.bz2 $USERSRCDIR
wget $DOWNLOADSOURCE/libgdiplus/libgdiplus-$MONOVERSION.tar.bz2 $USERSRCDIR
wget $DOWNLOADSOURCE/gluezilla/gluezilla-$GLUEZILLA.tar.bz2 $USERSRCDIR
echo -e "Done Getting Mono Sources"

echo -e "Getting XSP/Mod_Mono Sources"
cd $USERSRCDIR
wget $DOWNLOADSOURCE/xsp/xsp-$MONOBUILD.tar.bz2
wget $DOWNLOADSOURCE/mod_mono/mod_mono-$MONOVERSION.tar.bz2
echo -e "Done Getting XSP/Mod_Mono Sources"

echo -e "Getting Development Tools"
cd $USERSRCDIR
wget $DOWNLOADSOURCE/mono-tools/mono-tools-$MONOVERSION.tar.bz2
wget $DOWNLOADSOURCE/gecko-sharp2/gecko-sharp-$GECKOSHARP.tar.bz2
wget $DOWNLOADSOURCE/gtksourceview-sharp2/gtksourceview-sharp-$GTKSOURCEVIEW.tar.bz2
wget $DOWNLOADSOURCE/boo/boo-$BOO.tar.bz2
wget $DOWNLOADSOURCE/ikvm/ikvmbin-$IKVM.zip
wget $DOWNLOADSOURCE/mono-debugger/mono-debugger-$MONOVERSION.tar.bz2
wget $DOWNLOADSOURCE/cocoa-sharp/cocoa-sharp-$COCOASHARP.tar.bz2
wget $DOWNLOADSOURCE/nant/nant-$NANT-src.tar.bz2
wget $DOWNLOADSOURCE/mono-addins/mono-addins-$MONOADDINS.tar.bz2
echo - "Done Getting Development Tools"

echo -e "Getting GTK# $GTKSHARP Development Components"
cd $USERSRCDIR
wget $DOWNLOADSOURCE/gtk-sharp212/gtk-sharp-$GTKSHARP.tar.bz2
wget $DOWNLOADSOURCE/gnome-sharp2/gnome-sharp-$GNOMESHARP.tar.bz2
wget $DOWNLOADSOURCE/gnome-desktop-sharp2/gnome-desktop-sharp-$GNOMEDESKTOPSHARP.tar.bz2
echo -e "Done Getting GTK# $GTKSHARP Development Components"

echo -e "Getting MonoDevelop $MONODEVELOPBUILD Development Environment"
cd $USERSRCDIR
wget $DOWNLOADSOURCE/monodevelop/monodevelop-$MONODEVELOPBUILD.tar.bz2
wget $DOWNLOADSOURCE/monodevelop-database/monodevelop-database-$MONODEVELOPBUILD.tar.bz2
wget $DOWNLOADSOURCE/monodevelop-debugger-gdb/monodevelop-debugger-gdb-$MONODEVELOPBUILD.tar.bz2
wget $DOWNLOADSOURCE/monodevelop-java/monodevelop-java-$MONODEVELOPBUILD.tar.bz2
wget $DOWNLOADSOURCE/monodevelop-vala/monodevelop-vala-$MONODEVELOPBUILD.tar.bz2
echo -e "Done Getting MonoDevelop $MONODEVELOPBUILD Development Environment"

echo -e "Getting Other Compoents"
cd $USERSRCDIR
wget $DOWNLOADSOURCE/webkit-sharp/webkit-sharp-$WEBKITSHARP.tar.bz2
echo -e "Done Getting Other Compoents"

echo -e "Done Retreiving Source Files..."

echo -e "Compiling from $USERSRCDIR to $USERBINDIR"

echo -e "Unzipping libgdiplus-$MONOVERSION.tar.bz2..."
cd $USERSRCDIR
tar -jxf libgdiplus-$MONOVERSION.tar.bz2
cd libgdiplus-$MONOVERSION
./configure --prefix=$USERBINDIR
make -s
make install
echo -e "Done with libgdiplus-$MONOVERSION"

echo -e "Unzipping mono-$MONOBUILD.tar.bz2..."
cd $USERSRCDIR
tar -jxf mono-$MONOBUILD.tar.bz2
cd mono-$MONOBUILD
./configure --prefix=$USERBINDIR
make -s
make install
echo -e "Done with mono-$MONOBUILD"

echo -e "Done Compiling and Installing"
echo -e "Have a Great Day!"

else
        echo -e "Missing SRC and/or BIN directories"
fi