mono: refactor and cleanup
Refactor and cleanup in preparation for mono44
This commit is contained in:
parent
01b8db1bc7
commit
a605b54b38
@ -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
|
let
|
||||||
llvm = callPackage ./llvm.nix { };
|
llvm = callPackage ./llvm.nix { };
|
||||||
llvmOpts = stdenv.lib.optionalString withLLVM "--enable-llvm --enable-llvmloaded --with-llvm=${llvm}";
|
sha256 = "1ydw9l89apc9p7xr5mdzy0h97g2q6v243g82mxswfc2rrqhfs4gd";
|
||||||
|
version = "4.0.4.1";
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "mono-${version}";
|
name = "mono-${version}";
|
||||||
version = "4.0.4.1";
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
|
inherit sha256;
|
||||||
url = "http://download.mono-project.com/sources/mono/${name}.tar.bz2";
|
url = "http://download.mono-project.com/sources/mono/${name}.tar.bz2";
|
||||||
sha256 = "1ydw9l89apc9p7xr5mdzy0h97g2q6v243g82mxswfc2rrqhfs4gd";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs =
|
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 ]);
|
++ (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
|
# In fact I think this line does not help at all to what I
|
||||||
# wanted to achieve: have mono to find libgdiplus automatically
|
# 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":
|
# 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
|
# The file /nix/store/xxx-mono-2.4.2.1/lib/mscorlib.dll is an invalid CIL image
|
||||||
@ -53,10 +63,9 @@ stdenv.mkDerivation rec {
|
|||||||
# Other items in the DLLMap may need to be pointed to their store locations, I don't think this is exhaustive
|
# 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
|
# http://www.mono-project.com/Config_DllMap
|
||||||
postBuild = ''
|
postBuild = ''
|
||||||
find . -name 'config' -type f | while read i; do
|
find . -name 'config' -type f | xargs \
|
||||||
sed -i "s@libX11.so.6@${libX11.out}/lib/libX11.so.6@g" $i
|
sed -i -e "s@libX11.so.6@${libX11.out}/lib/libX11.so.6@g" \
|
||||||
sed -i "s@/.*libgdiplus.so@${libgdiplus}/lib/libgdiplus.so@g" $i
|
-e "s@/.*libgdiplus.so@${libgdiplus}/lib/libgdiplus.so@g" \
|
||||||
done
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# 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
|
||||||
@ -76,7 +85,7 @@ stdenv.mkDerivation rec {
|
|||||||
homepage = http://mono-project.com/;
|
homepage = http://mono-project.com/;
|
||||||
description = "Cross platform, open source .NET development framework";
|
description = "Cross platform, open source .NET development framework";
|
||||||
platforms = with stdenv.lib.platforms; darwin ++ linux;
|
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 ?
|
license = stdenv.lib.licenses.free; # Combination of LGPL/X11/GPL ?
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user