Skip to content

Instantly share code, notes, and snippets.

@klaufir
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klaufir/9387137 to your computer and use it in GitHub Desktop.
Save klaufir/9387137 to your computer and use it in GitHub Desktop.
Mono compilation howto on Ubuntu with Stow
Compile latest Mono on Ubuntu
#1. make sure to have the universe repo, on 14.04 your /etc/apt/sources.list must look like this
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe
deb http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe
#2. then update your local package index by
apt-get update
#3. use stow for easier management
#stow stores packages in the directoy /usr/local/stow/package
#stow installs symlinks into /usr/local from the package directory
#example: when you have a package at /usr/local/stow/something
# and it has one file /usr/local/stow/something/bin/test
# then by
# > cd /usr/local/stow
# > stow something
# it will place symlinks from /usr/local/bin/test -> /usr/local/stow/something/bin/test
# removing these symlinks is done by
# > stow --delete something
apt-get install stow
#necessary packages for build
apt-get install mono-gmcs build-essential autoconf git libtool gettext libfontconfig-dev libglib2.0-dev
#libgdiplus dependencies
apt-get install libexif-dev libjpeg-dev libpng-dev libtiff-dev libglib2.0-dev libgif-dev libx11-dev
git clone https://github.com/mono/libgdiplus.git
cd libgdiplus
./autogen.sh --prefix=/usr/local
make
make install DESTDIR=~/libgdi_inst
sudo bash
mkdir /usr/local/stow/libgdiplus
sudo mv ~/libgdi_inst/usr/local/* /usr/local/stow/libgdiplus
cd /usr/local/stow
stow libgdiplus
git clone https://github.com/mono/mono.git
cd mono
./autogen.sh --prefix=/usr/local
make get-monolite-latest
make EXTERNAL_MCS="${PWD}/mcs/class/lib/monolite/gmcs.exe"
make install DESTDIR=~/mono_inst
sudo bash
mkdir /usr/local/stow/mono
mv ~/mono_inst/usr/local/* /usr/local/stow/mono
cd /usr/local/stow
#this install symlinks from /usr/local/stow/mono -> /usr/local
#this is useful, because the actual files will be separated in /usr/local/stow/mono
#you can remove the symlinks from /usr/local using stow --delete mono,
#this will not delete any files, only the simlinks
stow mono
## now for f# (work in progress)
git clone https://github.com/fsharp/fsharp.git
cd fsharp
./autogen.sh --prefix=/usr/local
make
make install DESTDIR=~/fsharp_inst
sudo bash
mkdir /usr/local/stow/fsharp
mv ~/fsharp_inst/usr/local/* /usr/local/stow/fsharp
cd /usr/local/stow
stow fsharp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment