summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@gmail.com>2015-02-21 10:54:12 -0600
committerThomas Tuegel <ttuegel@gmail.com>2015-02-21 11:39:18 -0600
commit2e38240c9578c44928bb1cbb5c5106e090267790 (patch)
treebbf56d5f1985f1394a2d16d18c0f118e13663cb1 /pkgs
parent69ff7ab541f7826aba29f216306f01a2067dd724 (diff)
downloadnixpkgs-2e38240c9578c44928bb1cbb5c5106e090267790.tar
nixpkgs-2e38240c9578c44928bb1cbb5c5106e090267790.tar.gz
nixpkgs-2e38240c9578c44928bb1cbb5c5106e090267790.tar.bz2
nixpkgs-2e38240c9578c44928bb1cbb5c5106e090267790.tar.lz
nixpkgs-2e38240c9578c44928bb1cbb5c5106e090267790.tar.xz
nixpkgs-2e38240c9578c44928bb1cbb5c5106e090267790.tar.zst
nixpkgs-2e38240c9578c44928bb1cbb5c5106e090267790.zip
add qt-5.4
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0001-dlopen-gtkstyle.patch63
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0002-dlopen-webkit-nsplugin.patch53
-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/0006-tzdir.patch52
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0007-dlopen-webkit-gtk.patch25
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0008-dlopen-webkit-udev.patch31
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0009-dlopen-serialport-udev.patch28
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0010-dlopen-libXcursor.patch29
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0011-dlopen-openssl.patch38
-rw-r--r--pkgs/development/libraries/qt-5/5.4/0012-dlopen-dbus.patch25
-rw-r--r--pkgs/development/libraries/qt-5/5.4/default.nix356
-rw-r--r--pkgs/development/libraries/qt-5/5.4/manifest.nix274
-rwxr-xr-xpkgs/development/libraries/qt-5/5.4/manifest.sh15
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qt-submodule.nix58
-rw-r--r--pkgs/development/libraries/qt-5/5.4/qtbase.nix185
-rw-r--r--pkgs/development/libraries/qt-5/5.4/setup-hook.sh58
-rw-r--r--pkgs/top-level/all-packages.nix2
19 files changed, 1380 insertions, 1 deletions
diff --git a/pkgs/development/libraries/qt-5/5.4/0001-dlopen-gtkstyle.patch b/pkgs/development/libraries/qt-5/5.4/0001-dlopen-gtkstyle.patch
new file mode 100644
index 00000000000..3f411139f5b
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/0001-dlopen-gtkstyle.patch
@@ -0,0 +1,63 @@
+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()
+     static bool initialized = false;
+     if (!initialized) {
+         // enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
+-        QLibrary libgtk(QLS("gtk-x11-2.0"), 0, 0);
++        QLibrary libgtk(QLS("@gtk@/lib/libgtk-x11-2.0"), 0, 0);
+ 
+         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)
+ void QGtkStylePrivate::resolveGtk() const
+ {
+     // enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
+-    QLibrary libgtk(QLS("gtk-x11-2.0"), 0, 0);
++    QLibrary libgtk(QLS("@gtk@/lib/libgtk-x11-2.0"), 0, 0);
+ 
+     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
+     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");
+ 
+-    gnome_icon_lookup_sync = (Ptr_gnome_icon_lookup_sync)QLibrary::resolve(QLS("gnomeui-2"), 0, "gnome_icon_lookup_sync");
+-    gnome_vfs_init= (Ptr_gnome_vfs_init)QLibrary::resolve(QLS("gnomevfs-2"), 0, "gnome_vfs_init");
++    gnome_icon_lookup_sync = (Ptr_gnome_icon_lookup_sync)QLibrary::resolve(QLS("@libgnomeui@/lib/libgnomeui-2"), 0, "gnome_icon_lookup_sync");
++    gnome_vfs_init= (Ptr_gnome_vfs_init)QLibrary::resolve(QLS("@gnome_vfs@/lib/libgnomevfs-2"), 0, "gnome_vfs_init");
+ }
+ 
+ /* \internal
+@@ -601,9 +601,9 @@ void QGtkStylePrivate::cleanupGtkWidgets()
+ static bool resolveGConf()
+ {
+     if (!QGtkStylePrivate::gconf_client_get_default) {
+-        QGtkStylePrivate::gconf_client_get_default = (Ptr_gconf_client_get_default)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_default");
+-        QGtkStylePrivate::gconf_client_get_string =  (Ptr_gconf_client_get_string)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_string");
+-        QGtkStylePrivate::gconf_client_get_bool =  (Ptr_gconf_client_get_bool)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_bool");
++        QGtkStylePrivate::gconf_client_get_default = (Ptr_gconf_client_get_default)QLibrary::resolve(QLS("@gconf@/lib/libgconf-2"), 4, "gconf_client_get_default");
++        QGtkStylePrivate::gconf_client_get_string =  (Ptr_gconf_client_get_string)QLibrary::resolve(QLS("@gconf@/lib/libgconf-2"), 4, "gconf_client_get_string");
++        QGtkStylePrivate::gconf_client_get_bool =  (Ptr_gconf_client_get_bool)QLibrary::resolve(QLS("@gconf@/lib/libgconf-2"), 4, "gconf_client_get_bool");
+     }
+     return (QGtkStylePrivate::gconf_client_get_default !=0);
+ }
+-- 
+2.1.3
+
diff --git a/pkgs/development/libraries/qt-5/5.4/0002-dlopen-webkit-nsplugin.patch b/pkgs/development/libraries/qt-5/5.4/0002-dlopen-webkit-nsplugin.patch
new file mode 100644
index 00000000000..0752cdcf479
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/0002-dlopen-webkit-nsplugin.patch
@@ -0,0 +1,53 @@
+From 8c30f72dbe11752e8ed25f292c6e5695d7733f72 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
+
+---
+ qtwebkit/Source/WebCore/plugins/qt/PluginPackageQt.cpp                  | 2 +-
+ qtwebkit/Source/WebCore/plugins/qt/PluginViewQt.cpp                     | 2 +-
+ .../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)
+         }
+     }
+ 
+-    QLibrary library(QLatin1String("libgtk-x11-2.0"), 0);
++    QLibrary library(QLatin1String("@gtk@/lib/libgtk-x11-2.0"), 0);
+     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
+index de06a2f..363bde5 100644
+--- a/qtwebkit/Source/WebCore/plugins/qt/PluginViewQt.cpp
++++ b/qtwebkit/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:
+     // Display *gdkDisplay = gdk_x11_display_get_xdisplay(gdk_display_get_default());
+-    QLibrary library(QLatin1String("libgdk-x11-2.0"), 0);
++    QLibrary library(QLatin1String("@gdk_pixbuf@/lib/libgdk-x11-2.0"), 0);
+     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
+index d734ff6..62a2197 100644
+--- a/qtwebkit/Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
++++ b/qtwebkit/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());
+ 
+-    QLibrary library(QLatin1String("libgdk-x11-2.0"), 0);
++    QLibrary library(QLatin1String("@gdk_pixbuf@/libgdk-x11-2.0"), 0);
+     if (!library.load())
+         return 0;
+ 
+-- 
+2.1.3
+
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
new file mode 100644
index 00000000000..4abb69da4d8
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/0003-glib-2.32.patch
@@ -0,0 +1,25 @@
+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
new file mode 100644
index 00000000000..e6b921b771d
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/0004-dlopen-resolv.patch
@@ -0,0 +1,39 @@
+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
new file mode 100644
index 00000000000..d112427bdd6
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/0005-dlopen-gl.patch
@@ -0,0 +1,25 @@
+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/0006-tzdir.patch b/pkgs/development/libraries/qt-5/5.4/0006-tzdir.patch
new file mode 100644
index 00000000000..d5a74b25fb3
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/0006-tzdir.patch
@@ -0,0 +1,52 @@
+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;
+ // Parse zone.tab table, assume lists all installed zones, if not will need to read directories
+ static QTzTimeZoneHash loadTzTimeZones()
+ {
+-    QString path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
++    QString path = qgetenv("TZDIR");
++    path += "/zone.tab";
++    if (!QFile::exists(path))
++        path = QStringLiteral("/usr/share/zoneinfo/zone.tab");
+     if (!QFile::exists(path))
+         path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
+ 
+@@ -559,12 +562,18 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId)
+         if (!tzif.open(QIODevice::ReadOnly))
+             return;
+     } else {
+-        // Open named tz, try modern path first, if fails try legacy path
+-        tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
++        // Try TZDIR first
++        QString zoneinfoDir = qgetenv("TZDIR");
++        zoneinfoDir += "/" + QString::fromLocal8Bit(ianaId);
++        tzif.setFileName(zoneinfoDir);
+         if (!tzif.open(QIODevice::ReadOnly)) {
+-            tzif.setFileName(QLatin1String("/usr/lib/zoneinfo/") + QString::fromLocal8Bit(ianaId));
+-            if (!tzif.open(QIODevice::ReadOnly))
+-                return;
++            // Open named tz, try modern path first, if fails try legacy path
++            tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
++            if (!tzif.open(QIODevice::ReadOnly)) {
++                tzif.setFileName(QLatin1String("/usr/lib/zoneinfo/") + QString::fromLocal8Bit(ianaId));
++                if (!tzif.open(QIODevice::ReadOnly))
++                    return;
++            }
+         }
+     }
+ 
+-- 
+2.1.3
+
diff --git a/pkgs/development/libraries/qt-5/5.4/0007-dlopen-webkit-gtk.patch b/pkgs/development/libraries/qt-5/5.4/0007-dlopen-webkit-gtk.patch
new file mode 100644
index 00000000000..9582b714c90
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/0007-dlopen-webkit-gtk.patch
@@ -0,0 +1,25 @@
+From 089db8835c80bf2b7dd91a97a5c6eb26636b6ab9 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
+
+---
+ qtwebkit/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
+index 8de6521..0b25748 100644
+--- a/qtwebkit/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
++++ b/qtwebkit/Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
+@@ -53,7 +53,7 @@ static void messageHandler(QtMsgType type, const QMessageLogContext&, const QStr
+ 
+ static bool initializeGtk()
+ {
+-    QLibrary gtkLibrary(QLatin1String("libgtk-x11-2.0"), 0);
++    QLibrary gtkLibrary(QLatin1String("@gtk@/lib/libgtk-x11-2.0"), 0);
+     if (!gtkLibrary.load())
+         return false;
+     typedef void* (*gtk_init_ptr)(void*, void*);
+-- 
+2.1.3
+
diff --git a/pkgs/development/libraries/qt-5/5.4/0008-dlopen-webkit-udev.patch b/pkgs/development/libraries/qt-5/5.4/0008-dlopen-webkit-udev.patch
new file mode 100644
index 00000000000..e8a4ba6a215
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/0008-dlopen-webkit-udev.patch
@@ -0,0 +1,31 @@
+From 25d2922cce383fcaa4c138e0cc6c8d92328eeacb 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
+
+---
+ qtwebkit/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
+index 60ff317..da8ac69 100644
+--- a/qtwebkit/Source/WebCore/platform/qt/GamepadsQt.cpp
++++ b/qtwebkit/Source/WebCore/platform/qt/GamepadsQt.cpp
+@@ -111,12 +111,12 @@ private:
+     bool load()
+     {
+         m_libUdev.setLoadHints(QLibrary::ResolveAllSymbolsHint);
+-        m_libUdev.setFileNameAndVersion(QStringLiteral("udev"), 1);
++        m_libUdev.setFileNameAndVersion(QStringLiteral("@udev@/lib/libudev"), 1);
+         m_loaded = m_libUdev.load();
+         if (resolveMethods())
+             return true;
+ 
+-        m_libUdev.setFileNameAndVersion(QStringLiteral("udev"), 0);
++        m_libUdev.setFileNameAndVersion(QStringLiteral("@udev@/lib/libudev"), 0);
+         m_loaded = m_libUdev.load();
+         return resolveMethods();
+     }
+-- 
+2.1.3
+
diff --git a/pkgs/development/libraries/qt-5/5.4/0009-dlopen-serialport-udev.patch b/pkgs/development/libraries/qt-5/5.4/0009-dlopen-serialport-udev.patch
new file mode 100644
index 00000000000..e1e66a3ce95
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/0009-dlopen-serialport-udev.patch
@@ -0,0 +1,28 @@
+From 17c7257e54c00ea2121f2cf95fb2be5e5db6b4ad 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
+
+---
+ qtserialport/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)
+ inline bool resolveSymbols(QLibrary *udevLibrary)
+ {
+     if (!udevLibrary->isLoaded()) {
+-        udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 1);
++        udevLibrary->setFileNameAndVersion(QStringLiteral("@udev@/lib/libudev"), 1);
+         if (!udevLibrary->load()) {
+-            udevLibrary->setFileNameAndVersion(QStringLiteral("udev"), 0);
++            udevLibrary->setFileNameAndVersion(QStringLiteral("@udev@/lib/libudev"), 0);
+             if (!udevLibrary->load()) {
+                 qWarning("Failed to load the library: %s, supported version(s): %i and %i", qPrintable(udevLibrary->fileName()), 1, 0);
+                 return false;
+-- 
+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
new file mode 100644
index 00000000000..49ade86fae3
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/0010-dlopen-libXcursor.patch
@@ -0,0 +1,29 @@
+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/0011-dlopen-openssl.patch b/pkgs/development/libraries/qt-5/5.4/0011-dlopen-openssl.patch
new file mode 100644
index 00000000000..d08061dd5dd
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/0011-dlopen-openssl.patch
@@ -0,0 +1,38 @@
+From 99d458c93698b2d4f16ff164ed54237279ffbb64 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Mon, 1 Dec 2014 17:35:21 -0600
+Subject: [PATCH] dlopen-openssl
+
+---
+ qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp b/qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp
+index 4e6200f..d9c3e7d 100644
+--- a/qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp
++++ b/qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp
+@@ -585,8 +585,8 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
+ #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>
+-    libssl->setFileNameAndVersion(QLatin1String("ssl"), QLatin1String(SHLIB_VERSION_NUMBER));
+-    libcrypto->setFileNameAndVersion(QLatin1String("crypto"), QLatin1String(SHLIB_VERSION_NUMBER));
++    libssl->setFileNameAndVersion(QLatin1String("@openssl@/lib/libssl"), QLatin1String(SHLIB_VERSION_NUMBER));
++    libcrypto->setFileNameAndVersion(QLatin1String("@openssl@/lib/libcrypto"), QLatin1String(SHLIB_VERSION_NUMBER));
+     if (libcrypto->load() && libssl->load()) {
+         // libssl.so.<SHLIB_VERSION_NUMBER> and libcrypto.so.<SHLIB_VERSION_NUMBER> found
+         return pair;
+@@ -597,8 +597,8 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
+ #endif
+ 
+     // second attempt: find the development files libssl.so and libcrypto.so
+-    libssl->setFileNameAndVersion(QLatin1String("ssl"), -1);
+-    libcrypto->setFileNameAndVersion(QLatin1String("crypto"), -1);
++    libssl->setFileNameAndVersion(QLatin1String("@openssl@/lib/libssl"), -1);
++    libcrypto->setFileNameAndVersion(QLatin1String("@openssl@/lib/libcrypto"), -1);
+     if (libcrypto->load() && libssl->load()) {
+         // libssl.so.0 and libcrypto.so.0 found
+         return pair;
+-- 
+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
new file mode 100644
index 00000000000..f32386e114b
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/0012-dlopen-dbus.patch
@@ -0,0 +1,25 @@
+From eec8a79c6cc9e2c65fd43db48ca2347de3ae0c5e Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Mon, 1 Dec 2014 17:38:04 -0600
+Subject: [PATCH] dlopen-dbus
+
+---
+ qtbase/src/dbus/qdbus_symbols.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/qtbase/src/dbus/qdbus_symbols.cpp b/qtbase/src/dbus/qdbus_symbols.cpp
+index a7a1b67..661baf1 100644
+--- a/qtbase/src/dbus/qdbus_symbols.cpp
++++ b/qtbase/src/dbus/qdbus_symbols.cpp
+@@ -93,7 +93,7 @@ bool qdbus_loadLibDBus()
+ 
+     static int majorversions[] = { 3, 2, -1 };
+     lib->unload();
+-    lib->setFileName(QLatin1String("dbus-1"));
++    lib->setFileName(QLatin1String("@dbus_libs@/lib/libdbus-1"));
+     for (uint i = 0; i < sizeof(majorversions) / sizeof(majorversions[0]); ++i) {
+         lib->setFileNameAndVersion(lib->fileName(), majorversions[i]);
+         if (lib->load() && lib->resolve("dbus_connection_open_private"))
+-- 
+2.1.3
+
diff --git a/pkgs/development/libraries/qt-5/5.4/default.nix b/pkgs/development/libraries/qt-5/5.4/default.nix
new file mode 100644
index 00000000000..0a460f863af
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/default.nix
@@ -0,0 +1,356 @@
+# Maintainer's Notes:
+#
+# Minor updates:
+#  1. Edit ./manifest.sh to point to the updated URL.
+#  2. Run ./manifest.sh.
+#  3. Build and enjoy.
+#
+# Major updates:
+#  We prefer not to immediately overwrite older versions with major updates, so
+#  make a copy of this directory first. After copying, be sure to delete ./tmp
+#  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
+
+# options
+, developerBuild ? false
+}:
+
+with autonix;
+with stdenv.lib;
+
+let
+  manifest =
+    importManifest ./manifest.nix { mirror = "http://download.qt.io"; };
+  srcs = mapAttrs (name: manifest: manifest.src) manifest;
+
+  version = "5.4.0";
+
+  callPackage = newScope (self // { inherit qtSubmodule; });
+
+  qtSubmodule = callPackage ./qt-submodule.nix {
+    inherit srcs version;
+    inherit (stdenv) mkDerivation;
+  };
+
+  self =
+    {
+
+      qmake = callPackage ./qmake.nix { inherit (self) base; };
+
+      activeqt = callPackage
+        (
+          { qtSubmodule, base }:
+
+          qtSubmodule {
+            name = "qtactiveqt";
+            qtInputs = [ base ];
+          }
+        )
+        {};
+
+      /* androidextras = not packaged */
+
+      base = callPackage ./qtbase.nix {
+        mesa = mesa_noglu;
+        cups = if stdenv.isLinux then 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;
+      };
+
+      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
+          , alsaLib, gstreamer, gst_plugins_base, pulseaudio
+          }:
+
+          qtSubmodule {
+            name = "qtmultimedia";
+            qtInputs = [ base declarative ];
+            buildInputs = [
+              alsaLib gstreamer gst_plugins_base pulseaudio
+            ];
+          }
+        )
+        {};
+
+      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 ];
+          }
+        )
+        {};
+
+    };
+
+in self
diff --git a/pkgs/development/libraries/qt-5/5.4/manifest.nix b/pkgs/development/libraries/qt-5/5.4/manifest.nix
new file mode 100644
index 00000000000..38e5f8972be
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/manifest.nix
@@ -0,0 +1,274 @@
+# This file is generated automatically. DO NOT EDIT!
+{ stdenv, fetchurl, mirror }:
+[
+  {
+    name = stdenv.lib.nameFromURL "qtwebengine-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/108ywq0s80nanyrjs95nmfxvxmp1ijv2-qtwebengine-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtwebengine-opensource-src-5.4.0.tar.xz";
+      sha256 = "0fqmwhl2pxs0w33lqhcwgwdyrj61b8jmd3hc668xwirzsv0ab4db";
+      name = "qtwebengine-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtwebkit-examples-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/dgy0bd4382cak76d34ins8v1rxvcg2zg-qtwebkit-examples-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtwebkit-examples-opensource-src-5.4.0.tar.xz";
+      sha256 = "1xp9y3q0p5w3gj372hwbzb606akf6ynic94ppwzyhrhy70yjyamh";
+      name = "qtwebkit-examples-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtsensors-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/3ddk1slwp3sl11q3vrh14vczz1g3k77c-qtsensors-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtsensors-opensource-src-5.4.0.tar.xz";
+      sha256 = "0ng1mbvv2ffhk7rs3djiz2i7j297flnn1jkgqk6zpfbjyp6363wa";
+      name = "qtsensors-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtandroidextras-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/h77c86qj0fxr233x0b4n669mfd1kd14k-qtandroidextras-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtandroidextras-opensource-src-5.4.0.tar.xz";
+      sha256 = "0j40409x68bj6hbfrz0vqzafkbplzfcnlb7b7m72ddav0jm4ad3w";
+      name = "qtandroidextras-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtxmlpatterns-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/l30dh38cmmhz1laiwawfyx88d2njnf7s-qtxmlpatterns-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtxmlpatterns-opensource-src-5.4.0.tar.xz";
+      sha256 = "09albq9qj82hzphb3y4ivkkly6gjyxmcbghd7m73i9f7kdxnj73r";
+      name = "qtxmlpatterns-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtactiveqt-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/02axrl74rym70hs4ncwbpx520a6y5lfk-qtactiveqt-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtactiveqt-opensource-src-5.4.0.tar.xz";
+      sha256 = "1kvn8dqyr3iw5w55yba9ljldgc15zsa1ibdkhfwj3rk3579mfxba";
+      name = "qtactiveqt-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtx11extras-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/xqd394dy8j57iwvixy09a8mlklllf817-qtx11extras-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtx11extras-opensource-src-5.4.0.tar.xz";
+      sha256 = "0k27q46khwf3hzygb145akns37s8cmwbqyzjff810xxqwb4npim3";
+      name = "qtx11extras-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qttranslations-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/hafxaps23gqkpaq1ryh142jc9fh71kxp-qttranslations-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qttranslations-opensource-src-5.4.0.tar.xz";
+      sha256 = "12zrldi5jw6zknwg6p573gvz0f4v22wvwwc5mykj26j8g28qv9xc";
+      name = "qttranslations-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtwayland-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/ffs7rhirwgyqijcwkv2rn9i0f3126qwp-qtwayland-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtwayland-opensource-src-5.4.0.tar.xz";
+      sha256 = "0abgsf67whdppg9q35b359wllz2pfzx6vw2gld6hhnhlx7rgf7k0";
+      name = "qtwayland-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtmultimedia-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/7ap1klckqnjx03i1024jd1nfw1kbdib3-qtmultimedia-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtmultimedia-opensource-src-5.4.0.tar.xz";
+      sha256 = "0ldgz677apqj8jm6b7cmma18jv97va26hjqjs3r26hg6gaidpfas";
+      name = "qtmultimedia-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtmacextras-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/w526ln2xj4bfqw2xbarhidain51idf3k-qtmacextras-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtmacextras-opensource-src-5.4.0.tar.xz";
+      sha256 = "0vq4dhsxwi1csy5qnbbjp3fmgmhqb7ah0nzrsickvv37vyfv85hn";
+      name = "qtmacextras-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtimageformats-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/yp6paa7psi4fwaih9mcvfxj9vldlmk5k-qtimageformats-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtimageformats-opensource-src-5.4.0.tar.xz";
+      sha256 = "0ip0iyn8fz96w5xi8w6dlxx0lhv1glmkdy5myz7zhi0yyy6ng6y8";
+      name = "qtimageformats-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qttools-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/1x2lvbyc2h25zmjyvawrfzn5yya13fjl-qttools-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qttools-opensource-src-5.4.0.tar.xz";
+      sha256 = "06klc0vdqfnj8dwqq64602x0wl8ackcim1y33mw6616kzyba11as";
+      name = "qttools-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtconnectivity-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/33mxdwaih2ysjzyvjgfgq86ys9bd9s8x-qtconnectivity-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtconnectivity-opensource-src-5.4.0.tar.xz";
+      sha256 = "0f0hkgqr606q4jj8g70xq72lp9q6kdyfw6rdiin8zhnarjxqark3";
+      name = "qtconnectivity-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtwebchannel-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/bx82yn9n0srdzlid1blwg196jqyhhgpp-qtwebchannel-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtwebchannel-opensource-src-5.4.0.tar.xz";
+      sha256 = "0k2r0qrqrxhw2mjyd9f8r36f04yxfkgw1dmbbdczhw4234jh3sr4";
+      name = "qtwebchannel-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtserialport-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/3q6b9l2cwszm9jz5csx2jsfqk08nz9nh-qtserialport-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtserialport-opensource-src-5.4.0.tar.xz";
+      sha256 = "1hsqs1dy8x5v3l4z8zk9rjprz14w8nv13j4yy47r4nsgf7pikihg";
+      name = "qtserialport-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtdoc-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/bbqvydxnaw4asp2a9j4pq0d5zi1zaqsf-qtdoc-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtdoc-opensource-src-5.4.0.tar.xz";
+      sha256 = "06gx7b3xq3jdprmwfzsy2c1x7klry1wsrfs1iyjgfq9sdja9d1nm";
+      name = "qtdoc-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtwinextras-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/by4v18v2k0xaz9znh18qfr8fvy8n67qg-qtwinextras-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtwinextras-opensource-src-5.4.0.tar.xz";
+      sha256 = "01p3haicfbsg0nb654s16pxl9hr57dksk2w5h2ijghpivqhlzbh3";
+      name = "qtwinextras-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtbase-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/01rpn59v04bx5f9mw92v6zq2hl4bigcr-qtbase-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtbase-opensource-src-5.4.0.tar.xz";
+      sha256 = "1lciiq64qzbgg8kvc2fl98ykpn7fcjv2q6n2ivbw4yz7ll5j9sns";
+      name = "qtbase-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtdeclarative-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/mc0dz5hbaqf3sannvg4j7zxwqcsj3g0f-qtdeclarative-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtdeclarative-opensource-src-5.4.0.tar.xz";
+      sha256 = "1dnpz86asklm3qvm1wyjm3w1kyr319yas8w03ry9m1pnn1sr4z76";
+      name = "qtdeclarative-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtgraphicaleffects-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/r7hpzw01dxh31px5lm1jv6pz753sawrd-qtgraphicaleffects-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtgraphicaleffects-opensource-src-5.4.0.tar.xz";
+      sha256 = "06cblcjd6c7nbq1lc8b7mydambf16qmpargc1x0bh3hq6bji0gx4";
+      name = "qtgraphicaleffects-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtquick1-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/f449vw01acb5jjf74fhfjrjhp8z00dby-qtquick1-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtquick1-opensource-src-5.4.0.tar.xz";
+      sha256 = "1p1js3ck3310kbgvnzsfd0gfd4p9c3fccfas7hzkhcj83iybga6m";
+      name = "qtquick1-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qt5-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/6nh8apj4l1xpqcjq1lkb9g1n50wd6xsz-qt5-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qt5-opensource-src-5.4.0.tar.xz";
+      sha256 = "0gw782dvmvz6c8lpgvn7fi0d8wydjrrfarhjrbbwmswa37492s5r";
+      name = "qt5-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtscript-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/zc0k3d4s867p17bas7clvabdsh2xblhh-qtscript-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtscript-opensource-src-5.4.0.tar.xz";
+      sha256 = "1l0f6g1m5p9zgc4pbx6xm5b31ygcl4dayj43hwblpwinxh15gwzm";
+      name = "qtscript-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtwebsockets-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/camx69vrzl5ciwmc7rygax1iphcdk474-qtwebsockets-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtwebsockets-opensource-src-5.4.0.tar.xz";
+      sha256 = "1pybyksa8gwm98f65l3pa8dxbplz882r13b7i0idsg4q9952gk9a";
+      name = "qtwebsockets-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtquickcontrols-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/y0n7c5safk5174b14a9p6kqw2p2n3vrs-qtquickcontrols-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtquickcontrols-opensource-src-5.4.0.tar.xz";
+      sha256 = "07p6z9c1cgyx9qx81mpgnh8dim4q9im714lzk8zyghwi68rl77xm";
+      name = "qtquickcontrols-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtenginio-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/afpm16dyv3bis6xfr4lnhnd0xrflpi86-qtenginio-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtenginio-opensource-src-5.4.0.tar.xz";
+      sha256 = "0k4j5nc33ijifjpii074bar105z1mn98qg1vzn8q5lq0y7jm82gs";
+      name = "qtenginio-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtwebkit-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/v0l3znjnhnnlbvbdb33ns3npz1p7dlzw-qtwebkit-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtwebkit-opensource-src-5.4.0.tar.xz";
+      sha256 = "1hc8s6l70ikf7ld2x84p6d2wwyxdfqw2pdqlma42wpaxfq3j4rvc";
+      name = "qtwebkit-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtlocation-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/kbgbnl01j85iab7a88x4gi3q2n40n9zr-qtlocation-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtlocation-opensource-src-5.4.0.tar.xz";
+      sha256 = "0mnlh6z8hq9j32sxqsd8al811p4iv99wd8bsm97w9nyxbwdhqhp8";
+      name = "qtlocation-opensource-src-5.4.0.tar.xz";
+    };
+  }
+  {
+    name = stdenv.lib.nameFromURL "qtsvg-opensource-src-5.4.0.tar.xz" ".tar";
+    store = "/nix/store/h9qfbbj46sc2nhx24354b9cgq9hnssdc-qtsvg-opensource-src-5.4.0.tar.xz";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.4/5.4.0/submodules/qtsvg-opensource-src-5.4.0.tar.xz";
+      sha256 = "12dpqb67mm1h1x3f4811zvk4dbnswsg58ipl57m3mdn7mhmpdvk8";
+      name = "qtsvg-opensource-src-5.4.0.tar.xz";
+    };
+  }
+]
diff --git a/pkgs/development/libraries/qt-5/5.4/manifest.sh b/pkgs/development/libraries/qt-5/5.4/manifest.sh
new file mode 100755
index 00000000000..333bb89afb1
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/manifest.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+if [ $# -eq 0 ]; then
+
+  # 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 ../../../../.. -A autonix.manifest) \
+    http://download.qt.io/official_releases/qt/5.4/5.4.0/submodules/ \
+      -A '*.tar.xz'
+
+else
+
+  $(nix-build ../../../.. -A autonix.manifest) -A '*.tar.xz' "$@"
+
+fi
diff --git a/pkgs/development/libraries/qt-5/5.4/qt-submodule.nix b/pkgs/development/libraries/qt-5/5.4/qt-submodule.nix
new file mode 100644
index 00000000000..e120d0a920c
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qt-submodule.nix
@@ -0,0 +1,58 @@
+{ 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";
+
+  preConfigure = ''
+    export PATH="$out/bin:$PATH"
+  '';
+
+  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
new file mode 100644
index 00000000000..45de927bc8d
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/qtbase.nix
@@ -0,0 +1,185 @@
+{ stdenv, substituteAll
+, srcs, version
+
+, 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
+}:
+
+with stdenv.lib;
+
+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; })
+    ];
+
+  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"
+  '';
+
+  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
+
+    -gui
+    -widgets
+    -opengl desktop
+    -qml-debug
+    -nis
+    -iconv
+    -icu
+    -pch
+    -glib
+    -xcb
+    -qpa xcb
+    -${optionalString (cups == null) "no-"}cups
+
+    -no-eglfs
+    -no-directfb
+    -no-linuxfb
+    -no-kms
+
+    -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
+  '';
+
+  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
+  ++ optionals mesaSupported [ mesa mesa_glu ]
+  ++ optional (cups != null) cups
+  ++ optional (mysql != null) mysql
+  ++ optional (postgresql != null) postgresql;
+
+  buildInputs = [ gdb bison flex gperf ruby ];
+
+  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
+
+      mkdir -p "$out/nix-support"
+      substitute ${./setup-hook.sh} "$out/nix-support/setup-hook" \
+        --subst-var out --subst-var-by lndir "${lndir}"
+    '';
+
+  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/setup-hook.sh b/pkgs/development/libraries/qt-5/5.4/setup-hook.sh
new file mode 100644
index 00000000000..ac76590d117
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.4/setup-hook.sh
@@ -0,0 +1,58 @@
+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 [[ -n $qtSubmodule ]] && [[ -d "$1/lib" ]]; then
+            @lndir@/bin/lndir -silent "$1/lib" "$qtOut/lib"
+            find "$1/lib" -printf 'lib/%P\n' >> "$qtOut/nix-support/qt-inputs"
+        fi
+
+        propagatedBuildInputs+=" $1"
+    fi
+
+    if [[ -f "$1/bin/qmake" ]]; then
+        addToSearchPath PATH "$qtOut/bin"
+    fi
+
+    if [[ -d "$1/lib/qt5/qml" ]] || [[ -d "$1/lib/qt5/plugins" ]] || [[ -d "$1/lib/qt5/imports" ]]; then
+        propagatedUserEnvPkgs+=" $1"
+    fi
+}
+
+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"
+
+cp "@out@/bin/qmake" "$qtOut/bin"
+cat >"$qtOut/bin/qt.conf" <<EOF
+[Paths]
+Prefix = $qtOut
+Plugins = $qtOut/lib/qt5/plugins
+Imports = $qtOut/lib/qt5/imports
+Qml2Imports = $qtOut/lib/qt5/qml
+EOF
+
+envHooks+=(addQtModule)
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 272d6b159b5..5b5624c0970 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7087,7 +7087,7 @@ let
     bison = bison2; # error: too few arguments to function 'int yylex(...
   };
 
-  qt5split = callPackage ../development/libraries/qt-5/5.3-submodules {};
+  qt54 = callPackage ../development/libraries/qt-5/5.4 {};
 
   qt5Full = appendToName "full" (qt5.override {
     buildDocs = true;