1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 05:00:16 +00:00

Revert "qt58: ignore NIX_PROFILES environment variable"

This reverts commit 6169bd98f5.
This commit is contained in:
Thomas Tuegel 2017-05-10 15:57:24 -05:00
parent e8880627e8
commit 88a5082edf
No known key found for this signature in database
GPG key ID: 22CBF5249D4B4D59
4 changed files with 44 additions and 0 deletions

View file

@ -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);

View file

@ -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

View file

@ -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) {

View file

@ -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