void-packages/srcpkgs/telegram-desktop/patches/qt5-dynamic-linking.patch

52 lines
2.1 KiB
Diff

From 6645b23021d169c8d3fc0f4522e1725571ace288 Mon Sep 17 00:00:00 2001
From: John Zimmermann <johnz@posteo.net>
Date: Wed, 26 Sep 2018 20:36:13 +0200
Subject: [PATCH 2/7] Fix a few bugs that are caused by dynamic linking to qt5.
---
Telegram/SourceFiles/core/launcher.cpp | 8 ++++++++
Telegram/SourceFiles/qt_static_plugins.cpp | 9 ---------
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git Telegram/SourceFiles/core/launcher.cpp Telegram/SourceFiles/core/launcher.cpp
index d4bdadc17..bf9066274 100644
--- Telegram/SourceFiles/core/launcher.cpp
+++ Telegram/SourceFiles/core/launcher.cpp
@@ -59,6 +59,14 @@ int Launcher::exec() {
Logs::start(this); // must be started before Platform is started
Platform::start(); // must be started before QApplication is created
+
+ // I don't know why path is not in QT_PLUGIN_PATH by default
+ QCoreApplication::addLibraryPath("/usr/lib/qt/plugins");
+ // without this Telegram doesn't start on Ubuntu 17.04 due GTK errors
+ setenv("QT_STYLE_OVERRIDE", "qwerty", false);
+ // Telegram doesn't start when extraordinary theme is set, see launchpad.net/bugs/1680943
+ unsetenv("QT_QPA_PLATFORMTHEME");
+
auto result = executeApplication();
DEBUG_LOG(("Telegram finished, result: %1").arg(result));
diff --git Telegram/SourceFiles/qt_static_plugins.cpp Telegram/SourceFiles/qt_static_plugins.cpp
index e29f348c8..122ff0f5d 100644
--- Telegram/SourceFiles/qt_static_plugins.cpp
+++ Telegram/SourceFiles/qt_static_plugins.cpp
@@ -15,13 +15,4 @@ Q_IMPORT_PLUGIN(QWebpPlugin)
Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)
Q_IMPORT_PLUGIN(QGenericEnginePlugin)
#elif defined Q_OS_LINUX // Q_OS_WIN | Q_OS_MAC
-Q_IMPORT_PLUGIN(QWebpPlugin)
-Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
-Q_IMPORT_PLUGIN(QConnmanEnginePlugin)
-Q_IMPORT_PLUGIN(QGenericEnginePlugin)
-Q_IMPORT_PLUGIN(QNetworkManagerEnginePlugin)
-Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin)
-Q_IMPORT_PLUGIN(QIbusPlatformInputContextPlugin)
-Q_IMPORT_PLUGIN(QFcitxPlatformInputContextPlugin)
-Q_IMPORT_PLUGIN(QHimePlatformInputContextPlugin)
#endif // Q_OS_WIN | Q_OS_MAC | Q_OS_LINUX
--
2.19.0