summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEsteve Varela Colominas <esteve.varela@gmail.com>2021-08-03 23:07:49 +0200
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2021-08-04 01:29:27 -0700
commitba3e19059ebe0e6eb6a05e53fd42fff5bdf8e5fd (patch)
treeb3a13e768dd60c83e3c4359f40da34ca09f6df10 /net-im/telegram-desktop
parentsys-fs/mdadm: Bump to version 4.2_rc2. Removed old (diff)
downloadgentoo-ba3e19059ebe0e6eb6a05e53fd42fff5bdf8e5fd.tar.gz
gentoo-ba3e19059ebe0e6eb6a05e53fd42fff5bdf8e5fd.tar.bz2
gentoo-ba3e19059ebe0e6eb6a05e53fd42fff5bdf8e5fd.zip
net-im/telegram-desktop: Fix running with QT_QPA_PLATFORMTHEME=gtk2
Closes: https://bugs.gentoo.org/806292 See-also: https://bugs.archlinux.org/task/71541 Thanks-to: Ilia Durov <ildurrx@mail.ru> Signed-off-by: Esteve Varela Colominas <esteve.varela@gmail.com> Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'net-im/telegram-desktop')
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.8.11-load-gtk-with-qlibrary.patch112
-rw-r--r--net-im/telegram-desktop/telegram-desktop-2.8.11.ebuild3
2 files changed, 114 insertions, 1 deletions
diff --git a/net-im/telegram-desktop/files/tdesktop-2.8.11-load-gtk-with-qlibrary.patch b/net-im/telegram-desktop/files/tdesktop-2.8.11-load-gtk-with-qlibrary.patch
new file mode 100644
index 000000000000..91e3f859eebc
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-2.8.11-load-gtk-with-qlibrary.patch
@@ -0,0 +1,112 @@
+Fix running with QT_QPA_PLATFORMTHEME=gtk2
+
+From: https://bugs.archlinux.org/task/71541
+
+--- tdesktop-2.8.11-full.orig/Telegram/CMakeLists.txt
++++ tdesktop-2.8.11-full/Telegram/CMakeLists.txt
+@@ -114,25 +114,16 @@
+ endif()
+
+ if (NOT DESKTOP_APP_DISABLE_GTK_INTEGRATION)
+- target_link_libraries(Telegram PRIVATE rt)
+ find_package(PkgConfig REQUIRED)
+
+- if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
+- pkg_check_modules(GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0)
+- target_link_libraries(Telegram PRIVATE PkgConfig::GTK3)
+-
+- if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
+- pkg_check_modules(X11 REQUIRED IMPORTED_TARGET x11)
+- target_link_libraries(Telegram PRIVATE PkgConfig::X11)
+- endif()
+- else()
+- pkg_check_modules(GTK REQUIRED gtk+-3.0)
+- target_include_directories(Telegram PRIVATE ${GTK_INCLUDE_DIRS})
++ pkg_check_modules(GTK REQUIRED gtk+-3.0)
++ target_include_directories(Telegram PRIVATE ${GTK_INCLUDE_DIRS})
+
+- if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
+- target_link_libraries(Telegram PRIVATE X11)
+- endif()
++ if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
++ target_link_libraries(Telegram PRIVATE X11)
+ endif()
++
++ target_link_libraries(Telegram PRIVATE rt)
+ endif()
+ endif()
+
+--- tdesktop-2.8.11-full.orig/Telegram/lib_base/CMakeLists.txt
++++ tdesktop-2.8.11-full/Telegram/lib_base/CMakeLists.txt
+@@ -254,13 +254,8 @@
+ if (NOT DESKTOP_APP_DISABLE_GTK_INTEGRATION)
+ find_package(PkgConfig REQUIRED)
+
+- if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
+- pkg_check_modules(GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0)
+- target_link_libraries(lib_base PUBLIC PkgConfig::GTK3)
+- else()
+- pkg_check_modules(GTK REQUIRED gtk+-3.0)
+- target_include_directories(lib_base PUBLIC ${GTK_INCLUDE_DIRS})
+- endif()
++ pkg_check_modules(GTK REQUIRED gtk+-3.0)
++ target_include_directories(lib_base PUBLIC ${GTK_INCLUDE_DIRS})
+ endif()
+ endif()
+
+--- tdesktop-2.8.11-full.orig/Telegram/lib_base/base/platform/linux/base_linux_gtk_integration_p.h
++++ tdesktop-2.8.11-full/Telegram/lib_base/base/platform/linux/base_linux_gtk_integration_p.h
+@@ -13,15 +13,7 @@
+ #include <gdk/gdk.h>
+ } // extern "C"
+
+-#if defined DESKTOP_APP_USE_PACKAGED && !defined DESKTOP_APP_USE_PACKAGED_LAZY
+-#define LINK_TO_GTK
+-#endif // DESKTOP_APP_USE_PACKAGED && !DESKTOP_APP_USE_PACKAGED_LAZY
+-
+-#ifdef LINK_TO_GTK
+-#define LOAD_GTK_SYMBOL(lib, func) (func = ::func)
+-#else // LINK_TO_GTK
+ #define LOAD_GTK_SYMBOL LOAD_LIBRARY_SYMBOL
+-#endif // !LINK_TO_GTK
+
+ namespace base {
+ namespace Platform {
+@@ -31,11 +23,7 @@
+ QLibrary &lib,
+ const char *name,
+ std::optional<int> version = std::nullopt) {
+-#ifdef LINK_TO_GTK
+- return true;
+-#else // LINK_TO_GTK
+ return LoadLibrary(lib, name, version);
+-#endif // LINK_TO_GTK
+ }
+
+ inline gboolean (*gtk_init_check)(int *argc, char ***argv) = nullptr;
+--- tdesktop-2.8.11-full.orig/Telegram/lib_webview/CMakeLists.txt
++++ tdesktop-2.8.11-full/Telegram/lib_webview/CMakeLists.txt
+@@ -51,19 +51,11 @@
+ if (NOT DESKTOP_APP_DISABLE_WEBKIT)
+ find_package(PkgConfig REQUIRED)
+
+- if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
+- pkg_check_modules(GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0)
+- target_link_libraries(lib_webview PUBLIC PkgConfig::GTK3)
++ pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
++ target_include_directories(lib_webview PUBLIC ${GTK3_INCLUDE_DIRS})
+
+- pkg_check_modules(WEBKIT REQUIRED IMPORTED_TARGET webkit2gtk-4.0)
+- target_link_libraries(lib_webview PUBLIC PkgConfig::WEBKIT)
+- else()
+- pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
+- target_include_directories(lib_webview PUBLIC ${GTK3_INCLUDE_DIRS})
+-
+- pkg_check_modules(WEBKIT REQUIRED webkit2gtk-4.0)
+- target_include_directories(lib_webview PUBLIC ${WEBKIT_INCLUDE_DIRS})
+- endif()
++ pkg_check_modules(WEBKIT REQUIRED webkit2gtk-4.0)
++ target_include_directories(lib_webview PUBLIC ${WEBKIT_INCLUDE_DIRS})
+ else()
+ remove_target_sources(lib_webview ${src_loc}
+ webview/platform/linux/webview_linux_webkit_gtk.cpp
diff --git a/net-im/telegram-desktop/telegram-desktop-2.8.11.ebuild b/net-im/telegram-desktop/telegram-desktop-2.8.11.ebuild
index 3e3603edd15a..c82d78ed253c 100644
--- a/net-im/telegram-desktop/telegram-desktop-2.8.11.ebuild
+++ b/net-im/telegram-desktop/telegram-desktop-2.8.11.ebuild
@@ -76,8 +76,9 @@ PATCHES=(
"${FILESDIR}/tdesktop-2.8.9-disable-webkit-separately.patch"
# Not a proper fix, not upstreamed
"${FILESDIR}/tdesktop-2.8.9-webview-fix-glib.patch"
- # Not upstreamed (yet)
"${FILESDIR}/tdesktop-2.8.10-jemalloc-only-telegram.patch"
+ # Already upstream
+ "${FILESDIR}/tdesktop-2.8.11-load-gtk-with-qlibrary.patch"
)
pkg_pretend() {