Difference between revisions of "Building mono from source"

From LSDevLinux
Jump to: navigation, search
(Dependencies)
(Reflect change of upstream repos from svn to git)
Line 1: Line 1:
 
== Dependencies ==
 
== Dependencies ==
  $ sudo aptitude install bison mono-devel libgif-dev git-core subversion-tools quilt
+
  $ sudo aptitude install bison mono-devel libgif-dev git-core quilt
  
 
== Get, patch, build, install mono ==
 
== Get, patch, build, install mono ==
Line 7: Line 7:
 
  $ cd mono-calgary
 
  $ cd mono-calgary
 
  mono-calgary$ ./checkout-and-build-mono
 
  mono-calgary$ ./checkout-and-build-mono
The script will download mono from the mono svn repo, patch mono, build and install mono. The installation will prompt for your sudo password to install into <code>/usr/local</code>.
+
The script will check out the mono sources from the upstream git repo, patch them, build and install mono. The installation will prompt for your sudo password to install into <code>/usr/local</code>.
  
 
To ensure the use of the custom version of mono in <code>/usr/local</code> when you run applications, make sure <code>/usr/local/bin</code> is in your PATH before <code>/usr/bin</code> is, or (better) use <code>/usr/local/bin/mono application.exe</code> whenever you run an application. On most Linux distros, <code>/usr/local/bin</code> is already included in your PATH. You can check to see what your current PATH is by typing:
 
To ensure the use of the custom version of mono in <code>/usr/local</code> when you run applications, make sure <code>/usr/local/bin</code> is in your PATH before <code>/usr/bin</code> is, or (better) use <code>/usr/local/bin/mono application.exe</code> whenever you run an application. On most Linux distros, <code>/usr/local/bin</code> is already included in your PATH. You can check to see what your current PATH is by typing:
Line 13: Line 13:
 
Note that the binfmt system that allows you to execute interpreted programs without specifying the interpreter on the command line (eg by typing just <code>application.exe</code>) will still use <code>/usr/bin/mono</code> unless you reconfigure it.
 
Note that the binfmt system that allows you to execute interpreted programs without specifying the interpreter on the command line (eg by typing just <code>application.exe</code>) will still use <code>/usr/bin/mono</code> unless you reconfigure it.
  
'''Warning:''' The <code>checkout-and-build-mono</code> script runs a <code>svn revert -R .</code> and <code>svn-clean</code>, so if you make any of your own changes to the svn trees, they would be lost.
+
'''Warning:''' The <code>checkout-and-build-mono</code> script runs <code>git reset --hard</code> and <code>git clean -dxf</code> in the <code>mono</code> etc. subdirectories, so if you make any of your own changes to the those trees, they will be lost.
 +
 
 
==Register in GAC==
 
==Register in GAC==
 
Since you are installing mono into <code>/usr/local</code>, you will need to register some <code>/usr/lib/mono</code> assemblies into the <code>/usr/local/lib/mono</code> GAC.
 
Since you are installing mono into <code>/usr/local</code>, you will need to register some <code>/usr/lib/mono</code> assemblies into the <code>/usr/local/lib/mono</code> GAC.

Revision as of 17:09, 28 March 2011

Dependencies

$ sudo aptitude install bison mono-devel libgif-dev git-core quilt

Get, patch, build, install mono

To build the custom mono, do these steps:

$ git clone git://git.lsdev.sil.org/mono-calgary.git
$ cd mono-calgary
mono-calgary$ ./checkout-and-build-mono

The script will check out the mono sources from the upstream git repo, patch them, build and install mono. The installation will prompt for your sudo password to install into /usr/local.

To ensure the use of the custom version of mono in /usr/local when you run applications, make sure /usr/local/bin is in your PATH before /usr/bin is, or (better) use /usr/local/bin/mono application.exe whenever you run an application. On most Linux distros, /usr/local/bin is already included in your PATH. You can check to see what your current PATH is by typing:

$ echo $PATH

Note that the 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.

Warning: The checkout-and-build-mono script runs git reset --hard and git clean -dxf in the mono etc. subdirectories, so if you make any of your own changes to the those trees, they will be lost.

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.

Instructions for Ubuntu 9.10 Karmic and later

You may need to make some slight alterations for the folder names, especially the ones with numbers.

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

Update custom mono

To get the latest custom mono:

mono-calgary$ git pull
mono-calgary$ ./checkout-and-build-mono