2014-02-24 04:44:43 +01:00
|
|
|
{ stdenv, fetchurl, binutilsCross ? null, gccCross ? null
|
|
|
|
, onlyHeaders ? false
|
|
|
|
, onlyPthreads ? false
|
|
|
|
}:
|
2012-05-24 23:23:23 +02:00
|
|
|
|
|
|
|
let
|
2014-02-23 23:44:11 +01:00
|
|
|
name = "mingw-w64-3.1.0";
|
2012-05-24 23:23:23 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation (rec {
|
|
|
|
inherit name;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2014-02-23 23:44:11 +01:00
|
|
|
url = "mirror://sourceforge/mingw-w64/mingw-w64-v3.1.0.tar.bz2";
|
|
|
|
sha256 = "1lhpw381gc59w8b1r9zzdwa9cdi2wx6qx7s6rvajapmbw7ksgrzc";
|
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 {
|
|
|
|
buildInputs = [ gccCross binutilsCross ];
|
|
|
|
|
|
|
|
crossConfig = gccCross.crossConfig;
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
})
|
|
|
|
)
|