lol

qt56: determine plugin and import paths from PATH

Plugin and QML import paths were previously determined by NIX_PROFILES. Using
PATH instead allows Qt applications to work under nix-shell without further modification.

+26 -27
+7 -7
pkgs/development/libraries/qt-5/5.6/qtbase/dlopen-resolv.patch
··· 1 - Index: qtbase-opensource-src-5.6.1/src/network/kernel/qdnslookup_unix.cpp 1 + Index: qtbase-opensource-src-5.6.2/src/network/kernel/qdnslookup_unix.cpp 2 2 =================================================================== 3 - --- qtbase-opensource-src-5.6.1.orig/src/network/kernel/qdnslookup_unix.cpp 4 - +++ qtbase-opensource-src-5.6.1/src/network/kernel/qdnslookup_unix.cpp 5 - @@ -78,7 +78,7 @@ static bool resolveLibraryInternal() 3 + --- qtbase-opensource-src-5.6.2.orig/src/network/kernel/qdnslookup_unix.cpp 4 + +++ qtbase-opensource-src-5.6.2/src/network/kernel/qdnslookup_unix.cpp 5 + @@ -83,7 +83,7 @@ static bool resolveLibraryInternal() 6 6 if (!lib.load()) 7 7 #endif 8 8 { ··· 11 11 if (!lib.load()) 12 12 return false; 13 13 } 14 - Index: qtbase-opensource-src-5.6.1/src/network/kernel/qhostinfo_unix.cpp 14 + Index: qtbase-opensource-src-5.6.2/src/network/kernel/qhostinfo_unix.cpp 15 15 =================================================================== 16 - --- qtbase-opensource-src-5.6.1.orig/src/network/kernel/qhostinfo_unix.cpp 17 - +++ qtbase-opensource-src-5.6.1/src/network/kernel/qhostinfo_unix.cpp 16 + --- qtbase-opensource-src-5.6.2.orig/src/network/kernel/qhostinfo_unix.cpp 17 + +++ qtbase-opensource-src-5.6.2/src/network/kernel/qhostinfo_unix.cpp 18 18 @@ -94,7 +94,7 @@ static bool resolveLibraryInternal() 19 19 if (!lib.load()) 20 20 #endif
+6 -6
pkgs/development/libraries/qt-5/5.6/qtbase/nix-profiles-library-paths.patch pkgs/development/libraries/qt-5/5.6/qtbase/library-paths.patch
··· 6 6 QStringList *app_libpaths = new QStringList; 7 7 coreappdata()->app_libpaths.reset(app_libpaths); 8 8 9 - + // Add library paths derived from NIX_PROFILES. 10 - + const QStringList profiles = QFile::decodeName(qgetenv("NIX_PROFILES")).split(' '); 11 - + const QString plugindir = QStringLiteral(NIXPKGS_QT_PLUGIN_PREFIX); 12 - + for (const QString &profile: profiles) { 13 - + if (!profile.isEmpty()) { 14 - + app_libpaths->append(profile + QDir::separator() + plugindir); 9 + + // Add library paths derived from PATH 10 + + const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':'); 11 + + const QString plugindir = QStringLiteral("../" NIXPKGS_QT_PLUGIN_PREFIX); 12 + + for (const QString &path: paths) { 13 + + if (!path.isEmpty()) { 14 + + app_libpaths->append(QDir::cleanPath(path + QDir::separator() + plugindir)); 15 15 + } 16 16 + } 17 17 +
+1 -2
pkgs/development/libraries/qt-5/5.6/qtbase/series
··· 4 4 dlopen-openssl.patch 5 5 dlopen-dbus.patch 6 6 xdg-config-dirs.patch 7 - nix-profiles-library-paths.patch 7 + library-paths.patch 8 8 compose-search-path.patch 9 9 libressl.patch 10 - qpa-platform-plugin-path.patch
+5 -5
pkgs/development/libraries/qt-5/5.6/qtbase/tzdir.patch
··· 1 - Index: qtbase-opensource-src-5.6.0/src/corelib/tools/qtimezoneprivate_tz.cpp 1 + Index: qtbase-opensource-src-5.6.2/src/corelib/tools/qtimezoneprivate_tz.cpp 2 2 =================================================================== 3 - --- qtbase-opensource-src-5.6.0.orig/src/corelib/tools/qtimezoneprivate_tz.cpp 4 - +++ qtbase-opensource-src-5.6.0/src/corelib/tools/qtimezoneprivate_tz.cpp 5 - @@ -62,7 +62,10 @@ typedef QHash<QByteArray, QTzTimeZone> Q 3 + --- qtbase-opensource-src-5.6.2.orig/src/corelib/tools/qtimezoneprivate_tz.cpp 4 + +++ qtbase-opensource-src-5.6.2/src/corelib/tools/qtimezoneprivate_tz.cpp 5 + @@ -64,7 +64,10 @@ typedef QHash<QByteArray, QTzTimeZone> Q 6 6 // Parse zone.tab table, assume lists all installed zones, if not will need to read directories 7 7 static QTzTimeZoneHash loadTzTimeZones() 8 8 { ··· 14 14 if (!QFile::exists(path)) 15 15 path = QStringLiteral("/usr/lib/zoneinfo/zone.tab"); 16 16 17 - @@ -560,12 +563,18 @@ void QTzTimeZonePrivate::init(const QByt 17 + @@ -636,12 +639,18 @@ void QTzTimeZonePrivate::init(const QByt 18 18 if (!tzif.open(QIODevice::ReadOnly)) 19 19 return; 20 20 } else {
+6 -6
pkgs/development/libraries/qt-5/5.6/qtdeclarative/nix-profiles-import-paths.patch pkgs/development/libraries/qt-5/5.6/qtdeclarative/import-paths.patch
··· 6 6 QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath); 7 7 addImportPath(installImportsPath); 8 8 9 - + // Add library paths derived from NIX_PROFILES. 10 - + const QStringList profiles = QFile::decodeName(qgetenv("NIX_PROFILES")).split(' '); 11 - + const QString qmldir = QStringLiteral(NIXPKGS_QML2_IMPORT_PREFIX); 12 - + for (const QString &profile: profiles) { 13 - + if (!profile.isEmpty()) { 14 - + addImportPath(profile + QDir::separator() + qmldir); 9 + + // Add import paths derived from PATH 10 + + const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':'); 11 + + const QString qmldir = QStringLiteral("../" NIXPKGS_QML2_IMPORT_PREFIX); 12 + + for (const QString &path: paths) { 13 + + if (!path.isEmpty()) { 14 + + addImportPath(QDir::cleanPath(path + QDir::separator() + qmldir)); 15 15 + } 16 16 + } 17 17 +
+1 -1
pkgs/development/libraries/qt-5/5.6/qtdeclarative/series
··· 1 - nix-profiles-import-paths.patch 1 + import-paths.patch