about summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@mailbox.org>2017-06-15 07:58:55 -0500
committerThomas Tuegel <ttuegel@mailbox.org>2017-06-18 08:44:47 -0500
commitdab7700f6ce9266e02a630eea0c4440470ba58e5 (patch)
treea7e4773e97cc8a61f6a1b7d0d4f7fd9626b7a78e /pkgs/development/libraries
parentce28d8947d3e698f48cbbf4c3291c9427124886e (diff)
qt58: determine plugin and import paths from PATH
Plugin and QML import paths were previously determined by NIX_PROFILES. Using
PATH instead allows Qt applications to work under nix-shell without further
modification.
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/qt-5/5.8/qtbase/default.nix1
-rw-r--r--pkgs/development/libraries/qt-5/5.8/qtbase/library-paths.patch (renamed from pkgs/development/libraries/qt-5/5.8/qtbase/nix-profiles-library-paths.patch)12
-rw-r--r--pkgs/development/libraries/qt-5/5.8/qtbase/qpa-platform-plugin-path.patch43
-rw-r--r--pkgs/development/libraries/qt-5/5.8/qtbase/series3
-rw-r--r--pkgs/development/libraries/qt-5/5.8/qtdeclarative/import-paths.patch (renamed from pkgs/development/libraries/qt-5/5.8/qtdeclarative/nix-profiles-import-paths.patch)12
-rw-r--r--pkgs/development/libraries/qt-5/5.8/qtdeclarative/series2
6 files changed, 14 insertions, 59 deletions
diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix
index 3048baeb32739..93be661b7dab1 100644
--- a/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix
+++ b/pkgs/development/libraries/qt-5/5.8/qtbase/default.nix
@@ -132,7 +132,6 @@ stdenv.mkDerivation {
         -docdir $out/$qtDocPrefix"
 
     NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PREFIX=\"$qtPluginPrefix\""
-    NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QPA_PLATFORM_PLUGIN_PATH=\"''${!outputLib}/$qtPluginPrefix/platforms\""
   '';
 
 
diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/nix-profiles-library-paths.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/library-paths.patch
index f626e399288ac..38eecbe2c6468 100644
--- a/pkgs/development/libraries/qt-5/5.8/qtbase/nix-profiles-library-paths.patch
+++ b/pkgs/development/libraries/qt-5/5.8/qtbase/library-paths.patch
@@ -6,12 +6,12 @@ Index: qtbase-opensource-src-5.8.0/src/corelib/kernel/qcoreapplication.cpp
          QStringList *app_libpaths = new QStringList;
          coreappdata()->app_libpaths.reset(app_libpaths);
  
-+        // Add library paths derived from NIX_PROFILES.
-+        const QStringList profiles = QFile::decodeName(qgetenv("NIX_PROFILES")).split(' ');
-+        const QString plugindir = QStringLiteral(NIXPKGS_QT_PLUGIN_PREFIX);
-+        for (const QString &profile: profiles) {
-+            if (!profile.isEmpty()) {
-+                app_libpaths->append(profile + QDir::separator() + plugindir);
++        // Add library paths derived from PATH
++        const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
++        const QString plugindir = QStringLiteral("../" NIXPKGS_QT_PLUGIN_PREFIX);
++        for (const QString &path: paths) {
++            if (!path.isEmpty()) {
++                app_libpaths->append(QDir::cleanPath(path + QDir::separator() + plugindir));
 +            }
 +        }
 +
diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/qpa-platform-plugin-path.patch b/pkgs/development/libraries/qt-5/5.8/qtbase/qpa-platform-plugin-path.patch
deleted file mode 100644
index 18780db05e776..0000000000000
--- a/pkgs/development/libraries/qt-5/5.8/qtbase/qpa-platform-plugin-path.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-Index: qtbase-opensource-src-5.8.0/src/gui/kernel/qplatformintegrationfactory.cpp
-===================================================================
---- qtbase-opensource-src-5.8.0.orig/src/gui/kernel/qplatformintegrationfactory.cpp
-+++ qtbase-opensource-src-5.8.0/src/gui/kernel/qplatformintegrationfactory.cpp
-@@ -62,9 +62,10 @@ QPlatformIntegration *QPlatformIntegrati
-     // Try loading the plugin from platformPluginPath first:
-     if (!platformPluginPath.isEmpty()) {
-         QCoreApplication::addLibraryPath(platformPluginPath);
--        if (QPlatformIntegration *ret = qLoadPlugin<QPlatformIntegration, QPlatformIntegrationPlugin>(directLoader(), platform, paramList, argc, argv))
--            return ret;
-     }
-+    QCoreApplication::addLibraryPath(QLatin1String(NIXPKGS_QPA_PLATFORM_PLUGIN_PATH));
-+    if (QPlatformIntegration *ret = qLoadPlugin<QPlatformIntegration, QPlatformIntegrationPlugin>(directLoader(), platform, paramList, argc, argv))
-+        return ret;
- #else
-     Q_UNUSED(platformPluginPath);
- #endif
-@@ -84,15 +85,16 @@ QStringList QPlatformIntegrationFactory:
- #ifndef QT_NO_LIBRARY
-     if (!platformPluginPath.isEmpty()) {
-         QCoreApplication::addLibraryPath(platformPluginPath);
--        list = directLoader()->keyMap().values();
--        if (!list.isEmpty()) {
--            const QString postFix = QLatin1String(" (from ")
--                                    + QDir::toNativeSeparators(platformPluginPath)
--                                    + QLatin1Char(')');
--            const QStringList::iterator end = list.end();
--            for (QStringList::iterator it = list.begin(); it != end; ++it)
--                (*it).append(postFix);
--        }
-+    }
-+    QCoreApplication::addLibraryPath(QLatin1String(NIXPKGS_QPA_PLATFORM_PLUGIN_PATH));
-+    list = directLoader()->keyMap().values();
-+    if (!list.isEmpty()) {
-+        const QString postFix = QLatin1String(" (from ")
-+            + QDir::toNativeSeparators(platformPluginPath)
-+            + QLatin1Char(')');
-+        const QStringList::iterator end = list.end();
-+        for (QStringList::iterator it = list.begin(); it != end; ++it)
-+            (*it).append(postFix);
-     }
- #else
-     Q_UNUSED(platformPluginPath);
diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/series b/pkgs/development/libraries/qt-5/5.8/qtbase/series
index 03f5e6b1002e6..f3387694518a3 100644
--- a/pkgs/development/libraries/qt-5/5.8/qtbase/series
+++ b/pkgs/development/libraries/qt-5/5.8/qtbase/series
@@ -2,9 +2,8 @@ dlopen-resolv.patch
 tzdir.patch
 dlopen-libXcursor.patch
 xdg-config-dirs.patch
-nix-profiles-library-paths.patch
+library-paths.patch
 libressl.patch
-qpa-platform-plugin-path.patch
 dlopen-gl.patch
 compose-search-path.patch
 cmake-paths.patch
diff --git a/pkgs/development/libraries/qt-5/5.8/qtdeclarative/nix-profiles-import-paths.patch b/pkgs/development/libraries/qt-5/5.8/qtdeclarative/import-paths.patch
index 2d51f7b675960..d50ee823a78ba 100644
--- a/pkgs/development/libraries/qt-5/5.8/qtdeclarative/nix-profiles-import-paths.patch
+++ b/pkgs/development/libraries/qt-5/5.8/qtdeclarative/import-paths.patch
@@ -6,12 +6,12 @@ Index: qtdeclarative-opensource-src-5.8.0/src/qml/qml/qqmlimport.cpp
      QString installImportsPath =  QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
      addImportPath(installImportsPath);
  
-+    // Add library paths derived from NIX_PROFILES.
-+    const QStringList profiles = QFile::decodeName(qgetenv("NIX_PROFILES")).split(' ');
-+    const QString qmldir = QStringLiteral(NIXPKGS_QML2_IMPORT_PREFIX);
-+    for (const QString &profile: profiles) {
-+        if (!profile.isEmpty()) {
-+            addImportPath(profile + QDir::separator() + qmldir);
++    // Add import paths derived from PATH
++    const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
++    const QString qmldir = QStringLiteral("../" NIXPKGS_QML2_IMPORT_PREFIX);
++    for (const QString &path: paths) {
++        if (!path.isEmpty()) {
++            addImportPath(QDir::cleanPath(path + QDir::separator() + qmldir));
 +        }
 +    }
 +
diff --git a/pkgs/development/libraries/qt-5/5.8/qtdeclarative/series b/pkgs/development/libraries/qt-5/5.8/qtdeclarative/series
index 7dbe197c56e01..38abb916a508f 100644
--- a/pkgs/development/libraries/qt-5/5.8/qtdeclarative/series
+++ b/pkgs/development/libraries/qt-5/5.8/qtdeclarative/series
@@ -1 +1 @@
-nix-profiles-import-paths.patch
+import-paths.patch