MonoDevelop 3.0をソースからビルドしてインストールする手順。 検証に使った環境はUbuntu 12.04 (Precise Pangolin)。

MonoDevelop本体

MonoDevelopが必要とするアセンブリのインストール

MonoDevelopが必要とするアセンブリをあらかじめインストールしておく。 必要になるものは以下のアセンブリ。 各アセンブリのインストール方法についてはMono 2.10 のビルド・インストールもしくはMono 2.11 のビルド・インストールを参照のこと。

  • MonoDevelopが必要とするアセンブリ・パッケージ
    • Mono (2.10.8以上)
    • Mono Addins
    • gtk-sharp (2.12.8以上)
    • monodoc
    • gecko-sharp
    • gtksourceview-sharp
    • mono-debugger (デバッガを使用する場合)

ソースのダウンロードとconfigure

tarballの場合

wget http://download.mono-project.com/sources/monodevelop/monodevelop-3.0.5.tar.bz2
tar -xvf monodevelop-3.0.5.tar.bz2 
cd monodevelop-3.0.5/

./configure --prefix=/opt/mono/2.11/ --enable-git

configureの結果を確認する。

Configuration summary

   * Installation prefix = /opt/mono/2.11
   * C# compiler = /opt/mono/2.11/bin/dmcs
   * Mono class library development extensions: yes
   * Version control providers:
   *     Subversion (Unix): yes
   *     Git: yes
   * Platform bindings: GNOME 
   * Unit tests: no

3.0.4.6の場合

3.0.4.6では、tarballを使ってビルドしようとすると「config.status: error: cannot find input file: `tests/UnitTests/Makefile.in'」というエラーが出てconfigureに失敗する。 testsディレクトリ以下の存在しないファイルを参照しようとしてエラーとなるので、次のファイルを修正することでこのエラーを回避できる。

  • 修正するファイル
    • configure.in
    • configure
    • Main.sln
  • 以下のディレクトリ・ファイルを参照している箇所を削除する
    • tests/UnitTests
    • tests/UserInterfaceTests
    • tests/MonoDevelop.MacDev.Tests
    • tests/MacPlatform.Tests

具体的な修正内容は以下の通り。

configure.inの修正箇所
344,347d343
< tests/UnitTests/Makefile
< tests/UserInterfaceTests/Makefile
< tests/MonoDevelop.MacDev.Tests/Makefile
< tests/MacPlatform.Tests/Makefile
configureの修正箇所
4383c4383
< ac_config_files="$ac_config_files build/Makefile build/MacOSX/Makefile contrib/Makefile contrib/Mono.Debugger.Soft/Makefile contrib/NRefactory/Makefile contrib/ICSharpCode.NRefactory/Makefile contrib/ICSharpCode.NRefactory.CSharp/Makefile contrib/ICSharpCode.Decompiler/Makefile external/Makefile src/Makefile src/core/Makefile src/core/Mono.Texteditor/Makefile src/core/Mono.Debugging/Makefile src/core/MonoDevelop.Core/Makefile src/core/MonoDevelop.Projects.Formats.MSBuild/Makefile src/core/MonoDevelop.Ide/Makefile src/core/MonoDevelop.Ide/BuildVariables.cs src/core/MonoDevelop.Startup/Makefile src/tools/Makefile src/tools/mdhost/Makefile src/tools/mdtool/Makefile src/tools/SharpCoco/Makefile src/tools/mdmonitor/Makefile src/addins/Makefile src/addins/MonoDeveloperExtensions/Makefile src/addins/MonoDeveloperExtensions/NUnit/Makefile src/addins/NUnit/Makefile src/addins/NUnit/NUnitRunner/Makefile src/addins/VersionControl/MonoDevelop.VersionControl/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Git/Makefile src/addins/VersionControl/Makefile src/addins/CSharpBinding/Makefile src/addins/CSharpBinding/Autotools/Makefile src/addins/CSharpBinding/AspNet/Makefile src/addins/ILAsmBinding/Makefile src/addins/VBNetBinding/Makefile src/addins/prj2make-sharp-lib/Makefile src/addins/ChangeLogAddIn/Makefile src/addins/MonoDevelop.GtkCore/Makefile src/addins/MonoDevelop.GtkCore/libstetic/Makefile src/addins/MonoDevelop.GtkCore/libsteticui/Makefile src/addins/TextTemplating/Makefile src/addins/TextTemplating/Mono.TextTemplating/Makefile src/addins/TextTemplating/TextTransform/Makefile src/addins/TextTemplating/MonoDevelop.TextTemplating/Makefile src/addins/TextTemplating/Mono.TextTemplating.Tests/Makefile src/addins/AspNet/Makefile src/addins/AspNet/MonoDevelop.AspNet/Makefile src/addins/AspNet/MonoDevelop.AspNet.Mvc/Makefile src/addins/MonoDevelop.Autotools/Makefile src/addins/MonoDevelop.DesignerSupport/Makefile src/addins/MonoDevelop.WebReferences/Makefile src/addins/Deployment/Makefile src/addins/Deployment/MonoDevelop.Deployment/Makefile src/addins/Deployment/MonoDevelop.Deployment.Linux/Makefile src/addins/MonoDevelop.Gettext/Makefile src/addins/MonoDevelop.RegexToolkit/Makefile src/addins/CBinding/Makefile src/addins/GnomePlatform/Makefile src/addins/MacPlatform/Makefile src/addins/WindowsPlatform/Makefile src/addins/MonoDevelop.AssemblyBrowser/Makefile src/addins/MonoDevelop.SourceEditor2/Makefile src/addins/MonoDevelop.XmlEditor/Makefile src/addins/MonoDevelop.Refactoring/Makefile src/addins/MonoDevelop.Debugger/Makefile src/addins/MonoDevelop.Debugger.Soft/Makefile src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/Makefile src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/Makefile src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/Makefile src/addins/MonoDevelop.HexEditor/Makefile src/addins/MonoDevelop.DocFood/Makefile src/addins/MonoDevelop.MacDev/Makefile tests/Makefile tests/UnitTests/Makefile tests/UserInterfaceTests/Makefile tests/MonoDevelop.MacDev.Tests/Makefile tests/MacPlatform.Tests/Makefile Makefile monodevelop mdtool monodevelop.pc monodevelop-core-addins.pc monodevelop-core-mac-addins.pc monodevelop.spec po/Makefile man/Makefile theme-icons/Makefile"
---
> ac_config_files="$ac_config_files build/Makefile build/MacOSX/Makefile contrib/Makefile contrib/Mono.Debugger.Soft/Makefile contrib/NRefactory/Makefile contrib/ICSharpCode.NRefactory/Makefile contrib/ICSharpCode.NRefactory.CSharp/Makefile contrib/ICSharpCode.Decompiler/Makefile external/Makefile src/Makefile src/core/Makefile src/core/Mono.Texteditor/Makefile src/core/Mono.Debugging/Makefile src/core/MonoDevelop.Core/Makefile src/core/MonoDevelop.Projects.Formats.MSBuild/Makefile src/core/MonoDevelop.Ide/Makefile src/core/MonoDevelop.Ide/BuildVariables.cs src/core/MonoDevelop.Startup/Makefile src/tools/Makefile src/tools/mdhost/Makefile src/tools/mdtool/Makefile src/tools/SharpCoco/Makefile src/tools/mdmonitor/Makefile src/addins/Makefile src/addins/MonoDeveloperExtensions/Makefile src/addins/MonoDeveloperExtensions/NUnit/Makefile src/addins/NUnit/Makefile src/addins/NUnit/NUnitRunner/Makefile src/addins/VersionControl/MonoDevelop.VersionControl/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/Makefile src/addins/VersionControl/MonoDevelop.VersionControl.Git/Makefile src/addins/VersionControl/Makefile src/addins/CSharpBinding/Makefile src/addins/CSharpBinding/Autotools/Makefile src/addins/CSharpBinding/AspNet/Makefile src/addins/ILAsmBinding/Makefile src/addins/VBNetBinding/Makefile src/addins/prj2make-sharp-lib/Makefile src/addins/ChangeLogAddIn/Makefile src/addins/MonoDevelop.GtkCore/Makefile src/addins/MonoDevelop.GtkCore/libstetic/Makefile src/addins/MonoDevelop.GtkCore/libsteticui/Makefile src/addins/TextTemplating/Makefile src/addins/TextTemplating/Mono.TextTemplating/Makefile src/addins/TextTemplating/TextTransform/Makefile src/addins/TextTemplating/MonoDevelop.TextTemplating/Makefile src/addins/TextTemplating/Mono.TextTemplating.Tests/Makefile src/addins/AspNet/Makefile src/addins/AspNet/MonoDevelop.AspNet/Makefile src/addins/AspNet/MonoDevelop.AspNet.Mvc/Makefile src/addins/MonoDevelop.Autotools/Makefile src/addins/MonoDevelop.DesignerSupport/Makefile src/addins/MonoDevelop.WebReferences/Makefile src/addins/Deployment/Makefile src/addins/Deployment/MonoDevelop.Deployment/Makefile src/addins/Deployment/MonoDevelop.Deployment.Linux/Makefile src/addins/MonoDevelop.Gettext/Makefile src/addins/MonoDevelop.RegexToolkit/Makefile src/addins/CBinding/Makefile src/addins/GnomePlatform/Makefile src/addins/MacPlatform/Makefile src/addins/WindowsPlatform/Makefile src/addins/MonoDevelop.AssemblyBrowser/Makefile src/addins/MonoDevelop.SourceEditor2/Makefile src/addins/MonoDevelop.XmlEditor/Makefile src/addins/MonoDevelop.Refactoring/Makefile src/addins/MonoDevelop.Debugger/Makefile src/addins/MonoDevelop.Debugger.Soft/Makefile src/addins/MonoDevelop.Debugger.Soft/Mono.Debugging.Soft/Makefile src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/Makefile src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft.AspNet/Makefile src/addins/MonoDevelop.HexEditor/Makefile src/addins/MonoDevelop.DocFood/Makefile src/addins/MonoDevelop.MacDev/Makefile tests/Makefile Makefile monodevelop mdtool monodevelop.pc monodevelop-core-addins.pc monodevelop-core-mac-addins.pc monodevelop.spec po/Makefile man/Makefile theme-icons/Makefile"
5230,5233d5229
<     "tests/UnitTests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/UnitTests/Makefile" ;;
<     "tests/UserInterfaceTests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/UserInterfaceTests/Makefile" ;;
<     "tests/MonoDevelop.MacDev.Tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/MonoDevelop.MacDev.Tests/Makefile" ;;
<     "tests/MacPlatform.Tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/MacPlatform.Tests/Makefile" ;;
Main.slnの修正箇所
148,151d147
< Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.Debugger.Tests", "src\addins\MonoDevelop.Debugger\MonoDevelop.Debugger.Tests\MonoDevelop.Debugger.Tests.csproj", "{174E6044-DD3A-49AB-9A5C-2A1F341B7B4F}"
< EndProject
< Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.Debugger.Tests.TestApp", "src\addins\MonoDevelop.Debugger\MonoDevelop.Debugger.Tests.TestApp\MonoDevelop.Debugger.Tests.TestApp.csproj", "{05EDFE55-C8D1-47E4-BB61-0BC809CD82E2}"
< EndProject
190,197d185
< Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "tests\UnitTests\UnitTests.csproj", "{1497D0A8-AFF1-4938-BC22-BE79B358BA5B}"
< EndProject
< Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserInterfaceTests", "tests\UserInterfaceTests\UserInterfaceTests.csproj", "{07F55155-51A8-4072-9F80-FA473666F086}"
< EndProject
< Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.MacDev.Tests", "tests\MonoDevelop.MacDev.Tests\MonoDevelop.MacDev.Tests.csproj", "{76495467-E8BF-43B0-A03C-18C6341966B9}"
< EndProject
< Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MacPlatform.Tests", "tests\MacPlatform.Tests\MacPlatform.Tests.csproj", "{C05AAB7A-523F-4109-966B-6675BE0975BA}"
< EndProject
224,230d211
< 		{05EDFE55-C8D1-47E4-BB61-0BC809CD82E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
< 		{05EDFE55-C8D1-47E4-BB61-0BC809CD82E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
< 		{05EDFE55-C8D1-47E4-BB61-0BC809CD82E2}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
< 		{05EDFE55-C8D1-47E4-BB61-0BC809CD82E2}.DebugMac|Any CPU.Build.0 = Debug|Any CPU
< 		{05EDFE55-C8D1-47E4-BB61-0BC809CD82E2}.DebugWin32|x86.ActiveCfg = Debug|Any CPU
< 		{05EDFE55-C8D1-47E4-BB61-0BC809CD82E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
< 		{05EDFE55-C8D1-47E4-BB61-0BC809CD82E2}.Release|Any CPU.Build.0 = Release|Any CPU
239,246d219
< 		{07F55155-51A8-4072-9F80-FA473666F086}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
< 		{07F55155-51A8-4072-9F80-FA473666F086}.Debug|Any CPU.Build.0 = Debug|Any CPU
< 		{07F55155-51A8-4072-9F80-FA473666F086}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
< 		{07F55155-51A8-4072-9F80-FA473666F086}.DebugMac|Any CPU.Build.0 = Debug|Any CPU
< 		{07F55155-51A8-4072-9F80-FA473666F086}.DebugWin32|x86.ActiveCfg = Debug|Any CPU
< 		{07F55155-51A8-4072-9F80-FA473666F086}.DebugWin32|x86.Build.0 = Debug|Any CPU
< 		{07F55155-51A8-4072-9F80-FA473666F086}.Release|Any CPU.ActiveCfg = Release|Any CPU
< 		{07F55155-51A8-4072-9F80-FA473666F086}.Release|Any CPU.Build.0 = Release|Any CPU
279,286d251
< 		{1497D0A8-AFF1-4938-BC22-BE79B358BA5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
< 		{1497D0A8-AFF1-4938-BC22-BE79B358BA5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
< 		{1497D0A8-AFF1-4938-BC22-BE79B358BA5B}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
< 		{1497D0A8-AFF1-4938-BC22-BE79B358BA5B}.DebugMac|Any CPU.Build.0 = Debug|Any CPU
< 		{1497D0A8-AFF1-4938-BC22-BE79B358BA5B}.DebugWin32|x86.ActiveCfg = Debug|Any CPU
< 		{1497D0A8-AFF1-4938-BC22-BE79B358BA5B}.DebugWin32|x86.Build.0 = Debug|Any CPU
< 		{1497D0A8-AFF1-4938-BC22-BE79B358BA5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
< 		{1497D0A8-AFF1-4938-BC22-BE79B358BA5B}.Release|Any CPU.Build.0 = Release|Any CPU
292,298d256
< 		{174E6044-DD3A-49AB-9A5C-2A1F341B7B4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
< 		{174E6044-DD3A-49AB-9A5C-2A1F341B7B4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
< 		{174E6044-DD3A-49AB-9A5C-2A1F341B7B4F}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
< 		{174E6044-DD3A-49AB-9A5C-2A1F341B7B4F}.DebugMac|Any CPU.Build.0 = Debug|Any CPU
< 		{174E6044-DD3A-49AB-9A5C-2A1F341B7B4F}.DebugWin32|x86.ActiveCfg = Debug|Any CPU
< 		{174E6044-DD3A-49AB-9A5C-2A1F341B7B4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
< 		{174E6044-DD3A-49AB-9A5C-2A1F341B7B4F}.Release|Any CPU.Build.0 = Release|Any CPU
458,462d415
< 		{76495467-E8BF-43B0-A03C-18C6341966B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
< 		{76495467-E8BF-43B0-A03C-18C6341966B9}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
< 		{76495467-E8BF-43B0-A03C-18C6341966B9}.DebugMac|Any CPU.Build.0 = Debug|Any CPU
< 		{76495467-E8BF-43B0-A03C-18C6341966B9}.DebugWin32|x86.ActiveCfg = Debug|Any CPU
< 		{76495467-E8BF-43B0-A03C-18C6341966B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
679,684d631
< 		{C05AAB7A-523F-4109-966B-6675BE0975BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
< 		{C05AAB7A-523F-4109-966B-6675BE0975BA}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
< 		{C05AAB7A-523F-4109-966B-6675BE0975BA}.DebugMac|Any CPU.Build.0 = Debug|Any CPU
< 		{C05AAB7A-523F-4109-966B-6675BE0975BA}.DebugWin32|x86.ActiveCfg = Debug|Any CPU
< 		{C05AAB7A-523F-4109-966B-6675BE0975BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
< 		{C05AAB7A-523F-4109-966B-6675BE0975BA}.Release|Any CPU.Build.0 = Release|Any CPU
887,888d833
< 		{174E6044-DD3A-49AB-9A5C-2A1F341B7B4F} = {776872D9-76FA-407B-BA69-08E25A24E5CE}
< 		{05EDFE55-C8D1-47E4-BB61-0BC809CD82E2} = {776872D9-76FA-407B-BA69-08E25A24E5CE}
903,906d847
< 		{1497D0A8-AFF1-4938-BC22-BE79B358BA5B} = {78C10DAE-D3D7-44FC-93DF-831D8D54ECF9}
< 		{07F55155-51A8-4072-9F80-FA473666F086} = {78C10DAE-D3D7-44FC-93DF-831D8D54ECF9}
< 		{76495467-E8BF-43B0-A03C-18C6341966B9} = {78C10DAE-D3D7-44FC-93DF-831D8D54ECF9}
< 		{C05AAB7A-523F-4109-966B-6675BE0975BA} = {78C10DAE-D3D7-44FC-93DF-831D8D54ECF9}

3.0.1以前の場合

3.0.1以前のバージョンでは、tarballを使ってビルドしようとすると「src/addins/MonoDevelop.CodeMetrics/Makefile.inが見つからない」というエラーが出てサブモジュールのビルドに失敗するため、gitからソースを取得してビルドする必要がある。 ([MonoDevelop] Building MD 3.0.1)

gitからソースを取得する場合

git clone git://github.com/mono/monodevelop.git -b 3.0-series ./monodevelop-3.0.x
cd monodevelop-3.0.x/

--selectオプションをつけて./configureを実行し、ビルドするアドインを選択/解除する。

$ ./configure --prefix=/opt/mono/2.11/ --select

Select the packages to include in the build for the profile 'default':

1. [X] main
2. [ ] extras/JavaBinding
3. [ ] extras/ValaBinding
4. [ ] extras/MonoDevelop.Database
5. [ ] extras/MonoDevelop.Debugger.Gdb
6. [ ] extras/PyBinding
7. [ ] extras/MonoDevelop.MonoMac
8. [ ] extras/MonoDevelop.MeeGo

Enter the number of an add-in to enable/disable,
(q) quit, (c) clear all, (s) select all, or ENTER to continue:  

Configuring package: main
-------------------------

configureの結果を確認する。

Configuration summary

   * Installation prefix = /opt/mono/2.11
   * C# compiler = /opt/mono/2.11/bin/dmcs
   * Mono class library development extensions: yes
   * Version control providers:
   *     Subversion (Unix): yes
   *     Git: yes
   * Platform bindings: GNOME 
   * Unit tests: no

Now type `make' to compile MonoDevelop
Configuration Summary
---------------------

MonoDevelop has been configured with 
    prefix = /opt/mono/2.11/
    profile = default

Packages included in the build:
    main

ビルド、起動

問題が無ければ、makeする。

make

ビルドしたものをインストールせず、すぐに実行したければmake runする。

make run

インストールするには、make installする。

sudo make install

symbol lookup errorが発生して起動できない場合の対処

GLibのバージョンが2.31以上の場合、g_thread_*が定義されておらず、MonoDevelopの起動時に以下のようなエラーが発生する。 (MonoDevelop本体ではなくgtk-sharp-2.0の問題)

monodevelop: symbol lookup error: /opt/mono/2.11/lib/libglibsharpglue-2.so: undefined symbol: g_thread_supported

gtk-sharp-2.0をビルドする前に、glib/Thread.csを以下のように修正してg_thread_*を呼び出さないように変更することで上記のエラーは発生しなくなる。 (gtk-sharp-2.12.11で確認済み)

glib/Thread.cs
--- Thread.cs.org	2012-05-20 12:15:21.030339182 +0900
+++ Thread.cs	2012-05-20 12:18:47.251019917 +0900
@@ -26,10 +26,20 @@
 
 	public class Thread
 	{
 		private Thread () {}
 		
+#if true
+		public static void Init ()
+		{
+		}
+
+		public static bool Supported
+		{
+			get { return true; }
+		}
+#else
 		[DllImport("libgthread-2.0-0.dll")]
 		static extern void g_thread_init (IntPtr i);
 
 		public static void Init ()
 		{
@@ -43,7 +53,8 @@
 		{
 			get {
 				return glibsharp_g_thread_supported ();
 			}
 		}
+#endif
 	}
 }