2012-05-24 23:23:23 +02:00
|
|
|
{stdenv, fetchurl, binutilsCross ? null, gccCross ? null, onlyHeaders ? false}:
|
|
|
|
|
|
|
|
let
|
|
|
|
name = "mingw-w64-2.0.3";
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation (rec {
|
|
|
|
inherit name;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/mingw-w64/mingw-w64-v2.0.3.tar.gz";
|
|
|
|
sha256 = "043jk6z90f9pxs9kfn6ckh2vlnbgcv6yfbp5ybahrj3z58dcijp5";
|
|
|
|
};
|
|
|
|
|
2012-05-25 00:07:23 +02:00
|
|
|
# I don't know what's that $host directory about, I put the
|
|
|
|
# files inside include as usual.
|
|
|
|
postInstall = ''
|
|
|
|
rmdir $out/include
|
|
|
|
mv $out/x86_64-w64-mingw32/* $out
|
|
|
|
rm -R $out/x86_64-w64-mingw32
|
|
|
|
'';
|
2012-05-24 23:23:23 +02:00
|
|
|
} //
|
|
|
|
(if onlyHeaders then {
|
|
|
|
name = name + "-headers";
|
|
|
|
preConfingure = ''
|
|
|
|
cd mingw-w64-headers
|
|
|
|
'';
|
|
|
|
configureFlags = "--without-crt --host=x86_64-w64-mingw32";
|
|
|
|
} else {
|
|
|
|
buildInputs = [ gccCross binutilsCross ];
|
|
|
|
|
|
|
|
crossConfig = gccCross.crossConfig;
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
})
|
|
|
|
)
|