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.
This commit is contained in:
parent
dab7700f6c
commit
e6cf9b9df0
@ -1,8 +1,8 @@
|
|||||||
Index: qtbase-opensource-src-5.6.1/src/network/kernel/qdnslookup_unix.cpp
|
Index: qtbase-opensource-src-5.6.2/src/network/kernel/qdnslookup_unix.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- qtbase-opensource-src-5.6.1.orig/src/network/kernel/qdnslookup_unix.cpp
|
--- qtbase-opensource-src-5.6.2.orig/src/network/kernel/qdnslookup_unix.cpp
|
||||||
+++ qtbase-opensource-src-5.6.1/src/network/kernel/qdnslookup_unix.cpp
|
+++ qtbase-opensource-src-5.6.2/src/network/kernel/qdnslookup_unix.cpp
|
||||||
@@ -78,7 +78,7 @@ static bool resolveLibraryInternal()
|
@@ -83,7 +83,7 @@ static bool resolveLibraryInternal()
|
||||||
if (!lib.load())
|
if (!lib.load())
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@ -11,10 +11,10 @@ Index: qtbase-opensource-src-5.6.1/src/network/kernel/qdnslookup_unix.cpp
|
|||||||
if (!lib.load())
|
if (!lib.load())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Index: qtbase-opensource-src-5.6.1/src/network/kernel/qhostinfo_unix.cpp
|
Index: qtbase-opensource-src-5.6.2/src/network/kernel/qhostinfo_unix.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- qtbase-opensource-src-5.6.1.orig/src/network/kernel/qhostinfo_unix.cpp
|
--- qtbase-opensource-src-5.6.2.orig/src/network/kernel/qhostinfo_unix.cpp
|
||||||
+++ qtbase-opensource-src-5.6.1/src/network/kernel/qhostinfo_unix.cpp
|
+++ qtbase-opensource-src-5.6.2/src/network/kernel/qhostinfo_unix.cpp
|
||||||
@@ -94,7 +94,7 @@ static bool resolveLibraryInternal()
|
@@ -94,7 +94,7 @@ static bool resolveLibraryInternal()
|
||||||
if (!lib.load())
|
if (!lib.load())
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,12 +6,12 @@ Index: qtbase-opensource-src-5.6.2/src/corelib/kernel/qcoreapplication.cpp
|
|||||||
QStringList *app_libpaths = new QStringList;
|
QStringList *app_libpaths = new QStringList;
|
||||||
coreappdata()->app_libpaths.reset(app_libpaths);
|
coreappdata()->app_libpaths.reset(app_libpaths);
|
||||||
|
|
||||||
+ // Add library paths derived from NIX_PROFILES.
|
+ // Add library paths derived from PATH
|
||||||
+ const QStringList profiles = QFile::decodeName(qgetenv("NIX_PROFILES")).split(' ');
|
+ const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
|
||||||
+ const QString plugindir = QStringLiteral(NIXPKGS_QT_PLUGIN_PREFIX);
|
+ const QString plugindir = QStringLiteral("../" NIXPKGS_QT_PLUGIN_PREFIX);
|
||||||
+ for (const QString &profile: profiles) {
|
+ for (const QString &path: paths) {
|
||||||
+ if (!profile.isEmpty()) {
|
+ if (!path.isEmpty()) {
|
||||||
+ app_libpaths->append(profile + QDir::separator() + plugindir);
|
+ app_libpaths->append(QDir::cleanPath(path + QDir::separator() + plugindir));
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
@ -4,7 +4,6 @@ dlopen-libXcursor.patch
|
|||||||
dlopen-openssl.patch
|
dlopen-openssl.patch
|
||||||
dlopen-dbus.patch
|
dlopen-dbus.patch
|
||||||
xdg-config-dirs.patch
|
xdg-config-dirs.patch
|
||||||
nix-profiles-library-paths.patch
|
library-paths.patch
|
||||||
compose-search-path.patch
|
compose-search-path.patch
|
||||||
libressl.patch
|
libressl.patch
|
||||||
qpa-platform-plugin-path.patch
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
Index: qtbase-opensource-src-5.6.0/src/corelib/tools/qtimezoneprivate_tz.cpp
|
Index: qtbase-opensource-src-5.6.2/src/corelib/tools/qtimezoneprivate_tz.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- qtbase-opensource-src-5.6.0.orig/src/corelib/tools/qtimezoneprivate_tz.cpp
|
--- qtbase-opensource-src-5.6.2.orig/src/corelib/tools/qtimezoneprivate_tz.cpp
|
||||||
+++ qtbase-opensource-src-5.6.0/src/corelib/tools/qtimezoneprivate_tz.cpp
|
+++ qtbase-opensource-src-5.6.2/src/corelib/tools/qtimezoneprivate_tz.cpp
|
||||||
@@ -62,7 +62,10 @@ typedef QHash<QByteArray, QTzTimeZone> Q
|
@@ -64,7 +64,10 @@ typedef QHash<QByteArray, QTzTimeZone> Q
|
||||||
// Parse zone.tab table, assume lists all installed zones, if not will need to read directories
|
// Parse zone.tab table, assume lists all installed zones, if not will need to read directories
|
||||||
static QTzTimeZoneHash loadTzTimeZones()
|
static QTzTimeZoneHash loadTzTimeZones()
|
||||||
{
|
{
|
||||||
@ -14,7 +14,7 @@ Index: qtbase-opensource-src-5.6.0/src/corelib/tools/qtimezoneprivate_tz.cpp
|
|||||||
if (!QFile::exists(path))
|
if (!QFile::exists(path))
|
||||||
path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
|
path = QStringLiteral("/usr/lib/zoneinfo/zone.tab");
|
||||||
|
|
||||||
@@ -560,12 +563,18 @@ void QTzTimeZonePrivate::init(const QByt
|
@@ -636,12 +639,18 @@ void QTzTimeZonePrivate::init(const QByt
|
||||||
if (!tzif.open(QIODevice::ReadOnly))
|
if (!tzif.open(QIODevice::ReadOnly))
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -6,12 +6,12 @@ Index: qtdeclarative-opensource-src-5.6.2/src/qml/qml/qqmlimport.cpp
|
|||||||
QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
|
QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
|
||||||
addImportPath(installImportsPath);
|
addImportPath(installImportsPath);
|
||||||
|
|
||||||
+ // Add library paths derived from NIX_PROFILES.
|
+ // Add import paths derived from PATH
|
||||||
+ const QStringList profiles = QFile::decodeName(qgetenv("NIX_PROFILES")).split(' ');
|
+ const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
|
||||||
+ const QString qmldir = QStringLiteral(NIXPKGS_QML2_IMPORT_PREFIX);
|
+ const QString qmldir = QStringLiteral("../" NIXPKGS_QML2_IMPORT_PREFIX);
|
||||||
+ for (const QString &profile: profiles) {
|
+ for (const QString &path: paths) {
|
||||||
+ if (!profile.isEmpty()) {
|
+ if (!path.isEmpty()) {
|
||||||
+ addImportPath(profile + QDir::separator() + qmldir);
|
+ addImportPath(QDir::cleanPath(path + QDir::separator() + qmldir));
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
@ -1 +1 @@
|
|||||||
nix-profiles-import-paths.patch
|
import-paths.patch
|
||||||
|
Loading…
Reference in New Issue
Block a user