Skip to content

Instantly share code, notes, and snippets.

@rsyring
Created March 4, 2012 22:06
Show Gist options
  • Save rsyring/1975033 to your computer and use it in GitHub Desktop.
Save rsyring/1975033 to your computer and use it in GitHub Desktop.
Script to Install MonoDevelop 2.8.6.5 on Ubuntu 11.10 Oneiric
#!/bin/bash -e
TOPDIR=$(pwd)
BUILDDIR=$TOPDIR/build
PREFIX=/opt/mono-2.10
export PATH=$PREFIX/bin:$PATH
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
echo "updating existing system"
sudo apt-get update
sudo apt-get upgrade -y
echo "installing prerequisites"
if [ ! -f "xulrunner-1.9.2_1.9.2.17+build3+nobinonly-0ubuntu1_amd64.deb" ]
then
wget http://launchpadlibrarian.net/70321329/xulrunner-1.9.2_1.9.2.17%2Bbuild3%2Bnobinonly-0ubuntu1_amd64.deb
fi
if [ ! -f "libgluezilla_2.6-2ubuntu2_amd64.deb" ]
then
wget http://launchpadlibrarian.net/66460780/libgluezilla_2.6-2ubuntu2_amd64.deb
fi
sudo dpkg -i "xulrunner-1.9.2_1.9.2.17+build3+nobinonly-0ubuntu1_amd64.deb"
sudo dpkg -i "libgluezilla_2.6-2ubuntu2_amd64.deb"
sudo apt-get install -y build-essential libc6-dev g++ gcc libglib2.0-dev pkg-config git-core apache2 apache2-threaded-dev bison gettext autoconf automake libtool libpango1.0-dev libatk1.0-dev libgtk2.0-dev libtiff4-dev libgif-dev libglade2-dev gnome-devel libgnomecanvas2-dev libgnomeui-dev
mkdir -p $BUILDDIR
echo
echo "downloading mono packages"
echo
cd $BUILDDIR
PACKAGES=("mono-addins-0.6.2"
"mono-debugger-2.10"
"mono-tools-2.10"
"gnome-sharp-2.24.1"
"monodevelop-2.8.6.5"
"monodevelop-debugger-gdb-2.8.6.5"
"monodevelop-database-2.8.6.5"
#"gluezilla-2.6" # have to install gluezilla package from:
)
URLS=("http://origin-download.mono-project.com/sources/mono-addins/mono-addins-0.6.2.tar.bz2"
"http://origin-download.mono-project.com/sources/mono-debugger/mono-debugger-2.10.tar.bz2"
# didn't upgrade mono-tools to 2.11 b/c the tarball is missing a lot of files
"http://origin-download.mono-project.com/sources/mono-tools/mono-tools-2.10.tar.bz2"
"http://origin-download.mono-project.com/sources/gnome-sharp2/gnome-sharp-2.24.1.tar.bz2"
"http://download.mono-project.com/sources/monodevelop/monodevelop-2.8.6.5.tar.bz2"
"http://download.mono-project.com/sources/monodevelop-debugger-gdb/monodevelop-debugger-gdb-2.8.6.5.tar.bz2"
"http://download.mono-project.com/sources/monodevelop-database/monodevelop-database-2.8.6.5.tar.bz2"
#"http://origin-download.mono-project.com/sources/gluezilla/gluezilla-2.6.tar.bz2"
)
echo Downloading
count=${#PACKAGES[@]}
index=0
while [ "$index" -lt "$count" ]
do
#only download it if you don't already have it.
if [ ! -f "${PACKAGES[$index]}.tar" ]
then
wget "${URLS[@]:$index:1}"
fi
if [ -f "${PACKAGES[$index]}.tar.bz2" ]
then
bunzip2 -df "${PACKAGES[$index]}.tar.bz2"
fi
if [ -f "${PACKAGES[$index]}.tar" ]
then
tar -xvf "${PACKAGES[$index]}.tar"
fi
let "index = $index + 1"
done
echo
echo "Building commenting tool for broken tests."
echo
COMMENTCS="$TOPDIR/comment-lines.cs"
COMMENTEXE="$TOPDIR/comment-lines.exe"
echo "using System; using System.Linq; using System.Collections.Generic; using System.Text; using System.IO; namespace FixGnomeSharp { public class Program { public static int Main(string[] args) { string fileName = null; string[] sLines = null; int[] lines = null; if (args != null) { foreach (var arg in args) { if (arg.StartsWith(\"-f:\") && arg.Length > 3) fileName = arg.Substring(3); if (arg.StartsWith(\"-l:\") && arg.Length > 3) { sLines = arg.Substring(3).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); lines = new int[sLines.Length]; for (int ix = 0; ix < sLines.Length; ix++) lines[ix] = int.Parse(sLines[ix]); } } } if (lines == null || lines.Length == 0 || fileName == null || !File.Exists(fileName)) { PrintUsage(); return 1; } /*comment line 221, 449 and 450*/ using (var ms = new MemoryStream()) { using (var writer = new StreamWriter(ms, new UTF8Encoding(false, false))) { using (var fileStream = File.OpenRead(fileName)) { using (var reader = new StreamReader(fileStream, new UTF8Encoding(false, false))) { int ix = 1; while (!reader.EndOfStream) { var line = reader.ReadLine(); if (lines.Contains(ix)) writer.Write('#'); writer.Write(line + '\n'); ix++; } } } } File.WriteAllBytes(fileName, ms.ToArray()); } return 0; } static void PrintUsage() { Console.WriteLine(\"Cannot comment without both arguments. Usage: comment-lines -f:FILE -l:LINE#[,LINE#...]\"); } } }" > "$COMMENTCS"
if [ -f "$COMMENTCS" ]
then
gmcs -out:$COMMENTEXE $COMMENTCS
fi
echo
echo "building mono packages"
echo
for i in "${PACKAGES[@]}"
do
cd $BUILDDIR/$i
./configure --prefix=$PREFIX
# need to comment out a few lines in gnome-sharp due to a test bug.
if [ $i == "gnome-sharp-2.24.1" ]
then
mono $COMMENTEXE -f:$BUILDDIR/$i/sample/gnomevfs/Makefile -l:221,449,450
fi
make
sudo make install
done
cd $TOPDIR
rm comment-lines*
echo "creating a launcher in $TOPDIR"
echo "#!/bin/bash
MONO_PREFIX=$PREFIX
GNOME_PREFIX=/usr
export DYLD_LIBRARY_FALLBACK_PATH=$MONO_PREFIX/lib:$DYLD_LIBRARY_FALLBACK_PATH
export LD_LIBRARY_PATH=$MONO_PREFIX/lib:$LD_LIBRARY_PATH
export C_INCLUDE_PATH=$MONO_PREFIX/include:$GNOME_PREFIX/include
export ACLOCAL_PATH=$MONO_PREFIX/share/aclocal
export PKG_CONFIG_PATH=$MONO_PREFIX/lib/pkgconfig:$GNOME_PREFIX/lib/pkgconfig
export PATH=$MONO_PREFIX/bin:$PATH
monodevelop" > "$TOPDIR/monodevelop-launcher.sh"
chmod 755 "$TOPDIR/monodevelop-launcher.sh"
echo
echo "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment