Difference between revisions of "Building mono from source"

From LSDevLinux
Jump to: navigation, search
m
(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)
Line 11: Line 11:
  
 
== Build and install custom mono ==
 
== Build and install custom mono ==
Building the custom mono is now done with the BuildOptMono.sh script in https://github.com/sillsdev/mono-calgary.git.
+
Building the custom mono is now done with the <code>BuildOptMono.sh</code> script in <code><nowiki>git://github.com/sillsdev/mono-calgary.git</nowiki></code>
  
 
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: 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.)
Line 18: Line 18:
  
 
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.
 
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 <code>application.exe</code>) will still use <code>/usr/bin/mono</code> unless you reconfigure it.
 
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 <code>application.exe</code>) will still use <code>/usr/bin/mono</code> unless you reconfigure it.

Revision as of 10:15, 15 July 2014

Dependencies

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 BuildOptMono.sh script in git://github.com/sillsdev/mono-calgary.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/BuildOptMono.sh.

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/BuildOptMono.sh