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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.2 KiB
Nix
Raw Normal View History

{ 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;
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
};
outputs = [ "out" "dev" ];
2018-08-10 16:00:49 +00:00
configureFlags = [
"--enable-idl"
"--enable-secure-api"
"--with-default-msvcrt=${crt}"
2022-05-02 20:31:58 +00:00
] ++ archFlags;
enableParallelBuilding = true;
buildInputs = [ windows.mingw_w64_headers ];
dontStrip = true;
hardeningDisable = [ "stackprotector" "fortify" ];
meta = {
2021-01-15 14:45:37 +00:00
platforms = lib.platforms.windows;
broken = !(lib.elem crt [ "msvcrt" "ucrt" ]);
};
}