Difference between revisions of "Building mono from source"

From LSDevLinux
Jump to: navigation, search
(Added some missing details on the use of BuildOptMono.sh)
m
Line 14: Line 14:
  
 
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.)
 +
 
JohnT: Then, cd to fwrepo/mono and run mono-calgary/BuildOptMono.sh.
 
JohnT: Then, cd to fwrepo/mono and run mono-calgary/BuildOptMono.sh.
JohnT: If there are problems it may help to switch 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.
  
  

Revision as of 09:36, 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 https://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