centos下mono monodevelop 的安裝

 

MonoDevelop 1.0 on CentOS 5 and Fedora: Compiling and Installing

Monday, March 24th, 2008 by Jason

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. Monodoc
  9. Mono Tools
  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:$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

     

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

     

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

     

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.

Posted in Free Software Comments Off

Comments are closed.

 


Copyright © Proven Corporation Co., Ltd., Thailand. All rights reserved.

Free software and open source solutions and support in Thailand, Singapore, and Southeast Asia.

Feel free to contact us.

發佈了27 篇原創文章 · 獲贊 3 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章