mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 02:42:59 +00:00
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.1/src/network/kernel/qdnslookup_unix.cpp
|
||||
@@ -78,7 +78,7 @@ static bool resolveLibraryInternal()
|
||||
--- qtbase-opensource-src-5.6.2.orig/src/network/kernel/qdnslookup_unix.cpp
|
||||
+++ qtbase-opensource-src-5.6.2/src/network/kernel/qdnslookup_unix.cpp
|
||||
@@ -83,7 +83,7 @@ static bool resolveLibraryInternal()
|
||||
if (!lib.load())
|
||||
#endif
|
||||
{
|
||||
@ -11,10 +11,10 @@ Index: qtbase-opensource-src-5.6.1/src/network/kernel/qdnslookup_unix.cpp
|
||||
if (!lib.load())
|
||||
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.1/src/network/kernel/qhostinfo_unix.cpp
|
||||
--- qtbase-opensource-src-5.6.2.orig/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()
|
||||
if (!lib.load())
|
||||
#endif
|
||||
|
@ -6,12 +6,12 @@ Index: qtbase-opensource-src-5.6.2/src/corelib/kernel/qcoreapplication.cpp
|
||||
QStringList *app_libpaths = new QStringList;
|
||||
coreappdata()->app_libpaths.reset(app_libpaths);
|
||||
|
||||
+ // Add library paths derived from NIX_PROFILES.
|
||||
+ const QStringList profiles = QFile::decodeName(qgetenv("NIX_PROFILES")).split(' ');
|
||||
+ const QString plugindir = QStringLiteral(NIXPKGS_QT_PLUGIN_PREFIX);
|
||||
+ for (const QString &profile: profiles) {
|
||||
+ if (!profile.isEmpty()) {
|
||||
+ app_libpaths->append(profile + QDir::separator() + plugindir);
|
||||
+ // Add library paths derived from PATH
|
||||
+ const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
|
||||
+ const QString plugindir = QStringLiteral("../" NIXPKGS_QT_PLUGIN_PREFIX);
|
||||
+ for (const QString &path: paths) {
|
||||
+ if (!path.isEmpty()) {
|
||||
+ app_libpaths->append(QDir::cleanPath(path + QDir::separator() + plugindir));
|
||||
+ }
|
||||
+ }
|
||||
+
|
@ -4,7 +4,6 @@ dlopen-libXcursor.patch
|
||||
dlopen-openssl.patch
|
||||
dlopen-dbus.patch
|
||||
xdg-config-dirs.patch
|
||||
nix-profiles-library-paths.patch
|
||||
library-paths.patch
|
||||
compose-search-path.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.0/src/corelib/tools/qtimezoneprivate_tz.cpp
|
||||
@@ -62,7 +62,10 @@ typedef QHash<QByteArray, QTzTimeZone> Q
|
||||
--- qtbase-opensource-src-5.6.2.orig/src/corelib/tools/qtimezoneprivate_tz.cpp
|
||||
+++ qtbase-opensource-src-5.6.2/src/corelib/tools/qtimezoneprivate_tz.cpp
|
||||
@@ -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
|
||||
static QTzTimeZoneHash loadTzTimeZones()
|
||||
{
|
||||
@ -14,7 +14,7 @@ Index: qtbase-opensource-src-5.6.0/src/corelib/tools/qtimezoneprivate_tz.cpp
|
||||
if (!QFile::exists(path))
|
||||
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))
|
||||
return;
|
||||
} else {
|
||||
|
@ -6,12 +6,12 @@ Index: qtdeclarative-opensource-src-5.6.2/src/qml/qml/qqmlimport.cpp
|
||||
QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
|
||||
addImportPath(installImportsPath);
|
||||
|
||||
+ // Add library paths derived from NIX_PROFILES.
|
||||
+ const QStringList profiles = QFile::decodeName(qgetenv("NIX_PROFILES")).split(' ');
|
||||
+ const QString qmldir = QStringLiteral(NIXPKGS_QML2_IMPORT_PREFIX);
|
||||
+ for (const QString &profile: profiles) {
|
||||
+ if (!profile.isEmpty()) {
|
||||
+ addImportPath(profile + QDir::separator() + qmldir);
|
||||
+ // Add import paths derived from PATH
|
||||
+ const QStringList paths = QFile::decodeName(qgetenv("PATH")).split(':');
|
||||
+ const QString qmldir = QStringLiteral("../" NIXPKGS_QML2_IMPORT_PREFIX);
|
||||
+ for (const QString &path: paths) {
|
||||
+ if (!path.isEmpty()) {
|
||||
+ 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