3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/qt-5/5.6/qtbase/nix-profiles-library-paths.patch
2016-06-09 18:44:56 +03:00

23 lines
1.3 KiB
Diff

Index: qtbase-opensource-src-5.6.0/src/corelib/kernel/qcoreapplication.cpp
===================================================================
--- qtbase-opensource-src-5.6.0.orig/src/corelib/kernel/qcoreapplication.cpp
+++ qtbase-opensource-src-5.6.0/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) {