Building mono from source

From LSDevLinux
Revision as of 10:15, 15 July 2014 by Mayhewn (talk | contribs) (Build and install custom mono: Don't encourage cloning from http:// URLs, as we have standardized on git:// and it's safer if everyone uses the same thing)

Jump to: navigation, search


On Ubuntu or Debian Linux

$ sudo apt-get install gnulib mono-devel mono-mcs libgif-dev libjpeg-dev libtiff4-dev libexif-dev git quilt

And of course to build the package you'll also need:

$ sudo apt-get install devscripts cdbs

On Mac

$ sudo port install bison mono giflib git-core quilt

Note: port is the MacPorts package management command. For further information, see Build FieldWorks for Mac.

Build and install custom mono

Building the custom mono is now done with the script in git://

JohnT: That is: clone the mono-calgary repo from the url above, typically in fwrepo/mono. (For the paths below to work without modification, mono-calgary must be a child of fwrepo/mono.)

JohnT: Then, cd to fwrepo/mono and run mono-calgary/

JohnT: If there are problems it may help to cd to fwrepo/mono/mono and make clean (don't worry if that gives errors), then git clean -dxf. Then cd back to fwrepo/mono and try again.

Note that the Linux binfmt system that allows you to execute interpreted programs without specifying the interpreter on the command line (eg by typing just application.exe) will still use /usr/bin/mono unless you reconfigure it.

Register in GAC

Since you are installing mono into /usr/local, you will need to register some /usr/lib/mono assemblies into the /usr/local/lib/mono GAC.

$ for assembly in /usr/lib/mono/gac/{glib,pango,atk,gtk,gdk}-sharp/*/*-sharp.dll; \
    do sudo gacutil -i $assembly; done

Trying to do this step in Precise gave me errors and did not register anything. An example error is:

Failure adding assembly /usr/lib/mono/gac/glib-sharp/*/*-sharp.dll to the cache: The system cannot find the file specified.

Update custom mono

  1. Update and rebuild mono:
  2. for repo in libgdiplus mono mono-basic gtk-sharp mono-calgary; do
    cd ~/fwrepo/mono/$repo && git pull; done
    cd ~/fwrepo/mono && mono-calgary/