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