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 000000000000..68163fc0c312 --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.6/qtbase/nix-profiles-library-paths.patch @@ -0,0 +1,20 @@ +Index: qtbase-opensource-src-5.6.2/src/corelib/kernel/qcoreapplication.cpp +=================================================================== +--- qtbase-opensource-src-5.6.2.orig/src/corelib/kernel/qcoreapplication.cpp ++++ qtbase-opensource-src-5.6.2/src/corelib/kernel/qcoreapplication.cpp +@@ -2533,6 +2533,15 @@ 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"); ++ for (const QByteArray &profile: profiles) { ++ if (!profile.isEmpty()) { ++ app_libpaths->append(QFile::decodeName(profile) + plugindir); ++ } ++ } ++ + const QByteArray libPathEnv = qgetenv("QT_PLUGIN_PATH"); + if (!libPathEnv.isEmpty()) { + QStringList paths = QFile::decodeName(libPathEnv).split(QDir::listSeparator(), QString::SkipEmptyParts); diff --git a/pkgs/development/libraries/qt-5/5.6/qtbase/series b/pkgs/development/libraries/qt-5/5.6/qtbase/series index 9ef8c998c661..2196d8383752 100644 --- a/pkgs/development/libraries/qt-5/5.6/qtbase/series +++ b/pkgs/development/libraries/qt-5/5.6/qtbase/series @@ -4,5 +4,6 @@ dlopen-libXcursor.patch dlopen-openssl.patch dlopen-dbus.patch xdg-config-dirs.patch +nix-profiles-library-paths.patch compose-search-path.patch libressl.patch 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/nix-profiles-library-paths.patch new file mode 100644 index 000000000000..c5d91066d8f6 --- /dev/null +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/nix-profiles-library-paths.patch @@ -0,0 +1,22 @@ +Index: qtbase-opensource-src-5.8.0/src/corelib/kernel/qcoreapplication.cpp +=================================================================== +--- qtbase-opensource-src-5.8.0.orig/src/corelib/kernel/qcoreapplication.cpp ++++ qtbase-opensource-src-5.8.0/src/corelib/kernel/qcoreapplication.cpp +@@ -2476,7 +2476,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"); ++ for (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) { diff --git a/pkgs/development/libraries/qt-5/5.8/qtbase/series b/pkgs/development/libraries/qt-5/5.8/qtbase/series index 0378ca1f5035..6f6942b44443 100644 --- a/pkgs/development/libraries/qt-5/5.8/qtbase/series +++ b/pkgs/development/libraries/qt-5/5.8/qtbase/series @@ -2,6 +2,7 @@ dlopen-resolv.patch tzdir.patch dlopen-libXcursor.patch xdg-config-dirs.patch +nix-profiles-library-paths.patch libressl.patch qpa-plugin-path.patch dlopen-gl.patch