summary refs log tree commit diff
path: root/pkgs/development/libraries/qt-5/5.5/qtbase/nix-profiles-library-paths.patch
blob: 470526b1dcdbf8e445a29af673f5d2ce516d4bc5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Index: qt-everywhere-opensource-src-5.5.1/qtbase/src/corelib/kernel/qcoreapplication.cpp
===================================================================
--- qt-everywhere-opensource-src-5.5.1.orig/qtbase/src/corelib/kernel/qcoreapplication.cpp
+++ qt-everywhere-opensource-src-5.5.1/qtbase/src/corelib/kernel/qcoreapplication.cpp
@@ -2498,6 +2498,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);
 }