about summary refs log tree commit diff
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2014-03-03 22:31:18 +0100
committeraszlig <aszlig@redmoonstudios.org>2014-03-03 22:38:48 +0100
commite64b342fa8fda783a7247e0469943ce728498004 (patch)
tree567a9c73e4fbb2137f9c714848d11287db7692b3
parentae0b5d6813362492e744b1ac10e21309bb4e238b (diff)
downloadnixlib-e64b342fa8fda783a7247e0469943ce728498004.tar
nixlib-e64b342fa8fda783a7247e0469943ce728498004.tar.gz
nixlib-e64b342fa8fda783a7247e0469943ce728498004.tar.bz2
nixlib-e64b342fa8fda783a7247e0469943ce728498004.tar.lz
nixlib-e64b342fa8fda783a7247e0469943ce728498004.tar.xz
nixlib-e64b342fa8fda783a7247e0469943ce728498004.tar.zst
nixlib-e64b342fa8fda783a7247e0469943ce728498004.zip
Use mingw-w64 for 32bit Windows builds as well.
Mingw(32) is rather poorly maintaned and has quite a lot of bugs. And
because our Windows cross builds were also poorly maintained and most of
the cross-tests were broken as well, I'm just taking this step and try
to switch to mingw-w64 for everything "cross Windows".

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
-rw-r--r--pkgs/development/compilers/gcc/4.6/default.nix6
-rw-r--r--pkgs/development/compilers/gcc/4.8/default.nix6
-rw-r--r--pkgs/development/interpreters/lua-5/5.2.nix6
-rw-r--r--pkgs/development/libraries/SDL/default.nix2
-rw-r--r--pkgs/development/libraries/glew/default.nix2
-rw-r--r--pkgs/development/libraries/pcre/default.nix2
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix3
-rw-r--r--pkgs/os-specific/windows/mingw-w64/default.nix2
-rw-r--r--pkgs/top-level/all-packages.nix8
-rw-r--r--pkgs/top-level/release-cross.nix11
10 files changed, 19 insertions, 29 deletions
diff --git a/pkgs/development/compilers/gcc/4.6/default.nix b/pkgs/development/compilers/gcc/4.6/default.nix
index 3ed0f7ad0e6d..af1113226980 100644
--- a/pkgs/development/compilers/gcc/4.6/default.nix
+++ b/pkgs/development/compilers/gcc/4.6/default.nix
@@ -159,10 +159,8 @@ let version = "4.6.3";
             # In any case, mingw32 g++ linking is broken by default with shared libs,
             # unless adding "-lsupc++" to any linking command. I don't know why.
             " --disable-shared" +
-            (if cross.config == "x86_64-w64-mingw32" then
-              # To keep ABI compatibility with upstream mingw-w64
-              " --enable-fully-dynamic-string"
-              else "")
+            # To keep ABI compatibility with upstream mingw-w64
+            " --enable-fully-dynamic-string"
             else (if cross.libc == "uclibc" then
               # In uclibc cases, libgomp needs an additional '-ldl'
               # and as I don't know how to pass it, I disable libgomp.
diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix
index aea525933234..e2c887c368f5 100644
--- a/pkgs/development/compilers/gcc/4.8/default.nix
+++ b/pkgs/development/compilers/gcc/4.8/default.nix
@@ -175,10 +175,8 @@ let version = "4.8.2";
             # In any case, mingw32 g++ linking is broken by default with shared libs,
             # unless adding "-lsupc++" to any linking command. I don't know why.
             " --disable-shared" +
-            (if cross.config == "x86_64-w64-mingw32" then
-              # To keep ABI compatibility with upstream mingw-w64
-              " --enable-fully-dynamic-string"
-              else "")
+            # To keep ABI compatibility with upstream mingw-w64
+            " --enable-fully-dynamic-string"
             else (if cross.libc == "uclibc" then
               # In uclibc cases, libgomp needs an additional '-ldl'
               # and as I don't know how to pass it, I disable libgomp.
diff --git a/pkgs/development/interpreters/lua-5/5.2.nix b/pkgs/development/interpreters/lua-5/5.2.nix
index 609c6b3e404a..b8fcbe5f242a 100644
--- a/pkgs/development/interpreters/lua-5/5.2.nix
+++ b/pkgs/development/interpreters/lua-5/5.2.nix
@@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
   '';
 
   crossAttrs = let
-    isMingwW64 = stdenv.cross.config == "x86_64-w64-mingw32";
+    isMingw = stdenv.cross.libc == "msvcrt";
   in {
     configurePhase = ''
       makeFlagsArray=(
@@ -61,9 +61,9 @@ stdenv.mkDerivation rec {
         RANLIB=${stdenv.cross.config}-ranlib
         V=${majorVersion}
         R=${version}
-        ${stdenv.lib.optionals isMingwW64 "mingw"}
+        ${stdenv.lib.optionals isMingw "mingw"}
       )
-    '' + stdenv.lib.optionalString isMingwW64 ''
+    '' + stdenv.lib.optionalString isMingw ''
       installFlagsArray=(
         TO_BIN="lua.exe luac.exe"
         TO_LIB="liblua.a lua52.dll"
diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix
index 0df130b11fb1..56ac04bebe62 100644
--- a/pkgs/development/libraries/SDL/default.nix
+++ b/pkgs/development/libraries/SDL/default.nix
@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
 
   crossAttrs = {
     configureFlags = configureFlagsFun {
-      alsaSupport = stdenv.cross.config != "x86_64-w64-mingw32";
+      alsaSupport = stdenv.cross.libc != "msvcrt";
       alsaLib = alsaLib.crossDrv;
     } + "--disable-directx";
   };
diff --git a/pkgs/development/libraries/glew/default.nix b/pkgs/development/libraries/glew/default.nix
index b79fa97047b9..32083f96dfd1 100644
--- a/pkgs/development/libraries/glew/default.nix
+++ b/pkgs/development/libraries/glew/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
     "CC=${stdenv.cross.config}-gcc"
     "LD=${stdenv.cross.config}-gcc"
     "STRIP="
-  ] ++ optional (stdenv.cross.config == "x86_64-w64-mingw32") "SYSTEM=mingw";
+  ] ++ optional (stdenv.cross.libc == "msvcrt") "SYSTEM=mingw";
 
   meta = {
     description = "An OpenGL extension loading library for C(++)";
diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix
index 067c3af43871..7138c44da643 100644
--- a/pkgs/development/libraries/pcre/default.nix
+++ b/pkgs/development/libraries/pcre/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     # XXX: test failure on Cygwin
     # we are running out of stack on both freeBSDs on Hydra
 
-  crossAttrs = optionalAttrs (stdenv.cross.config == "x86_64-w64-mingw32") {
+  crossAttrs = optionalAttrs (stdenv.cross.libc == "msvcrt") {
     buildInputs = [ windows.mingw_w64_pthreads.crossDrv ];
   };
 
diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix
index 16bd1ee65d2e..1bd027f52986 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -148,8 +148,7 @@ stdenv.mkDerivation rec {
   '';
 
   crossAttrs = let
-    isMingw = stdenv.cross.config == "i686-pc-mingw32" ||
-      stdenv.cross.config == "x86_64-w64-mingw32";
+    isMingw = stdenv.cross.libc == "msvcrt";
   in {
     # I've not tried any case other than i686-pc-mingw32.
     # -nomake tools:   it fails linking some asian language symbols
diff --git a/pkgs/os-specific/windows/mingw-w64/default.nix b/pkgs/os-specific/windows/mingw-w64/default.nix
index c5b6017aae4d..bf15b208e1a7 100644
--- a/pkgs/os-specific/windows/mingw-w64/default.nix
+++ b/pkgs/os-specific/windows/mingw-w64/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation (rec {
   preConfigure = ''
     cd mingw-w64-headers
   '';
-  configureFlags = "--without-crt --host=x86_64-w64-mingw32";
+  configureFlags = "--without-crt";
 } else if onlyPthreads then {
   name = name + "-pthreads";
   preConfigure = ''
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 133ef21060c7..952fe59734de 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -2419,9 +2419,7 @@ let
 
   gccCrossStageStatic = let
       isMingw = (stdenv.cross.libc == "msvcrt");
-      isMingw64 = isMingw && stdenv.cross.config == "x86_64-w64-mingw32";
-      libcCross1 = if isMingw64 then windows.mingw_w64_headers else
-                   if isMingw then windows.mingw_headers1 else null;
+      libcCross1 = if isMingw then windows.mingw_w64_headers else null;
     in
       wrapGCCCross {
       gcc = forceNativeDrv (lib.addMetaAttrs { hydraPlatforms = []; } (
@@ -4235,9 +4233,7 @@ let
   # We can choose:
   libcCrossChooser = name : if name == "glibc" then glibcCross
     else if name == "uclibc" then uclibcCross
-    else if name == "msvcrt" && stdenv.cross.config == "x86_64-w64-mingw32" then
-      windows.mingw_w64
-    else if name == "msvcrt" then windows.mingw_headers3
+    else if name == "msvcrt" then windows.mingw_w64
     else throw "Unknown libc";
 
   libcCross = assert crossSystem != null; libcCrossChooser crossSystem.libc;
diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix
index 6871567ca8d1..cef3d2dffbdb 100644
--- a/pkgs/top-level/release-cross.nix
+++ b/pkgs/top-level/release-cross.nix
@@ -140,11 +140,11 @@ in {
   crossUltraSparcLinux = mapTestOnCross crossSystem basic;
 }) // (
 
-/* Test some cross builds on mingw32 */
+/* Test some cross builds on 32 bit mingw-w64 */
 let
   crossSystem = {
-      config = "i686-pc-mingw32";
-      arch = "x86";
+      config = "i686-w64-mingw32";
+      arch = "x86"; # Irrelevant
       libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
       platform = {};
   };
@@ -161,11 +161,10 @@ in {
   };
 }) // (
 
-/* Test some cross builds on mingw-w64 */
+/* Test some cross builds on 64 bit mingw-w64 */
 let
   crossSystem = {
-      # That's the triplet they use in the mingw-w64 docs,
-      # and it's relevant for nixpkgs conditions.
+      # That's the triplet they use in the mingw-w64 docs.
       config = "x86_64-w64-mingw32";
       arch = "x86_64"; # Irrelevant
       libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain