summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2012-06-05 21:21:21 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2012-06-05 21:21:21 +0000
commit430b05551604bf08827539b2f0ec3b294c923640 (patch)
tree048d844b28964d7f7374ed209c57d4a16fa933cd /pkgs/development
parentda4c1e38fd0921fba903eac0c26146430aca094f (diff)
downloadnixlib-430b05551604bf08827539b2f0ec3b294c923640.tar
nixlib-430b05551604bf08827539b2f0ec3b294c923640.tar.gz
nixlib-430b05551604bf08827539b2f0ec3b294c923640.tar.bz2
nixlib-430b05551604bf08827539b2f0ec3b294c923640.tar.lz
nixlib-430b05551604bf08827539b2f0ec3b294c923640.tar.xz
nixlib-430b05551604bf08827539b2f0ec3b294c923640.tar.zst
nixlib-430b05551604bf08827539b2f0ec3b294c923640.zip
Adding crossAttrs to cross-build qt with mingw32 and mingw64
svn path=/nixpkgs/trunk/; revision=34364
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix35
1 files changed, 35 insertions, 0 deletions
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 a3a78af439a4..52a80d656cf1 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -102,6 +102,41 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  crossAttrs = let
+    isMingw = stdenv.cross.config == "i686-pc-mingw32" ||
+      stdenv.cross.config == "x86_64-w64-mingw32";
+  in {
+    # I've not tried any case other than i686-pc-mingw32.
+    # -nomake tools:   it fails linking some asian language symbols
+    # -no-svg: it fails to build on mingw64
+    configureFlags = ''
+      -static -release -confirm-license -opensource
+      -no-opengl -no-phonon
+      -no-svg
+      -make qmake -make libs -nomake tools
+      -nomake demos -nomake examples -nomake docs
+    '' + stdenv.lib.optionalString isMingw " -xplatform win32-g++-4.6";
+    patches = [];
+    preConfigure = ''
+      sed -i -e 's/ g++/ ${stdenv.cross.config}-g++/' \
+        -e 's/ gcc/ ${stdenv.cross.config}-gcc/' \
+        -e 's/ ar/ ${stdenv.cross.config}-ar/' \
+        -e 's/ strip/ ${stdenv.cross.config}-strip/' \
+        -e 's/ windres/ ${stdenv.cross.config}-windres/' \
+        mkspecs/win32-g++/qmake.conf
+    '';
+
+    # I don't know why it does not install qmake
+    postInstall = ''
+      cp bin/qmake* $out/bin
+    '';
+    dontSetConfigureCross = true;
+    dontStrip = true;
+  } // (if isMingw then
+  {
+    propagatedBuildInputs = [ ];
+  } else {});
+
   meta = with stdenv.lib; {
     homepage = http://qt.nokia.com/products;
     description = "A cross-platform application framework for C++";