about summary refs log tree commit diff
path: root/pkgs/development/libraries/qt-5/5.6/qtbase/nix-profiles-library-paths.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/qt-5/5.6/qtbase/nix-profiles-library-paths.patch')
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtbase/nix-profiles-library-paths.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/nix-profiles-library-paths.patch b/pkgs/development/libraries/qt-5/5.6/qtbase/nix-profiles-library-paths.patch
new file mode 100644
index 0000000000000..b2aad140ad0f2
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.6/qtbase/nix-profiles-library-paths.patch
@@ -0,0 +1,22 @@
+Index: qt-everywhere-opensource-src-5.6.0/qtbase/src/corelib/kernel/qcoreapplication.cpp
+===================================================================
+--- qt-everywhere-opensource-src-5.6.0.orig/qtbase/src/corelib/kernel/qcoreapplication.cpp
++++ qt-everywhere-opensource-src-5.6.0/qtbase/src/corelib/kernel/qcoreapplication.cpp
+@@ -2533,7 +2533,17 @@ QStringList QCoreApplication::libraryPat
+         QStringList *app_libpaths = new QStringList;
+         coreappdata()->app_libpaths.reset(app_libpaths);
+ 
++        // Add library paths derived from NIX_PROFILES.
++        const QByteArrayList profiles = qgetenv("NIX_PROFILES").split(' ');
++        const QString plugindir = QString::fromLatin1("/lib/qt5/plugins");
++        Q_FOREACH (const QByteArray &profile, profiles) {
++            if (!profile.isEmpty()) {
++                app_libpaths->append(QFile::decodeName(profile) + plugindir);
++            }
++        }
++
+         const QByteArray libPathEnv = qgetenv("QT_PLUGIN_PATH");
++        qunsetenv("QT_PLUGIN_PATH"); // do not propagate to child processes
+         if (!libPathEnv.isEmpty()) {
+             QStringList paths = QFile::decodeName(libPathEnv).split(QDir::listSeparator(), QString::SkipEmptyParts);
+             for (QStringList::const_iterator it = paths.constBegin(); it != paths.constEnd(); ++it) {