nixpkgs/pkgs/os-specific/windows/mingw-w64/default.nix

37 lines
750 B
Nix
Raw Normal View History

{ stdenv, fetchurl, binutils ? null, gccCross ? null
, onlyHeaders ? false
, onlyPthreads ? false
}:
let
2016-02-04 11:07:28 +01:00
version = "4.0.6";
name = "mingw-w64-${version}";
in
2016-02-04 11:07:28 +01:00
stdenv.mkDerivation ({
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";
};
} //
(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;
})
)