qt58.qtbase: Fix QT_QPA_PLATFORM_PLUGIN_PATH

The default installation path for QPA plugins is appended to
QT_QPA_PLATFORM_PLUGIN_PATH, making it unnecessary to wrap some applications and
preventing applications from loading platform plugins from the wrong Qt version.
This commit is contained in:
Thomas Tuegel 2017-04-15 11:12:11 -05:00
parent 44eb84feb6
commit 2ce3fe0a71
No known key found for this signature in database
GPG Key ID: 22CBF5249D4B4D59
3 changed files with 30 additions and 5 deletions

@ -106,6 +106,8 @@ stdenv.mkDerivation {
-importdir $out/lib/qt5/imports \
-qmldir $out/lib/qt5/qml \
-docdir $out/share/doc/qt5"
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QPA_PLATFORM_PLUGIN_PATH=\"''${!outputLib}/lib/qt5/plugins\""
'';
prefixKey = "-prefix ";
@ -227,11 +229,18 @@ stdenv.mkDerivation {
nativeBuildInputs = [ bison flex gperf lndir perl pkgconfig python2 ] ++ lib.optional (!stdenv.isDarwin) patchelf;
# freetype-2.5.4 changed signedness of some struct fields
NIX_CFLAGS_COMPILE = "-Wno-error=sign-compare"
+ lib.optionalString stdenv.isDarwin " -D__MAC_OS_X_VERSION_MAX_ALLOWED=1090 -D__AVAILABILITY_INTERNAL__MAC_10_10=__attribute__((availability(macosx,introduced=10.10)))";
# Note that nixpkgs's objc4 is from macOS 10.11 while the SDK is
# 10.9 which necessitates the above macro definition that mentions
# 10.10
NIX_CFLAGS_COMPILE =
[
"-Wno-error=sign-compare"
]
++ lib.optionals stdenv.isDarwin
[
"-D__MAC_OS_X_VERSION_MAX_ALLOWED=1090"
"-D__AVAILABILITY_INTERNAL__MAC_10_10=__attribute__((availability(macosx,introduced=10.10)))"
# Note that nixpkgs's objc4 is from macOS 10.11 while the SDK is
# 10.9 which necessitates the above macro definition that mentions
# 10.10
];
postInstall = ''
find "$out" -name "*.cmake" | while read file; do

@ -0,0 +1,15 @@
Index: qtbase-opensource-src-5.8.0/src/gui/kernel/qguiapplication.cpp
===================================================================
--- qtbase-opensource-src-5.8.0.orig/src/gui/kernel/qguiapplication.cpp
+++ qtbase-opensource-src-5.8.0/src/gui/kernel/qguiapplication.cpp
@@ -1217,6 +1217,10 @@ void QGuiApplicationPrivate::createPlatf
// Load the platform integration
QString platformPluginPath = QString::fromLocal8Bit(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH"));
+ if (!platformPluginPath.isEmpty()) {
+ platformPluginPath.append(QStringLiteral(":"));
+ }
+ platformPluginPath.append(QStringLiteral(NIXPKGS_QPA_PLATFORM_PLUGIN_PATH));
QByteArray platformName;

@ -7,3 +7,4 @@ xdg-config-dirs.patch
nix-profiles-library-paths.patch
compose-search-path.patch
libressl.patch
qpa-plugin-path.patch