您的位置:首页 > 运维架构 > Linux

MonoDevelop 1.0 on CentOS 5 and Fedora: Compiling and Install

2011-05-13 11:26 501 查看
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
Objectives
Preparation
Enabling the Environment
Mono 1.9
Libgdiplus
GTK#
Mono.Addins
Mono Tools
Monodoc
Gtksourceview
MonoDevelop
Nant
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.9sudo chown -R `whoami` /usr/local/software # (Be careful if you already have software here)mkdir -p /usr/src/monodevelop-installyum 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.shecho ''export PKG_CONFIG_PATH=/usr/local/software/mono-1.9/lib/pkgconfig'' \ >> /usr/local/software/mono-1.9/env.shecho ''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.shIn this document, Monodevelop is not completely integrated into the GUI, menus, etc. for a couple of reasons:

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.
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-installwget http://go-mono.com/sources/mono/mono-1.9.tar.bz2tar xjf mono-1.9.tar.bz2cd mono-1.9./configure --prefix=/usr/local/software/mono-1.9Optionally,
--with-ikvm-native=no –with-moonlight=noOptionally,
--with-xen_opt=yesmake && make install
Libgdiplus:
cd /usr/src/monodevelop-installwget http://go-mono.com/sources/libgdiplus/libgdiplus-1.9.tar.bz2tar xjf libgdiplus-1.9.tar.bz2cd libgdiplus-1.9./configure --prefix=/usr/local/software/mono-1.9make && make install
GTK#
cd /usr/src/monodevelop-installwget http://go-mono.com/sources/gtk-sharp-2.0/gtk-sharp-2.8.4.tar.bz2tar xjf gtk-sharp-2.8.4.tar.bz2cd gtk-sharp-2.8.4./configure --prefix=/usr/local/software/mono-1.9make && make install
Mono.Addins:
cd /usr/src/monodevelop-installwget http://go-mono.com/sources/mono-addins/mono-addins-0.3.1.tar.bz2tar xjf mono-addins-0.3.1.tar.bz2cd mono-addins-0.3.1./configure --prefix=/usr/local/software/mono-1.9make && make install
Mono Tools:
cd /usr/src/monodevelop-installwget http://go-mono.com/sources/mono-tools/mono-tools-1.9.tar.bz2tar xjf mono-tools-1.9.tar.bz2cd mono-tools-1.9./configure --prefix=/usr/local/software/mono-1.9make && make install
Monodoc
cd /usr/src/monodevelop-installwget http://go-mono.com/sources/monodoc/monodoc-1.9.zipunzip monodoc-1.9.zipcd monodoc-1.9./configure --prefix=/usr/local/software/mono-1.9make && make install
Gtksourceview:
cd /usr/src/monodevelop-installwget http://go-mono.com/sources/gtksourceview-sharp-2.0/gtksourceview-sharp-2.0-0.10.tar.gztar xzf gtksourceview-sharp-2.0-0.10.tar.gzcd gtksourceview-sharp-2.0-0.10./configure --prefix=/usr/local/software/mono-1.9make && make install
Monodevelop:
cd /usr/src/monodevelop-installwget http://go-mono.com/sources/monodevelop/monodevelop-1.0.tar.bz2tar xjf monodevelop-1.0.tar.bz2cd monodevelop-1.0./configure --prefix=/usr/local/software/mono-1.9make && 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-installwget http://downloads.sourceforge.net/nant/nant-0.85-bin.tar.gztar xzf nant-0.85-bin.tar.gz -C /usr/local/software/mono-1.9echo ''#!/bin/bash'' > /usr/local/software/mono-1.9/bin/nantecho ''mono /usr/local/software/mono-1.9/nant-0.85/bin/NAnt.exe "mailto:$@"'' >> /usr/local/software/mono-1.9/bin/nantchmod +x /usr/local/software/mono-1.9/bin/nant
Finished!
You’re done! Run it!

monodevelopFeel 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.

文章出处:飞诺网(www.firnow.com):http://dev.firnow.com/course/4_webprogram/asp.net/netjs/200855/113134.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: