2021-01-20 02:09:31 +00:00
|
|
|
{ lib, stdenv, windows, fetchurl }:
|
2018-08-10 16:00:49 +00:00
|
|
|
|
|
|
|
let
|
2022-05-02 20:31:58 +00:00
|
|
|
version = "10.0.0";
|
|
|
|
|
|
|
|
knownArches = [ "32" "64" "arm32" "arm64" ];
|
|
|
|
enabledArch =
|
|
|
|
if stdenv.targetPlatform.isAarch32
|
|
|
|
then "arm32"
|
|
|
|
else if stdenv.targetPlatform.isAarch64
|
|
|
|
then "arm64"
|
|
|
|
else if stdenv.targetPlatform.isx86_32
|
|
|
|
then "32"
|
|
|
|
else if stdenv.targetPlatform.isx86_64
|
|
|
|
then "64"
|
|
|
|
else null;
|
|
|
|
archFlags =
|
|
|
|
if enabledArch == null
|
|
|
|
then [] # maybe autoconf will save us
|
|
|
|
else map (arch: lib.enableFeature (arch == enabledArch) "lib${arch}") knownArches;
|
|
|
|
|
2022-05-02 21:15:18 +00:00
|
|
|
crt = stdenv.hostPlatform.libc;
|
2018-08-10 16:00:49 +00:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "mingw-w64";
|
|
|
|
inherit version;
|
2018-08-10 16:00:49 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/mingw-w64/mingw-w64-v${version}.tar.bz2";
|
2022-05-02 20:31:58 +00:00
|
|
|
sha256 = "sha256-umtDCu1yxjo3aFMfaj/8Kw/eLFejslFFDc9ImolPCJQ=";
|
2018-08-10 16:00:49 +00:00
|
|
|
};
|
|
|
|
|
2019-11-11 05:08:45 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2018-08-10 16:00:49 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-idl"
|
|
|
|
"--enable-secure-api"
|
2022-05-02 21:15:18 +00:00
|
|
|
"--with-default-msvcrt=${crt}"
|
2022-05-02 20:31:58 +00:00
|
|
|
] ++ archFlags;
|
2012-05-24 21:23:23 +00:00
|
|
|
|
2019-11-11 05:08:45 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2017-06-19 19:30:17 +00:00
|
|
|
buildInputs = [ windows.mingw_w64_headers ];
|
2012-05-24 21:23:23 +00:00
|
|
|
dontStrip = true;
|
2017-12-29 14:29:05 +00:00
|
|
|
hardeningDisable = [ "stackprotector" "fortify" ];
|
2018-08-10 15:51:18 +00:00
|
|
|
|
|
|
|
meta = {
|
2021-01-15 14:45:37 +00:00
|
|
|
platforms = lib.platforms.windows;
|
2022-05-02 21:15:18 +00:00
|
|
|
broken = !(lib.elem crt [ "msvcrt" "ucrt" ]);
|
2018-08-10 15:51:18 +00:00
|
|
|
};
|
2017-06-19 15:51:01 +00:00
|
|
|
}
|