2017-04-26 01:18:29 +00:00
|
|
|
{ stdenv, fetchurl, binutils ? null, gccCross ? null
|
2014-02-24 03:44:43 +00:00
|
|
|
, onlyHeaders ? false
|
|
|
|
, onlyPthreads ? false
|
|
|
|
}:
|
2012-05-24 21:23:23 +00:00
|
|
|
|
|
|
|
let
|
2016-02-04 10:07:28 +00:00
|
|
|
version = "4.0.6";
|
|
|
|
name = "mingw-w64-${version}";
|
2012-05-24 21:23:23 +00:00
|
|
|
in
|
2016-02-04 10:07:28 +00:00
|
|
|
stdenv.mkDerivation ({
|
2012-05-24 21:23:23 +00:00
|
|
|
inherit name;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2016-02-04 10:07:28 +00:00
|
|
|
url = "mirror://sourceforge/mingw-w64/mingw-w64-v${version}.tar.bz2";
|
|
|
|
sha256 = "0p01vm5kx1ixc08402z94g1alip4vx66gjpvyi9maqyqn2a76h0c";
|
2012-05-24 21:23:23 +00:00
|
|
|
};
|
|
|
|
} //
|
|
|
|
(if onlyHeaders then {
|
|
|
|
name = name + "-headers";
|
2014-02-24 03:43:00 +00:00
|
|
|
preConfigure = ''
|
2012-05-24 21:23:23 +00:00
|
|
|
cd mingw-w64-headers
|
|
|
|
'';
|
2014-03-03 21:31:18 +00:00
|
|
|
configureFlags = "--without-crt";
|
2014-02-24 03:44:43 +00:00
|
|
|
} else if onlyPthreads then {
|
|
|
|
name = name + "-pthreads";
|
|
|
|
preConfigure = ''
|
|
|
|
cd mingw-w64-libraries/winpthreads
|
|
|
|
'';
|
2012-05-24 21:23:23 +00:00
|
|
|
} else {
|
2017-04-26 01:18:29 +00:00
|
|
|
buildInputs = [ gccCross binutils ];
|
2012-05-24 21:23:23 +00:00
|
|
|
|
|
|
|
crossConfig = gccCross.crossConfig;
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
})
|
|
|
|
)
|