summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorRahul Gopinath <rahul@gopinath.org>2016-07-03 12:32:46 -0700
committerBjørn Forsman <bjorn.forsman@gmail.com>2016-07-04 10:44:34 +0200
commita605b54b38285b790ac87da983036cb64a5de288 (patch)
tree743c8d98f5d1bdea38287bc3e2e53fe592f35503 /pkgs/development/compilers
parent01b8db1bc78251745cec68a57a83d8e1264593fa (diff)
downloadnixpkgs-a605b54b38285b790ac87da983036cb64a5de288.tar
nixpkgs-a605b54b38285b790ac87da983036cb64a5de288.tar.gz
nixpkgs-a605b54b38285b790ac87da983036cb64a5de288.tar.bz2
nixpkgs-a605b54b38285b790ac87da983036cb64a5de288.tar.lz
nixpkgs-a605b54b38285b790ac87da983036cb64a5de288.tar.xz
nixpkgs-a605b54b38285b790ac87da983036cb64a5de288.tar.zst
nixpkgs-a605b54b38285b790ac87da983036cb64a5de288.zip
mono: refactor and cleanup
Refactor and cleanup in preparation for mono44
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/mono/default.nix33
1 files changed, 21 insertions, 12 deletions
diff --git a/pkgs/development/compilers/mono/default.nix b/pkgs/development/compilers/mono/default.nix
index 54e76c731a1..123ffa57ac0 100644
--- a/pkgs/development/compilers/mono/default.nix
+++ b/pkgs/development/compilers/mono/default.nix
@@ -1,19 +1,20 @@
-{ stdenv, fetchurl, bison, pkgconfig, glib, gettext, perl, libgdiplus, libX11, callPackage, ncurses, zlib, withLLVM ? false, cacert, Foundation, libobjc }:
+{ stdenv, fetchurl, bison, pkgconfig, glib, gettext, perl, libgdiplus, libX11, callPackage, ncurses, zlib, withLLVM ? false, cacert, Foundation, libobjc, python }:
 
 let
   llvm     = callPackage ./llvm.nix { };
-  llvmOpts = stdenv.lib.optionalString withLLVM "--enable-llvm --enable-llvmloaded --with-llvm=${llvm}";
+  sha256 = "1ydw9l89apc9p7xr5mdzy0h97g2q6v243g82mxswfc2rrqhfs4gd";
+  version = "4.0.4.1";
 in
 stdenv.mkDerivation rec {
   name = "mono-${version}";
-  version = "4.0.4.1";
+
   src = fetchurl {
+    inherit sha256;
     url = "http://download.mono-project.com/sources/mono/${name}.tar.bz2";
-    sha256 = "1ydw9l89apc9p7xr5mdzy0h97g2q6v243g82mxswfc2rrqhfs4gd";
   };
 
   buildInputs =
-    [ bison pkgconfig glib gettext perl libgdiplus libX11 ncurses zlib
+    [ bison pkgconfig glib gettext perl libgdiplus libX11 ncurses zlib python
     ]
     ++ (stdenv.lib.optionals stdenv.isDarwin [ Foundation libobjc ]);
 
@@ -26,7 +27,16 @@ stdenv.mkDerivation rec {
 
   # In fact I think this line does not help at all to what I
   # wanted to achieve: have mono to find libgdiplus automatically
-  configureFlags = "--x-includes=${libX11.dev}/include --x-libraries=${libX11.out}/lib --with-libgdiplus=${libgdiplus}/lib/libgdiplus.so ${llvmOpts}";
+  configureFlags = [
+    "--x-includes=${libX11.dev}/include"
+    "--x-libraries=${libX11.out}/lib"
+    "--with-libgdiplus=${libgdiplus}/lib/libgdiplus.so"
+  ]
+  ++ stdenv.lib.optionals withLLVM [
+    "--enable-llvm"
+    "--enable-llvmloaded"
+    "--with-llvm=${llvm}"
+  ];
 
   # Attempt to fix this error when running "mcs --version":
   # The file /nix/store/xxx-mono-2.4.2.1/lib/mscorlib.dll is an invalid CIL image
@@ -53,13 +63,12 @@ stdenv.mkDerivation rec {
   # Other items in the DLLMap may need to be pointed to their store locations, I don't think this is exhaustive
   # http://www.mono-project.com/Config_DllMap
   postBuild = ''
-    find . -name 'config' -type f | while read i; do
-        sed -i "s@libX11.so.6@${libX11.out}/lib/libX11.so.6@g" $i
-        sed -i "s@/.*libgdiplus.so@${libgdiplus}/lib/libgdiplus.so@g" $i
-    done
+    find . -name 'config' -type f | xargs \
+    sed -i -e "s@libX11.so.6@${libX11.out}/lib/libX11.so.6@g" \
+           -e "s@/.*libgdiplus.so@${libgdiplus}/lib/libgdiplus.so@g" \
   '';
 
-  # Without this, any Mono application attempting to open an SSL connection will throw with 
+  # Without this, any Mono application attempting to open an SSL connection will throw with
   # The authentication or decryption has failed.
   # ---> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server.
   postInstall = ''
@@ -76,7 +85,7 @@ stdenv.mkDerivation rec {
     homepage = http://mono-project.com/;
     description = "Cross platform, open source .NET development framework";
     platforms = with stdenv.lib.platforms; darwin ++ linux;
-    maintainers = with stdenv.lib.maintainers; [ viric thoughtpolice obadz ];
+    maintainers = with stdenv.lib.maintainers; [ viric thoughtpolice obadz vrthra ];
     license = stdenv.lib.licenses.free; # Combination of LGPL/X11/GPL ?
   };
 }