295315cc87
See previous commit for what was done to `binutils` to make this possible. There were some uses of `forcedNativePackages` added. The combination of overrides with that attribute is highly spooky: it's often important that if an overridden package comes from it, the replaced arguments for that package come from it. Long term this package set and all the spookiness should be gone and irrelevant: "Move along, nothing to see here!" No hashes should be changed with this commit
37 lines
750 B
Nix
37 lines
750 B
Nix
{ stdenv, fetchurl, binutils ? null, gccCross ? null
|
|
, onlyHeaders ? false
|
|
, onlyPthreads ? false
|
|
}:
|
|
|
|
let
|
|
version = "4.0.6";
|
|
name = "mingw-w64-${version}";
|
|
in
|
|
stdenv.mkDerivation ({
|
|
inherit name;
|
|
|
|
src = fetchurl {
|
|
url = "mirror://sourceforge/mingw-w64/mingw-w64-v${version}.tar.bz2";
|
|
sha256 = "0p01vm5kx1ixc08402z94g1alip4vx66gjpvyi9maqyqn2a76h0c";
|
|
};
|
|
} //
|
|
(if onlyHeaders then {
|
|
name = name + "-headers";
|
|
preConfigure = ''
|
|
cd mingw-w64-headers
|
|
'';
|
|
configureFlags = "--without-crt";
|
|
} else if onlyPthreads then {
|
|
name = name + "-pthreads";
|
|
preConfigure = ''
|
|
cd mingw-w64-libraries/winpthreads
|
|
'';
|
|
} else {
|
|
buildInputs = [ gccCross binutils ];
|
|
|
|
crossConfig = gccCross.crossConfig;
|
|
|
|
dontStrip = true;
|
|
})
|
|
)
|