diff options
Diffstat (limited to 'nixpkgs/pkgs/os-specific/windows/mingw-w64')
4 files changed, 63 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/windows/mingw-w64/default.nix b/nixpkgs/pkgs/os-specific/windows/mingw-w64/default.nix new file mode 100644 index 000000000000..a7d4f09b90e9 --- /dev/null +++ b/nixpkgs/pkgs/os-specific/windows/mingw-w64/default.nix @@ -0,0 +1,26 @@ +{ stdenv, windows, fetchurl }: + +let + version = "5.0.4"; +in stdenv.mkDerivation { + name = "mingw-w64-${version}"; + + src = fetchurl { + url = "mirror://sourceforge/mingw-w64/mingw-w64-v${version}.tar.bz2"; + sha256 = "00zq3z1hbzd5yzmskskjg79xrzwsqx7ihyprfaxy4hb897vf29sm"; + }; + + configureFlags = [ + "--enable-idl" + "--enable-secure-api" + ]; + + buildInputs = [ windows.mingw_w64_headers ]; + dontStrip = true; + hardeningDisable = [ "stackprotector" "fortify" ]; + patches = [ ./osvi.patch ]; + + meta = { + platforms = stdenv.lib.platforms.windows; + }; +} diff --git a/nixpkgs/pkgs/os-specific/windows/mingw-w64/headers.nix b/nixpkgs/pkgs/os-specific/windows/mingw-w64/headers.nix new file mode 100644 index 000000000000..6a93cea67080 --- /dev/null +++ b/nixpkgs/pkgs/os-specific/windows/mingw-w64/headers.nix @@ -0,0 +1,13 @@ +{ stdenvNoCC, mingw_w64 }: + +stdenvNoCC.mkDerivation { + name = "${mingw_w64.name}-headers"; + inherit (mingw_w64) src meta; + + patches = [ ./osvi.patch ]; + + preConfigure = '' + cd mingw-w64-headers + ''; + +} diff --git a/nixpkgs/pkgs/os-specific/windows/mingw-w64/osvi.patch b/nixpkgs/pkgs/os-specific/windows/mingw-w64/osvi.patch new file mode 100644 index 000000000000..c51ff4bd5dfd --- /dev/null +++ b/nixpkgs/pkgs/os-specific/windows/mingw-w64/osvi.patch @@ -0,0 +1,14 @@ +Fix `error: osvi undeclared (first use in this function)' issue. + +See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863064 +--- a/mingw-w64-headers/include/multimon.h ++++ b/mingw-w64-headers/include/multimon.h +@@ -127,7 +127,7 @@ + WINBOOL IsPlatformNT() { + OSVERSIONINFOA oi = { 0 }; + +- oi.dwOSVersionInfoSize = sizeof (osvi); ++ oi.dwOSVersionInfoSize = sizeof (oi); + GetVersionExA ((OSVERSIONINFOA *) &oi); + return (oi.dwPlatformId == VER_PLATFORM_WIN32_NT); + } \ No newline at end of file diff --git a/nixpkgs/pkgs/os-specific/windows/mingw-w64/pthreads.nix b/nixpkgs/pkgs/os-specific/windows/mingw-w64/pthreads.nix new file mode 100644 index 000000000000..bbcb028d3cbb --- /dev/null +++ b/nixpkgs/pkgs/os-specific/windows/mingw-w64/pthreads.nix @@ -0,0 +1,10 @@ +{ stdenv, mingw_w64 }: + +stdenv.mkDerivation { + name = "${mingw_w64.name}-pthreads"; + inherit (mingw_w64) src meta; + + preConfigure = '' + cd mingw-w64-libraries/winpthreads + ''; +} |