Skip to content

Instantly share code, notes, and snippets.

@haf
Created September 13, 2012 09:10
Show Gist options
  • Save haf/3713087 to your computer and use it in GitHub Desktop.
Save haf/3713087 to your computer and use it in GitHub Desktop.
Installing Mono 2.10.8 + MonoDevelop 3 + F# 2.0 in ubuntu 12.04
#!/bin/sh
# change this to the version that you want to install
# in order for this script to work, the version has to
# exist as a tag or branch on git as "monodevelop-$MD_VER"
MD_VER=3.0.3.5
# the branch/tag that we will checkout to build and install
MD=monodevelop-$MD_VER
# this is the directory in which monodevelop will be installed
INSTALL_PREFIX=/usr/local
# the full path to monodevelop
INSTALL_DIR=$INSTALL_PREFIX/$MD
# this is the profile that drives how monodevelop gets built.
# possible values are 'stable', 'all', and 'core'
INSTALL_PROFILE=stable
#### THE FOLLOWING INSTALLS THE SOFTWARE ####
echo -e "\n-------==<( Installing Dependencies )>==-------"
sudo apt-get -y install git gtk-sharp2 mono-gmcs mono-devel libmono-addins-cil-dev libmono-addins-gui-cil-dev libmono-addins-msbuild-cil-dev gnome-sharp2 autoconf automake intltool checkinstall || (echo "Failed to install the dependencies neccesary to download and compile monodevelop"; exit 1;)
echo -e "\n-------==<( Downloading $MD from github )>==-------"
git clone git://github.com/mono/monodevelop.git || (echo "Failed to download the monodevelop source code"; exit 1;)
pushd monodevelop
echo -e "\n-------==<( Switching to $MD Branch )>==-------"
git checkout $MD || (echo "Failed to get version $MD from github. If you edited this script to change the version, you may have chosen a version that isn't tagged in github, or (if you didn't) the default version in this script may no longer be available"; exit 1;)
git submodule init
git submodule update
echo -e "\n-------==<( Configuring Build Script )>==-------"
./configure --prefix=$INSTALL_DIR --profile=$INSTALL_PROFILE || (echo "Something has gone wrong configuring the build script. If you are attempting to compile a newer version than 3.0.1, the developers may have introduced a new dependency that isn't installed. This may also occur if you are attempting to run this script on a platform that isn't ubuntu oneiric or Mint 12"; exit 1;)
echo -e "\n-------==<( Building MonoDevelop... )>==-------"
make || (echo "There was an error compiling monodevelop. Since the build script was successfully configured, this is unusual. Consider posting your error on my blog to see if I can help you. It's possible that you've actually come across a bug in the MD build script."; exit 1;)
echo -e "\n-------==<( Installing MonoDevelop to $INSTALL_DIR )>==-------"
sudo checkinstall || (echo "There was an error installing MonoDevelop. Have a look at the previous output"; exit 1;)
popd
echo -e "\n-------==<( Adding a monodevelop script to $INSTALL_PREFIX )>==-------"
# echo "#!/bin/sh\n\n/usr/local/monodevelop-3.0.3.5/bin/monodevelop" | sudo tee /usr/local/bin/monodevelop
echo "#!/bin/sh\n\n$INSTALL_DIR/bin/monodevelop" | sudo tee $INSTALL_PREFIX/bin/monodevelop
sudo chmod +x $INSTALL_PREFIX/bin/monodevelop
echo -e "\n-------==<( Adding Environment Variables to $HOME/.bashrc )>==-------"
echo "export XDG_DATA_HOME=\$XDG_DATA_HOME:$INSTALL_DIR/share" >> $HOME/.bashrc
echo "export XDG_DATA_DIRS=\$XDG_DATA_DIRS:$INSTALL_DIR/share" >> $HOME/.bashrc
echo -e "\n-------==<( MonoDevelop Install Complete )>==-------"
echo "You can remove monodevelop by writing 'dpkg -r monodevelop'."
echo "You'll have to restart your terminals or do 'source ~/.bashrc'."
echo "It's up to you to create panel launchers and/or start menu entries."
echo -e "\n-------==<( Installing F# )>==-------"
git clone git://github.com/fsharp/fsharp
pushd fsharp
./autogen.sh --prefix=/usr
make || (echo "There was an error compiling the F# compiler and its utilities."; exit 1;)
sudo make install
popd
echo -e "\n-------==<( F# installation complete )>==-------"
echo "Run monodevelop. Go to tools, add-in manager, gallery. Install F# language binding."
echo "Done."
# 1. http://blog.johnruiz.com/2012/05/installing-monodevelop-3-on-ubuntu.html
# 2. http://thecodedecanter.wordpress.com/2012/09/06/installing-monodevelop-3-with-fsharp-support-on-ubuntu/
# 3. https://help.ubuntu.com/community/CheckInstall
# Can't use checkinstall 'F#: No such file or directory'
# sudo checkinstall || (echo "There was an error installing F#. Have a look at the previous output"; exit 1;)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment