summary refs log tree commit diff
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@gmail.com>2015-12-20 08:11:52 -0600
committerThomas Tuegel <ttuegel@gmail.com>2015-12-20 08:11:52 -0600
commit5ff1c586066501a4aa1083fb43838340cf1233c0 (patch)
tree2ae1fd463b91afe44031541dab7fc3226980fcc2
parent78b876f600b3399a128733e1fce6ab54f3cbbf28 (diff)
parent298c4befda449f0b158a85efe16219fbe716c02d (diff)
downloadnixlib-5ff1c586066501a4aa1083fb43838340cf1233c0.tar
nixlib-5ff1c586066501a4aa1083fb43838340cf1233c0.tar.gz
nixlib-5ff1c586066501a4aa1083fb43838340cf1233c0.tar.bz2
nixlib-5ff1c586066501a4aa1083fb43838340cf1233c0.tar.lz
nixlib-5ff1c586066501a4aa1083fb43838340cf1233c0.tar.xz
nixlib-5ff1c586066501a4aa1083fb43838340cf1233c0.tar.zst
nixlib-5ff1c586066501a4aa1083fb43838340cf1233c0.zip
Merge pull request #11839 from ttuegel/qt-5.4
Qt infrastructure update
-rw-r--r--nixos/modules/services/x11/desktop-managers/kde5.nix4
-rw-r--r--pkgs/applications/audio/tomahawk/default.nix6
-rw-r--r--pkgs/applications/editors/sigil/default.nix5
-rw-r--r--pkgs/applications/editors/tiled/default.nix4
-rw-r--r--pkgs/applications/graphics/antimony/default.nix4
-rw-r--r--pkgs/applications/graphics/apitrace/default.nix4
-rw-r--r--pkgs/applications/graphics/awesomebump/default.nix4
-rw-r--r--pkgs/applications/graphics/luminance-hdr/default.nix5
-rw-r--r--pkgs/applications/graphics/photoqt/default.nix12
-rw-r--r--pkgs/applications/graphics/phototonic/default.nix4
-rw-r--r--pkgs/applications/graphics/rapcad/default.nix8
-rw-r--r--pkgs/applications/misc/calibre/default.nix4
-rw-r--r--pkgs/applications/misc/dfilemanager/default.nix4
-rw-r--r--pkgs/applications/misc/gpsbabel/default.nix4
-rw-r--r--pkgs/applications/misc/qtpass/default.nix4
-rw-r--r--pkgs/applications/misc/robomongo/default.nix4
-rw-r--r--pkgs/applications/misc/twmn/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/qutebrowser/default.nix7
-rw-r--r--pkgs/applications/networking/instant-messengers/qtox/default.nix11
-rw-r--r--pkgs/applications/networking/instant-messengers/teamspeak/client.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/telegram/cutegram/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/telegram/telegram-qml/default.nix2
-rw-r--r--pkgs/applications/networking/linssid/default.nix4
-rw-r--r--pkgs/applications/networking/p2p/firestr/default.nix6
-rw-r--r--pkgs/applications/science/electronics/fritzing/default.nix4
-rw-r--r--pkgs/applications/video/bomi/default.nix9
-rw-r--r--pkgs/applications/video/obs-studio/default.nix7
-rw-r--r--pkgs/applications/video/shotcut/default.nix4
-rw-r--r--pkgs/applications/video/smplayer/default.nix4
-rw-r--r--pkgs/applications/video/smtube/default.nix4
-rw-r--r--pkgs/data/documentation/zeal/default.nix5
-rw-r--r--pkgs/desktops/plasma-5.5/polkit-kde-agent.nix4
-rw-r--r--pkgs/development/libraries/accounts-qt/old.nix27
-rw-r--r--pkgs/development/libraries/grantlee/5.x-old.nix32
-rw-r--r--pkgs/development/libraries/kde-frameworks-5.17/kauth/default.nix4
-rw-r--r--pkgs/development/libraries/kde-frameworks-5.17/kfilemetadata.nix4
-rw-r--r--pkgs/development/libraries/libdbusmenu-qt/qt-5.4.nix23
-rw-r--r--pkgs/development/libraries/mlt/qt-5.4.nix39
-rw-r--r--pkgs/development/libraries/mlt/qt-5.nix (renamed from pkgs/development/libraries/mlt/qt-5.5.nix)0
-rw-r--r--pkgs/development/libraries/phonon-backend-gstreamer/qt5/old.nix41
-rw-r--r--pkgs/development/libraries/phonon/qt5/old.nix36
-rw-r--r--pkgs/development/libraries/qca-qt5/old.nix20
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0003-glib-2.32.patch25
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0004-dlopen-resolv.patch39
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0005-dlopen-gl.patch25
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0010-dlopen-libXcursor.patch29
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0012-dlopen-dbus.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0014-mkspecs-libgl.patch17
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0100-ssl.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.4/default.nix418
-rwxr-xr-xpkgs/development/libraries/qt-5/5.4/fetchsrcs.sh47
-rw-r--r--pkgs/development/libraries/qt-5/5.4/make-qt-wrapper.sh42
-rw-r--r--pkgs/development/libraries/qt-5/5.4/manifest.json301
-rwxr-xr-xpkgs/development/libraries/qt-5/5.4/manifest.sh9
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qt-submodule.nix54
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase.nix211
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/compose-search-path.patch16
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/decrypt-ssl-traffic.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/default.nix224
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-dbus.patch13
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-gl.patch17
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-gtkstyle.patch (renamed from pkgs/development/libraries/qt-5/5.4/0001-dlopen-gtkstyle.patch)37
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-libXcursor.patch17
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-openssl.patch (renamed from pkgs/development/libraries/qt-5/5.4/0011-dlopen-openssl.patch)12
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-resolv.patch26
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/mkspecs-libgl.patch15
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/nix-profiles-library-paths.patch26
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/series8
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/setup-hook.sh100
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/tzdir.patch (renamed from pkgs/development/libraries/qt-5/5.4/0006-tzdir.patch)24
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase/xdg-config-dirs.patch (renamed from pkgs/development/libraries/qt-5/5.4/0013-xdg_config_dirs.patch)20
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtconnectivity.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtdeclarative/0001-nix-profiles-import-paths.patch37
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtdeclarative/default.nix8
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtdoc.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtenginio.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtgraphicaleffects.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtimageformats.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtlocation.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtmultimedia.nix12
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtquick1/0001-nix-profiles-import-paths.patch37
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtquick1/default.nix7
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtquickcontrols.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtscript/0001-glib-2.32.patch25
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtscript/default.nix7
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtsensors.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtserialport/0001-dlopen-serialport-udev.patch (renamed from pkgs/development/libraries/qt-5/5.4/0009-dlopen-serialport-udev.patch)20
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtserialport/default.nix7
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtsvg.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qttools.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qttranslations.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtwebkit-examples.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtwebkit/0001-dlopen-webkit-nsplugin.patch (renamed from pkgs/development/libraries/qt-5/5.4/0002-dlopen-webkit-nsplugin.patch)36
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtwebkit/0002-dlopen-webkit-gtk.patch (renamed from pkgs/development/libraries/qt-5/5.4/0007-dlopen-webkit-gtk.patch)16
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtwebkit/0003-dlopen-webkit-udev.patch (renamed from pkgs/development/libraries/qt-5/5.4/0008-dlopen-webkit-udev.patch)16
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtwebkit/default.nix33
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtwebsockets.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtx11extras.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtxmlpatterns.nix6
-rw-r--r--pkgs/development/libraries/qt-5/5.4/setup-hook.sh77
-rw-r--r--pkgs/development/libraries/qt-5/5.4/srcs.nix245
-rw-r--r--pkgs/development/libraries/qt-5/5.5/default.nix8
-rw-r--r--pkgs/development/libraries/qt-5/qt-env.nix6
-rw-r--r--pkgs/development/libraries/quazip/default.nix2
-rw-r--r--pkgs/development/libraries/qwt/6.nix4
-rw-r--r--pkgs/development/libraries/signon/old.nix18
-rw-r--r--pkgs/development/python-modules/pyqt/5.x.nix5
-rw-r--r--pkgs/development/qtcreator/default.nix11
-rw-r--r--pkgs/misc/emulators/mgba/default.nix5
-rw-r--r--pkgs/tools/graphics/kst/default.nix4
-rw-r--r--pkgs/tools/misc/antimicro/default.nix4
-rw-r--r--pkgs/tools/misc/calamares/default.nix6
-rw-r--r--pkgs/tools/networking/cmst/default.nix4
-rw-r--r--pkgs/top-level/all-packages.nix194
-rw-r--r--pkgs/top-level/python-packages.nix2
115 files changed, 1453 insertions, 1691 deletions
diff --git a/nixos/modules/services/x11/desktop-managers/kde5.nix b/nixos/modules/services/x11/desktop-managers/kde5.nix
index 933efa08fa35..2aeb4f67d771 100644
--- a/nixos/modules/services/x11/desktop-managers/kde5.nix
+++ b/nixos/modules/services/x11/desktop-managers/kde5.nix
@@ -135,7 +135,7 @@ in
           pkgs.gst_all.gstPluginsUgly
           pkgs.gst_all.gstPluginsBad
           pkgs.gst_all.gstFfmpeg # for mp3 playback
-          pkgs.phonon_qt5_backend_gstreamer
+          pkgs.qt55.phonon-backend-gstreamer
           pkgs.gst_all_1.gstreamer
           pkgs.gst_all_1.gst-plugins-base
           pkgs.gst_all_1.gst-plugins-good
@@ -147,7 +147,7 @@ in
       ++ lib.optionals cfg.phonon.vlc.enable
         [
           pkgs.phonon_qt5_backend_vlc
-          pkgs.phonon_backend_vlc
+          pkgs.qt55.phonon-backend-vlc
         ];
 
     environment.pathsToLink = [ "/share" ];
diff --git a/pkgs/applications/audio/tomahawk/default.nix b/pkgs/applications/audio/tomahawk/default.nix
index 32d5f1aa13e5..61cb6b9896e3 100644
--- a/pkgs/applications/audio/tomahawk/default.nix
+++ b/pkgs/applications/audio/tomahawk/default.nix
@@ -11,9 +11,7 @@ assert enableXMPP      -> libjreen     != null;
 assert enableKDE       -> kdelibs      != null;
 assert enableTelepathy -> telepathy_qt != null;
 
-let
-  quazipQt4 = quazip.override { qt = qt4; };
-in stdenv.mkDerivation rec {
+stdenv.mkDerivation rec {
   name = "tomahawk-${version}";
   version = "0.8.4";
 
@@ -29,7 +27,7 @@ in stdenv.mkDerivation rec {
 
   buildInputs = [
     cmake pkgconfig attica boost gnutls libechonest liblastfm lucenepp phonon
-    qca2 qjson qt4 qtkeychain quazipQt4 sparsehash taglib websocketpp
+    qca2 qjson qt4 qtkeychain quazip sparsehash taglib websocketpp
     makeWrapper
   ] ++ stdenv.lib.optional enableXMPP      libjreen
     ++ stdenv.lib.optional enableKDE       kdelibs
diff --git a/pkgs/applications/editors/sigil/default.nix b/pkgs/applications/editors/sigil/default.nix
index 2af662ded7f2..ad6f599a3617 100644
--- a/pkgs/applications/editors/sigil/default.nix
+++ b/pkgs/applications/editors/sigil/default.nix
@@ -1,5 +1,6 @@
 { stdenv, fetchurl, unzip, cmake, pkgconfig, makeWrapper
-, hunspell, minizip, boost, xercesc, qt5
+, hunspell, minizip, boost, xercesc
+, qtbase, qttools, qtwebkit, qtxmlpatterns
 }:
 
 let
@@ -17,7 +18,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     unzip cmake pkgconfig
-    hunspell minizip boost xercesc qt5.base qt5.tools qt5.webkit qt5.xmlpatterns
+    hunspell minizip boost xercesc qtbase qttools qtwebkit qtxmlpatterns
   ];
 
   # XXX: the compiler seems to treat the .h file inappropriately:
diff --git a/pkgs/applications/editors/tiled/default.nix b/pkgs/applications/editors/tiled/default.nix
index b885e26fbef9..4590baf6b8e2 100644
--- a/pkgs/applications/editors/tiled/default.nix
+++ b/pkgs/applications/editors/tiled/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt5, pkgconfig, python }:
+{ stdenv, fetchurl, qtbase, qttools, pkgconfig, python }:
 
 let
   version = "0.12.3";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     inherit sha256;
   };
 
-  buildInputs = [ qt5.base qt5.tools pkgconfig python ];
+  buildInputs = [ qtbase qttools pkgconfig python ];
 
   preConfigure = "qmake -r PREFIX=$out";
 
diff --git a/pkgs/applications/graphics/antimony/default.nix b/pkgs/applications/graphics/antimony/default.nix
index 589d20cb1260..5e8dfd93f30e 100644
--- a/pkgs/applications/graphics/antimony/default.nix
+++ b/pkgs/applications/graphics/antimony/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, libpng, python3, boost, mesa, qt5, ncurses }:
+{ stdenv, fetchgit, libpng, python3, boost, mesa, qtbase, ncurses }:
 
 let
   gitRev    = "745eca3a2d2657c495d5509e9083c884e021d09c";
@@ -19,7 +19,7 @@ in
 
     buildInputs = [
       libpng python3 (boost.override { python = python3; })
-      mesa qt5.base ncurses
+      mesa qtbase ncurses
     ];
 
     configurePhase = ''
diff --git a/pkgs/applications/graphics/apitrace/default.nix b/pkgs/applications/graphics/apitrace/default.nix
index 10d4f703a825..072cc698e920 100644
--- a/pkgs/applications/graphics/apitrace/default.nix
+++ b/pkgs/applications/graphics/apitrace/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libX11, procps, python, qt5 }:
+{ stdenv, fetchFromGitHub, cmake, libX11, procps, python, qtbase }:
 
 let version = "7.1"; in
 stdenv.mkDerivation {
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
     owner = "apitrace";
   };
 
-  buildInputs = [ libX11 procps python qt5.base ];
+  buildInputs = [ libX11 procps python qtbase ];
   nativeBuildInputs = [ cmake ];
 
   buildPhase = ''
diff --git a/pkgs/applications/graphics/awesomebump/default.nix b/pkgs/applications/graphics/awesomebump/default.nix
index 77bddec7eb82..c71b1f9335b4 100644
--- a/pkgs/applications/graphics/awesomebump/default.nix
+++ b/pkgs/applications/graphics/awesomebump/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, qt5, makeWrapper }:
+{ lib, stdenv, fetchurl, qtbase, makeWrapper }:
 
 stdenv.mkDerivation {
   name = "awesomebump-4.0";
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   setSourceRoot = "sourceRoot=$(echo */Sources)";
 
-  buildInputs = [ qt5.base makeWrapper ];
+  buildInputs = [ qtbase makeWrapper ];
 
   preBuild = "qmake";
 
diff --git a/pkgs/applications/graphics/luminance-hdr/default.nix b/pkgs/applications/graphics/luminance-hdr/default.nix
index 5e7835b35499..98152694c6d9 100644
--- a/pkgs/applications/graphics/luminance-hdr/default.nix
+++ b/pkgs/applications/graphics/luminance-hdr/default.nix
@@ -1,5 +1,6 @@
-{ stdenv, cmake, fetchurl, fetchpatch, pkgconfig, qt5, boost, exiv2, fftwFloat, gsl
+{ stdenv, cmake, fetchurl, fetchpatch, pkgconfig, boost, exiv2, fftwFloat, gsl
 , ilmbase, lcms2, libraw, libtiff, openexr
+, qtbase, qtdeclarative, qttools, qtwebkit
 }:
 
 stdenv.mkDerivation rec {
@@ -21,7 +22,7 @@ stdenv.mkDerivation rec {
 
   buildInputs =
     [
-      qt5.base qt5.declarative qt5.tools qt5.webkit
+      qtbase qtdeclarative qttools qtwebkit
       boost exiv2 fftwFloat gsl ilmbase lcms2 libraw libtiff openexr
     ];
 
diff --git a/pkgs/applications/graphics/photoqt/default.nix b/pkgs/applications/graphics/photoqt/default.nix
index 7ae6d6e050fa..c96b0c182a62 100644
--- a/pkgs/applications/graphics/photoqt/default.nix
+++ b/pkgs/applications/graphics/photoqt/default.nix
@@ -1,11 +1,13 @@
-{ stdenv, fetchurl, cmake, makeWrapper, qt5, exiv2, graphicsmagick }:
+{ stdenv, fetchurl, cmake, makeWrapper, exiv2, graphicsmagick
+, qtbase, qtdeclarative, qtmultimedia, qtquickcontrols, qttools
+}:
 
 let
   version = "1.3";
   qmlPath = stdenv.lib.makeSearchPath "lib/qt5/qml/" [
-    qt5.quickcontrols
-    qt5.declarative
-    qt5.multimedia
+    qtquickcontrols
+    qtdeclarative
+    qtmultimedia
   ];
 in
 stdenv.mkDerivation rec {
@@ -15,7 +17,7 @@ stdenv.mkDerivation rec {
     sha256 = "0j2kvxfb5pd9abciv161nkcsyam6n8kfqs8ymwj2mxiqflwbmfl1";
   };
 
-  buildInputs = [ cmake makeWrapper qt5.base qt5.tools exiv2 graphicsmagick ];
+  buildInputs = [ cmake makeWrapper qtbase qttools exiv2 graphicsmagick ];
 
   preConfigure = ''
     export MAGICK_LOCATION="${graphicsmagick}/include/GraphicsMagick"
diff --git a/pkgs/applications/graphics/phototonic/default.nix b/pkgs/applications/graphics/phototonic/default.nix
index f1a46b63d588..6803b969b4b5 100644
--- a/pkgs/applications/graphics/phototonic/default.nix
+++ b/pkgs/applications/graphics/phototonic/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, qt5, exiv2 }:
+{ stdenv, fetchFromGitHub, qtbase, exiv2 }:
 
 stdenv.mkDerivation rec {
   name = "phototonic-${version}";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "1agd3bsrpljd019qrjvlbim5l0bhpx53dhpc0gvyn0wmcdzn92gj";
   };
 
-  buildInputs = [ qt5.base exiv2 ];
+  buildInputs = [ qtbase exiv2 ];
 
   configurePhase = ''
     sed -i 's;/usr;;' phototonic.pro
diff --git a/pkgs/applications/graphics/rapcad/default.nix b/pkgs/applications/graphics/rapcad/default.nix
index 701ad47985bc..cb92947b766d 100644
--- a/pkgs/applications/graphics/rapcad/default.nix
+++ b/pkgs/applications/graphics/rapcad/default.nix
@@ -1,4 +1,6 @@
-{stdenv, fetchgit, qt5, cgal, boost, gmp, mpfr, flex, bison, dxflib, readline }: 
+{ stdenv, fetchgit, cgal, boost, gmp, mpfr, flex, bison, dxflib, readline
+, qtbase
+}:
 
 stdenv.mkDerivation rec {
   version = "0.9.5";
@@ -9,8 +11,8 @@ stdenv.mkDerivation rec {
     rev = "refs/tags/v${version}";
     sha256 = "15c18jvgbwyrfhv7r35ih0gzx35vjlsbi984h1sckgh2z17hjq8l";
   };
-  
-  buildInputs = [qt5.base cgal boost gmp mpfr flex bison dxflib readline ];
+
+  buildInputs = [ qtbase cgal boost gmp mpfr flex bison dxflib readline ];
 
   configurePhase = ''
     qmake;
diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
index a3ecef308eb0..6ab83e29cc14 100644
--- a/pkgs/applications/misc/calibre/default.nix
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, python, pyqt5, sip_4_16, poppler_utils, pkgconfig, libpng
-, imagemagick, libjpeg, fontconfig, podofo, qt5, icu, sqlite
+, imagemagick, libjpeg, fontconfig, podofo, qtbase, icu, sqlite
 , makeWrapper, unrar, chmlib, pythonPackages, xz, libusb1, libmtp
 , xdg_utils
 }:
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   buildInputs =
     [ python pyqt5 sip_4_16 poppler_utils libpng imagemagick libjpeg
-      fontconfig podofo qt5.base chmlib icu sqlite libusb1 libmtp xdg_utils
+      fontconfig podofo qtbase chmlib icu sqlite libusb1 libmtp xdg_utils
       pythonPackages.mechanize pythonPackages.lxml pythonPackages.dateutil
       pythonPackages.cssutils pythonPackages.beautifulsoup pythonPackages.pillow
       pythonPackages.sqlite3 pythonPackages.netifaces pythonPackages.apsw
diff --git a/pkgs/applications/misc/dfilemanager/default.nix b/pkgs/applications/misc/dfilemanager/default.nix
index ba3bd5f0f0de..1891c4f21749 100644
--- a/pkgs/applications/misc/dfilemanager/default.nix
+++ b/pkgs/applications/misc/dfilemanager/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, cmake, qt5, file, kde5}:
+{ stdenv, fetchgit, cmake, file, qtbase, qttools, qtx11extras, solid }:
 
 let
   version = "git-2015-07-25";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "1dd21xl24xvxs100j8nzhpaqfqk8srqs92al9c03jmyjlk31s6lf";
   };
 
-  buildInputs = [ cmake qt5.base qt5.tools qt5.x11extras file kde5.solid];
+  buildInputs = [ cmake qtbase qttools qtx11extras file solid ];
 
   cmakeFlags = "-DQT5BUILD=true";
 
diff --git a/pkgs/applications/misc/gpsbabel/default.nix b/pkgs/applications/misc/gpsbabel/default.nix
index 172f1347f6b5..c21f8bbe814f 100644
--- a/pkgs/applications/misc/gpsbabel/default.nix
+++ b/pkgs/applications/misc/gpsbabel/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, zlib, qt5, which }:
+{ stdenv, fetchurl, zlib, qtbase, which }:
 
 stdenv.mkDerivation rec {
   name = "gpsbabel-${version}";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0xf7wmy2m29g2lm8lqc74yf8rf7sxfl3cfwbk7dpf0yf42pb0b6w";
   };
 
-  buildInputs = [ zlib qt5.base which ];
+  buildInputs = [ zlib qtbase which ];
 
   /* FIXME: Building the documentation, with "make doc", requires this:
 
diff --git a/pkgs/applications/misc/qtpass/default.nix b/pkgs/applications/misc/qtpass/default.nix
index 3c6d3ed36cef..3d45ef6884c4 100644
--- a/pkgs/applications/misc/qtpass/default.nix
+++ b/pkgs/applications/misc/qtpass/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, git, gnupg, makeWrapper, pass, qt5 }:
+{ stdenv, fetchurl, git, gnupg, makeWrapper, pass, qtbase, qttools }:
 
 stdenv.mkDerivation rec {
   name = "qtpass-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0c07bd1eb9e5336c0225f891e5b9a9df103f218619cf7ec6311edf654e8db281";
   };
 
-  buildInputs = [ git gnupg makeWrapper pass qt5.base qt5.tools ];
+  buildInputs = [ git gnupg makeWrapper pass qtbase qttools ];
 
   configurePhase = "qmake CONFIG+=release PREFIX=$out DESTDIR=$out";
 
diff --git a/pkgs/applications/misc/robomongo/default.nix b/pkgs/applications/misc/robomongo/default.nix
index 80424a308d77..ebd97f6621d4 100644
--- a/pkgs/applications/misc/robomongo/default.nix
+++ b/pkgs/applications/misc/robomongo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt5, openssl, boost, cmake, scons, python, pcre, bzip2 }:
+{ stdenv, fetchurl, qtbase, openssl, boost, cmake, scons, python, pcre, bzip2 }:
 
 stdenv.mkDerivation {
   name = "robomongo-0.8.4";
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
 
   NIX_CFLAGS_COMPILE = "-fno-stack-protector";
 
-  buildInputs = [ cmake boost scons qt5.base openssl python pcre bzip2 ];
+  buildInputs = [ cmake boost scons qtbase openssl python pcre bzip2 ];
 
   meta = {
     homepage = "http://robomongo.org/";
diff --git a/pkgs/applications/misc/twmn/default.nix b/pkgs/applications/misc/twmn/default.nix
index e2a21822acd7..bb3f359ab8ff 100644
--- a/pkgs/applications/misc/twmn/default.nix
+++ b/pkgs/applications/misc/twmn/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, fetchgit, qt5, pkgconfig, boost }:
+{ fetchurl, stdenv, fetchgit, qtbase, qtx11extras, pkgconfig, boost }:
 
 stdenv.mkDerivation rec {
   name = "twmn-git-2014-09-23";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "9c91e9d3d6d7f9d90d34da6f1a4b9f3dee65605c1e43729417d6921c54dded6b";
   };
 
-  buildInputs = [ qt5.base qt5.x11extras pkgconfig boost ];
+  buildInputs = [ qtbase qtx11extras pkgconfig boost ];
 
   configurePhase = ''
     sed -i s/-Werror// twmnd/twmnd.pro
diff --git a/pkgs/applications/networking/browsers/qutebrowser/default.nix b/pkgs/applications/networking/browsers/qutebrowser/default.nix
index 267b0871f080..c1c7a1297ce2 100644
--- a/pkgs/applications/networking/browsers/qutebrowser/default.nix
+++ b/pkgs/applications/networking/browsers/qutebrowser/default.nix
@@ -1,5 +1,6 @@
-{ stdenv, fetchgit, python, buildPythonPackage, qt5, pyqt5, jinja2, pygments, pyyaml, pypeg2,
-  gst_plugins_base, gst_plugins_good, gst_ffmpeg }:
+{ stdenv, fetchgit, python, buildPythonPackage, qtmultimedia, pyqt5
+, jinja2, pygments, pyyaml, pypeg2, gst_plugins_base, gst_plugins_good
+, gst_ffmpeg }:
 
 let version = "0.4.1"; in
 
@@ -23,7 +24,7 @@ buildPythonPackage {
   makeWrapperArgs = ''
     --prefix GST_PLUGIN_PATH : "${stdenv.lib.makeSearchPath "lib/gstreamer-0.10"
        [ gst_plugins_base gst_plugins_good gst_ffmpeg ]}"
-    --prefix QT_PLUGIN_PATH : "${qt5.multimedia}/lib/qt5/plugins"
+    --prefix QT_PLUGIN_PATH : "${qtmultimedia}/lib/qt5/plugins"
   '';
 
   meta = {
diff --git a/pkgs/applications/networking/instant-messengers/qtox/default.nix b/pkgs/applications/networking/instant-messengers/qtox/default.nix
index 170702e44d13..0a7b44ba8cbc 100644
--- a/pkgs/applications/networking/instant-messengers/qtox/default.nix
+++ b/pkgs/applications/networking/instant-messengers/qtox/default.nix
@@ -1,6 +1,7 @@
-{ stdenv, fetchgit, pkgconfig, libtoxcore-dev, qt5, openal, opencv,
+{ stdenv, fetchgit, pkgconfig, libtoxcore-dev, openal, opencv,
   libsodium, libXScrnSaver, glib, gdk_pixbuf, gtk2, cairo,
-  pango, atk, qrencode, ffmpeg, filter-audio, makeWrapper }:
+  pango, atk, qrencode, ffmpeg, filter-audio, makeWrapper,
+  qtbase, qtsvg, qttools, qttranslations }:
 
 let
   revision = "1673b43e26c853f6446f228fec083af166cbf446";
@@ -18,8 +19,8 @@ stdenv.mkDerivation rec {
   buildInputs =
     [
       libtoxcore-dev openal opencv libsodium filter-audio
-      qt5.base qt5.tools libXScrnSaver glib gtk2 cairo
-      pango atk qrencode ffmpeg qt5.translations makeWrapper
+      qtbase qttools libXScrnSaver glib gtk2 cairo
+      pango atk qrencode ffmpeg qttranslations makeWrapper
     ];
 
   nativeBuildInputs = [ pkgconfig ];
@@ -46,7 +47,7 @@ stdenv.mkDerivation rec {
     mkdir -p $out/bin
     cp qtox $out/bin
     wrapProgram $out/bin/qtox \
-      --prefix QT_PLUGIN_PATH : ${qt5.svg}/lib/qt5/plugins
+      --prefix QT_PLUGIN_PATH : ${qtsvg}/lib/qt5/plugins
   '';
 
   enableParallelBuilding = true;
diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
index a18ffac5d63d..7eedd997c1b4 100644
--- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
+++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, makeWrapper, makeDesktopItem, zlib, glib, libpng, freetype
-, xorg, fontconfig, qt55, xkeyboard_config, alsaLib, libpulseaudio ? null
+, xorg, fontconfig, qtbase, xkeyboard_config, alsaLib, libpulseaudio ? null
 , libredirect, quazip, less, which, unzip
 }:
 
@@ -12,7 +12,7 @@ let
   deps =
     [ zlib glib libpng freetype xorg.libSM xorg.libICE xorg.libXrender
       xorg.libXrandr xorg.libXfixes xorg.libXcursor xorg.libXinerama
-      xorg.libxcb fontconfig xorg.libXext xorg.libX11 alsaLib qt55.qtbase libpulseaudio
+      xorg.libxcb fontconfig xorg.libXext xorg.libX11 alsaLib qtbase libpulseaudio
     ];
 
   desktopItem = makeDesktopItem {
diff --git a/pkgs/applications/networking/instant-messengers/telegram/cutegram/default.nix b/pkgs/applications/networking/instant-messengers/telegram/cutegram/default.nix
index cf559a04fc50..26a7eb49279b 100644
--- a/pkgs/applications/networking/instant-messengers/telegram/cutegram/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telegram/cutegram/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub
-, qt5Libs, qtbase, qtquick1, qtmultimedia, qtquickcontrols, qtgraphicaleffects, makeQtWrapper
+, qtbase, qtquick1, qtmultimedia, qtquickcontrols, qtgraphicaleffects, makeQtWrapper
 , telegram-qml, libqtelegram-aseman-edition }:
 
 stdenv.mkDerivation rec {
diff --git a/pkgs/applications/networking/instant-messengers/telegram/telegram-qml/default.nix b/pkgs/applications/networking/instant-messengers/telegram/telegram-qml/default.nix
index 4fc1ee379274..b51f8435ce13 100644
--- a/pkgs/applications/networking/instant-messengers/telegram/telegram-qml/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telegram/telegram-qml/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub
-, qt5Libs, qtbase, qtmultimedia, qtquick1
+, qtbase, qtmultimedia, qtquick1
 , libqtelegram-aseman-edition }:
 
 stdenv.mkDerivation rec {
diff --git a/pkgs/applications/networking/linssid/default.nix b/pkgs/applications/networking/linssid/default.nix
index 369010f41b52..76de1d208cc0 100644
--- a/pkgs/applications/networking/linssid/default.nix
+++ b/pkgs/applications/networking/linssid/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt5, pkgconfig, boost, wirelesstools, iw, qwt6 }:
+{ stdenv, fetchurl, qtbase, qtsvg, pkgconfig, boost, wirelesstools, iw, qwt6 }:
 
 stdenv.mkDerivation rec {
   name = "linssid-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "13d35rlcjncd8lx3khkgn9x8is2xjd5fp6ns5xsn3w6l4xj9b4gl";
   };
 
-  buildInputs = [ qt5.base qt5.svg pkgconfig boost qwt6 ];
+  buildInputs = [ qtbase qtsvg pkgconfig boost qwt6 ];
 
   patches = [ ./0001-unbundled-qwt.patch ];
 
diff --git a/pkgs/applications/networking/p2p/firestr/default.nix b/pkgs/applications/networking/p2p/firestr/default.nix
index 6b1a1fc94540..e216ede9a392 100644
--- a/pkgs/applications/networking/p2p/firestr/default.nix
+++ b/pkgs/applications/networking/p2p/firestr/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitHub, cmake, boost, botan, snappy, libopus, libuuid, qt5
-, libXScrnSaver, openssl }:
+{ stdenv, fetchFromGitHub, cmake, boost, botan, snappy, libopus, libuuid
+, libXScrnSaver, openssl, qtbase, qtmultimedia }:
 
 stdenv.mkDerivation {
   name = "firestr-0.8";
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
     sha256 = "0s2kdi8rw3i3f8gbiy0ykyi6xj5n8p80m0d1i86mhh8jpagvbfzb";
   };
 
-  buildInputs = [ cmake boost botan snappy libopus libuuid qt5.base qt5.multimedia
+  buildInputs = [ cmake boost botan snappy libopus libuuid qtbase qtmultimedia
                   libXScrnSaver openssl ];
 
   patches = ./return.patch;
diff --git a/pkgs/applications/science/electronics/fritzing/default.nix b/pkgs/applications/science/electronics/fritzing/default.nix
index 1fa0a0d97b50..302c6a318e65 100644
--- a/pkgs/applications/science/electronics/fritzing/default.nix
+++ b/pkgs/applications/science/electronics/fritzing/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt5, boost }:
+{ stdenv, fetchurl, qtbase, qtsvg, boost }:
 
 stdenv.mkDerivation rec {
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     tar xjf ${src}
   '';
 
-  buildInputs = [ qt5.base qt5.svg boost ];
+  buildInputs = [ qtbase qtsvg boost ];
 
   configurePhase = ''
     cd fritzing-${version}.source
diff --git a/pkgs/applications/video/bomi/default.nix b/pkgs/applications/video/bomi/default.nix
index da07458f4f64..36da9d320721 100644
--- a/pkgs/applications/video/bomi/default.nix
+++ b/pkgs/applications/video/bomi/default.nix
@@ -1,5 +1,6 @@
 { stdenv, fetchurl, fetchFromGitHub, pkgconfig, perl, python, which, makeWrapper
-, libX11, libxcb, qt5, mesa
+, libX11, libxcb, mesa
+, qtbase, qtdeclarative, qtquickcontrols, qttools, qtx11extras
 , ffmpeg
 , libchardet
 , mpg123
@@ -26,7 +27,7 @@ assert pulseSupport -> libpulseaudio != null;
 assert cddaSupport -> libcdda != null;
 assert youtubeSupport -> youtube-dl != null;
 
-let qtPath = makeSearchPath "lib/qt5/qml" [ qt5.declarative qt5.quickcontrols ];
+let qtPath = makeSearchPath "lib/qt5/qml" [ qtdeclarative qtquickcontrols ];
 in
 
 stdenv.mkDerivation rec {
@@ -42,7 +43,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = with stdenv.lib;
                 [ libX11 libxcb mesa
-                  qt5.base qt5.x11extras
+                  qtbase qtx11extras
                   ffmpeg
                   libchardet
                   mpg123
@@ -85,7 +86,7 @@ stdenv.mkDerivation rec {
                    ++ optional cddaSupport "--enable-cdda"
                    ;
 
-  nativeBuildInputs = [ pkgconfig perl python which qt5.tools makeWrapper ];
+  nativeBuildInputs = [ pkgconfig perl python which qttools makeWrapper ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/applications/video/obs-studio/default.nix b/pkgs/applications/video/obs-studio/default.nix
index 0bd0263005f5..2c2a26cc972c 100644
--- a/pkgs/applications/video/obs-studio/default.nix
+++ b/pkgs/applications/video/obs-studio/default.nix
@@ -4,7 +4,8 @@
 , ffmpeg
 , jansson
 , libxkbcommon
-, qt5
+, qtbase
+, qtx11extras
 , libv4l
 , x264
 , curl
@@ -34,8 +35,8 @@ in stdenv.mkDerivation rec {
                   jansson
                   libv4l
                   libxkbcommon
-                  qt5.base
-                  qt5.x11extras
+                  qtbase
+                  qtx11extras
                   x264
                 ]
                 ++ optional pulseaudioSupport libpulseaudio;
diff --git a/pkgs/applications/video/shotcut/default.nix b/pkgs/applications/video/shotcut/default.nix
index c0458748c96c..74f9c1604b22 100644
--- a/pkgs/applications/video/shotcut/default.nix
+++ b/pkgs/applications/video/shotcut/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL, frei0r, gettext, makeWrapper, mlt, pkgconfig, qt5 }:
+{ stdenv, fetchurl, SDL, frei0r, gettext, makeWrapper, mlt, pkgconfig, qtbase }:
 
 stdenv.mkDerivation rec {
   name = "shotcut-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1504ds3ppqmpg84nb2gb74qndqysjwn3xw7n8xv19kd1pppnr10f";
   };
 
-  buildInputs = [ SDL frei0r gettext makeWrapper mlt pkgconfig qt5.base ];
+  buildInputs = [ SDL frei0r gettext makeWrapper mlt pkgconfig qtbase ];
 
   configurePhase = "qmake PREFIX=$out";
 
diff --git a/pkgs/applications/video/smplayer/default.nix b/pkgs/applications/video/smplayer/default.nix
index aed5363100be..13c654222275 100644
--- a/pkgs/applications/video/smplayer/default.nix
+++ b/pkgs/applications/video/smplayer/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt5 }:
+{ stdenv, fetchurl, qtscript }:
 
 stdenv.mkDerivation rec {
   name = "smplayer-15.11.0";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./basegui.cpp.patch ];
 
-  buildInputs = [ qt5.script ];
+  buildInputs = [ qtscript ];
 
   preConfigure = ''
     makeFlags="PREFIX=$out"
diff --git a/pkgs/applications/video/smtube/default.nix b/pkgs/applications/video/smtube/default.nix
index 79dbf5764724..bc55f943a889 100644
--- a/pkgs/applications/video/smtube/default.nix
+++ b/pkgs/applications/video/smtube/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt5 }:
+{ stdenv, fetchurl, qtscript }:
 
 stdenv.mkDerivation rec {
   version = "15.11.0";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     "PREFIX=$(out)"
   ];
 
-  buildInputs = [ qt5.script ];
+  buildInputs = [ qtscript ];
 
   meta = with stdenv.lib; {
     description = "Play and download Youtube videos";
diff --git a/pkgs/data/documentation/zeal/default.nix b/pkgs/data/documentation/zeal/default.nix
index a6c77deb12ea..0f02bb7dc945 100644
--- a/pkgs/data/documentation/zeal/default.nix
+++ b/pkgs/data/documentation/zeal/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchFromGitHub, pkgconfig, qt5, libarchive, xorg }:
+{ stdenv, fetchFromGitHub, libarchive, pkgconfig, qtbase
+, qtimageformats, qtwebkit, xorg }:
 
 stdenv.mkDerivation rec {
   version = "0.1.1";
@@ -12,7 +13,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [
-    xorg.xcbutilkeysyms pkgconfig qt5.base qt5.webkit qt5.imageformats libarchive
+    xorg.xcbutilkeysyms pkgconfig qtbase qtimageformats qtwebkit libarchive
   ];
 
   configurePhase = ''
diff --git a/pkgs/desktops/plasma-5.5/polkit-kde-agent.nix b/pkgs/desktops/plasma-5.5/polkit-kde-agent.nix
index 0173ec655169..3fc3a441ac34 100644
--- a/pkgs/desktops/plasma-5.5/polkit-kde-agent.nix
+++ b/pkgs/desktops/plasma-5.5/polkit-kde-agent.nix
@@ -9,7 +9,7 @@
 , kconfig
 , kiconthemes
 , knotifications
-, polkitQt
+, polkit-qt
 }:
 
 plasmaPackage {
@@ -25,7 +25,7 @@ plasmaPackage {
     kconfig
     kiconthemes
     knotifications
-    polkitQt
+    polkit-qt
   ];
   propagatedBuildInputs = [ ki18n kwindowsystem ];
 }
diff --git a/pkgs/development/libraries/accounts-qt/old.nix b/pkgs/development/libraries/accounts-qt/old.nix
deleted file mode 100644
index 26a04362090c..000000000000
--- a/pkgs/development/libraries/accounts-qt/old.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ stdenv, fetchFromGitLab, doxygen, glib, libaccounts-glib, pkgconfig, qt5 }:
-
-let version = "1.13"; in
-stdenv.mkDerivation {
-  name = "accounts-qt-${version}";
-
-  src = fetchFromGitLab {
-    sha256 = "1gpkgw05dwsf2wk5cy3skgss3kw6mqh7iv3fadrxqxfc1za1xmyl";
-    rev = version;
-    repo = "libaccounts-qt";
-    owner = "accounts-sso";
-  };
-
-  meta = with stdenv.lib; {
-    description = "Qt library for accessing the online accounts database";
-    homepage = "http://code.google.com/p/accounts-sso/";
-    license = licenses.lgpl21;
-    maintainers = with maintainers; [ nckx ];
-  };
-
-  buildInputs = [ glib libaccounts-glib qt5.base ];
-  nativeBuildInputs = [ doxygen pkgconfig ];
-
-  configurePhase = ''
-    qmake PREFIX=$out LIBDIR=$out/lib CMAKE_CONFIG_PATH=$out/lib/cmake
-  '';
-}
diff --git a/pkgs/development/libraries/grantlee/5.x-old.nix b/pkgs/development/libraries/grantlee/5.x-old.nix
deleted file mode 100644
index 4127280fb9a2..000000000000
--- a/pkgs/development/libraries/grantlee/5.x-old.nix
+++ /dev/null
@@ -1,32 +0,0 @@
-{ stdenv, fetchurl, qt5, cmake }:
-
-stdenv.mkDerivation rec {
-  name = "grantlee-5.0.0";
-
-# Upstream download server has country code firewall, so I made a mirror.
-  src = fetchurl {
-    urls = [
-      "http://downloads.grantlee.org/${name}.tar.gz"
-      "http://www.loegria.net/grantlee/${name}.tar.gz"
-    ];
-    sha256 = "0qdifp1sg87j3869xva5ai2d6d5ph7z4b85wv1fypf2k5sljpwpa";
-  };
-
-  buildInputs = [ cmake qt5.base qt5.script ];
-
-  meta = {
-    description = "Qt5 port of Django template system";
-    longDescription = ''
-      Grantlee is a plugin based String Template system written using the Qt
-      framework. The goals of the project are to make it easier for application
-      developers to separate the structure of documents from the data they
-      contain, opening the door for theming.
-
-      The syntax is intended to follow the syntax of the Django template system,
-      and the design of Django is reused in Grantlee.'';
-
-    homepage = http://gitorious.org/grantlee;
-    maintainers = [ stdenv.lib.maintainers.urkud ];
-    inherit (qt5.base.meta) platforms;
-  };
-}
diff --git a/pkgs/development/libraries/kde-frameworks-5.17/kauth/default.nix b/pkgs/development/libraries/kde-frameworks-5.17/kauth/default.nix
index 42a100193340..2b000ff3c041 100644
--- a/pkgs/development/libraries/kde-frameworks-5.17/kauth/default.nix
+++ b/pkgs/development/libraries/kde-frameworks-5.17/kauth/default.nix
@@ -1,13 +1,13 @@
 { kdeFramework, lib
 , extra-cmake-modules
 , kcoreaddons
-, polkitQt
+, polkit-qt
 }:
 
 kdeFramework {
   name = "kauth";
   nativeBuildInputs = [ extra-cmake-modules ];
-  buildInputs = [ polkitQt ];
+  buildInputs = [ polkit-qt ];
   propagatedBuildInputs = [ kcoreaddons ];
   patches = [ ./kauth-policy-install.patch ];
   meta = {
diff --git a/pkgs/development/libraries/kde-frameworks-5.17/kfilemetadata.nix b/pkgs/development/libraries/kde-frameworks-5.17/kfilemetadata.nix
index 92ca1f26b93b..be99c58d5504 100644
--- a/pkgs/development/libraries/kde-frameworks-5.17/kfilemetadata.nix
+++ b/pkgs/development/libraries/kde-frameworks-5.17/kfilemetadata.nix
@@ -1,11 +1,11 @@
 { kdeFramework, lib, extra-cmake-modules, attr, ebook_tools, exiv2
-, ffmpeg, karchive, ki18n, popplerQt, qtbase, taglib
+, ffmpeg, karchive, ki18n, poppler, qtbase, taglib
 }:
 
 kdeFramework {
   name = "kfilemetadata";
   nativeBuildInputs = [ extra-cmake-modules ];
-  buildInputs = [ attr ebook_tools exiv2 ffmpeg karchive popplerQt taglib ];
+  buildInputs = [ attr ebook_tools exiv2 ffmpeg karchive poppler taglib ];
   propagatedBuildInputs = [ qtbase ki18n ];
   meta = {
     maintainers = [ lib.maintainers.ttuegel ];
diff --git a/pkgs/development/libraries/libdbusmenu-qt/qt-5.4.nix b/pkgs/development/libraries/libdbusmenu-qt/qt-5.4.nix
deleted file mode 100644
index 5f76162453c4..000000000000
--- a/pkgs/development/libraries/libdbusmenu-qt/qt-5.4.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ stdenv, fetchbzr, qt5, cmake }:
-
-stdenv.mkDerivation {
-  name = "libdbusmenu-qt-0.9.3+14";
-
-  src = fetchbzr {
-    url = "http://bazaar.launchpad.net/~dbusmenu-team/libdbusmenu-qt/trunk";
-    rev = "ps-jenkins@lists.canonical.com-20140619090718-mppiiax5atpnb8i2";
-    sha256 = "1dbhaljyivbv3wc184zpjfjmn24zb6aj72wgg1gg1xl5f783issd";
-  };
-
-  buildInputs = [ qt5.base ];
-  nativeBuildInputs = [ cmake ];
-
-  cmakeFlags = "-DWITH_DOC=OFF";
-
-  meta = with stdenv.lib; {
-    homepage = "http://launchpad.net/libdbusmenu-qt";
-    description = "Provides a Qt implementation of the DBusMenu spec";
-    maintainers = [ maintainers.ttuegel ];
-    inherit (qt5.base.meta) platforms;
-  };
-}
diff --git a/pkgs/development/libraries/mlt/qt-5.4.nix b/pkgs/development/libraries/mlt/qt-5.4.nix
deleted file mode 100644
index 6f308a20fdc0..000000000000
--- a/pkgs/development/libraries/mlt/qt-5.4.nix
+++ /dev/null
@@ -1,39 +0,0 @@
-{ stdenv, fetchurl, SDL, ffmpeg, frei0r, libjack2, libdv, libsamplerate
-, libvorbis, libxml2, makeWrapper, movit, pkgconfig, qt5, sox
-}:
-
-stdenv.mkDerivation rec {
-  name = "mlt-${version}";
-  version = "0.9.8";
-
-  src = fetchurl {
-    url = "https://github.com/mltframework/mlt/archive/v${version}.tar.gz";
-    sha256 = "0x0hsb05i7g70dh3jll41qlvcylailfgsr0y1dpx7hyigynxc50j";
-  };
-
-  buildInputs = [
-    SDL ffmpeg frei0r libjack2 libdv libsamplerate libvorbis libxml2
-    makeWrapper movit pkgconfig qt5.base qt5.svg sox
-  ];
-
-  # Mostly taken from:
-  # http://www.kdenlive.org/user-manual/downloading-and-installing-kdenlive/installing-source/installing-mlt-rendering-engine
-  configureFlags = [
-    "--avformat-swscale" "--enable-gpl" "--enable-gpl" "--enable-gpl3"
-    "--enable-opengl"
-  ];
-
-  enableParallelBuilding = true;
-
-  postInstall = ''
-    wrapProgram $out/bin/melt --prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1
-  '';
-
-  meta = with stdenv.lib; {
-    description = "Open source multimedia framework, designed for television broadcasting";
-    homepage = http://www.mltframework.org/;
-    license = licenses.gpl3;
-    maintainers = [ maintainers.goibhniu ];
-    platforms = platforms.linux;
-  };
-}
diff --git a/pkgs/development/libraries/mlt/qt-5.5.nix b/pkgs/development/libraries/mlt/qt-5.nix
index d66d3fe93720..d66d3fe93720 100644
--- a/pkgs/development/libraries/mlt/qt-5.5.nix
+++ b/pkgs/development/libraries/mlt/qt-5.nix
diff --git a/pkgs/development/libraries/phonon-backend-gstreamer/qt5/old.nix b/pkgs/development/libraries/phonon-backend-gstreamer/qt5/old.nix
deleted file mode 100644
index d91808ec8803..000000000000
--- a/pkgs/development/libraries/phonon-backend-gstreamer/qt5/old.nix
+++ /dev/null
@@ -1,41 +0,0 @@
-{ stdenv, fetchurl, cmake, gst_all_1, phonon_qt5, pkgconfig, qt5, debug ? false }:
-
-with stdenv.lib;
-
-let
-  version = "4.8.2";
-  pname = "phonon-backend-gstreamer";
-in
-
-stdenv.mkDerivation rec {
-  name = "${pname}-${version}";
-
-  src = fetchurl {
-    url = "mirror://kde/stable/phonon/${pname}/${version}/src/${name}.tar.xz";
-    sha256 = "1q1ix6zsfnh6gfnpmwp67s376m7g7ahpjl1qp2fqakzb5cgzgq10";
-  };
-
-  buildInputs = with gst_all_1; [
-    gstreamer gst-plugins-base phonon_qt5 qt5.base
-  ];
-
-  NIX_CFLAGS_COMPILE = [
-    # This flag should be picked up through pkgconfig, but it isn't.
-    "-I${gst_all_1.gstreamer}/lib/gstreamer-1.0/include"
-  ];
-
-  nativeBuildInputs = [ cmake pkgconfig ];
-
-  cmakeFlags = [
-    "-DCMAKE_INSTALL_LIBDIR=lib"
-    "-DPHONON_BUILD_PHONON4QT5=ON"
-  ]
-  ++ optional debug "-DCMAKE_BUILD_TYPE=Debug";
-
-  meta = with stdenv.lib; {
-    homepage = http://phonon.kde.org/;
-    description = "GStreamer backend for Phonon";
-    platforms = platforms.linux;
-    maintainer = with maintainers; [ ttuegel ];
-  };
-}
diff --git a/pkgs/development/libraries/phonon/qt5/old.nix b/pkgs/development/libraries/phonon/qt5/old.nix
deleted file mode 100644
index 3dddd60b59f8..000000000000
--- a/pkgs/development/libraries/phonon/qt5/old.nix
+++ /dev/null
@@ -1,36 +0,0 @@
-{ stdenv, fetchurl, cmake, mesa, pkgconfig, libpulseaudio, qt5, debug ? false }:
-
-with stdenv.lib;
-
-let
-  v = "4.8.3";
-in
-
-stdenv.mkDerivation rec {
-  name = "phonon-${v}";
-
-  src = fetchurl {
-    url = "mirror://kde/stable/phonon/${v}/src/phonon-${v}.tar.xz";
-    sha256 = "05nshngk03ln90vsjz44dx8al576f4vd5fvhs1l0jmx13jb9q551";
-  };
-
-  buildInputs = [ mesa qt5.base qt5.quick1 qt5.tools libpulseaudio ];
-
-  nativeBuildInputs = [ cmake pkgconfig ];
-
-  NIX_CFLAGS_COMPILE = "-fPIC";
-
-  cmakeFlags = [
-    "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}"
-    "-DPHONON_BUILD_PHONON4QT5=ON"
-    "-DCMAKE_INSTALL_LIBDIR=lib"
-  ];
-
-  meta = {
-    homepage = http://phonon.kde.org/;
-    description = "Multimedia API for Qt";
-    license = stdenv.lib.licenses.lgpl2;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ ttuegel ];
-  };
-}
diff --git a/pkgs/development/libraries/qca-qt5/old.nix b/pkgs/development/libraries/qca-qt5/old.nix
deleted file mode 100644
index a3e9e9be6423..000000000000
--- a/pkgs/development/libraries/qca-qt5/old.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ stdenv, fetchurl, cmake, openssl, pkgconfig, qt5 }:
-
-stdenv.mkDerivation rec {
-  name = "qca-qt5-2.1.1";
-
-  src = fetchurl {
-    url = "http://download.kde.org/stable/qca/2.1.1/src/qca-2.1.1.tar.xz";
-    sha256 = "10z9icq28fww4qbzwra8d9z55ywbv74qk68nhiqfrydm21wkxplm";
-  };
-
-  buildInputs = [ openssl qt5.base ];
-  nativeBuildInputs = [ cmake pkgconfig ];
-
-  meta = with stdenv.lib; {
-    description = "Qt 5 Cryptographic Architecture";
-    homepage = http://delta.affinix.com/qca;
-    maintainers = with maintainers; [ ttuegel ];
-    license = licenses.lgpl21Plus;
-  };
-}
diff --git a/pkgs/development/libraries/qt-5/5.4/0003-glib-2.32.patch b/pkgs/development/libraries/qt-5/5.4/0003-glib-2.32.patch
deleted file mode 100644
index 4abb69da4d85..000000000000
--- a/pkgs/development/libraries/qt-5/5.4/0003-glib-2.32.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From a41c3e3a3a1ce4b373b1bbb98f3a835e9e8a0718 Mon Sep 17 00:00:00 2001
-From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Mon, 1 Dec 2014 17:22:39 -0600
-Subject: [PATCH] glib-2.32
-
----
- qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h b/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
-index 1f6d25e..087c3fb 100644
---- a/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
-+++ b/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
-@@ -81,7 +81,7 @@
- #include <pthread.h>
- #elif PLATFORM(GTK)
- #include <wtf/gtk/GOwnPtr.h>
--typedef struct _GMutex GMutex;
-+typedef union _GMutex GMutex;
- typedef struct _GCond GCond;
- #endif
- 
--- 
-2.1.3
-
diff --git a/pkgs/development/libraries/qt-5/5.4/0004-dlopen-resolv.patch b/pkgs/development/libraries/qt-5/5.4/0004-dlopen-resolv.patch
deleted file mode 100644
index e6b921b771d3..000000000000
--- a/pkgs/development/libraries/qt-5/5.4/0004-dlopen-resolv.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 63af41c6eeca28c911c13b1a77afeaf860863c2d Mon Sep 17 00:00:00 2001
-From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Mon, 1 Dec 2014 17:22:55 -0600
-Subject: [PATCH] dlopen-resolv
-
----
- qtbase/src/network/kernel/qdnslookup_unix.cpp | 2 +-
- qtbase/src/network/kernel/qhostinfo_unix.cpp  | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/qtbase/src/network/kernel/qdnslookup_unix.cpp b/qtbase/src/network/kernel/qdnslookup_unix.cpp
-index 8c5a0eb..27ebf16 100644
---- a/qtbase/src/network/kernel/qdnslookup_unix.cpp
-+++ b/qtbase/src/network/kernel/qdnslookup_unix.cpp
-@@ -87,7 +87,7 @@ static void resolveLibrary()
-     if (!lib.load())
- #endif
-     {
--        lib.setFileName(QLatin1String("resolv"));
-+        lib.setFileName(QLatin1String("@glibc/lib/resolv"));
-         if (!lib.load())
-             return;
-     }
-diff --git a/qtbase/src/network/kernel/qhostinfo_unix.cpp b/qtbase/src/network/kernel/qhostinfo_unix.cpp
-index df8c8b1..613d0e0 100644
---- a/qtbase/src/network/kernel/qhostinfo_unix.cpp
-+++ b/qtbase/src/network/kernel/qhostinfo_unix.cpp
-@@ -103,7 +103,7 @@ static void resolveLibrary()
-     if (!lib.load())
- #endif
-     {
--        lib.setFileName(QLatin1String("resolv"));
-+        lib.setFileName(QLatin1String("@glibc@/lib/libresolv"));
-         if (!lib.load())
-             return;
-     }
--- 
-2.1.3
-
diff --git a/pkgs/development/libraries/qt-5/5.4/0005-dlopen-gl.patch b/pkgs/development/libraries/qt-5/5.4/0005-dlopen-gl.patch
deleted file mode 100644
index d112427bdd63..000000000000
--- a/pkgs/development/libraries/qt-5/5.4/0005-dlopen-gl.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 6aaf6858bf817172a4c503158e1701c4837ee790 Mon Sep 17 00:00:00 2001
-From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Mon, 1 Dec 2014 17:23:08 -0600
-Subject: [PATCH] dlopen-gl
-
----
- qtbase/src/plugins/platforms/xcb/qglxintegration.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/qtbase/src/plugins/platforms/xcb/qglxintegration.cpp b/qtbase/src/plugins/platforms/xcb/qglxintegration.cpp
-index 67235e0..2220a2e 100644
---- a/qtbase/src/plugins/platforms/xcb/qglxintegration.cpp
-+++ b/qtbase/src/plugins/platforms/xcb/qglxintegration.cpp
-@@ -434,7 +434,7 @@ void (*QGLXContext::getProcAddress(const QByteArray &procName)) ()
-             {
-                 extern const QString qt_gl_library_name();
- //                QLibrary lib(qt_gl_library_name());
--                QLibrary lib(QLatin1String("GL"));
-+                QLibrary lib(QLatin1String("@openglDriver@/lib/libGL"));
-                 glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB");
-             }
-         }
--- 
-2.1.3
-
diff --git a/pkgs/development/libraries/qt-5/5.4/0010-dlopen-libXcursor.patch b/pkgs/development/libraries/qt-5/5.4/0010-dlopen-libXcursor.patch
deleted file mode 100644
index 49ade86fae3f..000000000000
--- a/pkgs/development/libraries/qt-5/5.4/0010-dlopen-libXcursor.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From b56e3737ca97e3de664603976989da4419297eb3 Mon Sep 17 00:00:00 2001
-From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Mon, 1 Dec 2014 17:33:51 -0600
-Subject: [PATCH] dlopen-libXcursor
-
----
- qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
-index 6dbac90..4b23fc2 100644
---- a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
-+++ b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
-@@ -305,10 +305,10 @@ QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen)
- #ifdef XCB_USE_XLIB
-     static bool function_ptrs_not_initialized = true;
-     if (function_ptrs_not_initialized) {
--        QLibrary xcursorLib(QLatin1String("Xcursor"), 1);
-+        QLibrary xcursorLib(QLatin1String("@libXcursor@/lib/libXcursor"), 1);
-         bool xcursorFound = xcursorLib.load();
-         if (!xcursorFound) { // try without the version number
--            xcursorLib.setFileName(QLatin1String("Xcursor"));
-+            xcursorLib.setFileName(QLatin1String("@libXcursor@/lib/Xcursor"));
-             xcursorFound = xcursorLib.load();
-         }
-         if (xcursorFound) {
--- 
-2.1.3
-
diff --git a/pkgs/development/libraries/qt-5/5.4/0012-dlopen-dbus.patch b/pkgs/development/libraries/qt-5/5.4/0012-dlopen-dbus.patch
deleted file mode 100644
index 77eb7bc85af5..000000000000
--- a/pkgs/development/libraries/qt-5/5.4/0012-dlopen-dbus.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/qtbase/src/dbus/qdbus_symbols.cpp b/qtbase/src/dbus/qdbus_symbols.cpp
-index 6764309..33f25f9 100644
---- a/qtbase/src/dbus/qdbus_symbols.cpp
-+++ b/qtbase/src/dbus/qdbus_symbols.cpp
-@@ -88,7 +88,7 @@ bool qdbus_loadLibDBus()
- #ifdef Q_OS_WIN
-         QLatin1String("dbus-1"),
- #endif
--        QLatin1String("libdbus-1")
-+        QLatin1String("@dbus_libs@/lib/libdbus-1")
-     };
- 
-     lib->unload();
diff --git a/pkgs/development/libraries/qt-5/5.4/0014-mkspecs-libgl.patch b/pkgs/development/libraries/qt-5/5.4/0014-mkspecs-libgl.patch
deleted file mode 100644
index 1fc4bbd60765..000000000000
--- a/pkgs/development/libraries/qt-5/5.4/0014-mkspecs-libgl.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Ensure Qt knows where libGL is.
-
-Author: Bjørn Forsman <bjorn.forsman@gmail.com>
-diff -uNr qt-everywhere-opensource-src-5.3.2.orig/qtbase/mkspecs/common/linux.conf qt-everywhere-opensource-src-5.3.2/qtbase/mkspecs/common/linux.conf
---- qt-everywhere-opensource-src-5.3.2.orig/qtbase/mkspecs/common/linux.conf	2014-09-11 12:48:07.000000000 +0200
-+++ qt-everywhere-opensource-src-5.3.2/qtbase/mkspecs/common/linux.conf	2015-08-23 13:03:30.617473019 +0200
-@@ -12,8 +12,8 @@
- QMAKE_LIBDIR            =
- QMAKE_INCDIR_X11        =
- QMAKE_LIBDIR_X11        =
--QMAKE_INCDIR_OPENGL     =
--QMAKE_LIBDIR_OPENGL     =
-+QMAKE_INCDIR_OPENGL     = @mesa@/include
-+QMAKE_LIBDIR_OPENGL     = @mesa@/lib
- QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL
- QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL
- QMAKE_INCDIR_EGL        =
diff --git a/pkgs/development/libraries/qt-5/5.4/0100-ssl.patch b/pkgs/development/libraries/qt-5/5.4/0100-ssl.patch
deleted file mode 100644
index 4607274de74c..000000000000
--- a/pkgs/development/libraries/qt-5/5.4/0100-ssl.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/qtbase/src/network/ssl/qsslsocket_openssl.cpp b/qtbase/src/network/ssl/qsslsocket_openssl.cpp
-index 8833e3f..c56d381 100644
---- a/qtbase/src/network/ssl/qsslsocket_openssl.cpp
-+++ b/qtbase/src/network/ssl/qsslsocket_openssl.cpp
-@@ -47,7 +47,7 @@
- ****************************************************************************/
- 
- //#define QSSLSOCKET_DEBUG
--//#define QT_DECRYPT_SSL_TRAFFIC
-+#define QT_DECRYPT_SSL_TRAFFIC
- 
- #include "qssl_p.h"
- #include "qsslsocket_openssl_p.h"
diff --git a/pkgs/development/libraries/qt-5/5.4/default.nix b/pkgs/development/libraries/qt-5/5.4/default.nix
index 136c352d1aa5..9b1324d11373 100644
--- a/pkgs/development/libraries/qt-5/5.4/default.nix
+++ b/pkgs/development/libraries/qt-5/5.4/default.nix
@@ -1,8 +1,8 @@
 # Maintainer's Notes:
 #
 # Minor updates:
-#  1. Edit ./manifest.sh to point to the updated URL.
-#  2. Run ./manifest.sh.
+#  1. Edit ./fetchsrcs.sh to point to the updated URL.
+#  2. Run ./fetchsrcs.sh.
 #  3. Build and enjoy.
 #
 # Major updates:
@@ -11,350 +11,106 @@
 #  if it exists. Then follow the minor update instructions. Be sure to check if
 #  any new components have been added and package them as necessary.
 
-{ autonix, fetchurl, newScope, stdenv
-
-, bison2
-, mesa_noglu
-, cups
-, gnome
+{ pkgs
 
 # options
 , developerBuild ? false
 , decryptSslTraffic ? false
 }:
 
-with autonix;
+let inherit (pkgs) makeSetupHook makeWrapper stdenv; in
+
 with stdenv.lib;
 
 let
-  srcs =
-    let
-      manifest = builtins.fromJSON (builtins.readFile ./manifest.json);
-      mirror = "http://download.qt.io";
-      fetch = src: fetchurl (src // { url = "${mirror}/${src.url}"; });
-      mkPair = pkg: nameValuePair (builtins.parseDrvName pkg.name).name (fetch pkg.src);
-      pairs = map mkPair manifest;
-    in listToAttrs pairs;
-
-  version = "5.4.2";
-
-  callPackage = newScope (self // { inherit qtSubmodule; });
-
-  qtSubmodule = callPackage ./qt-submodule.nix {
-    inherit srcs version;
-    inherit (stdenv) mkDerivation;
-  };
-
-  self =
-    {
-
-      activeqt = callPackage
-        (
-          { qtSubmodule, base }:
 
-          qtSubmodule {
-            name = "qtactiveqt";
-            qtInputs = [ base ];
-          }
-        )
-        {};
+  mirror = "http://download.qt.io";
+  srcs = import ./srcs.nix { inherit mirror; inherit (pkgs) fetchurl; };
 
-      /* androidextras = not packaged */
+  qtSubmodule = args:
+    let
+      inherit (args) name;
+      inherit (srcs."${args.name}") version src;
+      inherit (pkgs.stdenv) mkDerivation;
+    in mkDerivation (args // {
+      name = "${name}-${version}";
+      inherit src;
+
+      propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or []);
+
+      NIX_QT_SUBMODULE = args.NIX_QT_SUBMODULE or true;
+      dontAddPrefix = args.dontAddPrefix or true;
+      dontFixLibtool = args.dontFixLibtool or true;
+      configureScript = args.configureScript or "qmake";
+
+      enableParallelBuilding = args.enableParallelBuilding or true;
+
+      meta = {
+        homepage = http://qt-project.org;
+        description = "A cross-platform application framework for C++";
+        license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ];
+        maintainers = with maintainers; [ bbenoist qknight ttuegel ];
+        platforms = platforms.linux;
+      } // (args.meta or {});
+    });
+
+  addPackages = self: with self;
+    let
+      callPackage = self.newScope { inherit qtSubmodule srcs; };
+    in {
 
-      base = callPackage ./qtbase.nix {
-        mesa = mesa_noglu;
-        cups = if stdenv.isLinux then cups else null;
+      qtbase = callPackage ./qtbase {
+        mesa = pkgs.mesa_noglu;
+        cups = if stdenv.isLinux then pkgs.cups else null;
         # GNOME dependencies are not used unless gtkStyle == true
-        inherit (gnome) libgnomeui GConf gnome_vfs;
-        bison = bison2; # error: too few arguments to function 'int yylex(...
-        inherit developerBuild srcs version decryptSslTraffic;
+        inherit (pkgs.gnome) libgnomeui GConf gnome_vfs;
+        bison = pkgs.bison2; # error: too few arguments to function 'int yylex(...
+        inherit developerBuild decryptSslTraffic;
       };
 
-      connectivity = callPackage
-        (
-          { qtSubmodule, base, declarative }:
-
-          qtSubmodule {
-            name = "qtconnectivity";
-            qtInputs = [ base declarative ];
-          }
-        )
-        {};
-
-      declarative = callPackage
-        (
-          { qtSubmodule, python, base, svg, xmlpatterns }:
-
-          qtSubmodule {
-            name = "qtdeclarative";
-            qtInputs = [ base svg xmlpatterns ];
-            nativeBuildInputs = [ python ];
-          }
-        )
-        {};
-
-      doc = callPackage
-        (
-          { qtSubmodule, declarative }:
-
-          qtSubmodule {
-            name = "qtdoc";
-            qtInputs = [ declarative ];
-          }
-        )
-        {};
-
-      enginio = callPackage
-        (
-          { qtSubmodule, declarative }:
-
-          qtSubmodule {
-            name = "qtenginio";
-            qtInputs = [ declarative ];
-          }
-        )
-        {};
-
-      graphicaleffects = callPackage
-        (
-          { qtSubmodule, declarative }:
-
-          qtSubmodule {
-            name = "qtgraphicaleffects";
-            qtInputs = [ declarative ];
-          }
-        )
-        {};
-
-      imageformats = callPackage
-        (
-          { qtSubmodule, base }:
-
-          qtSubmodule {
-            name = "qtimageformats";
-            qtInputs = [ base ];
-          }
-        )
-        {};
-
-      location = callPackage
-        (
-          { qtSubmodule, base, multimedia }:
-
-          qtSubmodule {
-            name = "qtlocation";
-            qtInputs = [ base multimedia ];
-          }
-        )
-        {};
-
-      /* macextras = not packaged */
-
-      multimedia = callPackage
-        (
-          { qtSubmodule, base, declarative, pkgconfig
-          , alsaLib, gstreamer, gst_plugins_base, libpulseaudio
-          }:
-
-          qtSubmodule {
-            name = "qtmultimedia";
-            qtInputs = [ base declarative ];
-            buildInputs = [
-              pkgconfig alsaLib gstreamer gst_plugins_base libpulseaudio
-            ];
-          }
-        )
-        {};
-
-      quick1 = callPackage
-        (
-          { qtSubmodule, script, svg, webkit, xmlpatterns }:
-
-          qtSubmodule {
-            name = "qtquick1";
-            qtInputs = [ script svg webkit xmlpatterns ];
-          }
-        )
-        {};
-
-      quickcontrols = callPackage
-        (
-          { qtSubmodule, declarative }:
-
-          qtSubmodule {
-            name = "qtquickcontrols";
-            qtInputs = [ declarative ];
-          }
-        )
-        {};
-
-      script = callPackage
-        (
-          { qtSubmodule, base, tools }:
-
-          qtSubmodule {
-            name = "qtscript";
-            qtInputs = [ base tools ];
-            patchFlags = "-p2"; # patches originally for monolithic build
-            patches = [ ./0003-glib-2.32.patch ];
-          }
-        )
-        {};
-
-      sensors = callPackage
-        (
-          { qtSubmodule, base, declarative }:
-
-          qtSubmodule {
-            name = "qtsensors";
-            qtInputs = [ base declarative ];
-          }
-        )
-        {};
-
-      serialport = callPackage
-        (
-          { qtSubmodule, base }:
-
-          qtSubmodule {
-            name = "qtserialport";
-            qtInputs = [ base ];
-            patchFlags = "-p2"; # patches originally for monolithic build
-            patches = [ ./0009-dlopen-serialport-udev.patch ];
-          }
-        )
-        {};
-
-      svg = callPackage
-        (
-          { qtSubmodule, base }:
-
-          qtSubmodule {
-            name = "qtsvg";
-            qtInputs = [ base ];
-          }
-        )
-        {};
-
-      tools = callPackage
-        (
-          { qtSubmodule, activeqt, base, declarative, webkit }:
-
-          qtSubmodule {
-            name = "qttools";
-            qtInputs = [ activeqt base declarative webkit ];
-          }
-        )
-        {};
-
-      translations = callPackage
-        (
-          { qtSubmodule, tools }:
-
-          qtSubmodule {
-            name = "qttranslations";
-            qtInputs = [ tools ];
-          }
-        )
-        {};
-
-      /* wayland = not packaged */
-
-      /* webchannel = not packaged */
-
-      /* webengine = not packaged */
-
-      webkit = callPackage
-        (
-          { qtSubmodule, declarative, location, multimedia, sensors
-          , fontconfig, gdk_pixbuf, gtk, libwebp, libxml2, libxslt
-          , sqlite, udev
-          , bison2, flex, gdb, gperf, perl, pkgconfig, python, ruby
-          , substituteAll
-          , flashplayerFix ? false
-          }:
-
-          qtSubmodule {
-            name = "qtwebkit";
-            qtInputs = [ declarative location multimedia sensors ];
-            buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite ];
-            nativeBuildInputs = [
-              bison2 flex gdb gperf perl pkgconfig python ruby
-            ];
-            patchFlags = "-p2"; # patches originally for monolithic build
-            patches =
-              optional flashplayerFix
-                (substituteAll
-                  {
-                    src = ./0002-dlopen-webkit-nsplugin.patch;
-                    inherit gtk gdk_pixbuf;
-                  }
-                )
-              ++ optional flashplayerFix
-                (substituteAll
-                  {
-                    src = ./0007-dlopen-webkit-gtk.patch;
-                    inherit gtk;
-                  }
-                )
-              ++ [
-                (substituteAll
-                  {
-                    src = ./0008-dlopen-webkit-udev.patch;
-                    inherit udev;
-                  }
-                )
-              ];
-          }
-        )
-        {};
-
-      webkit-examples = callPackage
-        (
-          { qtSubmodule, tools, webkit }:
-
-          qtSubmodule {
-            name = "qtwebkit-examples";
-            qtInputs = [ tools webkit ];
-          }
-        )
-        {};
-
-      websockets = callPackage
-        (
-          { qtSubmodule, base, declarative }:
-
-          qtSubmodule {
-            name = "qtwebsockets";
-            qtInputs = [ base declarative ];
-          }
-        )
-        {};
-
-      /* winextras = not packaged */
-
-      x11extras = callPackage
-        (
-          { qtSubmodule, base }:
-
-          qtSubmodule {
-            name = "qtx11extras";
-            qtInputs = [ base ];
-          }
-        )
-        {};
-
-      xmlpatterns = callPackage
-        (
-          { qtSubmodule, base }:
-
-          qtSubmodule {
-            name = "qtxmlpatterns";
-            qtInputs = [ base ];
-          }
-        )
-        {};
+      /* qt3d = not packaged */
+      /* qtactiveqt = not packaged */
+      /* qtandroidextras = not packaged */
+      /* qtcanvas3d = not packaged */
+      qtconnectivity = callPackage ./qtconnectivity.nix {};
+      qtdeclarative = callPackage ./qtdeclarative {};
+      qtdoc = callPackage ./qtdoc.nix {};
+      qtenginio = callPackage ./qtenginio.nix {};
+      qtgraphicaleffects = callPackage ./qtgraphicaleffects.nix {};
+      qtimageformats = callPackage ./qtimageformats.nix {};
+      qtlocation = callPackage ./qtlocation.nix {};
+      /* qtmacextras = not packaged */
+      qtmultimedia = callPackage ./qtmultimedia.nix {
+        inherit (pkgs.gst_all_1) gstreamer gst-plugins-base;
+      };
+      qtquick1 = callPackage ./qtquick1 {};
+      qtquickcontrols = callPackage ./qtquickcontrols.nix {};
+      qtscript = callPackage ./qtscript {};
+      qtsensors = callPackage ./qtsensors.nix {};
+      qtserialport = callPackage ./qtserialport {};
+      qtsvg = callPackage ./qtsvg.nix {};
+      qttools = callPackage ./qttools.nix {};
+      qttranslations = callPackage ./qttranslations.nix {};
+      /* qtwayland = not packaged */
+      /* qtwebchannel = not packaged */
+      /* qtwebengine = not packaged */
+      qtwebkit = callPackage ./qtwebkit {};
+      qtwebkit-examples = callPackage ./qtwebkit-examples.nix {};
+      qtwebsockets = callPackage ./qtwebsockets.nix {};
+      /* qtwinextras = not packaged */
+      qtx11extras = callPackage ./qtx11extras.nix {};
+      qtxmlpatterns = callPackage ./qtxmlpatterns.nix {};
+
+      env = callPackage ../qt-env.nix {};
+      full = env "qt-${qtbase.version}" [
+        qtconnectivity qtdeclarative qtdoc qtenginio qtgraphicaleffects qtimageformats
+        qtlocation qtmultimedia qtquick1 qtquickcontrols qtscript qtsensors qtserialport
+        qtsvg qttools qttranslations qtwebkit qtwebkit-examples qtwebsockets qtx11extras
+        qtxmlpatterns
+      ];
+
+      makeQtWrapper = makeSetupHook { deps = [ makeWrapper ]; } ./make-qt-wrapper.sh;
 
     };
 
-in self
+in makeScope pkgs.newScope addPackages
diff --git a/pkgs/development/libraries/qt-5/5.4/fetchsrcs.sh b/pkgs/development/libraries/qt-5/5.4/fetchsrcs.sh
new file mode 100755
index 000000000000..0fd5bb8d5fee
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/fetchsrcs.sh
@@ -0,0 +1,47 @@
+#! /usr/bin/env nix-shell
+#! nix-shell -i bash -p coreutils findutils gnused nix wget
+
+set -x
+
+# The trailing slash at the end is necessary!
+RELEASE_URL="http://download.qt.io/official_releases/qt/5.4/5.4.2/submodules/"
+EXTRA_WGET_ARGS='-A *.tar.xz'
+
+mkdir tmp; cd tmp
+
+wget -nH -r -c --no-parent $RELEASE_URL $EXTRA_WGET_ARGS
+
+cat >../srcs.nix <<EOF
+# DO NOT EDIT! This file is generated automatically by manifest.sh
+{ fetchurl, mirror }:
+
+{
+EOF
+
+workdir=$(pwd)
+
+find . | while read src; do
+    if [[ -f "${src}" ]]; then
+        url="${src:2}"
+        # Sanitize file name
+        filename=$(basename "$src" | tr '@' '_')
+        nameversion="${filename%.tar.*}"
+        name=$(echo "$nameversion" | sed -e 's,-[[:digit:]].*,,' | sed -e 's,-opensource-src$,,')
+        version=$(echo "$nameversion" | sed -e 's,^\([[:alpha:]][[:alnum:]]*-\)\+,,')
+        sha256=$(nix-hash --type sha256 --base32 --flat "$src")
+        cat >>../srcs.nix <<EOF
+  $name = {
+    version = "$version";
+    src = fetchurl {
+      url = "\${mirror}/$url";
+      sha256 = "$sha256";
+      name = "$filename";
+    };
+  };
+EOF
+    fi
+done
+
+echo "}" >>../srcs.nix
+
+cd ..
diff --git a/pkgs/development/libraries/qt-5/5.4/make-qt-wrapper.sh b/pkgs/development/libraries/qt-5/5.4/make-qt-wrapper.sh
new file mode 100644
index 000000000000..d61665455bf4
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/make-qt-wrapper.sh
@@ -0,0 +1,42 @@
+addQtDependency() {
+    addToSearchPath QT_PLUGIN_PATH "$1/lib/qt5/plugins"
+    addToSearchPath QML_IMPORT_PATH "$1/lib/qt5/imports"
+    addToSearchPath QML2_IMPORT_PATH "$1/lib/qt5/qml"
+    addToSearchPath XDG_CONFIG_DIRS "$1/etc/xdg"
+    addToSearchPath XDG_DATA_DIRS "$1/share"
+}
+
+wrapQtProgram() {
+    local prog="$1"
+    shift
+    wrapProgram "$prog" \
+        --prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \
+        --prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \
+        --prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \
+        --prefix XDG_CONFIG_DIRS : "$XDG_CONFIG_DIRS" \
+        --prefix XDG_DATA_DIRS : "$XDG_DATA_DIRS" \
+        "$@"
+}
+
+makeQtWrapper() {
+    local old="$1"
+    local new="$2"
+    shift
+    shift
+    makeWrapper "$old" "$new" \
+        --prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \
+        --prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \
+        --prefix QML2_IMPORT_PATH : "$QML2_IMPORT_PATH" \
+        --prefix XDG_CONFIG_DIRS : "$XDG_CONFIG_DIRS" \
+        --prefix XDG_DATA_DIRS : "$XDG_DATA_DIRS" \
+        "$@"
+}
+
+# cannot use addToSearchPath because these directories may not exist yet
+export QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}$out/lib/qt5/plugins"
+export QML_IMPORT_PATH="$QML_IMPORT_PATH${QML_IMPORT_PATH:+:}$out/lib/qt5/imports"
+export QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}$out/lib/qt5/qml"
+export XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS${XDG_CONFIG_DIRS:+:}$out/etc/xdg"
+export XDG_DATA_DIRS="$XDG_DATA_DIRS${XDG_DATA_DIRS:+:}$out/share"
+
+envHooks+=(addQtDependency)
diff --git a/pkgs/development/libraries/qt-5/5.4/manifest.json b/pkgs/development/libraries/qt-5/5.4/manifest.json
deleted file mode 100644
index 83dedb41706c..000000000000
--- a/pkgs/development/libraries/qt-5/5.4/manifest.json
+++ /dev/null
@@ -1,301 +0,0 @@
-[
-  {
-    "name": "qtbase-opensource-src-5.4.2",
-    "store": "/nix/store/60xy2xnsl5kwraqkgh8d950nj1pk3kmi-qtbase-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtbase-opensource-src-5.4.2.tar.xz",
-      "sha256": "0x2szpjjvsrpcqw0dd3gsim7b1jv9p716pnllzjbia5mp0hggi4z",
-      "name": "qtbase-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtenginio-opensource-src-5.4.2",
-    "store": "/nix/store/4iprnq6sm0b1pnxmxb5krip7kk40xqmr-qtenginio-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtenginio-opensource-src-5.4.2.tar.xz",
-      "sha256": "082i3fapjw6xs0jkz7x529dn3pb6w1pfli3cjrgvggff86gwlgwn",
-      "name": "qtenginio-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtserialport-opensource-src-5.4.2",
-    "store": "/nix/store/l9k1v23ddnhjch5b2p3l28xbqkhz63yl-qtserialport-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtserialport-opensource-src-5.4.2.tar.xz",
-      "sha256": "1h6p5rb0ldxgzd4md3n79gy0j9blhj736670xqjd9vlvh1743kck",
-      "name": "qtserialport-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtscript-opensource-src-5.4.2",
-    "store": "/nix/store/n4ixnakw3fiflyimshkp43h7ijlpiif6-qtscript-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtscript-opensource-src-5.4.2.tar.xz",
-      "sha256": "0izsmy0cr8iii78r10ndkidyljxqd2k9g03f5xb9nxacvr2f8hp0",
-      "name": "qtscript-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtwebchannel-opensource-src-5.4.2",
-    "store": "/nix/store/qbkqkn4ck0fqbndl9fzp7iaz6c475xq8-qtwebchannel-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtwebchannel-opensource-src-5.4.2.tar.xz",
-      "sha256": "0vy1zjbghfa1wirxd8fd2n2n8yryykzr09913qm2nlfbcxdsgqsn",
-      "name": "qtwebchannel-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtwinextras-opensource-src-5.4.2",
-    "store": "/nix/store/9kmig3lg8d8s5r1jl3xj5q3jrkp3p8sx-qtwinextras-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtwinextras-opensource-src-5.4.2.tar.xz",
-      "sha256": "0sgybvr1y2xsddlqc95ninxj3rfmd4gv7a8f7rqcxdynjan5gij0",
-      "name": "qtwinextras-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtwebsockets-opensource-src-5.4.2",
-    "store": "/nix/store/zk4s5pgp3mh6xdq6z3svi305vn0pli27-qtwebsockets-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtwebsockets-opensource-src-5.4.2.tar.xz",
-      "sha256": "0lv1la8333qnirxmscs42xnnra0xry1gjbhi3bxrf1hrfs2im9j4",
-      "name": "qtwebsockets-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtmultimedia-opensource-src-5.4.2",
-    "store": "/nix/store/n8wpy6b8jw1rf51z1qhxbbym7j8rr8ay-qtmultimedia-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtmultimedia-opensource-src-5.4.2.tar.xz",
-      "sha256": "0h29cs8ajnjarhjx1aczdnxqwvg6pqs9s8w28hw488s149wqqrnj",
-      "name": "qtmultimedia-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtgraphicaleffects-opensource-src-5.4.2",
-    "store": "/nix/store/2q2vk530mf32zzd1v8bpax8iixviw6q5-qtgraphicaleffects-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtgraphicaleffects-opensource-src-5.4.2.tar.xz",
-      "sha256": "02p8xm5ajicjam30ry3g1lm2p4nja2q0sls8dzimqrxhw5xlg3xs",
-      "name": "qtgraphicaleffects-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtxmlpatterns-opensource-src-5.4.2",
-    "store": "/nix/store/3fqgpa668hb1xmwjw056cw58qzb3r0g4-qtxmlpatterns-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtxmlpatterns-opensource-src-5.4.2.tar.xz",
-      "sha256": "0ar7znqp1i02ha5ngy2kzk3hlgkafjbn2xa8j2k78gzmwsmdhzxa",
-      "name": "qtxmlpatterns-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qttranslations-opensource-src-5.4.2",
-    "store": "/nix/store/mg9b5z2nznzxrz501hm06b7l27jjwaca-qttranslations-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qttranslations-opensource-src-5.4.2.tar.xz",
-      "sha256": "0b4l69c16z8gjd4mq75zz3lj2gxarr9wyk0vk60jg1mi62vxvdls",
-      "name": "qttranslations-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtdeclarative-opensource-src-5.4.2",
-    "store": "/nix/store/bjmv4fgphx9bggzcwy4lcdas9phbwjsg-qtdeclarative-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtdeclarative-opensource-src-5.4.2.tar.xz",
-      "sha256": "1bj1wwms6lpj8s70y8by3j0hjsw6g9v8m6fybx68krzzizbj2c5p",
-      "name": "qtdeclarative-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtwebkit-opensource-src-5.4.2",
-    "store": "/nix/store/pfhq8ask8jhzdh2x882d014b10ddywma-qtwebkit-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtwebkit-opensource-src-5.4.2.tar.xz",
-      "sha256": "0vffbpiczag2n2hp5gc0nii8n7vkidr8f8pp8a47px0183hl6hiy",
-      "name": "qtwebkit-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtquick1-opensource-src-5.4.2",
-    "store": "/nix/store/n807cxddkvhbzw3ciqs29zc5mw47z2qs-qtquick1-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtquick1-opensource-src-5.4.2.tar.xz",
-      "sha256": "0178z15a31fw3l6933fwxs7sk0csifpwckydp3rqnn3fg5f2fwvp",
-      "name": "qtquick1-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtquickcontrols-opensource-src-5.4.2",
-    "store": "/nix/store/gq8afk8zr2vrrsfmp4caqv02209qk9xb-qtquickcontrols-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtquickcontrols-opensource-src-5.4.2.tar.xz",
-      "sha256": "137z3c3drxlvkdfc7zgcl0xqmavw0ladzqy0i3bq51h756qdc877",
-      "name": "qtquickcontrols-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtimageformats-opensource-src-5.4.2",
-    "store": "/nix/store/cmpx0338z1j0wzk6scfpay5k10023d46-qtimageformats-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtimageformats-opensource-src-5.4.2.tar.xz",
-      "sha256": "1nny6j9pm5ri3n1vwl5lrfrdz0fl81rx127wa49rkg2rjai2aawb",
-      "name": "qtimageformats-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtdoc-opensource-src-5.4.2",
-    "store": "/nix/store/jv4wgs6pz9xqmin9m4q4mifr2vfcjn3h-qtdoc-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtdoc-opensource-src-5.4.2.tar.xz",
-      "sha256": "15lamv6jvd7v33ldpcrazcdksv6qibdcgh4ncbyh774k8avgrlh8",
-      "name": "qtdoc-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtwayland-opensource-src-5.4.2",
-    "store": "/nix/store/qa3yi9lyx2dm4wqzb3qzvzba1sgnj74z-qtwayland-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtwayland-opensource-src-5.4.2.tar.xz",
-      "sha256": "14pmpkfq70plw07igxjaiji4vnjg5kg7izlb0wwym1lisg7bwkg0",
-      "name": "qtwayland-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtmacextras-opensource-src-5.4.2",
-    "store": "/nix/store/wdq1z3bzr9n11yln8avx10sgzgyvp8cl-qtmacextras-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtmacextras-opensource-src-5.4.2.tar.xz",
-      "sha256": "0h0p3s0rvd3g9rgr4hwcggdbsav2g30vijqwmdxgxd8c00yply80",
-      "name": "qtmacextras-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtactiveqt-opensource-src-5.4.2",
-    "store": "/nix/store/0ik7vc3zwdjvrp4fpyqf1zpyqdxvvqvq-qtactiveqt-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtactiveqt-opensource-src-5.4.2.tar.xz",
-      "sha256": "014kwficqydciwdm1yw88yms81qm8pmi6xfhhfpbc9k85pc6jlla",
-      "name": "qtactiveqt-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtlocation-opensource-src-5.4.2",
-    "store": "/nix/store/sa4dawsw2wv45ld3afbz9nfc64qkyx1s-qtlocation-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtlocation-opensource-src-5.4.2.tar.xz",
-      "sha256": "1v43hl2zzi90vaw11y8dvsksrjn0r2v0br7pw6njl8lqadpg4jnw",
-      "name": "qtlocation-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtconnectivity-opensource-src-5.4.2",
-    "store": "/nix/store/v2aiscvf582azyzg696rglway56l7xl2-qtconnectivity-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtconnectivity-opensource-src-5.4.2.tar.xz",
-      "sha256": "1nj68bzgm3r1gg171kj0acnifzb3jx0m5pf4f81xb7zl4hfxasrs",
-      "name": "qtconnectivity-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtx11extras-opensource-src-5.4.2",
-    "store": "/nix/store/nz62qld9h96z5a0b7fg52fsh5d6q0kqw-qtx11extras-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtx11extras-opensource-src-5.4.2.tar.xz",
-      "sha256": "0jgyywjxavfpiz8202g3s0g9izfl185mmak4fs9h80w1i3gn5zzn",
-      "name": "qtx11extras-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qttools-opensource-src-5.4.2",
-    "store": "/nix/store/i8n6xrhalg3z4i0min4w79rq9h9hch0x-qttools-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qttools-opensource-src-5.4.2.tar.xz",
-      "sha256": "1d5nx01r7wxhdg9f1i9xhsvsbwgaz3yv516s068riy970bhdgwzd",
-      "name": "qttools-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtsensors-opensource-src-5.4.2",
-    "store": "/nix/store/0ar28gp8klqxynjnc1r4kj9x7g8cknk2-qtsensors-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtsensors-opensource-src-5.4.2.tar.xz",
-      "sha256": "1yawvjbdymgw8af7ir9zcin89xxck9dm2l6hnc43lwrky0frcvcf",
-      "name": "qtsensors-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtwebengine-opensource-src-5.4.2",
-    "store": "/nix/store/ikr8cc3bn62jlv9afpzhxvqs5qhsc2yc-qtwebengine-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtwebengine-opensource-src-5.4.2.tar.xz",
-      "sha256": "06cyl733prakniqrn8sd807lclk5im2vmysjdcijry2mcyah2ih8",
-      "name": "qtwebengine-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtsvg-opensource-src-5.4.2",
-    "store": "/nix/store/0llm31zpiaqig940a8dsp1dk2npxsnjc-qtsvg-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtsvg-opensource-src-5.4.2.tar.xz",
-      "sha256": "1dsyncp154xvb7d82nmnfjm0ngymnhqmliq58ljwxsjmpjlncakz",
-      "name": "qtsvg-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qt5-opensource-src-5.4.2",
-    "store": "/nix/store/0jrx1clg8vqid9b2n9z8f0xbwjm0yynr-qt5-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qt5-opensource-src-5.4.2.tar.xz",
-      "sha256": "17a0pybr4bpyv9pj7cr5hl4g31biv89bjr8zql723h0b12ql1w44",
-      "name": "qt5-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtwebkit-examples-opensource-src-5.4.2",
-    "store": "/nix/store/6pmmi9bjbdxkbw2xkkc1srk5ambnjcxv-qtwebkit-examples-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtwebkit-examples-opensource-src-5.4.2.tar.xz",
-      "sha256": "0pm9ik1j09jfb5xflc16449nff2xsfyfms7vxlcdjg4dhcqfmll8",
-      "name": "qtwebkit-examples-opensource-src-5.4.2.tar.xz"
-    }
-  }
-,
-  {
-    "name": "qtandroidextras-opensource-src-5.4.2",
-    "store": "/nix/store/grrsklibvplaj5pdwjp2zirxmqnq10hf-qtandroidextras-opensource-src-5.4.2.tar.xz",
-    "src": {
-      "url": "official_releases/qt/5.4/5.4.2/submodules/qtandroidextras-opensource-src-5.4.2.tar.xz",
-      "sha256": "0krfm0wg26x7575p8isswdhrkb0jxyp169grwklil7mfw8yg3xhx",
-      "name": "qtandroidextras-opensource-src-5.4.2.tar.xz"
-    }
-  }
-]
diff --git a/pkgs/development/libraries/qt-5/5.4/manifest.sh b/pkgs/development/libraries/qt-5/5.4/manifest.sh
deleted file mode 100755
index 780269a6417a..000000000000
--- a/pkgs/development/libraries/qt-5/5.4/manifest.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-set -x
-
-# The extra slash at the end of the URL is necessary to stop wget
-# from recursing over the whole server! (No, it's not a bug.)
-$(nix-build ../../../../.. --no-out-link -A autonix.manifest) \
-  http://download.qt.io/official_releases/qt/5.4/5.4.2/submodules/ \
-    -A '*.tar.xz'
diff --git a/pkgs/development/libraries/qt-5/5.4/qt-submodule.nix b/pkgs/development/libraries/qt-5/5.4/qt-submodule.nix
deleted file mode 100644
index 4012b637e286..000000000000
--- a/pkgs/development/libraries/qt-5/5.4/qt-submodule.nix
+++ /dev/null
@@ -1,54 +0,0 @@
-{ stdenv, mkDerivation
-, srcs, version
-, lndir
-, base
-}:
-
-with stdenv.lib;
-
-args:
-
-mkDerivation (args // {
-
-  name = "${args.name}-${version}";
-  inherit version;
-
-  srcs = args.srcs or [srcs."${args.name}-opensource-src"];
-
-  qtSubmodule = args.qtSubmodule or true;
-  dontAddPrefix = args.dontAddPrefix or true;
-  dontFixLibtool = args.dontFixLibtool or true;
-  configureScript = args.configureScript or "qmake";
-
-  postInstall = ''
-    rm "$out/bin/qmake" "$out/bin/qt.conf"
-
-    cat "$out/nix-support/qt-inputs" | while read file; do
-      if [[ -h "$out/$file" ]]; then
-        rm "$out/$file"
-      fi
-    done
-
-    cat "$out/nix-support/qt-inputs" | while read file; do
-      if [[ -d "$out/$file" ]]; then
-        rmdir --ignore-fail-on-non-empty -p "$out/$file"
-      fi
-    done
-
-    rm "$out/nix-support/qt-inputs"
-  '';
-
-  propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or []);
-
-  enableParallelBuilding =
-    args.enableParallelBuilding or true; # often fails on Hydra, as well as qt4
-
-  meta = args.meta or {
-    homepage = http://qt-project.org;
-    description = "A cross-platform application framework for C++";
-    license = "GPL/LGPL";
-    maintainers = with maintainers; [ bbenoist qknight ttuegel ];
-    platforms = platforms.linux;
-  };
-
-})
diff --git a/pkgs/development/libraries/qt-5/5.4/qtbase.nix b/pkgs/development/libraries/qt-5/5.4/qtbase.nix
deleted file mode 100644
index 30d53eb874be..000000000000
--- a/pkgs/development/libraries/qt-5/5.4/qtbase.nix
+++ /dev/null
@@ -1,211 +0,0 @@
-{ stdenv, substituteAll
-, srcs, version
-
-, xorg, libX11, libxcb, libXcursor, libXext, libXrender, libXi
-, xcbutil, xcbutilimage, xcbutilkeysyms, xcbutilwm, libxkbcommon
-, fontconfig, freetype, openssl, dbus, glib, udev, libxml2, libxslt, pcre
-, zlib, libjpeg, libpng, libtiff, sqlite, icu
-
-, coreutils, bison, flex, gdb, gperf, lndir, ruby
-, python, perl, pkgconfig
-
-# optional dependencies
-, cups ? null
-, mysql ? null, postgresql ? null
-
-# options
-, mesaSupported, mesa, mesa_glu
-, buildDocs ? false
-, buildExamples ? false
-, buildTests ? false
-, developerBuild ? false
-, gtkStyle ? false, libgnomeui, GConf, gnome_vfs, gtk
-, decryptSslTraffic ? false
-}:
-
-with stdenv.lib;
-
-let system-x86_64 = elem stdenv.system platforms.x86_64; in
-
-stdenv.mkDerivation {
-
-  name = "qtbase-${version}";
-  inherit version;
-
-  srcs = with srcs; [ qt5-opensource-src qtbase-opensource-src ];
-  sourceRoot = "qt-everywhere-opensource-src-${version}";
-
-  postUnpack = ''
-    mv qtbase-opensource-src-${version} ./qt-everywhere-opensource-src-${version}/qtbase
-  '';
-
-  prePatch = ''
-    substituteInPlace configure --replace /bin/pwd pwd
-    substituteInPlace qtbase/configure --replace /bin/pwd pwd
-    substituteInPlace qtbase/src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
-    substituteInPlace qtbase/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp \
-        --replace /usr/share/X11/locale ${libX11}/share/X11/locale \
-        --replace /usr/lib/X11/locale ${libX11}/share/X11/locale
-    sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i config.tests/*/*.test -i qtbase/mkspecs/*/*.conf
-  '';
-
-  patches =
-    optional gtkStyle
-      (substituteAll {
-        src = ./0001-dlopen-gtkstyle.patch;
-        # substituteAll ignores env vars starting with capital letter
-        gconf = GConf;
-        inherit gnome_vfs libgnomeui gtk;
-      })
-    ++ [
-      (substituteAll {
-        src = ./0004-dlopen-resolv.patch;
-        glibc = stdenv.cc.libc;
-      })
-      (substituteAll {
-        src = ./0005-dlopen-gl.patch;
-        openglDriver = if mesaSupported then mesa.driverLink else "/no-such-path";
-      })
-      ./0006-tzdir.patch
-      (substituteAll { src = ./0010-dlopen-libXcursor.patch; inherit libXcursor; })
-      (substituteAll { src = ./0011-dlopen-openssl.patch; inherit openssl; })
-      (substituteAll { src = ./0012-dlopen-dbus.patch; dbus_libs = dbus; })
-      ./0013-xdg_config_dirs.patch
-    ] ++ optional mesaSupported
-      (substituteAll { src = ./0014-mkspecs-libgl.patch; inherit mesa; })
-    ++ (optional decryptSslTraffic ./0100-ssl.patch);
-
-  preConfigure = ''
-    export LD_LIBRARY_PATH="$PWD/qtbase/lib:$PWD/qtbase/plugins/platforms:$PWD/qttools/lib:$LD_LIBRARY_PATH"
-    export MAKEFLAGS=-j$NIX_BUILD_CORES
-
-    sed -i 's/PATHS.*NO_DEFAULT_PATH//' "qtbase/src/corelib/Qt5Config.cmake.in"
-    sed -i 's/PATHS.*NO_DEFAULT_PATH//' "qtbase/src/corelib/Qt5CoreMacros.cmake"
-    sed -i 's/NO_DEFAULT_PATH//' "qtbase/src/gui/Qt5GuiConfigExtras.cmake.in"
-    sed -i 's/PATHS.*NO_DEFAULT_PATH//' "qtbase/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in"
-
-    export configureFlags+="-plugindir $out/lib/qt5/plugins -importdir $out/lib/qt5/imports -qmldir $out/lib/qt5/qml"
-    export configureFlags+=" -docdir $out/share/doc/qt5"
-  '';
-
-  prefixKey = "-prefix ";
-
-  # -no-eglfs, -no-directfb, -no-linuxfb and -no-kms because of the current minimalist mesa
-  # TODO Remove obsolete and useless flags once the build will be totally mastered
-  configureFlags = ''
-    -verbose
-    -confirm-license
-    -opensource
-
-    -release
-    -shared
-    -c++11
-    ${optionalString developerBuild "-developer-build"}
-    -largefile
-    -accessibility
-    -rpath
-    -optimized-qmake
-    -strip
-    -reduce-relocations
-    -system-proxies
-    -pkg-config
-
-    -gui
-    -widgets
-    -opengl desktop
-    -qml-debug
-    -nis
-    -iconv
-    -icu
-    -pch
-    -glib
-    -xcb
-    -qpa xcb
-    -${optionalString (cups == null) "no-"}cups
-    -${optionalString (!gtkStyle) "no-"}gtkstyle
-
-    -no-eglfs
-    -no-directfb
-    -no-linuxfb
-    -no-kms
-
-    ${optionalString (!system-x86_64) "-no-sse2"}
-    -no-sse3
-    -no-ssse3
-    -no-sse4.1
-    -no-sse4.2
-    -no-avx
-    -no-avx2
-    -no-mips_dsp
-    -no-mips_dspr2
-
-    -system-zlib
-    -system-libpng
-    -system-libjpeg
-    -system-xcb
-    -system-xkbcommon
-    -openssl-linked
-    -dbus-linked
-
-    -system-sqlite
-    -${if mysql != null then "plugin" else "no"}-sql-mysql
-    -${if postgresql != null then "plugin" else "no"}-sql-psql
-
-    -make libs
-    -make tools
-    -${optionalString (buildExamples == false) "no"}make examples
-    -${optionalString (buildTests == false) "no"}make tests
-  '';
-
-  # PostgreSQL autodetection fails sporadically because Qt omits the "-lpq" flag
-  # if dependency paths contain the string "pq", which can occur in the hash.
-  # To prevent these failures, we need to override PostgreSQL detection.
-  PSQL_LIBS = optionalString (postgresql != null) "-L${postgresql}/lib -lpq";
-
-  propagatedBuildInputs = [
-    xorg.libXcomposite libX11 libxcb libXext libXrender libXi
-    fontconfig freetype openssl dbus.libs glib udev libxml2 libxslt pcre
-    zlib libjpeg libpng libtiff sqlite icu
-    xcbutil xcbutilimage xcbutilkeysyms xcbutilwm libxkbcommon
-  ]
-  # Qt doesn't directly need GLU (just GL), but many apps use, it's small and
-  # doesn't remain a runtime-dep if not used
-  ++ optionals mesaSupported [ mesa mesa_glu ]
-  ++ optional (cups != null) cups
-  ++ optional (mysql != null) mysql.lib
-  ++ optional (postgresql != null) postgresql
-  ++ optionals gtkStyle [gnome_vfs libgnomeui gtk GConf];
-
-  buildInputs =
-    [ bison flex gperf ruby ]
-    ++ optional developerBuild gdb;
-
-  nativeBuildInputs = [ python perl pkgconfig ];
-
-  # freetype-2.5.4 changed signedness of some struct fields
-  NIX_CFLAGS_COMPILE = "-Wno-error=sign-compare";
-
-  postInstall =
-    ''
-      ${optionalString buildDocs ''
-        make docs && make install_docs
-      ''}
-
-      # Don't retain build-time dependencies like gdb and ruby.
-      sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $out/mkspecs/qconfig.pri
-    '';
-
-  inherit lndir;
-  setupHook = ./setup-hook.sh;
-
-  enableParallelBuilding = true; # often fails on Hydra, as well as qt4
-
-  meta = {
-    homepage = http://qt-project.org;
-    description = "A cross-platform application framework for C++";
-    license = "GPL/LGPL";
-    maintainers = with maintainers; [ bbenoist qknight ttuegel ];
-    platforms = platforms.linux;
-  };
-
-}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtbase/compose-search-path.patch b/pkgs/development/libraries/qt-5/5.4/qtbase/compose-search-path.patch
new file mode 100644
index 000000000000..08d12087f080
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/compose-search-path.patch
@@ -0,0 +1,16 @@
+Index: qt-everywhere-opensource-src-5.5.1/qtbase/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
+===================================================================
+--- qt-everywhere-opensource-src-5.5.1.orig/qtbase/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
++++ qt-everywhere-opensource-src-5.5.1/qtbase/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp
+@@ -68,10 +68,7 @@ void TableGenerator::initPossibleLocatio
+     // the QTCOMPOSE environment variable
+     if (qEnvironmentVariableIsSet("QTCOMPOSE"))
+         m_possibleLocations.append(QString::fromLocal8Bit(qgetenv("QTCOMPOSE")));
+-    m_possibleLocations.append(QStringLiteral("/usr/share/X11/locale"));
+-    m_possibleLocations.append(QStringLiteral("/usr/local/share/X11/locale"));
+-    m_possibleLocations.append(QStringLiteral("/usr/lib/X11/locale"));
+-    m_possibleLocations.append(QStringLiteral("/usr/local/lib/X11/locale"));
++    m_possibleLocations.append(QStringLiteral("${libX11}/share/X11/locale"));
+     m_possibleLocations.append(QStringLiteral(X11_PREFIX "/share/X11/locale"));
+     m_possibleLocations.append(QStringLiteral(X11_PREFIX "/lib/X11/locale"));
+ }
diff --git a/pkgs/development/libraries/qt-5/5.4/qtbase/decrypt-ssl-traffic.patch b/pkgs/development/libraries/qt-5/5.4/qtbase/decrypt-ssl-traffic.patch
new file mode 100644
index 000000000000..10e7e01a07f2
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/decrypt-ssl-traffic.patch
@@ -0,0 +1,13 @@
+Index: qt-everywhere-opensource-src-5.4.2/qtbase/src/network/ssl/qsslsocket_openssl.cpp
+===================================================================
+--- qt-everywhere-opensource-src-5.4.2.orig/qtbase/src/network/ssl/qsslsocket_openssl.cpp
++++ qt-everywhere-opensource-src-5.4.2/qtbase/src/network/ssl/qsslsocket_openssl.cpp
+@@ -47,7 +47,7 @@
+ ****************************************************************************/
+ 
+ //#define QSSLSOCKET_DEBUG
+-//#define QT_DECRYPT_SSL_TRAFFIC
++#define QT_DECRYPT_SSL_TRAFFIC
+ 
+ #include "qssl_p.h"
+ #include "qsslsocket_openssl_p.h"
diff --git a/pkgs/development/libraries/qt-5/5.4/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.4/qtbase/default.nix
new file mode 100644
index 000000000000..36bd3822bf73
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/default.nix
@@ -0,0 +1,224 @@
+{ stdenv, lib, fetchurl, copyPathsToStore, makeWrapper
+, srcs
+
+, xlibs, libX11, libxcb, libXcursor, libXext, libXrender, libXi
+, xcbutil, xcbutilimage, xcbutilkeysyms, xcbutilwm, libxkbcommon
+, fontconfig, freetype, openssl, dbus, glib, udev, libxml2, libxslt, pcre
+, zlib, libjpeg, libpng, libtiff, sqlite, icu
+
+, coreutils, bison, flex, gdb, gperf, lndir, ruby
+, python, perl, pkgconfig
+
+# optional dependencies
+, cups ? null
+, mysql ? null, postgresql ? null
+
+# options
+, mesaSupported, mesa, mesa_glu
+, buildDocs ? false
+, buildExamples ? false
+, buildTests ? false
+, developerBuild ? false
+, gtkStyle ? false, libgnomeui, GConf, gnome_vfs, gtk
+, decryptSslTraffic ? false
+}:
+
+let
+  inherit (srcs.qt5) version;
+  system-x86_64 = lib.elem stdenv.system lib.platforms.x86_64;
+in
+
+stdenv.mkDerivation {
+
+  name = "qtbase-${version}";
+  inherit version;
+
+  srcs = with srcs; [ qt5.src qtbase.src ];
+
+  sourceRoot = "qt-everywhere-opensource-src-${version}";
+
+  postUnpack = ''
+    mv qtbase-opensource-src-${version} ./qt-everywhere-opensource-src-${version}/qtbase
+  '';
+
+  patches =
+    copyPathsToStore (lib.readPathsFromFile ./. ./series)
+    ++ lib.optional gtkStyle ./dlopen-gtkstyle.patch
+    ++ lib.optional decryptSslTraffic ./decrypt-ssl-traffic.patch
+    ++ lib.optional mesaSupported [ ./dlopen-gl.patch ./mkspecs-libgl.patch ];
+
+  postPatch =
+    ''
+      substituteInPlace configure --replace /bin/pwd pwd
+      substituteInPlace qtbase/configure --replace /bin/pwd pwd
+      substituteInPlace qtbase/src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
+      sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i config.tests/*/*.test -i qtbase/mkspecs/*/*.conf
+
+      sed -i 's/PATHS.*NO_DEFAULT_PATH//' "qtbase/src/corelib/Qt5Config.cmake.in"
+      sed -i 's/PATHS.*NO_DEFAULT_PATH//' "qtbase/src/corelib/Qt5CoreMacros.cmake"
+      sed -i 's/NO_DEFAULT_PATH//' "qtbase/src/gui/Qt5GuiConfigExtras.cmake.in"
+      sed -i 's/PATHS.*NO_DEFAULT_PATH//' "qtbase/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in"
+
+      substituteInPlace qtbase/src/network/kernel/qdnslookup_unix.cpp \
+        --replace "@glibc@" "${stdenv.cc.libc}"
+      substituteInPlace qtbase/src/network/kernel/qhostinfo_unix.cpp \
+        --replace "@glibc@" "${stdenv.cc.libc}"
+
+      substituteInPlace qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp \
+        --replace "@libXcursor@" "${libXcursor}"
+
+      substituteInPlace qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp \
+        --replace "@openssl@" "${openssl}"
+
+      substituteInPlace qtbase/src/dbus/qdbus_symbols.cpp \
+        --replace "@dbus_libs@" "${dbus}"
+
+      substituteInPlace \
+        qtbase/src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp \
+        --replace "@libX11@" "${libX11}"
+    ''
+    + lib.optionalString gtkStyle ''
+      substituteInPlace qtbase/src/widgets/styles/qgtk2painter.cpp --replace "@gtk@" "${gtk}"
+      substituteInPlace qtbase/src/widgets/styles/qgtkstyle_p.cpp \
+        --replace "@gtk@" "${gtk}" \
+        --replace "@gnome_vfs@" "${gnome_vfs}" \
+        --replace "@libgnomeui@" "${libgnomeui}" \
+        --replace "@gconf@" "${GConf}"
+    ''
+    + lib.optionalString mesaSupported ''
+      substituteInPlace \
+        qtbase/src/plugins/platforms/xcb/qglxintegration.cpp \
+        --replace "@mesa@" "${mesa}"
+      substituteInPlace qtbase/mkspecs/common/linux.conf --replace "@mesa@" "${mesa}"
+    '';
+
+  preConfigure = ''
+    export LD_LIBRARY_PATH="$PWD/qtbase/lib:$PWD/qtbase/plugins/platforms:$LD_LIBRARY_PATH"
+    export MAKEFLAGS=-j$NIX_BUILD_CORES
+
+    export configureFlags+="-plugindir $out/lib/qt5/plugins -importdir $out/lib/qt5/imports -qmldir $out/lib/qt5/qml"
+    export configureFlags+=" -docdir $out/share/doc/qt5"
+  '';
+
+  prefixKey = "-prefix ";
+
+  # -no-eglfs, -no-directfb, -no-linuxfb and -no-kms because of the current minimalist mesa
+  # TODO Remove obsolete and useless flags once the build will be totally mastered
+  configureFlags = ''
+    -verbose
+    -confirm-license
+    -opensource
+
+    -release
+    -shared
+    -c++11
+    ${lib.optionalString developerBuild "-developer-build"}
+    -largefile
+    -accessibility
+    -rpath
+    -optimized-qmake
+    -strip
+    -reduce-relocations
+    -system-proxies
+    -pkg-config
+
+    -gui
+    -widgets
+    -opengl desktop
+    -qml-debug
+    -nis
+    -iconv
+    -icu
+    -pch
+    -glib
+    -xcb
+    -qpa xcb
+    -${lib.optionalString (cups == null) "no-"}cups
+    -${lib.optionalString (!gtkStyle) "no-"}gtkstyle
+
+    -no-eglfs
+    -no-directfb
+    -no-linuxfb
+    -no-kms
+
+    ${lib.optionalString (!system-x86_64) "-no-sse2"}
+    -no-sse3
+    -no-ssse3
+    -no-sse4.1
+    -no-sse4.2
+    -no-avx
+    -no-avx2
+    -no-mips_dsp
+    -no-mips_dspr2
+
+    -system-zlib
+    -system-libpng
+    -system-libjpeg
+    -system-xcb
+    -system-xkbcommon
+    -openssl-linked
+    -dbus-linked
+
+    -system-sqlite
+    -${if mysql != null then "plugin" else "no"}-sql-mysql
+    -${if postgresql != null then "plugin" else "no"}-sql-psql
+
+    -make libs
+    -make tools
+    -${lib.optionalString (buildExamples == false) "no"}make examples
+    -${lib.optionalString (buildTests == false) "no"}make tests
+  '';
+
+  # PostgreSQL autodetection fails sporadically because Qt omits the "-lpq" flag
+  # if dependency paths contain the string "pq", which can occur in the hash.
+  # To prevent these failures, we need to override PostgreSQL detection.
+  PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql}/lib -lpq";
+
+  propagatedBuildInputs = [
+    xlibs.libXcomposite libX11 libxcb libXext libXrender libXi
+    fontconfig freetype openssl dbus.libs glib udev libxml2 libxslt pcre
+    zlib libjpeg libpng libtiff sqlite icu
+    xcbutil xcbutilimage xcbutilkeysyms xcbutilwm libxkbcommon
+  ]
+  # Qt doesn't directly need GLU (just GL), but many apps use, it's small and
+  # doesn't remain a runtime-dep if not used
+  ++ lib.optionals mesaSupported [ mesa mesa_glu ]
+  ++ lib.optional (cups != null) cups
+  ++ lib.optional (mysql != null) mysql.lib
+  ++ lib.optional (postgresql != null) postgresql
+  ++ lib.optionals gtkStyle [gnome_vfs libgnomeui gtk GConf];
+
+  buildInputs =
+    [ bison flex gperf ruby ]
+    ++ lib.optional developerBuild gdb;
+
+  nativeBuildInputs = [ python perl pkgconfig ];
+
+  propagatedNativeBuildInputs = [ makeWrapper ];
+
+  # freetype-2.5.4 changed signedness of some struct fields
+  NIX_CFLAGS_COMPILE = "-Wno-error=sign-compare";
+
+  postInstall =
+    ''
+      # Don't retain build-time dependencies like gdb and ruby.
+      sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $out/mkspecs/qconfig.pri
+    ''
+    + lib.optionalString buildDocs ''
+      make docs && make install_docs
+    '';
+
+  inherit lndir;
+  setupHook = ./setup-hook.sh;
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = http://qt-project.org;
+    description = "A cross-platform application framework for C++";
+    license = "GPL/LGPL";
+    maintainers = with maintainers; [ bbenoist qknight ttuegel ];
+    platforms = platforms.linux;
+  };
+
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-dbus.patch b/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-dbus.patch
new file mode 100644
index 000000000000..05e98d8be71d
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-dbus.patch
@@ -0,0 +1,13 @@
+Index: qt-everywhere-opensource-src-5.4.2/qtbase/src/dbus/qdbus_symbols.cpp
+===================================================================
+--- qt-everywhere-opensource-src-5.4.2.orig/qtbase/src/dbus/qdbus_symbols.cpp
++++ qt-everywhere-opensource-src-5.4.2/qtbase/src/dbus/qdbus_symbols.cpp
+@@ -88,7 +88,7 @@ bool qdbus_loadLibDBus()
+ #ifdef Q_OS_WIN
+         QLatin1String("dbus-1"),
+ #endif
+-        QLatin1String("libdbus-1")
++        QLatin1String("@dbus_libs@/lib/libdbus-1")
+     };
+ 
+     lib->unload();
diff --git a/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-gl.patch b/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-gl.patch
new file mode 100644
index 000000000000..d6e08cd24106
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-gl.patch
@@ -0,0 +1,17 @@
+Index: qt-everywhere-opensource-src-5.4.2/qtbase/src/plugins/platforms/xcb/qglxintegration.cpp
+===================================================================
+--- qt-everywhere-opensource-src-5.4.2.orig/qtbase/src/plugins/platforms/xcb/qglxintegration.cpp
++++ qt-everywhere-opensource-src-5.4.2/qtbase/src/plugins/platforms/xcb/qglxintegration.cpp
+@@ -560,7 +560,12 @@ void (*QGLXContext::getProcAddress(const
+             {
+                 extern const QString qt_gl_library_name();
+ //                QLibrary lib(qt_gl_library_name());
++                // Check system library paths first
+                 QLibrary lib(QLatin1String("GL"));
++                if (!lib.load()) {
++                    // Fallback to Mesa driver
++                    lib.setFileName(QLatin1String("@mesa@/lib/libGL"));
++                }
+                 glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB");
+             }
+         }
diff --git a/pkgs/development/libraries/qt-5/5.4/0001-dlopen-gtkstyle.patch b/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-gtkstyle.patch
index 3f411139f5be..c2be73779497 100644
--- a/pkgs/development/libraries/qt-5/5.4/0001-dlopen-gtkstyle.patch
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-gtkstyle.patch
@@ -1,18 +1,8 @@
-From 35d5995a58c86a6addbf0aaf0d1be64d39182872 Mon Sep 17 00:00:00 2001
-From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Mon, 1 Dec 2014 17:21:58 -0600
-Subject: [PATCH] dlopen-gtkstyle
-
----
- qtbase/src/widgets/styles/qgtk2painter.cpp |  2 +-
- qtbase/src/widgets/styles/qgtkstyle_p.cpp  | 12 ++++++------
- 2 files changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/qtbase/src/widgets/styles/qgtk2painter.cpp b/qtbase/src/widgets/styles/qgtk2painter.cpp
-index 7b9bd97..075947a 100644
---- a/qtbase/src/widgets/styles/qgtk2painter.cpp
-+++ b/qtbase/src/widgets/styles/qgtk2painter.cpp
-@@ -104,7 +104,7 @@ static void initGtk()
+Index: qt-everywhere-opensource-src-5.4.2/qtbase/src/widgets/styles/qgtk2painter.cpp
+===================================================================
+--- qt-everywhere-opensource-src-5.4.2.orig/qtbase/src/widgets/styles/qgtk2painter.cpp
++++ qt-everywhere-opensource-src-5.4.2/qtbase/src/widgets/styles/qgtk2painter.cpp
+@@ -96,7 +96,7 @@ static void initGtk()
      static bool initialized = false;
      if (!initialized) {
          // enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
@@ -21,11 +11,11 @@ index 7b9bd97..075947a 100644
  
          QGtk2PainterPrivate::gdk_pixmap_new = (Ptr_gdk_pixmap_new)libgtk.resolve("gdk_pixmap_new");
          QGtk2PainterPrivate::gdk_pixbuf_get_from_drawable = (Ptr_gdk_pixbuf_get_from_drawable)libgtk.resolve("gdk_pixbuf_get_from_drawable");
-diff --git a/qtbase/src/widgets/styles/qgtkstyle_p.cpp b/qtbase/src/widgets/styles/qgtkstyle_p.cpp
-index 2c64225..3343d32 100644
---- a/qtbase/src/widgets/styles/qgtkstyle_p.cpp
-+++ b/qtbase/src/widgets/styles/qgtkstyle_p.cpp
-@@ -334,7 +334,7 @@ void QGtkStylePrivate::gtkWidgetSetFocus(GtkWidget *widget, bool focus)
+Index: qt-everywhere-opensource-src-5.4.2/qtbase/src/widgets/styles/qgtkstyle_p.cpp
+===================================================================
+--- qt-everywhere-opensource-src-5.4.2.orig/qtbase/src/widgets/styles/qgtkstyle_p.cpp
++++ qt-everywhere-opensource-src-5.4.2/qtbase/src/widgets/styles/qgtkstyle_p.cpp
+@@ -326,7 +326,7 @@ void QGtkStylePrivate::gtkWidgetSetFocus
  void QGtkStylePrivate::resolveGtk() const
  {
      // enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
@@ -34,7 +24,7 @@ index 2c64225..3343d32 100644
  
      gtk_init = (Ptr_gtk_init)libgtk.resolve("gtk_init");
      gtk_window_new = (Ptr_gtk_window_new)libgtk.resolve("gtk_window_new");
-@@ -432,8 +432,8 @@ void QGtkStylePrivate::resolveGtk() const
+@@ -424,8 +424,8 @@ void QGtkStylePrivate::resolveGtk() cons
      pango_font_description_get_family = (Ptr_pango_font_description_get_family)libgtk.resolve("pango_font_description_get_family");
      pango_font_description_get_style = (Ptr_pango_font_description_get_style)libgtk.resolve("pango_font_description_get_style");
  
@@ -45,7 +35,7 @@ index 2c64225..3343d32 100644
  }
  
  /* \internal
-@@ -601,9 +601,9 @@ void QGtkStylePrivate::cleanupGtkWidgets()
+@@ -593,9 +593,9 @@ void QGtkStylePrivate::cleanupGtkWidgets
  static bool resolveGConf()
  {
      if (!QGtkStylePrivate::gconf_client_get_default) {
@@ -58,6 +48,3 @@ index 2c64225..3343d32 100644
      }
      return (QGtkStylePrivate::gconf_client_get_default !=0);
  }
--- 
-2.1.3
-
diff --git a/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-libXcursor.patch b/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-libXcursor.patch
new file mode 100644
index 000000000000..608c68b6d5b4
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-libXcursor.patch
@@ -0,0 +1,17 @@
+Index: qt-everywhere-opensource-src-5.4.2/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
+===================================================================
+--- qt-everywhere-opensource-src-5.4.2.orig/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
++++ qt-everywhere-opensource-src-5.4.2/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
+@@ -297,10 +297,10 @@ QXcbCursor::QXcbCursor(QXcbConnection *c
+ #ifdef XCB_USE_XLIB
+     static bool function_ptrs_not_initialized = true;
+     if (function_ptrs_not_initialized) {
+-        QLibrary xcursorLib(QLatin1String("Xcursor"), 1);
++        QLibrary xcursorLib(QLatin1String("@libXcursor@/lib/libXcursor"), 1);
+         bool xcursorFound = xcursorLib.load();
+         if (!xcursorFound) { // try without the version number
+-            xcursorLib.setFileName(QLatin1String("Xcursor"));
++            xcursorLib.setFileName(QLatin1String("@libXcursor@/lib/Xcursor"));
+             xcursorFound = xcursorLib.load();
+         }
+         if (xcursorFound) {
diff --git a/pkgs/development/libraries/qt-5/5.4/0011-dlopen-openssl.patch b/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-openssl.patch
index a79f0f363899..b648a58b5701 100644
--- a/pkgs/development/libraries/qt-5/5.4/0011-dlopen-openssl.patch
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-openssl.patch
@@ -1,8 +1,8 @@
-diff --git a/qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp b/qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp
-index c1fea93..bc1c0f0 100644
---- a/qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp
-+++ b/qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp
-@@ -611,8 +611,8 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
+Index: qt-everywhere-opensource-src-5.4.2/qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp
+===================================================================
+--- qt-everywhere-opensource-src-5.4.2.orig/qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp
++++ qt-everywhere-opensource-src-5.4.2/qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp
+@@ -611,8 +611,8 @@ static QPair<QLibrary*, QLibrary*> loadO
  #endif
  #if defined(SHLIB_VERSION_NUMBER) && !defined(Q_OS_QNX) // on QNX, the libs are always libssl.so and libcrypto.so
      // first attempt: the canonical name is libssl.so.<SHLIB_VERSION_NUMBER>
@@ -13,7 +13,7 @@ index c1fea93..bc1c0f0 100644
      if (libcrypto->load() && libssl->load()) {
          // libssl.so.<SHLIB_VERSION_NUMBER> and libcrypto.so.<SHLIB_VERSION_NUMBER> found
          return pair;
-@@ -629,8 +629,8 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
+@@ -629,8 +629,8 @@ static QPair<QLibrary*, QLibrary*> loadO
      //  OS X's /usr/lib/libssl.dylib, /usr/lib/libcrypto.dylib will be picked up in the third
      //    attempt, _after_ <bundle>/Contents/Frameworks has been searched.
      //  iOS does not ship a system libssl.dylib, libcrypto.dylib in the first place.
diff --git a/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-resolv.patch b/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-resolv.patch
new file mode 100644
index 000000000000..a79c806462f8
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/dlopen-resolv.patch
@@ -0,0 +1,26 @@
+Index: qt-everywhere-opensource-src-5.5.1/qtbase/src/network/kernel/qdnslookup_unix.cpp
+===================================================================
+--- qt-everywhere-opensource-src-5.5.1.orig/qtbase/src/network/kernel/qdnslookup_unix.cpp
++++ qt-everywhere-opensource-src-5.5.1/qtbase/src/network/kernel/qdnslookup_unix.cpp
+@@ -79,7 +79,7 @@ static void resolveLibrary()
+     if (!lib.load())
+ #endif
+     {
+-        lib.setFileName(QLatin1String("resolv"));
++        lib.setFileName(QLatin1String("@glibc/lib/resolv"));
+         if (!lib.load())
+             return;
+     }
+Index: qt-everywhere-opensource-src-5.5.1/qtbase/src/network/kernel/qhostinfo_unix.cpp
+===================================================================
+--- qt-everywhere-opensource-src-5.5.1.orig/qtbase/src/network/kernel/qhostinfo_unix.cpp
++++ qt-everywhere-opensource-src-5.5.1/qtbase/src/network/kernel/qhostinfo_unix.cpp
+@@ -95,7 +95,7 @@ static void resolveLibrary()
+     if (!lib.load())
+ #endif
+     {
+-        lib.setFileName(QLatin1String("resolv"));
++        lib.setFileName(QLatin1String("@glibc@/lib/libresolv"));
+         if (!lib.load())
+             return;
+     }
diff --git a/pkgs/development/libraries/qt-5/5.4/qtbase/mkspecs-libgl.patch b/pkgs/development/libraries/qt-5/5.4/qtbase/mkspecs-libgl.patch
new file mode 100644
index 000000000000..10115e8144ad
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/mkspecs-libgl.patch
@@ -0,0 +1,15 @@
+Index: qt-everywhere-opensource-src-5.5.1/qtbase/mkspecs/common/linux.conf
+===================================================================
+--- qt-everywhere-opensource-src-5.5.1.orig/qtbase/mkspecs/common/linux.conf
++++ qt-everywhere-opensource-src-5.5.1/qtbase/mkspecs/common/linux.conf
+@@ -12,8 +12,8 @@ QMAKE_INCDIR            =
+ QMAKE_LIBDIR            =
+ QMAKE_INCDIR_X11        =
+ QMAKE_LIBDIR_X11        =
+-QMAKE_INCDIR_OPENGL     =
+-QMAKE_LIBDIR_OPENGL     =
++QMAKE_INCDIR_OPENGL     = @mesa@/include
++QMAKE_LIBDIR_OPENGL     = @mesa@/lib
+ QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL
+ QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL
+ QMAKE_INCDIR_EGL        =
diff --git a/pkgs/development/libraries/qt-5/5.4/qtbase/nix-profiles-library-paths.patch b/pkgs/development/libraries/qt-5/5.4/qtbase/nix-profiles-library-paths.patch
new file mode 100644
index 000000000000..824d2ea0817f
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/nix-profiles-library-paths.patch
@@ -0,0 +1,26 @@
+Index: qt-everywhere-opensource-src-5.4.2/qtbase/src/corelib/kernel/qcoreapplication.cpp
+===================================================================
+--- qt-everywhere-opensource-src-5.4.2.orig/qtbase/src/corelib/kernel/qcoreapplication.cpp
++++ qt-everywhere-opensource-src-5.4.2/qtbase/src/corelib/kernel/qcoreapplication.cpp
+@@ -2442,6 +2442,21 @@ QStringList QCoreApplication::libraryPat
+                 }
+             }
+         }
++
++        // Add library paths derived from NIX_PROFILES.
++        const QByteArray nixProfilesEnv = qgetenv("NIX_PROFILES");
++        if (!nixProfilesEnv.isEmpty()) {
++            QLatin1Char pathSep(' ');
++            QStringList paths = QFile::decodeName(nixProfilesEnv).split(pathSep, QString::SkipEmptyParts);
++            for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) {
++                it->append("/lib/qt5/plugins");
++                QString canonicalPath = QDir(*it).canonicalPath();
++                if (!canonicalPath.isEmpty()
++                    && !app_libpaths->contains(canonicalPath)) {
++                    app_libpaths->append(canonicalPath);
++                }
++            }
++        }
+     }
+     return *(coreappdata()->app_libpaths);
+ }
diff --git a/pkgs/development/libraries/qt-5/5.4/qtbase/series b/pkgs/development/libraries/qt-5/5.4/qtbase/series
new file mode 100644
index 000000000000..3cfa50e85b70
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/series
@@ -0,0 +1,8 @@
+dlopen-resolv.patch
+tzdir.patch
+dlopen-libXcursor.patch
+dlopen-openssl.patch
+dlopen-dbus.patch
+xdg-config-dirs.patch
+nix-profiles-library-paths.patch
+compose-search-path.patch
diff --git a/pkgs/development/libraries/qt-5/5.4/qtbase/setup-hook.sh b/pkgs/development/libraries/qt-5/5.4/qtbase/setup-hook.sh
new file mode 100644
index 000000000000..b86b6df28ac8
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/setup-hook.sh
@@ -0,0 +1,100 @@
+if [[ -z "$QMAKE" ]]; then
+
+linkDependencyDir() {
+    @lndir@/bin/lndir -silent "$1/$2" "$qtOut/$2"
+    if [[ -n "$NIX_QT_SUBMODULE" ]]; then
+        find "$1/$2" -printf "$2/%P\n" >> "$out/nix-support/qt-inputs"
+    fi
+}
+
+addQtModule() {
+    if [[ -d "$1/mkspecs" ]]; then
+        # $1 is a Qt module
+        linkDependencyDir "$1" mkspecs
+
+        for dir in bin include lib share; do
+            if [[ -d "$1/$dir" ]]; then
+                linkDependencyDir "$1" "$dir"
+            fi
+        done
+    fi
+}
+
+propagateRuntimeDeps() {
+    local propagated
+    for dir in "etc/xdg" "lib/qt5/plugins" "lib/qt5/qml" "lib/qt5/imports" "share"; do
+        if [[ -d "$1/$dir" ]]; then
+            propagated=
+            for pkg in $propagatedBuildInputs; do
+                if [[ "z$pkg" == "z$1" ]]; then
+                    propagated=1
+                    break
+                fi
+            done
+            if [[ -z $propagated ]]; then
+                propagatedBuildInputs="$propagatedBuildInputs $1"
+            fi
+            break
+        fi
+    done
+}
+
+rmQtModules() {
+    cat "$out/nix-support/qt-inputs" | while read file; do
+      if [[ -h "$out/$file" ]]; then
+        rm "$out/$file"
+      fi
+    done
+
+    cat "$out/nix-support/qt-inputs" | while read file; do
+      if [[ -d "$out/$file" ]]; then
+        rmdir --ignore-fail-on-non-empty -p "$out/$file"
+      fi
+    done
+
+    rm "$out/nix-support/qt-inputs"
+}
+
+rmQMake() {
+    rm "$qtOut/bin/qmake" "$qtOut/bin/qt.conf"
+}
+
+setQMakePath() {
+    export PATH="$qtOut/bin${PATH:+:}$PATH"
+}
+
+qtOut=""
+if [[ -z "$NIX_QT_SUBMODULE" ]]; then
+    qtOut=`mktemp -d`
+else
+    qtOut=$out
+fi
+
+mkdir -p "$qtOut/bin" "$qtOut/mkspecs" "$qtOut/include" "$qtOut/nix-support" "$qtOut/lib" "$qtOut/share"
+
+cp "@out@/bin/qmake" "$qtOut/bin"
+cat >"$qtOut/bin/qt.conf" <<EOF
+[Paths]
+Prefix = $qtOut
+Plugins = lib/qt5/plugins
+Imports = lib/qt5/imports
+Qml2Imports = lib/qt5/qml
+Documentation = share/doc/qt5
+EOF
+
+export QMAKE="$qtOut/bin/qmake"
+
+envHooks+=(addQtModule propagateRuntimeDeps)
+preConfigurePhases+=(setQMakePath)
+
+if [[ -n "$NIX_QT_SUBMODULE" ]]; then
+    preFixupPhases+=(rmQtModules)
+    postPhases+=(rmQMake)
+fi
+
+fi
+
+if [[ -z "$NIX_QT_PIC" ]]; then
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC"
+    export NIX_QT_PIC=1
+fi
diff --git a/pkgs/development/libraries/qt-5/5.4/0006-tzdir.patch b/pkgs/development/libraries/qt-5/5.4/qtbase/tzdir.patch
index d5a74b25fb38..f62b25ef4457 100644
--- a/pkgs/development/libraries/qt-5/5.4/0006-tzdir.patch
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/tzdir.patch
@@ -1,17 +1,8 @@
-From 775fd74351faaabd45f6751618b28e2b05812d05 Mon Sep 17 00:00:00 2001
-From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Mon, 1 Dec 2014 17:23:22 -0600
-Subject: [PATCH] tzdir
-
----
- qtbase/src/corelib/tools/qtimezoneprivate_tz.cpp | 21 +++++++++++++++------
- 1 file changed, 15 insertions(+), 6 deletions(-)
-
-diff --git a/qtbase/src/corelib/tools/qtimezoneprivate_tz.cpp b/qtbase/src/corelib/tools/qtimezoneprivate_tz.cpp
-index b4ea91e..a56a245 100644
---- a/qtbase/src/corelib/tools/qtimezoneprivate_tz.cpp
-+++ b/qtbase/src/corelib/tools/qtimezoneprivate_tz.cpp
-@@ -68,7 +68,10 @@ typedef QHash<QByteArray, QTzTimeZone> QTzTimeZoneHash;
+Index: qt-everywhere-opensource-src-5.4.2/qtbase/src/corelib/tools/qtimezoneprivate_tz.cpp
+===================================================================
+--- qt-everywhere-opensource-src-5.4.2.orig/qtbase/src/corelib/tools/qtimezoneprivate_tz.cpp
++++ qt-everywhere-opensource-src-5.4.2/qtbase/src/corelib/tools/qtimezoneprivate_tz.cpp
+@@ -61,7 +61,10 @@ typedef QHash<QByteArray, QTzTimeZone> Q
  // Parse zone.tab table, assume lists all installed zones, if not will need to read directories
  static QTzTimeZoneHash loadTzTimeZones()
  {
@@ -23,7 +14,7 @@ index b4ea91e..a56a245 100644
      if (!QFile::exists(path))
          path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
  
-@@ -559,12 +562,18 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId)
+@@ -552,12 +555,18 @@ void QTzTimeZonePrivate::init(const QByt
          if (!tzif.open(QIODevice::ReadOnly))
              return;
      } else {
@@ -47,6 +38,3 @@ index b4ea91e..a56a245 100644
          }
      }
  
--- 
-2.1.3
-
diff --git a/pkgs/development/libraries/qt-5/5.4/0013-xdg_config_dirs.patch b/pkgs/development/libraries/qt-5/5.4/qtbase/xdg-config-dirs.patch
index 63066658f0f6..dbf5eac52e6b 100644
--- a/pkgs/development/libraries/qt-5/5.4/0013-xdg_config_dirs.patch
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase/xdg-config-dirs.patch
@@ -1,8 +1,8 @@
-diff --git a/qsettings.cpp b/qsettings.cpp
-index 35b3ed4..210dfeb 100644
---- a/qsettings.cpp
-+++ b/qtbase/src/corelib/io/qsettings.cpp
-@@ -1174,6 +1174,24 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format,
+Index: qt-everywhere-opensource-src-5.4.2/qtbase/src/corelib/io/qsettings.cpp
+===================================================================
+--- qt-everywhere-opensource-src-5.4.2.orig/qtbase/src/corelib/io/qsettings.cpp
++++ qt-everywhere-opensource-src-5.4.2/qtbase/src/corelib/io/qsettings.cpp
+@@ -1128,6 +1128,24 @@ QConfFileSettingsPrivate::QConfFileSetti
      if (!application.isEmpty())
          confFiles[F_System | F_Application].reset(QConfFile::fromName(systemPath + appFile, false));
      confFiles[F_System | F_Organization].reset(QConfFile::fromName(systemPath + orgFile, false));
@@ -27,11 +27,11 @@ index 35b3ed4..210dfeb 100644
  #else
      QString confName = getPath(format, QSettings::UserScope) + org;
      if (!application.isEmpty())
-diff --git a/qsettings_p.h b/qsettings_p.h
-index a28b583..b2a240d 100644
---- a/qsettings_p.h
-+++ b/qtbase/src/corelib/io/qsettings_p.h
-@@ -244,7 +244,7 @@ public:
+Index: qt-everywhere-opensource-src-5.4.2/qtbase/src/corelib/io/qsettings_p.h
+===================================================================
+--- qt-everywhere-opensource-src-5.4.2.orig/qtbase/src/corelib/io/qsettings_p.h
++++ qt-everywhere-opensource-src-5.4.2/qtbase/src/corelib/io/qsettings_p.h
+@@ -240,7 +240,7 @@ public:
          F_Organization = 0x1,
          F_User = 0x0,
          F_System = 0x2,
diff --git a/pkgs/development/libraries/qt-5/5.4/qtconnectivity.nix b/pkgs/development/libraries/qt-5/5.4/qtconnectivity.nix
new file mode 100644
index 000000000000..95cd6fea79b4
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtconnectivity.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qtbase, qtdeclarative }:
+
+qtSubmodule {
+  name = "qtconnectivity";
+  qtInputs = [ qtbase qtdeclarative ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtdeclarative/0001-nix-profiles-import-paths.patch b/pkgs/development/libraries/qt-5/5.4/qtdeclarative/0001-nix-profiles-import-paths.patch
new file mode 100644
index 000000000000..8e86f97a9477
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtdeclarative/0001-nix-profiles-import-paths.patch
@@ -0,0 +1,37 @@
+From 3f6fa74067aacd0e595e45b4ef7ce754514cb205 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Sat, 17 Oct 2015 09:28:18 -0500
+Subject: [PATCH] nix profiles import paths
+
+---
+ src/qml/qml/qqmlimport.cpp | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
+index 5a54609..f33c2f9 100644
+--- a/src/qml/qml/qqmlimport.cpp
++++ b/src/qml/qml/qqmlimport.cpp
+@@ -1549,6 +1549,20 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
+     QString installImportsPath =  QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
+     addImportPath(installImportsPath);
+ 
++    // Add import paths derived from NIX_PROFILES.
++    const QByteArray nixProfilesEnv = qgetenv("NIX_PROFILES");
++    if (!nixProfilesEnv.isEmpty()) {
++        QLatin1Char pathSep(' ');
++        QStringList paths = QFile::decodeName(nixProfilesEnv).split(pathSep, QString::SkipEmptyParts);
++        for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) {
++            it->append("/lib/qt5/qml");
++            QString canonicalPath = QDir(*it).canonicalPath();
++            if (!canonicalPath.isEmpty()) {
++                addImportPath(canonicalPath);
++            }
++        }
++    }
++
+     // env import paths
+     QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH");
+     if (!envImportPath.isEmpty()) {
+-- 
+2.5.2
+
diff --git a/pkgs/development/libraries/qt-5/5.4/qtdeclarative/default.nix b/pkgs/development/libraries/qt-5/5.4/qtdeclarative/default.nix
new file mode 100644
index 000000000000..9181c37b2258
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtdeclarative/default.nix
@@ -0,0 +1,8 @@
+{ qtSubmodule, python, qtbase, qtsvg, qtxmlpatterns }:
+
+qtSubmodule {
+  name = "qtdeclarative";
+  patches = [ ./0001-nix-profiles-import-paths.patch ];
+  qtInputs = [ qtbase qtsvg qtxmlpatterns ];
+  nativeBuildInputs = [ python ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtdoc.nix b/pkgs/development/libraries/qt-5/5.4/qtdoc.nix
new file mode 100644
index 000000000000..578ea6ba0b22
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtdoc.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qtdeclarative }:
+
+qtSubmodule {
+  name = "qtdoc";
+  qtInputs = [ qtdeclarative ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtenginio.nix b/pkgs/development/libraries/qt-5/5.4/qtenginio.nix
new file mode 100644
index 000000000000..b860a73ef890
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtenginio.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qtdeclarative }:
+
+qtSubmodule {
+  name = "qtenginio";
+  qtInputs = [ qtdeclarative ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtgraphicaleffects.nix b/pkgs/development/libraries/qt-5/5.4/qtgraphicaleffects.nix
new file mode 100644
index 000000000000..3273f12eb830
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtgraphicaleffects.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qtdeclarative }:
+
+qtSubmodule {
+  name = "qtgraphicaleffects";
+  qtInputs = [ qtdeclarative ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtimageformats.nix b/pkgs/development/libraries/qt-5/5.4/qtimageformats.nix
new file mode 100644
index 000000000000..03d0fffbe80e
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtimageformats.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qtbase }:
+
+qtSubmodule {
+  name = "qtimageformats";
+  qtInputs = [ qtbase ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtlocation.nix b/pkgs/development/libraries/qt-5/5.4/qtlocation.nix
new file mode 100644
index 000000000000..1e134057c4b4
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtlocation.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qtbase, qtmultimedia }:
+
+qtSubmodule {
+  name = "qtlocation";
+  qtInputs = [ qtbase qtmultimedia ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtmultimedia.nix b/pkgs/development/libraries/qt-5/5.4/qtmultimedia.nix
new file mode 100644
index 000000000000..b6b4d8ea0cf4
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtmultimedia.nix
@@ -0,0 +1,12 @@
+{ qtSubmodule, qtbase, qtdeclarative, pkgconfig
+, alsaLib, gstreamer, gst-plugins-base, libpulseaudio
+}:
+
+qtSubmodule {
+  name = "qtmultimedia";
+  qtInputs = [ qtbase qtdeclarative ];
+  buildInputs = [
+    pkgconfig alsaLib gstreamer gst-plugins-base libpulseaudio
+  ];
+  configureFlags = "GST_VERSION=1.0";
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtquick1/0001-nix-profiles-import-paths.patch b/pkgs/development/libraries/qt-5/5.4/qtquick1/0001-nix-profiles-import-paths.patch
new file mode 100644
index 000000000000..63b141f6ce5a
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtquick1/0001-nix-profiles-import-paths.patch
@@ -0,0 +1,37 @@
+From bbc706b3fcb90ca3b2b51d5e3434145572152711 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Sat, 17 Oct 2015 09:29:51 -0500
+Subject: [PATCH] nix profiles import paths
+
+---
+ src/declarative/qml/qdeclarativeimport.cpp | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp
+index 9404834..d185ed5 100644
+--- a/src/declarative/qml/qdeclarativeimport.cpp
++++ b/src/declarative/qml/qdeclarativeimport.cpp
+@@ -725,6 +725,20 @@ QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e)
+ 
+     addImportPath(installImportsPath);
+ 
++    // Add import paths derived from NIX_PROFILES.
++    const QByteArray nixProfilesEnv = qgetenv("NIX_PROFILES");
++    if (!nixProfilesEnv.isEmpty()) {
++        QLatin1Char pathSep(' ');
++        QStringList paths = QFile::decodeName(nixProfilesEnv).split(pathSep, QString::SkipEmptyParts);
++        for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) {
++            it->append("/lib/qt5/imports");
++            QString canonicalPath = QDir(*it).canonicalPath();
++            if (!canonicalPath.isEmpty()) {
++                addImportPath(canonicalPath);
++            }
++        }
++    }
++
+     // env import paths
+     QByteArray envImportPath = qgetenv("QML_IMPORT_PATH");
+     if (!envImportPath.isEmpty()) {
+-- 
+2.5.2
+
diff --git a/pkgs/development/libraries/qt-5/5.4/qtquick1/default.nix b/pkgs/development/libraries/qt-5/5.4/qtquick1/default.nix
new file mode 100644
index 000000000000..d1c7bb389a49
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtquick1/default.nix
@@ -0,0 +1,7 @@
+{ qtSubmodule, qtscript, qtsvg, qtwebkit, qtxmlpatterns }:
+
+qtSubmodule {
+  name = "qtquick1";
+  patches = [ ./0001-nix-profiles-import-paths.patch ];
+  qtInputs = [ qtscript qtsvg qtwebkit qtxmlpatterns ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtquickcontrols.nix b/pkgs/development/libraries/qt-5/5.4/qtquickcontrols.nix
new file mode 100644
index 000000000000..93a864621b82
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtquickcontrols.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qtdeclarative }:
+
+qtSubmodule {
+  name = "qtquickcontrols";
+  qtInputs = [ qtdeclarative ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtscript/0001-glib-2.32.patch b/pkgs/development/libraries/qt-5/5.4/qtscript/0001-glib-2.32.patch
new file mode 100644
index 000000000000..887e107b6c1b
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtscript/0001-glib-2.32.patch
@@ -0,0 +1,25 @@
+From abd80356449bb36c8adcc5c9ca1df6b47715d265 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Sun, 23 Aug 2015 09:13:34 -0500
+Subject: [PATCH] glib-2.32
+
+---
+ src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
+index 1f6d25e..087c3fb 100644
+--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
++++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
+@@ -81,7 +81,7 @@
+ #include <pthread.h>
+ #elif PLATFORM(GTK)
+ #include <wtf/gtk/GOwnPtr.h>
+-typedef struct _GMutex GMutex;
++typedef union _GMutex GMutex;
+ typedef struct _GCond GCond;
+ #endif
+ 
+-- 
+2.5.0
+
diff --git a/pkgs/development/libraries/qt-5/5.4/qtscript/default.nix b/pkgs/development/libraries/qt-5/5.4/qtscript/default.nix
new file mode 100644
index 000000000000..127766e2ebd6
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtscript/default.nix
@@ -0,0 +1,7 @@
+{ qtSubmodule, qtbase, qttools }:
+
+qtSubmodule {
+  name = "qtscript";
+  qtInputs = [ qtbase qttools ];
+  patches = [ ./0001-glib-2.32.patch ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtsensors.nix b/pkgs/development/libraries/qt-5/5.4/qtsensors.nix
new file mode 100644
index 000000000000..61e64dc47e4d
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtsensors.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qtbase, qtdeclarative }:
+
+qtSubmodule {
+  name = "qtsensors";
+  qtInputs = [ qtbase qtdeclarative ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/0009-dlopen-serialport-udev.patch b/pkgs/development/libraries/qt-5/5.4/qtserialport/0001-dlopen-serialport-udev.patch
index e1e66a3ce95a..6636cc9265a8 100644
--- a/pkgs/development/libraries/qt-5/5.4/0009-dlopen-serialport-udev.patch
+++ b/pkgs/development/libraries/qt-5/5.4/qtserialport/0001-dlopen-serialport-udev.patch
@@ -1,17 +1,17 @@
-From 17c7257e54c00ea2121f2cf95fb2be5e5db6b4ad Mon Sep 17 00:00:00 2001
+From d81c2c870b9bea8fb8e6b85baefb06542f568338 Mon Sep 17 00:00:00 2001
 From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Mon, 1 Dec 2014 17:31:03 -0600
-Subject: [PATCH] dlopen-serialport-udev
+Date: Sun, 23 Aug 2015 09:16:02 -0500
+Subject: [PATCH] dlopen serialport udev
 
 ---
- qtserialport/src/serialport/qtudev_p.h | 4 ++--
+ src/serialport/qtudev_p.h | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
-diff --git a/qtserialport/src/serialport/qtudev_p.h b/qtserialport/src/serialport/qtudev_p.h
-index 09940ab..45460f9 100644
---- a/qtserialport/src/serialport/qtudev_p.h
-+++ b/qtserialport/src/serialport/qtudev_p.h
-@@ -119,9 +119,9 @@ inline void *resolveSymbol(QLibrary *udevLibrary, const char *symbolName)
+diff --git a/src/serialport/qtudev_p.h b/src/serialport/qtudev_p.h
+index 6f2cabd..81b9849 100644
+--- a/src/serialport/qtudev_p.h
++++ b/src/serialport/qtudev_p.h
+@@ -105,9 +105,9 @@ inline QFunctionPointer resolveSymbol(QLibrary *udevLibrary, const char *symbolN
  inline bool resolveSymbols(QLibrary *udevLibrary)
  {
      if (!udevLibrary->isLoaded()) {
@@ -24,5 +24,5 @@ index 09940ab..45460f9 100644
                  qWarning("Failed to load the library: %s, supported version(s): %i and %i", qPrintable(udevLibrary->fileName()), 1, 0);
                  return false;
 -- 
-2.1.3
+2.5.0
 
diff --git a/pkgs/development/libraries/qt-5/5.4/qtserialport/default.nix b/pkgs/development/libraries/qt-5/5.4/qtserialport/default.nix
new file mode 100644
index 000000000000..fa7383fc1e76
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtserialport/default.nix
@@ -0,0 +1,7 @@
+{ qtSubmodule, qtbase }:
+
+qtSubmodule {
+  name = "qtserialport";
+  qtInputs = [ qtbase ];
+  patches = [ ./0001-dlopen-serialport-udev.patch ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtsvg.nix b/pkgs/development/libraries/qt-5/5.4/qtsvg.nix
new file mode 100644
index 000000000000..b9ccac7cf933
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtsvg.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qtbase }:
+
+qtSubmodule {
+  name = "qtsvg";
+  qtInputs = [ qtbase ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qttools.nix b/pkgs/development/libraries/qt-5/5.4/qttools.nix
new file mode 100644
index 000000000000..65edc4508128
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qttools.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qtbase }:
+
+qtSubmodule {
+  name = "qttools";
+  qtInputs = [ qtbase ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qttranslations.nix b/pkgs/development/libraries/qt-5/5.4/qttranslations.nix
new file mode 100644
index 000000000000..50fc8cf6826a
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qttranslations.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qttools }:
+
+qtSubmodule {
+  name = "qttranslations";
+  qtInputs = [ qttools ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtwebkit-examples.nix b/pkgs/development/libraries/qt-5/5.4/qtwebkit-examples.nix
new file mode 100644
index 000000000000..64f85c42d198
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtwebkit-examples.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qttools, qtwebkit }:
+
+qtSubmodule {
+  name = "qtwebkit-examples";
+  qtInputs = [ qttools qtwebkit ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/0002-dlopen-webkit-nsplugin.patch b/pkgs/development/libraries/qt-5/5.4/qtwebkit/0001-dlopen-webkit-nsplugin.patch
index 0752cdcf4793..0eeacce1bc05 100644
--- a/pkgs/development/libraries/qt-5/5.4/0002-dlopen-webkit-nsplugin.patch
+++ b/pkgs/development/libraries/qt-5/5.4/qtwebkit/0001-dlopen-webkit-nsplugin.patch
@@ -1,19 +1,19 @@
-From 8c30f72dbe11752e8ed25f292c6e5695d7733f72 Mon Sep 17 00:00:00 2001
+From 862ce7d357a3ec32683ac6ec7c0ebdc9346b44ba Mon Sep 17 00:00:00 2001
 From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Mon, 1 Dec 2014 17:22:23 -0600
-Subject: [PATCH] dlopen-webkit-nsplugin
+Date: Sun, 23 Aug 2015 09:18:54 -0500
+Subject: [PATCH 1/3] dlopen webkit nsplugin
 
 ---
- qtwebkit/Source/WebCore/plugins/qt/PluginPackageQt.cpp                  | 2 +-
- qtwebkit/Source/WebCore/plugins/qt/PluginViewQt.cpp                     | 2 +-
- .../WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp       | 2 +-
+ Source/WebCore/plugins/qt/PluginPackageQt.cpp                        | 2 +-
+ Source/WebCore/plugins/qt/PluginViewQt.cpp                           | 2 +-
+ Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)
 
-diff --git a/qtwebkit/Source/WebCore/plugins/qt/PluginPackageQt.cpp b/qtwebkit/Source/WebCore/plugins/qt/PluginPackageQt.cpp
-index 679480b..2c373cc 100644
---- a/qtwebkit/Source/WebCore/plugins/qt/PluginPackageQt.cpp
-+++ b/qtwebkit/Source/WebCore/plugins/qt/PluginPackageQt.cpp
-@@ -132,7 +132,7 @@ static void initializeGtk(QLibrary* module = 0)
+diff --git a/Source/WebCore/plugins/qt/PluginPackageQt.cpp b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
+index a923d49..2731d05 100644
+--- a/Source/WebCore/plugins/qt/PluginPackageQt.cpp
++++ b/Source/WebCore/plugins/qt/PluginPackageQt.cpp
+@@ -136,7 +136,7 @@ static void initializeGtk(QLibrary* module = 0)
          }
      }
  
@@ -22,10 +22,10 @@ index 679480b..2c373cc 100644
      if (library.load()) {
          typedef void *(*gtk_init_check_ptr)(int*, char***);
          gtk_init_check_ptr gtkInitCheck = (gtk_init_check_ptr)library.resolve("gtk_init_check");
-diff --git a/qtwebkit/Source/WebCore/plugins/qt/PluginViewQt.cpp b/qtwebkit/Source/WebCore/plugins/qt/PluginViewQt.cpp
+diff --git a/Source/WebCore/plugins/qt/PluginViewQt.cpp b/Source/WebCore/plugins/qt/PluginViewQt.cpp
 index de06a2f..363bde5 100644
---- a/qtwebkit/Source/WebCore/plugins/qt/PluginViewQt.cpp
-+++ b/qtwebkit/Source/WebCore/plugins/qt/PluginViewQt.cpp
+--- a/Source/WebCore/plugins/qt/PluginViewQt.cpp
++++ b/Source/WebCore/plugins/qt/PluginViewQt.cpp
 @@ -697,7 +697,7 @@ static Display *getPluginDisplay()
      // support gdk based plugins (like flash) that use a different X connection.
      // The code below has the same effect as this one:
@@ -35,10 +35,10 @@ index de06a2f..363bde5 100644
      if (!library.load())
          return 0;
  
-diff --git a/qtwebkit/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp b/qtwebkit/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
+diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
 index d734ff6..62a2197 100644
---- a/qtwebkit/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
-+++ b/qtwebkit/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
+--- a/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
++++ b/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
 @@ -64,7 +64,7 @@ static Display* getPluginDisplay()
      // The code below has the same effect as this one:
      // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
@@ -49,5 +49,5 @@ index d734ff6..62a2197 100644
          return 0;
  
 -- 
-2.1.3
+2.5.0
 
diff --git a/pkgs/development/libraries/qt-5/5.4/0007-dlopen-webkit-gtk.patch b/pkgs/development/libraries/qt-5/5.4/qtwebkit/0002-dlopen-webkit-gtk.patch
index 9582b714c903..bb5d1f74364c 100644
--- a/pkgs/development/libraries/qt-5/5.4/0007-dlopen-webkit-gtk.patch
+++ b/pkgs/development/libraries/qt-5/5.4/qtwebkit/0002-dlopen-webkit-gtk.patch
@@ -1,16 +1,16 @@
-From 089db8835c80bf2b7dd91a97a5c6eb26636b6ab9 Mon Sep 17 00:00:00 2001
+From 6a407d30357c2551abceac75c82f4a1688e47437 Mon Sep 17 00:00:00 2001
 From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Mon, 1 Dec 2014 17:26:39 -0600
-Subject: [PATCH] dlopen-webkit-gtk
+Date: Sun, 23 Aug 2015 09:19:16 -0500
+Subject: [PATCH 2/3] dlopen webkit gtk
 
 ---
- qtwebkit/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp | 2 +-
+ Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/qtwebkit/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp b/qtwebkit/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
+diff --git a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
 index 8de6521..0b25748 100644
---- a/qtwebkit/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
-+++ b/qtwebkit/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
+--- a/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
++++ b/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
 @@ -53,7 +53,7 @@ static void messageHandler(QtMsgType type, const QMessageLogContext&, const QStr
  
  static bool initializeGtk()
@@ -21,5 +21,5 @@ index 8de6521..0b25748 100644
          return false;
      typedef void* (*gtk_init_ptr)(void*, void*);
 -- 
-2.1.3
+2.5.0
 
diff --git a/pkgs/development/libraries/qt-5/5.4/0008-dlopen-webkit-udev.patch b/pkgs/development/libraries/qt-5/5.4/qtwebkit/0003-dlopen-webkit-udev.patch
index e8a4ba6a2151..f3b9d407bd72 100644
--- a/pkgs/development/libraries/qt-5/5.4/0008-dlopen-webkit-udev.patch
+++ b/pkgs/development/libraries/qt-5/5.4/qtwebkit/0003-dlopen-webkit-udev.patch
@@ -1,16 +1,16 @@
-From 25d2922cce383fcaa4c138e0cc6c8d92328eeacb Mon Sep 17 00:00:00 2001
+From 864020dd47c3b6d532d9f26b82185904cf9324f2 Mon Sep 17 00:00:00 2001
 From: Thomas Tuegel <ttuegel@gmail.com>
-Date: Mon, 1 Dec 2014 17:30:41 -0600
-Subject: [PATCH] dlopen-webkit-udev
+Date: Sun, 23 Aug 2015 09:19:29 -0500
+Subject: [PATCH 3/3] dlopen webkit udev
 
 ---
- qtwebkit/Source/WebCore/platform/qt/GamepadsQt.cpp | 4 ++--
+ Source/WebCore/platform/qt/GamepadsQt.cpp | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
-diff --git a/qtwebkit/Source/WebCore/platform/qt/GamepadsQt.cpp b/qtwebkit/Source/WebCore/platform/qt/GamepadsQt.cpp
+diff --git a/Source/WebCore/platform/qt/GamepadsQt.cpp b/Source/WebCore/platform/qt/GamepadsQt.cpp
 index 60ff317..da8ac69 100644
---- a/qtwebkit/Source/WebCore/platform/qt/GamepadsQt.cpp
-+++ b/qtwebkit/Source/WebCore/platform/qt/GamepadsQt.cpp
+--- a/Source/WebCore/platform/qt/GamepadsQt.cpp
++++ b/Source/WebCore/platform/qt/GamepadsQt.cpp
 @@ -111,12 +111,12 @@ private:
      bool load()
      {
@@ -27,5 +27,5 @@ index 60ff317..da8ac69 100644
          return resolveMethods();
      }
 -- 
-2.1.3
+2.5.0
 
diff --git a/pkgs/development/libraries/qt-5/5.4/qtwebkit/default.nix b/pkgs/development/libraries/qt-5/5.4/qtwebkit/default.nix
new file mode 100644
index 000000000000..596c02d39afb
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtwebkit/default.nix
@@ -0,0 +1,33 @@
+{ qtSubmodule, stdenv, qtdeclarative, qtlocation, qtmultimedia, qtsensors
+, fontconfig, gdk_pixbuf, gtk, libwebp, libxml2, libxslt
+, sqlite, udev
+, bison2, flex, gdb, gperf, perl, pkgconfig, python, ruby
+, substituteAll
+, flashplayerFix ? false
+}:
+
+with stdenv.lib;
+
+qtSubmodule {
+  name = "qtwebkit";
+  qtInputs = [ qtdeclarative qtlocation qtmultimedia qtsensors ];
+  buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite ];
+  nativeBuildInputs = [
+    bison2 flex gdb gperf perl pkgconfig python ruby
+  ];
+  patches =
+    let dlopen-webkit-nsplugin = substituteAll {
+          src = ./0001-dlopen-webkit-nsplugin.patch;
+          inherit gtk gdk_pixbuf;
+        };
+        dlopen-webkit-gtk = substituteAll {
+          src = ./0002-dlopen-webkit-gtk.patch;
+          inherit gtk;
+        };
+        dlopen-webkit-udev = substituteAll {
+          src = ./0003-dlopen-webkit-udev.patch;
+          inherit udev;
+        };
+    in optionals flashplayerFix [ dlopen-webkit-nsplugin dlopen-webkit-gtk ]
+    ++ [ dlopen-webkit-udev ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtwebsockets.nix b/pkgs/development/libraries/qt-5/5.4/qtwebsockets.nix
new file mode 100644
index 000000000000..fbdfbbcf0dbe
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtwebsockets.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qtbase, qtdeclarative }:
+
+qtSubmodule {
+  name = "qtwebsockets";
+  qtInputs = [ qtbase qtdeclarative ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtx11extras.nix b/pkgs/development/libraries/qt-5/5.4/qtx11extras.nix
new file mode 100644
index 000000000000..a765161e2d7e
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtx11extras.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qtbase }:
+
+qtSubmodule {
+  name = "qtx11extras";
+  qtInputs = [ qtbase ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/qtxmlpatterns.nix b/pkgs/development/libraries/qt-5/5.4/qtxmlpatterns.nix
new file mode 100644
index 000000000000..9a8ddbba2bd2
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtxmlpatterns.nix
@@ -0,0 +1,6 @@
+{ qtSubmodule, qtbase }:
+
+qtSubmodule {
+  name = "qtxmlpatterns";
+  qtInputs = [ qtbase ];
+}
diff --git a/pkgs/development/libraries/qt-5/5.4/setup-hook.sh b/pkgs/development/libraries/qt-5/5.4/setup-hook.sh
deleted file mode 100644
index 3bc4890f3bb2..000000000000
--- a/pkgs/development/libraries/qt-5/5.4/setup-hook.sh
+++ /dev/null
@@ -1,77 +0,0 @@
-addQtModule() {
-    if [[ -d "$1/mkspecs" ]]; then
-
-        @lndir@/bin/lndir -silent "$1/mkspecs" "$qtOut/mkspecs"
-        if [[ -n $qtSubmodule ]]; then
-            find "$1/mkspecs" -printf 'mkspecs/%P\n' >> "$qtOut/nix-support/qt-inputs"
-        fi
-
-        if [[ -d "$1/bin" ]]; then
-            @lndir@/bin/lndir -silent "$1/bin" "$qtOut/bin"
-            if [[ -n $qtSubmodule ]]; then
-                find "$1/bin" -printf 'bin/%P\n' >> "$qtOut/nix-support/qt-inputs"
-            fi
-        fi
-
-        if [[ -d "$1/include" ]]; then
-            @lndir@/bin/lndir -silent "$1/include" "$qtOut/include"
-            if [[ -n $qtSubmodule ]]; then
-                find "$1/include" -printf 'include/%P\n' >> "$qtOut/nix-support/qt-inputs"
-            fi
-        fi
-
-        if [[ -d "$1/lib" ]]; then
-            @lndir@/bin/lndir -silent "$1/lib" "$qtOut/lib"
-            if [[ -n $qtSubmodule ]]; then
-                find "$1/lib" -printf 'lib/%P\n' >> "$qtOut/nix-support/qt-inputs"
-            fi
-
-            if [[ -d "$1/lib/qt5/plugins" ]]; then
-                QT_PLUGIN_PATH="$QT_PLUGIN_PATH${QT_PLUGIN_PATH:+:}$1/lib/qt5/plugins";
-            fi
-
-            if [[ -d "$1/lib/qt5/imports" ]]; then
-                QML_IMPORT_PATH="$QML_IMPORT_PATH${QML_IMPORT_PATH:+:}$1/lib/qt5/imports";
-            fi
-
-            if [[ -d "$1/lib/qt5/qml" ]]; then
-                QML2_IMPORT_PATH="$QML2_IMPORT_PATH${QML2_IMPORT_PATH:+:}$1/lib/qt5/qml";
-            fi
-        fi
-
-        if [[ -d "$1/share" ]]; then
-            @lndir@/bin/lndir -silent "$1/share" "$qtOut/share"
-            if [[ -n $qtSubmodule ]]; then
-                find "$1/share" -printf 'share/%P\n' >> "$qtOut/nix-support/qt-inputs"
-            fi
-        fi
-    fi
-}
-
-setQMakePath() {
-    export PATH="$qtOut/bin${PATH:+:}$PATH"
-}
-
-qtOut=""
-if [[ -z $qtSubmodule ]]; then
-    qtOut="$PWD/qmake-$name"
-else
-    qtOut=$out
-fi
-
-mkdir -p "$qtOut/bin" "$qtOut/mkspecs" "$qtOut/include" \
-         "$qtOut/nix-support" "$qtOut/lib" "$qtOut/share"
-
-cp "@out@/bin/qmake" "$qtOut/bin"
-cat >"$qtOut/bin/qt.conf" <<EOF
-[Paths]
-Prefix = $qtOut
-Plugins = lib/qt5/plugins
-Imports = lib/qt5/imports
-Qml2Imports = lib/qt5/qml
-Documentation = share/doc/qt5
-EOF
-export QMAKE="$qtOut/bin/qmake"
-
-envHooks+=(addQtModule)
-preConfigurePhases+=" setQMakePath"
diff --git a/pkgs/development/libraries/qt-5/5.4/srcs.nix b/pkgs/development/libraries/qt-5/5.4/srcs.nix
new file mode 100644
index 000000000000..dd873f5961b3
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/srcs.nix
@@ -0,0 +1,245 @@
+# DO NOT EDIT! This file is generated automatically by manifest.sh
+{ fetchurl, mirror }:
+
+{
+  qtbase = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtbase-opensource-src-5.4.2.tar.xz";
+      sha256 = "0x2szpjjvsrpcqw0dd3gsim7b1jv9p716pnllzjbia5mp0hggi4z";
+      name = "qtbase-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtenginio = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtenginio-opensource-src-5.4.2.tar.xz";
+      sha256 = "082i3fapjw6xs0jkz7x529dn3pb6w1pfli3cjrgvggff86gwlgwn";
+      name = "qtenginio-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtserialport = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtserialport-opensource-src-5.4.2.tar.xz";
+      sha256 = "1h6p5rb0ldxgzd4md3n79gy0j9blhj736670xqjd9vlvh1743kck";
+      name = "qtserialport-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtscript = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtscript-opensource-src-5.4.2.tar.xz";
+      sha256 = "0izsmy0cr8iii78r10ndkidyljxqd2k9g03f5xb9nxacvr2f8hp0";
+      name = "qtscript-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtwebchannel = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtwebchannel-opensource-src-5.4.2.tar.xz";
+      sha256 = "0vy1zjbghfa1wirxd8fd2n2n8yryykzr09913qm2nlfbcxdsgqsn";
+      name = "qtwebchannel-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtwinextras = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtwinextras-opensource-src-5.4.2.tar.xz";
+      sha256 = "0sgybvr1y2xsddlqc95ninxj3rfmd4gv7a8f7rqcxdynjan5gij0";
+      name = "qtwinextras-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtwebsockets = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtwebsockets-opensource-src-5.4.2.tar.xz";
+      sha256 = "0lv1la8333qnirxmscs42xnnra0xry1gjbhi3bxrf1hrfs2im9j4";
+      name = "qtwebsockets-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtmultimedia = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtmultimedia-opensource-src-5.4.2.tar.xz";
+      sha256 = "0h29cs8ajnjarhjx1aczdnxqwvg6pqs9s8w28hw488s149wqqrnj";
+      name = "qtmultimedia-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtgraphicaleffects = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtgraphicaleffects-opensource-src-5.4.2.tar.xz";
+      sha256 = "02p8xm5ajicjam30ry3g1lm2p4nja2q0sls8dzimqrxhw5xlg3xs";
+      name = "qtgraphicaleffects-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtxmlpatterns = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtxmlpatterns-opensource-src-5.4.2.tar.xz";
+      sha256 = "0ar7znqp1i02ha5ngy2kzk3hlgkafjbn2xa8j2k78gzmwsmdhzxa";
+      name = "qtxmlpatterns-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qttranslations = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qttranslations-opensource-src-5.4.2.tar.xz";
+      sha256 = "0b4l69c16z8gjd4mq75zz3lj2gxarr9wyk0vk60jg1mi62vxvdls";
+      name = "qttranslations-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtdeclarative = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtdeclarative-opensource-src-5.4.2.tar.xz";
+      sha256 = "1bj1wwms6lpj8s70y8by3j0hjsw6g9v8m6fybx68krzzizbj2c5p";
+      name = "qtdeclarative-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtwebkit = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtwebkit-opensource-src-5.4.2.tar.xz";
+      sha256 = "0vffbpiczag2n2hp5gc0nii8n7vkidr8f8pp8a47px0183hl6hiy";
+      name = "qtwebkit-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtquick1 = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtquick1-opensource-src-5.4.2.tar.xz";
+      sha256 = "0178z15a31fw3l6933fwxs7sk0csifpwckydp3rqnn3fg5f2fwvp";
+      name = "qtquick1-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtquickcontrols = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtquickcontrols-opensource-src-5.4.2.tar.xz";
+      sha256 = "137z3c3drxlvkdfc7zgcl0xqmavw0ladzqy0i3bq51h756qdc877";
+      name = "qtquickcontrols-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtimageformats = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtimageformats-opensource-src-5.4.2.tar.xz";
+      sha256 = "1nny6j9pm5ri3n1vwl5lrfrdz0fl81rx127wa49rkg2rjai2aawb";
+      name = "qtimageformats-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtdoc = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtdoc-opensource-src-5.4.2.tar.xz";
+      sha256 = "15lamv6jvd7v33ldpcrazcdksv6qibdcgh4ncbyh774k8avgrlh8";
+      name = "qtdoc-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtwayland = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtwayland-opensource-src-5.4.2.tar.xz";
+      sha256 = "14pmpkfq70plw07igxjaiji4vnjg5kg7izlb0wwym1lisg7bwkg0";
+      name = "qtwayland-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtmacextras = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtmacextras-opensource-src-5.4.2.tar.xz";
+      sha256 = "0h0p3s0rvd3g9rgr4hwcggdbsav2g30vijqwmdxgxd8c00yply80";
+      name = "qtmacextras-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtactiveqt = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtactiveqt-opensource-src-5.4.2.tar.xz";
+      sha256 = "014kwficqydciwdm1yw88yms81qm8pmi6xfhhfpbc9k85pc6jlla";
+      name = "qtactiveqt-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtlocation = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtlocation-opensource-src-5.4.2.tar.xz";
+      sha256 = "1v43hl2zzi90vaw11y8dvsksrjn0r2v0br7pw6njl8lqadpg4jnw";
+      name = "qtlocation-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtconnectivity = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtconnectivity-opensource-src-5.4.2.tar.xz";
+      sha256 = "1nj68bzgm3r1gg171kj0acnifzb3jx0m5pf4f81xb7zl4hfxasrs";
+      name = "qtconnectivity-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtx11extras = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtx11extras-opensource-src-5.4.2.tar.xz";
+      sha256 = "0jgyywjxavfpiz8202g3s0g9izfl185mmak4fs9h80w1i3gn5zzn";
+      name = "qtx11extras-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qttools = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qttools-opensource-src-5.4.2.tar.xz";
+      sha256 = "1d5nx01r7wxhdg9f1i9xhsvsbwgaz3yv516s068riy970bhdgwzd";
+      name = "qttools-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtsensors = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtsensors-opensource-src-5.4.2.tar.xz";
+      sha256 = "1yawvjbdymgw8af7ir9zcin89xxck9dm2l6hnc43lwrky0frcvcf";
+      name = "qtsensors-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtwebengine = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtwebengine-opensource-src-5.4.2.tar.xz";
+      sha256 = "06cyl733prakniqrn8sd807lclk5im2vmysjdcijry2mcyah2ih8";
+      name = "qtwebengine-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtsvg = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtsvg-opensource-src-5.4.2.tar.xz";
+      sha256 = "1dsyncp154xvb7d82nmnfjm0ngymnhqmliq58ljwxsjmpjlncakz";
+      name = "qtsvg-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qt5 = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qt5-opensource-src-5.4.2.tar.xz";
+      sha256 = "17a0pybr4bpyv9pj7cr5hl4g31biv89bjr8zql723h0b12ql1w44";
+      name = "qt5-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtwebkit-examples = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtwebkit-examples-opensource-src-5.4.2.tar.xz";
+      sha256 = "0pm9ik1j09jfb5xflc16449nff2xsfyfms7vxlcdjg4dhcqfmll8";
+      name = "qtwebkit-examples-opensource-src-5.4.2.tar.xz";
+    };
+  };
+  qtandroidextras = {
+    version = "5.4.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.2/submodules/qtandroidextras-opensource-src-5.4.2.tar.xz";
+      sha256 = "0krfm0wg26x7575p8isswdhrkb0jxyp169grwklil7mfw8yg3xhx";
+      name = "qtandroidextras-opensource-src-5.4.2.tar.xz";
+    };
+  };
+}
diff --git a/pkgs/development/libraries/qt-5/5.5/default.nix b/pkgs/development/libraries/qt-5/5.5/default.nix
index 4bb24427b9fd..9b1324d11373 100644
--- a/pkgs/development/libraries/qt-5/5.5/default.nix
+++ b/pkgs/development/libraries/qt-5/5.5/default.nix
@@ -101,6 +101,14 @@ let
       qtx11extras = callPackage ./qtx11extras.nix {};
       qtxmlpatterns = callPackage ./qtxmlpatterns.nix {};
 
+      env = callPackage ../qt-env.nix {};
+      full = env "qt-${qtbase.version}" [
+        qtconnectivity qtdeclarative qtdoc qtenginio qtgraphicaleffects qtimageformats
+        qtlocation qtmultimedia qtquick1 qtquickcontrols qtscript qtsensors qtserialport
+        qtsvg qttools qttranslations qtwebkit qtwebkit-examples qtwebsockets qtx11extras
+        qtxmlpatterns
+      ];
+
       makeQtWrapper = makeSetupHook { deps = [ makeWrapper ]; } ./make-qt-wrapper.sh;
 
     };
diff --git a/pkgs/development/libraries/qt-5/qt-env.nix b/pkgs/development/libraries/qt-5/qt-env.nix
index e6973015acaa..11c6ac74d5f6 100644
--- a/pkgs/development/libraries/qt-5/qt-env.nix
+++ b/pkgs/development/libraries/qt-5/qt-env.nix
@@ -1,8 +1,6 @@
-{ runCommand, lndir }:
+{ runCommand, lndir, qtbase }: name: paths:
 
-{ paths, qtbase }:
-
-runCommand "qt-env" { inherit paths qtbase; } ''
+runCommand name { inherit paths qtbase; } ''
 
 mkdir -p "$out/bin" "$out/mkspecs" "$out/include" "$out/lib" "$out/share"
 
diff --git a/pkgs/development/libraries/quazip/default.nix b/pkgs/development/libraries/quazip/default.nix
index 119fda9eb80a..4db9d8b4665f 100644
--- a/pkgs/development/libraries/quazip/default.nix
+++ b/pkgs/development/libraries/quazip/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   installFlags = "INSTALL_ROOT=$(out)";
 
-  buildInputs = [ zlib (qt.base or qt) ];
+  buildInputs = [ zlib qt ];
 
   meta = {
     description = "Provides access to ZIP archives from Qt programs";
diff --git a/pkgs/development/libraries/qwt/6.nix b/pkgs/development/libraries/qwt/6.nix
index 822b888843e1..d4819d70bfc8 100644
--- a/pkgs/development/libraries/qwt/6.nix
+++ b/pkgs/development/libraries/qwt/6.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt5 }:
+{ stdenv, fetchurl, qtbase, qtsvg, qttools }:
 
 stdenv.mkDerivation rec {
   name = "qwt-6.1.2";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "031x4hz1jpbirv9k35rqb52bb9mf2w7qav89qv1yfw1r3n6z221b";
   };
 
-  propagatedBuildInputs = [ qt5.base qt5.svg qt5.tools ];
+  propagatedBuildInputs = [ qtbase qtsvg qttools ];
 
   postPatch = ''
     sed -e "s|QWT_INSTALL_PREFIX.*=.*|QWT_INSTALL_PREFIX = $out|g" -i qwtconfig.pri
diff --git a/pkgs/development/libraries/signon/old.nix b/pkgs/development/libraries/signon/old.nix
deleted file mode 100644
index bf211c3b8a34..000000000000
--- a/pkgs/development/libraries/signon/old.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{ stdenv, fetchurl, doxygen, qt5 }:
-
-stdenv.mkDerivation rec {
-  name = "signon-${version}";
-  version = "8.57";
-  src = fetchurl {
-    url = "https://gitlab.com/accounts-sso/signond/repository/archive.tar.gz?ref=${version}";
-    sha256 = "1vqkxhmdjk3217k38l2s3wld8x7f4jrbbh6xbr036cn1r23ncni5";
-  };
-
-  buildInputs = [ qt5.base ];
-  nativeBuildInputs = [ doxygen ];
-
-  configurePhase = ''
-    qmake PREFIX=$out LIBDIR=$out/lib CMAKE_CONFIG_PATH=$out/lib/cmake/SignOnQt5
-  '';
-
-}
diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix
index bb1d91b3ca83..c2e5cb1a763e 100644
--- a/pkgs/development/python-modules/pyqt/5.x.nix
+++ b/pkgs/development/python-modules/pyqt/5.x.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, python, pkgconfig, qt5, sip, pythonDBus, lndir, makeWrapper }:
+{ stdenv, fetchurl, python, pkgconfig, qtbase, qtsvg, qtwebkit, sip, pythonDBus
+, lndir, makeWrapper }:
 
 let
   version = "5.4.2";
@@ -20,7 +21,7 @@ in stdenv.mkDerivation {
 
   buildInputs = [
     python pkgconfig makeWrapper lndir
-    qt5.base qt5.svg qt5.webkit
+    qtbase qtsvg qtwebkit
   ];
 
   propagatedBuildInputs = [ sip ];
diff --git a/pkgs/development/qtcreator/default.nix b/pkgs/development/qtcreator/default.nix
index 4051ac218368..c0647a6df4a5 100644
--- a/pkgs/development/qtcreator/default.nix
+++ b/pkgs/development/qtcreator/default.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchurl, makeWrapper, qtLib, withDocumentation ? false }:
+{ stdenv, fetchurl, makeWrapper
+, qtbase, qtquickcontrols, qtscript, qtdeclarative
+, withDocumentation ? false
+}:
 
 with stdenv.lib;
 
@@ -16,7 +19,7 @@ stdenv.mkDerivation rec {
     sha256 = "0r9ysq9hzig4ag9m8pcpw1jng2fqqns8zwp0jj893gh8ia0sq9ar";
   };
 
-  buildInputs = [ makeWrapper qtLib.base qtLib.script qtLib.quickcontrols qtLib.declarative ];
+  buildInputs = [ makeWrapper qtbase qtscript qtquickcontrols qtdeclarative ];
 
   doCheck = false;
 
@@ -45,8 +48,8 @@ stdenv.mkDerivation rec {
     Categories=Qt;Development;IDE;
     __EOF__
     # Wrap the qtcreator binary
-    addToSearchPath QML2_IMPORT_PATH "${qtLib.quickcontrols}/lib/qt5/qml"
-    addToSearchPath QML2_IMPORT_PATH "${qtLib.declarative}/lib/qt5/qml"
+    addToSearchPath QML2_IMPORT_PATH "${qtquickcontrols}/lib/qt5/qml"
+    addToSearchPath QML2_IMPORT_PATH "${qtdeclarative}/lib/qt5/qml"
     wrapProgram $out/bin/qtcreator \
       --prefix QT_PLUGIN_PATH : "$QT_PLUGIN_PATH" \
       --prefix QML_IMPORT_PATH : "$QML_IMPORT_PATH" \
diff --git a/pkgs/misc/emulators/mgba/default.nix b/pkgs/misc/emulators/mgba/default.nix
index edf4c6a060dc..ea11e3a33e2b 100644
--- a/pkgs/misc/emulators/mgba/default.nix
+++ b/pkgs/misc/emulators/mgba/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, pkgconfig, cmake, ffmpeg, imagemagick, libzip, SDL2, qt5 }:
+{ stdenv, fetchurl, pkgconfig, cmake, ffmpeg, imagemagick, libzip, SDL2
+, qtbase, qtmultimedia }:
 
 stdenv.mkDerivation rec {
   name = "mgba-${meta.version}";
@@ -9,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     pkgconfig cmake ffmpeg imagemagick libzip SDL2
-    qt5.base qt5.multimedia
+    qtbase qtmultimedia
   ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/tools/graphics/kst/default.nix b/pkgs/tools/graphics/kst/default.nix
index 01fb5d829947..9b983450f480 100644
--- a/pkgs/tools/graphics/kst/default.nix
+++ b/pkgs/tools/graphics/kst/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, cmake, pkgconfig
-, qt5, gsl, getdata, netcdf, muparser, matio
+, qtbase, gsl, getdata, netcdf, muparser, matio
 }:
 stdenv.mkDerivation rec {
   name = "Kst-2.0.8";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ cmake pkgconfig ];
-  buildInputs = [ qt5.base gsl getdata netcdf muparser matio ];
+  buildInputs = [ qtbase gsl getdata netcdf muparser matio ];
 
   cmakeFlags = "-Dkst_qt5=1 -Dkst_release=1";
 
diff --git a/pkgs/tools/misc/antimicro/default.nix b/pkgs/tools/misc/antimicro/default.nix
index a2eed9139306..1d7984ac11da 100644
--- a/pkgs/tools/misc/antimicro/default.nix
+++ b/pkgs/tools/misc/antimicro/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, pkgconfig, SDL2, qt5, xorg, fetchzip }:
+{ stdenv, cmake, pkgconfig, SDL2, qtbase, qttools, xorg, fetchzip }:
 
 stdenv.mkDerivation rec {
   name = "antimicro-${version}";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [
-    cmake pkgconfig SDL2 qt5.base qt5.tools xorg.libXtst
+    cmake pkgconfig SDL2 qtbase qttools xorg.libXtst
   ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/tools/misc/calamares/default.nix b/pkgs/tools/misc/calamares/default.nix
index 6ca007229bcd..ab00d52c7779 100644
--- a/pkgs/tools/misc/calamares/default.nix
+++ b/pkgs/tools/misc/calamares/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, cmake, polkitQt, libyamlcpp, python, boost, parted
+{ stdenv, fetchgit, cmake, polkit-qt, libyamlcpp, python, boost, parted
 , extra-cmake-modules, kconfig, ki18n, kcoreaddons, solid, utillinux, libatasmart
 , ckbcomp, glibc, tzdata, xkeyboard_config, qtbase, qtquick1, qtsvg, qttools }:
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [
-    cmake qtbase qtquick1 qtsvg qttools libyamlcpp python boost polkitQt parted
+    cmake qtbase qtquick1 qtsvg qttools libyamlcpp python boost polkit-qt parted
     extra-cmake-modules kconfig ki18n kcoreaddons solid utillinux libatasmart
   ];
 
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
   '';
 
   preInstall = ''
-    substituteInPlace cmake_install.cmake --replace "${polkitQt}" "$out"
+    substituteInPlace cmake_install.cmake --replace "${polkit-qt}" "$out"
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/tools/networking/cmst/default.nix b/pkgs/tools/networking/cmst/default.nix
index 3bfa65cb4724..1b5767653fe2 100644
--- a/pkgs/tools/networking/cmst/default.nix
+++ b/pkgs/tools/networking/cmst/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, qt5, makeWrapper, libX11 }:
+{ stdenv, fetchgit, qtbase, makeWrapper, libX11 }:
 
 stdenv.mkDerivation rec {
   name = "cmst-2014.12.05";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "070rxv3kyn41ra7nnk1wbqvy6fjg38h7hrdv4dn71b201kmzd194";
   };
 
-  buildInputs = [ qt5.base makeWrapper ];
+  buildInputs = [ qtbase makeWrapper ];
 
   configurePhase = ''
     substituteInPlace ./cmst.pro \
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index e7c138c5fa7c..57026762d1b8 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -556,7 +556,7 @@ let
     withGui = false;
   };
 
-  apitrace = callPackage ../applications/graphics/apitrace {};
+  apitrace = qt5.callPackage ../applications/graphics/apitrace {};
 
   argyllcms = callPackage ../tools/graphics/argyllcms {};
 
@@ -809,7 +809,7 @@ let
 
   deis = goPackages.deis.bin // { outputs = [ "bin" ]; };
 
-  dfilemanager = callPackage ../applications/misc/dfilemanager { };
+  dfilemanager = kde5.dfilemanager;
 
   diagrams-builder = callPackage ../tools/graphics/diagrams-builder {
     inherit (haskellPackages) ghcWithPackages diagrams-builder;
@@ -1022,7 +1022,7 @@ let
 
   davix = callPackage ../tools/networking/davix { };
 
-  cantata = qt5Libs.callPackage ../applications/audio/cantata { };
+  cantata = qt5.callPackage ../applications/audio/cantata { };
 
   can-utils = callPackage ../os-specific/linux/can-utils { };
 
@@ -1072,7 +1072,7 @@ let
 
   citrix_receiver = callPackage ../applications/networking/remote/citrix-receiver { };
 
-  cmst = callPackage ../tools/networking/cmst { };
+  cmst = qt5.callPackage ../tools/networking/cmst { };
 
   colord = callPackage ../tools/misc/colord { };
 
@@ -1154,7 +1154,7 @@ let
 
   convmv = callPackage ../tools/misc/convmv { };
 
-  cool-retro-term = qt5Libs.callPackage ../applications/misc/cool-retro-term { };
+  cool-retro-term = qt5.callPackage ../applications/misc/cool-retro-term { };
 
   coreutils = callPackage ../tools/misc/coreutils {
     aclSupport = stdenv.isLinux;
@@ -2015,7 +2015,7 @@ let
 
   kpcli = callPackage ../tools/security/kpcli { };
 
-  kst = callPackage ../tools/graphics/kst { gsl = gsl_1; };
+  kst = qt5.callPackage ../tools/graphics/kst { gsl = gsl_1; };
 
   leocad = callPackage ../applications/graphics/leocad { };
 
@@ -2261,7 +2261,7 @@ let
 
   mfoc = callPackage ../tools/security/mfoc { };
 
-  mgba = callPackage ../misc/emulators/mgba { };
+  mgba = qt5.callPackage ../misc/emulators/mgba { };
 
   minissdpd = callPackage ../tools/networking/minissdpd { };
 
@@ -2721,7 +2721,7 @@ let
     inherit qt4;
   };
 
-  pinentry_qt5 = qt55Libs.callPackage ../tools/security/pinentry/qt5.nix {
+  pinentry_qt5 = qt5.callPackage ../tools/security/pinentry/qt5.nix {
     libcap = if stdenv.isDarwin then null else libcap;
   };
 
@@ -2992,7 +2992,7 @@ let
   screen-message = callPackage ../tools/X11/screen-message { };
 
   screencloud = callPackage ../applications/graphics/screencloud {
-    quazip = quazip.override { qt = qt4; };
+    quazip = qt5.quazip.override { qt = qt4; };
   };
 
   scrot = callPackage ../tools/graphics/scrot { };
@@ -3027,7 +3027,7 @@ let
 
   siege = callPackage ../tools/networking/siege {};
 
-  sigil = callPackage ../applications/editors/sigil { };
+  sigil = qt5.callPackage ../applications/editors/sigil { };
 
   # aka., gpg-tools
   signing-party = callPackage ../tools/security/signing-party { };
@@ -3226,7 +3226,7 @@ let
 
   thc-hydra = callPackage ../tools/security/thc-hydra { };
 
-  tiled = callPackage ../applications/editors/tiled { };
+  tiled = qt5.callPackage ../applications/editors/tiled { };
 
   tinc = callPackage ../tools/networking/tinc { };
 
@@ -6049,8 +6049,6 @@ let
 
   accountsservice = callPackage ../development/libraries/accountsservice { };
 
-  accounts-qt = callPackage ../development/libraries/accounts-qt/old.nix {};
-
   acl = callPackage ../development/libraries/acl { };
 
   activemq = callPackage ../development/libraries/apache-activemq { };
@@ -6642,8 +6640,6 @@ let
 
   grantlee = callPackage ../development/libraries/grantlee { };
 
-  grantlee5 = callPackage ../development/libraries/grantlee/5.x-old.nix { };
-
   gsasl = callPackage ../development/libraries/gsasl { };
 
   gsl = callPackage ../development/libraries/gsl { };
@@ -7032,8 +7028,6 @@ let
 
   libdbusmenu_qt = callPackage ../development/libraries/libdbusmenu-qt { };
 
-  libdbusmenu_qt5 = callPackage ../development/libraries/libdbusmenu-qt/qt-5.4.nix { };
-
   libdc1394 = callPackage ../development/libraries/libdc1394 {
     inherit (darwin.apple_sdk.frameworks) CoreServices;
   };
@@ -7822,8 +7816,6 @@ let
     qt = qt4;
   };
 
-  mlt-qt5 = callPackage ../development/libraries/mlt/qt-5.4.nix { };
-
   movit = callPackage ../development/libraries/movit { };
 
   mosquitto = callPackage ../servers/mqtt/mosquitto { };
@@ -8044,10 +8036,6 @@ let
 
   phonon_backend_vlc = callPackage ../development/libraries/phonon-backend-vlc/qt4 {};
 
-  phonon_qt5 = callPackage ../development/libraries/phonon/qt5/old.nix {};
-
-  phonon_qt5_backend_gstreamer = callPackage ../development/libraries/phonon-backend-gstreamer/qt5/old.nix {};
-
   physfs = callPackage ../development/libraries/physfs { };
 
   pipelight = callPackage ../tools/misc/pipelight {
@@ -8087,8 +8075,6 @@ let
     suffix = "qt4";
   };
 
-  poppler_qt5 = qt5Libs.popplerQt;
-
   poppler_utils = poppler.override { suffix = "utils"; utils = true; };
 
   popt = callPackage ../development/libraries/popt { };
@@ -8124,18 +8110,12 @@ let
 
   qca2 = callPackage ../development/libraries/qca2 { qt = qt4; };
 
-  qca-qt5 = callPackage ../development/libraries/qca-qt5/old.nix { };
-
   qimageblitz = callPackage ../development/libraries/qimageblitz {};
 
   qjson = callPackage ../development/libraries/qjson { };
 
   qoauth = callPackage ../development/libraries/qoauth { };
 
-  quazip = callPackage ../development/libraries/quazip {
-    qt = qt5;
-  };
-
   qt3 = callPackage ../development/libraries/qt-3 {
     openglSupport = mesaSupported;
     libpng = libpng12;
@@ -8157,8 +8137,13 @@ let
     developerBuild = true;
   });
 
-  qt54 = recurseIntoAttrs (callPackage ../development/libraries/qt-5/5.4 {});
-  qt55 = recurseIntoAttrs (import ../development/libraries/qt-5/5.5 { inherit pkgs; });
+  qt54 =
+    let imported = import ../development/libraries/qt-5/5.4 { inherit pkgs; };
+    in recurseIntoAttrs (imported.override (super: qt5LibsFun));
+
+  qt55 =
+    let imported = import ../development/libraries/qt-5/5.5 { inherit pkgs; };
+    in recurseIntoAttrs (imported.override (super: qt5LibsFun));
 
   qt5 = qt54;
 
@@ -8172,21 +8157,21 @@ let
 
     libkeyfinder = callPackage ../development/libraries/libkeyfinder { };
 
-    mlt = callPackage ../development/libraries/mlt/qt-5.5.nix {};
+    mlt = callPackage ../development/libraries/mlt/qt-5.nix {};
 
     openbr = callPackage ../development/libraries/openbr { };
 
     phonon = callPackage ../development/libraries/phonon/qt5 { };
 
-    phonon_backend_gstreamer = callPackage ../development/libraries/phonon-backend-gstreamer/qt5 { };
+    phonon-backend-gstreamer = callPackage ../development/libraries/phonon-backend-gstreamer/qt5 { };
 
-    phonon_backend_vlc = callPackage ../development/libraries/phonon-backend-vlc/qt5 { };
+    phonon-backend-vlc = callPackage ../development/libraries/phonon-backend-vlc/qt5 { };
 
-    polkitQt = callPackage ../development/libraries/polkit-qt-1 {
+    polkit-qt = callPackage ../development/libraries/polkit-qt-1 {
       withQt5 = true;
     };
 
-    popplerQt = callPackage ../development/libraries/poppler {
+    poppler = callPackage ../development/libraries/poppler {
       lcms = lcms2;
       qt5Support = true;
       suffix = "qt5";
@@ -8196,6 +8181,16 @@ let
 
     qmltermwidget = callPackage ../development/libraries/qmltermwidget { };
 
+    qtcreator = callPackage ../development/qtcreator {
+      withDocumentation = true;
+    };
+
+    quazip = callPackage ../development/libraries/quazip {
+      qt = qtbase;
+    };
+
+    qwt = callPackage ../development/libraries/qwt/6.nix { };
+
     signon = callPackage ../development/libraries/signon { };
 
     telepathy = callPackage ../development/libraries/telepathy/qt { };
@@ -8207,20 +8202,8 @@ let
 
   };
 
-  qt55Libs = lib.makeScope qt55.newScope qt5LibsFun;
-  qt5Libs = qt55Libs;
-
-  qtEnv = callPackage ../development/libraries/qt-5/qt-env.nix {};
-
-  qt5Full = appendToName "full" (qtEnv {
-    qtbase = qt5.base;
-    paths = lib.filter lib.isDerivation (lib.attrValues qt5);
-  });
-
-  qtcreator = callPackage ../development/qtcreator {
-    qtLib = qt54;
-    withDocumentation = true;
-  };
+  qtEnv = qt5.env;
+  qt5Full = qt5.full;
 
   qtkeychain = callPackage ../development/libraries/qtkeychain { };
 
@@ -8230,8 +8213,6 @@ let
 
   qwt = callPackage ../development/libraries/qwt {};
 
-  qwt6 = callPackage ../development/libraries/qwt/6.nix { };
-
   qxt = callPackage ../development/libraries/qxt {};
 
   rabbitmq-c = callPackage ../development/libraries/rabbitmq-c {};
@@ -8370,8 +8351,6 @@ let
 
   sfml = callPackage ../development/libraries/sfml { };
 
-  signon = callPackage ../development/libraries/signon/old.nix {};
-
   skalibs = callPackage ../development/libraries/skalibs { };
 
   slang = callPackage ../development/libraries/slang { };
@@ -8513,8 +8492,6 @@ let
 
   telepathy_qt = callPackage ../development/libraries/telepathy/qt { qtbase = qt4; };
 
-  telepathy_qt5 = telepathy_qt.override { qtbase = qt5.base; };
-
   tevent = callPackage ../development/libraries/tevent {
     python = python2;
   };
@@ -10950,7 +10927,7 @@ let
 
   xlsx2csv = pythonPackages.xlsx2csv;
 
-  zeal = callPackage ../data/documentation/zeal { };
+  zeal = qt5.callPackage ../data/documentation/zeal { };
 
 
   ### APPLICATIONS
@@ -11020,7 +10997,7 @@ let
 
   amsn = callPackage ../applications/networking/instant-messengers/amsn { };
 
-  antimony = callPackage ../applications/graphics/antimony {};
+  antimony = qt5.callPackage ../applications/graphics/antimony {};
 
   antiword = callPackage ../applications/office/antiword {};
 
@@ -11096,7 +11073,7 @@ let
   };
   awesome = awesome-3-5;
 
-  awesomebump = callPackage ../applications/graphics/awesomebump { };
+  awesomebump = qt5.callPackage ../applications/graphics/awesomebump { };
 
   inherit (gnome3) baobab;
 
@@ -11177,7 +11154,7 @@ let
 
   calcurse = callPackage ../applications/misc/calcurse { };
 
-  calibre = callPackage ../applications/misc/calibre {
+  calibre = qt5.callPackage ../applications/misc/calibre {
     inherit (pythonPackages) pyqt5 sip_4_16;
   };
 
@@ -11255,7 +11232,7 @@ let
 
   cmatrix = callPackage ../applications/misc/cmatrix { };
 
-  bomi = callPackage ../applications/video/bomi {
+  bomi = qt5.callPackage ../applications/video/bomi {
     youtube-dl = pythonPackages.youtube-dl;
     pulseSupport = config.pulseaudio or true;
   };
@@ -11311,7 +11288,7 @@ let
   cutecom = callPackage ../tools/misc/cutecom { };
 
   cutegram =
-    let cp = qt5Libs.callPackage;
+    let cp = qt5.callPackage;
     in cp ../applications/networking/instant-messengers/telegram/cutegram rec {
       libqtelegram-aseman-edition = cp ../applications/networking/instant-messengers/telegram/libqtelegram-aseman-edition { };
       telegram-qml = cp ../applications/networking/instant-messengers/telegram/telegram-qml {
@@ -11360,7 +11337,7 @@ let
     plugins = [];
   };
 
-  dfasma = qt5Libs.callPackage ../applications/audio/dfasma { };
+  dfasma = qt5.callPackage ../applications/audio/dfasma { };
 
   dia = callPackage ../applications/graphics/dia {
     inherit (pkgs.gnome) libart_lgpl libgnomeui;
@@ -11717,7 +11694,7 @@ let
 
   fluidsynth = callPackage ../applications/audio/fluidsynth { };
 
-  fmit = qt5Libs.callPackage ../applications/audio/fmit { };
+  fmit = qt5.callPackage ../applications/audio/fmit { };
 
   focuswriter = callPackage ../applications/editors/focuswriter { };
 
@@ -11729,7 +11706,7 @@ let
 
   fribid = callPackage ../applications/networking/browsers/mozilla-plugins/fribid { };
 
-  fritzing = callPackage ../applications/science/electronics/fritzing { };
+  fritzing = qt5.callPackage ../applications/science/electronics/fritzing { };
 
   fvwm = callPackage ../applications/window-managers/fvwm { };
 
@@ -11816,7 +11793,7 @@ let
     inherit (pkgs.gnome) libgnome libgnomeui;
   };
 
-  firestr = callPackage ../applications/networking/p2p/firestr
+  firestr = qt5.callPackage ../applications/networking/p2p/firestr
     { boost = boost155;
     };
 
@@ -11938,7 +11915,7 @@ let
 
   libquvi = callPackage ../applications/video/quvi/library.nix { };
 
-  linssid = callPackage ../applications/networking/linssid { };
+  linssid = qt5.callPackage ../applications/networking/linssid { };
 
   mi2ly = callPackage ../applications/audio/mi2ly {};
 
@@ -12031,7 +12008,7 @@ let
 
   gosmore = callPackage ../applications/misc/gosmore { };
 
-  gpsbabel = callPackage ../applications/misc/gpsbabel { };
+  gpsbabel = qt5.callPackage ../applications/misc/gpsbabel { };
 
   gpscorrelate = callPackage ../applications/misc/gpscorrelate { };
 
@@ -12168,7 +12145,7 @@ let
     lua = lua5;
   };
 
-  ipe = qt5Libs.callPackage ../applications/graphics/ipe {
+  ipe = qt5.callPackage ../applications/graphics/ipe {
     ghostscript = ghostscriptX;
     texlive = texlive.combine { inherit (texlive) scheme-small; };
   };
@@ -12230,9 +12207,9 @@ let
 
   kermit = callPackage ../tools/misc/kermit { };
 
-  keyfinder = qt5Libs.callPackage ../applications/audio/keyfinder { };
+  keyfinder = qt5.callPackage ../applications/audio/keyfinder { };
 
-  keyfinder-cli = qt5Libs.callPackage ../applications/audio/keyfinder-cli { };
+  keyfinder-cli = qt5.callPackage ../applications/audio/keyfinder-cli { };
 
   keymon = callPackage ../applications/video/key-mon { };
 
@@ -12363,7 +12340,7 @@ let
       webkit = webkitgtk2;
   };
 
-  luminanceHDR = callPackage ../applications/graphics/luminance-hdr { };
+  luminanceHDR = qt5.callPackage ../applications/graphics/luminance-hdr { };
 
   lxdvdrip = callPackage ../applications/video/lxdvdrip { };
 
@@ -12568,7 +12545,7 @@ let
       iceSupport = config.murmur.iceSupport or true;
     }) mumble mumble_git murmur murmur_git;
 
-  musescore = qt5Libs.callPackage ../applications/audio/musescore { };
+  musescore = qt5.callPackage ../applications/audio/musescore { };
 
   mutt = callPackage ../applications/networking/mailreaders/mutt { };
   mutt-with-sidebar = callPackage ../applications/networking/mailreaders/mutt {
@@ -12602,11 +12579,11 @@ let
      stdenv = stdenv_32bit;
   };
 
-  shotcut = callPackage ../applications/video/shotcut { mlt = mlt-qt5; };
+  shotcut = qt5.callPackage ../applications/video/shotcut { };
 
-  smplayer = callPackage ../applications/video/smplayer { };
+  smplayer = qt5.callPackage ../applications/video/smplayer { };
 
-  smtube = callPackage ../applications/video/smtube {};
+  smtube = qt5.callPackage ../applications/video/smtube {};
 
   sup = callPackage ../applications/networking/mailreaders/sup {
     ruby = ruby_1_9_3.override { cursesSupport = true; };
@@ -12701,7 +12678,7 @@ let
     inherit (gnome) libglade;
   };
 
-  obs-studio = callPackage ../applications/video/obs-studio {
+  obs-studio = qt5.callPackage ../applications/video/obs-studio {
     pulseaudioSupport = config.pulseaudio or true;
   };
 
@@ -12770,9 +12747,9 @@ let
     inherit (gst_all_1) gstreamer gst-plugins-base;
   };
 
-  photoqt = callPackage ../applications/graphics/photoqt { };
+  photoqt = qt5.callPackage ../applications/graphics/photoqt { };
 
-  phototonic = callPackage ../applications/graphics/phototonic { };
+  phototonic = qt5.callPackage ../applications/graphics/phototonic { };
 
   pianobar = callPackage ../applications/audio/pianobar { };
 
@@ -12900,9 +12877,9 @@ let
 
   qsynth = callPackage ../applications/audio/qsynth { };
 
-  qtox = callPackage ../applications/networking/instant-messengers/qtox { };
+  qtox = qt5.callPackage ../applications/networking/instant-messengers/qtox { };
 
-  qtpass = callPackage ../applications/misc/qtpass { };
+  qtpass = qt5.callPackage ../applications/misc/qtpass { };
 
   qtpfsgui = callPackage ../applications/graphics/qtpfsgui { };
 
@@ -12920,7 +12897,7 @@ let
     gst_plugins_bad = null;
   };
 
-  qutebrowser = callPackage ../applications/networking/browsers/qutebrowser {
+  qutebrowser = qt5.callPackage ../applications/networking/browsers/qutebrowser {
     inherit (python34Packages) buildPythonPackage python pyqt5 jinja2 pygments pyyaml pypeg2;
   };
 
@@ -12934,7 +12911,7 @@ let
     demo = false;
   };
 
-  rapcad = callPackage ../applications/graphics/rapcad {};
+  rapcad = qt5.callPackage ../applications/graphics/rapcad {};
 
   rapidsvn = callPackage ../applications/version-management/rapidsvn { };
 
@@ -13108,15 +13085,11 @@ let
 
   copy-com = callPackage ../applications/networking/copy-com { };
 
-  dropbox = callPackage ../applications/networking/dropbox {
-    qtbase = qt5.base;
-    qtdeclarative = qt5.declarative;
-    qtwebkit = qt5.webkit;
-  };
+  dropbox = qt5.callPackage ../applications/networking/dropbox { };
 
   dropbox-cli = callPackage ../applications/networking/dropbox-cli { };
 
-  lightdm = qt5Libs.callPackage ../applications/display-managers/lightdm {
+  lightdm = qt5.callPackage ../applications/display-managers/lightdm {
     qt4 = null;
     withQt5 = false;
   };
@@ -13137,7 +13110,7 @@ let
 
   printrun = callPackage ../applications/misc/printrun { };
 
-  sddm = qt5Libs.callPackage ../applications/display-managers/sddm {
+  sddm = qt5.callPackage ../applications/display-managers/sddm {
     themes = [];  # extra themes, etc.
   };
 
@@ -13159,7 +13132,7 @@ let
 
   sipp = callPackage ../development/tools/misc/sipp { };
 
-  sonic-visualiser = qt5Libs.callPackage ../applications/audio/sonic-visualiser {
+  sonic-visualiser = qt5.callPackage ../applications/audio/sonic-visualiser {
     inherit (pkgs.vamp) vampSDK;
   };
 
@@ -13256,7 +13229,7 @@ let
     gconf = gnome.GConf;
   };
 
-  teamspeak_client = callPackage ../applications/networking/instant-messengers/teamspeak/client.nix { };
+  teamspeak_client = qt55.callPackage ../applications/networking/instant-messengers/teamspeak/client.nix { };
   teamspeak_server = callPackage ../applications/networking/instant-messengers/teamspeak/server.nix { };
 
   taskjuggler = callPackage ../applications/misc/taskjuggler { };
@@ -13341,6 +13314,7 @@ let
     enableXMPP      = config.tomahawk.enableXMPP      or true;
     enableKDE       = config.tomahawk.enableKDE       or false;
     enableTelepathy = config.tomahawk.enableTelepathy or false;
+    quazip = qt5.quazip.override { qt = qt4; };
   };
 
   torchat = callPackage ../applications/networking/instant-messengers/torchat {
@@ -13374,7 +13348,7 @@ let
 
   twister = callPackage ../applications/networking/p2p/twister { };
 
-  twmn = callPackage ../applications/misc/twmn { };
+  twmn = qt5.callPackage ../applications/misc/twmn { };
 
   twinkle = callPackage ../applications/networking/instant-messengers/twinkle { };
 
@@ -13515,7 +13489,7 @@ let
     ffmpeg = ffmpeg_2;
   };
 
-  vlc_qt5 = qt5Libs.vlc;
+  vlc_qt5 = qt5.vlc;
 
   vmpk = callPackage ../applications/audio/vmpk { };
 
@@ -13991,7 +13965,7 @@ let
 
   chocolateDoom = callPackage ../games/chocolate-doom { };
 
-  cockatrice = qt5Libs.callPackage ../games/cockatrice {  };
+  cockatrice = qt5.callPackage ../games/cockatrice {  };
 
   confd = goPackages.confd.bin // { outputs = [ "bin" ]; };
 
@@ -14059,7 +14033,7 @@ let
 
   fish-fillets-ng = callPackage ../games/fish-fillets-ng {};
 
-  flightgear = qt5Libs.callPackage ../games/flightgear { };
+  flightgear = qt5.callPackage ../games/flightgear { };
 
   freecell-solver = callPackage ../games/freecell-solver { };
 
@@ -14162,7 +14136,7 @@ let
 
   mnemosyne = callPackage ../games/mnemosyne { };
 
-  mudlet = qt5Libs.callPackage ../games/mudlet {
+  mudlet = qt5.callPackage ../games/mudlet {
     inherit (lua51Packages) luafilesystem lrexlib luazip luasqlite3;
   };
 
@@ -14740,6 +14714,8 @@ let
       libyamlcpp = callPackage ../development/libraries/libyaml-cpp { makePIC=true; boost=boost; };
     };
 
+    dfilemanager = callPackage ../applications/misc/dfilemanager { };
+
     fcitx-qt5 = callPackage ../tools/inputmethods/fcitx/fcitx-qt5.nix { };
 
     k9copy = callPackage ../applications/video/k9copy {};
@@ -14785,7 +14761,7 @@ let
       apps = import ../applications/kde-apps-15.12 { inherit pkgs; };
       merged = self: frameworks self // plasma self // apps self // kde5PackagesFun self;
     in
-      recurseIntoAttrs (lib.makeScope qt55Libs.newScope merged);
+      recurseIntoAttrs (lib.makeScope qt5.newScope merged);
 
   kde5_latest =
     let
@@ -14794,7 +14770,7 @@ let
       apps = import ../applications/kde-apps-15.12 { inherit pkgs; };
       merged = self: frameworks self // plasma self // apps self // kde5PackagesFun self;
     in
-      recurseIntoAttrs (lib.makeScope qt55Libs.newScope merged);
+      recurseIntoAttrs (lib.makeScope qt5.newScope merged);
 
   theme-vertex = callPackage ../misc/themes/vertex { };
 
@@ -15257,7 +15233,7 @@ let
 
   ### MISC
 
-  antimicro = callPackage ../tools/misc/antimicro { };
+  antimicro = qt5.callPackage ../tools/misc/antimicro { };
 
   atari800 = callPackage ../misc/emulators/atari800 { };
 
@@ -15466,7 +15442,7 @@ let
     inherit (pythonPackages) pexpect paramiko;
   };
 
-  robomongo = callPackage ../applications/misc/robomongo { };
+  robomongo = qt5.callPackage ../applications/misc/robomongo { };
 
   rucksack = callPackage ../development/tools/rucksack { };
 
@@ -15801,6 +15777,7 @@ let
   ### Deprecated aliases - for backward compatibility
 
 aliases = with self; rec {
+  accounts-qt = qt5.accounts-qt;  # added 2015-12-19
   adobeReader = adobe-reader;
   arduino_core = arduino-core;  # added 2015-02-04
   asciidocFull = asciidoc-full;  # added 2014-06-22
@@ -15814,24 +15791,35 @@ aliases = with self; rec {
   exfat-utils = exfat;                  # 2015-09-11
   firefoxWrapper = firefox-wrapper;
   fuse_exfat = exfat;                   # 2015-09-11
+  grantlee5 = qt5.grantlee;  # added 2015-12-19
   htmlTidy = html-tidy;  # added 2014-12-06
   inherit (haskell.compiler) jhc uhc;   # 2015-05-15
   inotifyTools = inotify-tools;
   jquery_ui = jquery-ui;  # added 2014-09-07
+  libdbusmenu_qt5 = qt5.libdbusmenu;  # added 2015-12-19
   libtidy = html-tidy;  # added 2014-12-21
   lttngTools = lttng-tools;  # added 2014-07-31
   lttngUst = lttng-ust;  # added 2014-07-31
+  mlt-qt5 = qt5.mlt;  # added 2015-12-19
   nfsUtils = nfs-utils;  # added 2014-12-06
+  phonon_qt5 = qt5.phonon;  # added 2015-12-19
+  phonon_qt5_backend_gstreamer = qt5.phonon-backend-gstreamer;  # added 2015-12-19
+  poppler_qt5 = qt5.poppler;  # added 2015-12-19
+  qca-qt5 = qt5.qca-qt5;  # added 2015-12-19
+  qtcreator = qt5.qtcreator;  # added 2015-12-19
   quassel_qt5 = kde5.quassel_qt5; # added 2015-09-30
   quasselClient_qt5 = kde5.quasselClient_qt5; # added 2015-09-30
   quasselDaemon_qt5 = kde5.quasselDaemon; # added 2015-09-30
   quassel_kf5 = kde5.quassel; # added 2015-09-30
   quasselClient_kf5 = kde5.quasselClient; # added 2015-09-30
+  qwt6 = qt5.qwt;  # added 2015-12-19
   rdiff_backup = rdiff-backup;  # added 2014-11-23
   rssglx = rss-glx; #added 2015-03-25
   rxvt_unicode_with-plugins = rxvt_unicode-with-plugins; # added 2015-04-02
+  signon = qt5.signon;  # added 2015-12-19
   speedtest_cli = speedtest-cli;  # added 2015-02-17
   sqliteInteractive = sqlite-interactive;  # added 2014-12-06
+  telepathy_qt5 = qt5.telepathy;  # added 2015-12-19
   x11 = xlibsWrapper; # added 2015-09
   xf86_video_nouveau = xorg.xf86videonouveau; # added 2015-09
   xlibs = xorg; # added 2015-09
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index a952fb7c76b1..112a7f0da867 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -166,7 +166,7 @@ in modules // {
   pyqt5 = callPackage ../development/python-modules/pyqt/5.x.nix {
     sip = self.sip_4_16;
     pythonDBus = self.dbus;
-    qt5 = pkgs.qt5;
+    inherit (pkgs.qt5) qtbase qtsvg qtwebkit;
   };
 
   pyside = callPackage ../development/python-modules/pyside { };