MonoDevelop 1.0 on CentOS 5 and Fedora: Compiling and Installing

Recently, I had to get MonoDevelop working on CentOS 5 for a project. Here is my blow-by-blow summary of how to get it working. The procedure is designed for CentOS 5, and it works on my Fedora 8 system as well. Since most of the activity is just compiling stuff from source, it should be pretty easy to follow on a different distribution. It’s just a matter of getting the correct packages installed in the preparation phase.

Contents

  1. Objectives
  2. Preparation
  3. Enabling the Environment
  4. Mono 1.9
  5. Libgdiplus
  6. GTK#
  7. Mono.Addins
  8. Mono Tools
  9. Monodoc
  10. Gtksourceview
  11. MonoDevelop
  12. Nant
  13. Finish

Objectives

  • MonoDevelop platform ready to use on CentOS 5 or Fedora 8
  • For minimal maintenance headache, use the base operating system to provide as much sofware as possible, with the obvious exception of Mono 1.9 and MonoDevelop 1.0
  • The install is isolated from the rest of the system. MonoDevelop and its dependencies should have no overlap or interference with the base operating system.

Preparation

  • Note: In this document, all source code will go in /usr/src/monodevelop-install. All installed packages will go in /usr/local/software.
  • mkdir -p /usr/local/software/mono-1.9
  • sudo chown -R `whoami` /usr/local/software # (Be careful if you already have software here)
  • mkdir -p /usr/src/monodevelop-install
  • yum install glib2-devel pango-devel gtk2-devel glade2-devel libgnome-devel \
    gnome-desktop-devel gnome-panel-devel libgnomeprintui22-devel \
    gtksourceview-devel ruby ruby-rdoc gtkhtml38-devel wget \
    # (maybe openssl-devel also)
  • echo 'PATH="/usr/local/software/mono-1.9/bin:/usr/local/software/bzr-1.2:$PATH"' \
    > /usr/local/software/mono-1.9/env.sh
  • echo 'export PKG_CONFIG_PATH=/usr/local/software/mono-1.9/lib/pkgconfig' \
    >> /usr/local/software/mono-1.9/env.sh
  • echo 'export LD_LIBRARY_PATH=/usr/local/software/mono-1.9/lib' \
    >> /usr/local/software/mono-1.9/env.sh

Enabling the Environment

Important: You must always run this command before using Monodevelop, and also before continuing on with this procedure.

source /usr/local/software/mono-1.9/env.sh

In this document, Monodevelop is not completely integrated into the GUI, menus, etc. for a couple of reasons:

  1. Getting Monodevelop to show up in the menus is somewhat distro-specific. For RPM-based distros, look into setting the $XDG_DATA_DIRS variable in /etc/X11/xinit/xinitrc.d/, but you will also have to get the path working. For Debian-based distros, look into doing the same thing in /etc/X11/Xsession.d. And if you happen to be trying this on Solaris, look into /usr/dt/config/Xsession.d. Oh and by the way, the .desktop file that ships with Monodevelop is invalid for my Fedora 8 system! So you will have to manually edit it and (IIRC) remove the TryExec line.
  2. As you can see, this requires a bit of mucking with “standard” package-maintained config files, which I am hesitant to do because it violates the objective of isolation.

All this means you will always have to first source the small shell script which sets up the correct environment variables whenever you want to run Monodevelop.

Mono 1.9

  • cd /usr/src/monodevelop-install
  • wget http://go-mono.com/sources/mono/mono-1.9.tar.bz2
  • tar xjf mono-1.9.tar.bz2
  • cd mono-1.9
  • ./configure --prefix=/usr/local/software/mono-1.9
    • Optionally,
      --with-ikvm-native=no –with-moonlight=no
    • Optionally,
      --with-xen_opt=yes
  • make && make install

Libgdiplus:

  • cd /usr/src/monodevelop-install
  • wget http://go-mono.com/sources/libgdiplus/libgdiplus-1.9.tar.bz2
  • tar xjf libgdiplus-1.9.tar.bz2
  • cd libgdiplus-1.9
  • ./configure --prefix=/usr/local/software/mono-1.9
  • make && make install

GTK#

  • cd /usr/src/monodevelop-install
  • wget http://go-mono.com/sources/gtk-sharp-2.0/gtk-sharp-2.8.4.tar.bz2
  • tar xjf gtk-sharp-2.8.4.tar.bz2
  • cd gtk-sharp-2.8.4
  • ./configure --prefix=/usr/local/software/mono-1.9
  • make && make install

Mono.Addins:

  • cd /usr/src/monodevelop-install
  • wget http://go-mono.com/sources/mono-addins/mono-addins-0.3.1.tar.bz2
  • tar xjf mono-addins-0.3.1.tar.bz2
  • cd mono-addins-0.3.1
  • ./configure --prefix=/usr/local/software/mono-1.9
  • make && make install

Mono Tools:

  • cd /usr/src/monodevelop-install
  • wget http://go-mono.com/sources/mono-tools/mono-tools-1.9.tar.bz2
  • tar xjf mono-tools-1.9.tar.bz2
  • cd mono-tools-1.9
  • ./configure --prefix=/usr/local/software/mono-1.9
  • make && make install

Monodoc

  • cd /usr/src/monodevelop-install
  • wget http://go-mono.com/sources/monodoc/monodoc-1.9.zip
  • unzip monodoc-1.9.zip
  • cd monodoc-1.9
  • ./configure --prefix=/usr/local/software/mono-1.9
  • make && make install

Gtksourceview:

  • cd /usr/src/monodevelop-install
  • wget http://go-mono.com/sources/gtksourceview-sharp-2.0/gtksourceview-sharp-2.0-0.10.tar.gz
  • tar xzf gtksourceview-sharp-2.0-0.10.tar.gz
  • cd gtksourceview-sharp-2.0-0.10
  • ./configure --prefix=/usr/local/software/mono-1.9
  • make && make install

Monodevelop:

  • cd /usr/src/monodevelop-install
  • wget http://go-mono.com/sources/monodevelop/monodevelop-1.0.tar.bz2
  • tar xjf monodevelop-1.0.tar.bz2
  • cd monodevelop-1.0
  • ./configure --prefix=/usr/local/software/mono-1.9
  • make && make install

NAnt

This is optional, but many .NET applications build with it, so it might be worth throwing in there.

  • cd /usr/src/monodevelop-install
  • wget http://downloads.sourceforge.net/nant/nant-0.85-bin.tar.gz
  • tar xzf nant-0.85-bin.tar.gz -C /usr/local/software/mono-1.9
  • echo '#!/bin/bash' > /usr/local/software/mono-1.9/bin/nant
  • echo 'mono /usr/local/software/mono-1.9/nant-0.85/bin/NAnt.exe "$@"' >> /usr/local/software/mono-1.9/bin/nant
  • chmod +x /usr/local/software/mono-1.9/bin/nant

Finished!

You’re done! Run it!

monodevelop

Feel free to contact me if you have any input to add. I will try to add another post for Debian/Ubuntu and possibly Solaris in the future.

你可能感兴趣的:(centos,Debian,ubuntu,Ruby,Go)