lol
1{ stdenv, fetchurl, fetchgit, fetchNuGet
2, autoconf, automake, pkgconfig, shared_mime_info, intltool
3, glib, mono, gtk-sharp, gnome, gnome-sharp, unzip
4, dotnetPackages
5}:
6
7stdenv.mkDerivation rec {
8 version = "5.9.4.5";
9 revision = "8010a90f6e246b32364e3fb46ef2c9d1be9c9a2b";
10 name = "monodevelop-${version}";
11
12 src = fetchurl {
13 url = "http://download.mono-project.com/sources/monodevelop/${name}.tar.bz2";
14 sha256 = "0bim4bfv3zwijafl9g0cx3159zq43dlcv74mnyrda41j4p52w5ji";
15 };
16
17 nunit2510 = fetchurl {
18 url = "http://launchpad.net/nunitv2/2.5/2.5.10/+download/NUnit-2.5.10.11092.zip";
19 sha256 = "0k5h5bz1p2v3d0w0hpkpbpvdkcszgp8sr9ik498r1bs72w5qlwnc";
20 };
21
22 postPatch = ''
23 # From https://bugzilla.xamarin.com/show_bug.cgi?id=23696#c19
24
25 # cecil needs NUnit 2.5.10 - this is also missing from the tar
26 unzip -j ${nunit2510} -d external/cecil/Test/libs/nunit-2.5.10 NUnit-2.5.10.11092/bin/net-2.0/framework/\*
27
28 # the tar doesn't include the nuget binary, so grab it from github and copy it
29 # into the right place
30 cp -vfR "$(dirname $(pkg-config NuGet.Core --variable=Libraries))"/* external/nuget-binary/
31 '';
32
33 # Revert this commit which broke the ability to use pkg-config to locate dlls
34 patchFlags = [ "-p2" ];
35 patches = [ ./git-revert-12d610fb3f6dce121df538e36f21d8c2eeb0a6e3.patch ];
36
37 buildInputs = [
38 autoconf automake pkgconfig shared_mime_info intltool
39 mono gtk-sharp gnome-sharp unzip
40 pkgconfig
41 dotnetPackages.NUnit
42 dotnetPackages.NUnitRunners
43 dotnetPackages.Nuget
44 ];
45
46 preConfigure = "patchShebangs ./configure";
47
48 preBuild = ''
49 cat > ./buildinfo <<EOF
50 Release ID: ${version}
51 Git revision: ${revision}
52 Build date: 1970-01-01 00:00:01
53 EOF
54 '';
55
56 postInstall = ''
57 for prog in monodevelop mdtool; do
58 patch -p 0 $out/bin/$prog <<EOF
59 2a3,5
60 > export MONO_GAC_PREFIX=${gnome-sharp}:${gtk-sharp}:\$MONO_GAC_PREFIX
61 > export PATH=${mono}/bin:\$PATH
62 > export LD_LIBRARY_PATH=${glib}/lib:${gnome.libgnomeui}/lib:${gnome.gnome_vfs}/lib:${gnome-sharp}/lib:${gtk-sharp}/lib:${gtk-sharp.gtk}/lib:\$LD_LIBRARY_PATH
63 >
64 EOF
65 done
66
67 # Without this, you get a missing DLL error any time you install an addin..
68 ln -sv `pkg-config nunit.core --variable=Libraries` $out/lib/monodevelop/AddIns/NUnit
69 ln -sv `pkg-config nunit.core.interfaces --variable=Libraries` $out/lib/monodevelop/AddIns/NUnit
70 ln -sv `pkg-config nunit.framework --variable=Libraries` $out/lib/monodevelop/AddIns/NUnit
71 ln -sv `pkg-config nunit.util --variable=Libraries` $out/lib/monodevelop/AddIns/NUnit
72 '';
73
74 dontStrip = true;
75
76 meta = with stdenv.lib; {
77 platforms = platforms.linux;
78 maintainers = with maintainers; [ obadz ];
79 };
80}