Want to play with Mono 2.0? So do I…
Alrighty, so I wanted to play with Mono 2.0. I thought about packaging it up, but the packaging for Mono in Debian and Ubuntu is extremely complex, and would have taken me a lot of time that I simply don’t have. So, instead, I wrote a BASH script that pulls Mono 2.0 and friends from the Internet, builds it, and installs it in ${HOME}/opt on your system. The way it does this is based on the Parallel Mono Environments page on the Mono Web site. In the hope that this script will be useful on more than just Ubuntu, it DOES NOT try to pull in build-dependencies from the system. If you’re using Ubuntu (and this will probably work on Debian, too), you can pull the build-dependencies pretty easily:
$ sudo apt-get build-dep libgtksourceview2.0-cil \ libgecko2.0-cil libgtk2.0-cil libgnome2.0-cil mono \ libgluezilla
The usage screen for the script:
Mono 2.0 Home Directory Installer Copyright (c) 2008 M. Trausch <mike@trausch.us> License: GPLv3 Total download: ~206 MiB, total installed size: ~161 MiB. Download & build takes ~35 minutes on an AMD Phenom 9500 Quad-Core CPU w/ 8Mbps downstream Internet connection (and happy servers, of course). Logs are output to '/tmp/mono2-build.3044/log'. usage: install-mono2.sh [options] Available options: -s PKG --skip PKG Skip building package PKG (one of libgdiplus, mono, mono-basic, gtk-sharp, gnome-sharp, gnome-desktop-sharp, gluezilla, monodoc, mono-tools, mono-addins, gecko-sharp, gtksourceview-sharp, heap-buddy, nant, monodevelop). May be specified multiple times. -d --download-only Only download the packages, do not install them. -r --monodevelop-revision Specify which SVN revision of MonoDevelop trunk to install. Defaults to SVN HEAD. -S --skip-download Skip the download (if you're rebuilding, use this to save bandwidth. -m --monodevelop Download, build, and install MonoDevelop only. ONLY USEFUL FOR UPDATING MONODEVELOP AFTER YOU'VE RUN THIS SCRIPT TO INSTALL MONO 2.0. -1 --single-cpu Use ONLY single CPU/core for building. Use this if you have trouble building and think it might be related to 'make -j'.
Now, when this script runs, it will download the Mono files (and MonoDevelop from SVN) into /tmp/monosrc. It will do the build in /tmp/mono2-build.XXXXX where XXXXX is the process ID number of the install-mono2.sh script. When you’re finished and happy with the installation, you can safely remove those directories:
$ rm -Rf /tmp/mono2-build.* /tmp/monosrc
If you want to track MonoDevelop within SVN, then it is better to not delete /tmp/monosrc, because the script uses svn to pull from the MonoDevelop Subversion repository. This means that it can, if the directory already exists, save you bandwidth by only pulling a delta from the revision that you have and the current HEAD revision. The astute probably noticed that you can select a revision explicitly as well. I am currently using r115695, and have used it for a grand total of 20 minutes (and debugging, as best as I can tell, works quite wonderfully in it, but it is a work-in-progress, coming directly from the development mainline). In short, the MonoDevelop is great for toying with but not for production use. I may release a version of this script that lets you choose between the latest stable released version of MonoDevelop and an SVN revision, but I haven’t gotten there yet because I wanted to play with the SVN version (which uses features in Mono 2.0… that was the whole point of me wanting to play with Mono 2.0, actually).
In any case, the script is available for download here from my Web site.
A few words about the script: This script is released under the terms of the GNU General Public License, Version 3. It is version 3 ONLY. There is NO SUPPORT for this software; I wrote it for myself, and it may change or it may stagnate. I provide it in the hope that it is useful to someone out there other than myself, but it is AS-IS, WITHOUT WARRANTY, UNSUPPORTED software. If it changes your dog’s gender, bursts your house into flames, destroys your whatchamacallermicroflobbermajag, do not come and yell at me. That having been said, I welcome any modifications (at least to view them). You can modify it for your own use, you can share it (in fact I expect you to!) and you can tinker with and tweak it. Suggestions? Welcome! Comments? Welcome! Flames? Hey, free speech is your right…
Lastly, I RECOMMEND THAT YOU RUN THE SCRIPT ON A CLEAN USER ACCOUNT, WITHOUT YOUR DATA, WITHOUT YOUR ANYTHING IN THE WAY. Just create yourself another user, and login to it using Xnest or something, or log out of your user account completely—I don’t care how you do it. Why do I make this recommendation? Because while nothing bad should happen, it’s always best to sandbox things that you don’t trust. After all, what reason do you have to trust me if you don’t know me? You can also of course read through the script and audit it if you wish. It doesn’t handle EVERY exceptional condition, but it handles just about anything that needs to be and tells you where things went awry if they go wrong. And it logs everything (see the program output when you run it). It also takes advantage of multiple processors or cores if you have them for those (few) builds that will permit it without going nutso, but YMMV. If you have an issue with this aspect of the script, see the usage text. If there are any issues that you can’t solve with that, or installing build-dependencies, then paste the relevant segments of your failing log file to something like pastebin and ping me a comment here, and I can take a look at it and (try to) offer advice, depending on where the fail is.
Oh, yeah, and I used a hell of a lot of bandwidth putting it together and making sure that it did things like downloaded things right and all of that. Sorry for hitting your servers repeatedly, Mono people—and thank you for the software!
directhex 14th October 2008
Please, gentle reader, be VERY careful with what you run inside the Mono 2 terminal this script creates. Running apt-get or aptitude or similar for any reason put your system at enormous risk of breakage, due to conflicting locations for gacutil (as used during any mono-related package installs or upgrades), as well as for other things like monodoc.
And don’t even think about trying to put this new Mono into your $PATH.
Michael Trausch 14th October 2008
@directhex: Indeed. Thanks for the warning, I didn’t think of putting that out there. Of course, that would fall under my warning to use it in another account altogether (that would presumably not have
sudoprivileges).Putting it into $PATH would be wrong, this is why I created the Desktop launcher and install it in ${HOME}/opt… it’s only in $PATH then when the person is inside the terminal provided by the launcher.
I have expected the release to be of poor quality from what people have said, though I haven’t seen it. The Mono debugger is a bit disappointing, in that it doesn’t quite exactly work right, but everything else is great—even on my x86-64 system—and of course, MonoDevelop 2.0 Alpha 1 has issues, but then again it’s an alpha and direct-from-SVN, so I expected that.
Have you taken a look at it? As a pkg-mono person, I am sure you understand why I couldn’t quickly turn out packages… the Mono packages are far too complex for an upgrade. Why is this, by the way? I don’t buy footprint reasons, the class library was intended to be install all-or-none, and I think it’s a bit overboard to have to specify dependencies on individual programs. Sure, this means that things like Tomboy have a ~100 MiB dependency pull, but then again, as time goes on, more and more software will be written in the managed world of the CLR, especially since it’s so cross-platform as it is. Will this change in a future release of the packages, such that the runtime is a single package as it is intended?
Natan Yellin 15th November 2008
Eric set up a repository for Intrepid which should be easier to use. See http://eric.extremeboredom.net/2008/10/15/296
Nuno 14th February 2009
I will see if it works
Nuno 14th February 2009
Thanks