@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, bison, pkgconfig, glib, gettext, perl, libgdiplus, libX11, callPackage, ncurses, zlib, withLLVM ? false, cacert, Foundation, libobjc, python, version, sha256, cmake, autoconf, libtool, automake, gcc }:
1+{ stdenv, fetchurl, bison, pkgconfig, glib, gettext, perl, libgdiplus, libX11, callPackage, ncurses, zlib, withLLVM ? false, cacert, Foundation, libobjc, python, version, sha256, autoconf, libtool, automake, cmake, which }:
22
33let
44 llvm = callPackage ./llvm.nix { };
@@ -8,11 +8,11 @@ stdenv.mkDerivation rec {
88
99 src = fetchurl {
1010 inherit sha256;
11− url = "https://download.mono-project.com/sources/mono/${name}.tar.bz2";
11+ url = "http://download.mono-project.com/sources/mono/${name}.tar.bz2";
1212 };
1313
1414 buildInputs =
15− [ bison pkgconfig glib gettext perl libgdiplus libX11 ncurses zlib python cmake autoconf libtool automake gcc
15+ [ bison pkgconfig glib gettext perl libgdiplus libX11 ncurses zlib python autoconf libtool automake cmake which
1616 ]
1717 ++ (stdenv.lib.optionals stdenv.isDarwin [ Foundation libobjc ]);
1818
@@ -36,6 +36,11 @@ stdenv.mkDerivation rec {
3636 "--with-llvm=${llvm}"
3737 ];
3838
39+ configurePhase = ''
40+ substituteInPlace ./autogen.sh --replace "/usr/bin/env sh" "/bin/sh"
41+ ./autogen.sh --prefix $out
42+ '';
43+
3944 # Attempt to fix this error when running "mcs --version":
4045 # The file /nix/store/xxx-mono-2.4.2.1/lib/mscorlib.dll is an invalid CIL image
4146 dontStrip = true;
@@ -45,7 +50,7 @@ stdenv.mkDerivation rec {
4550
4651 # We want pkg-config to take priority over the dlls in the Mono framework and the GAC
4752 # because we control pkg-config
48− patches = [ ./pkgconfig-before-gac-5x.patch ];
53+ patches = [ ./pkgconfig-before-gac.patch ];
4954
5055 # Patch all the necessary scripts. Also, if we're using LLVM, we fix the default
5156 # LLVM path to point into the Mono LLVM build, since it's private anyway.
@@ -55,7 +60,6 @@ stdenv.mkDerivation rec {
5560 substituteInPlace mcs/class/corlib/System/Environment.cs --replace /usr/share "$out/share"
5661 '' + stdenv.lib.optionalString withLLVM ''
5762 substituteInPlace mono/mini/aot-compiler.c --replace "llvm_path = g_strdup (\"\")" "llvm_path = g_strdup (\"${llvm}/bin/\")"
58− echo 11111
5963 '';
6064
6165 # Fix mono DLLMap so it can find libX11 and gdiplus to run winforms apps