summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-im/telegram-desktop/files')
-rw-r--r--net-im/telegram-desktop/files/2.1.0-kde-dir.patch51
-rw-r--r--net-im/telegram-desktop/files/tdesktop-4.10.0-system-cppgir.patch32
-rw-r--r--net-im/telegram-desktop/files/tdesktop-4.10.5-qt_compare.patch12
-rw-r--r--net-im/telegram-desktop/files/tdesktop-4.2.4-jemalloc-only-telegram-r1.patch43
-rw-r--r--net-im/telegram-desktop/files/tdesktop-5.0.1-qt6-no-wayland.patch95
5 files changed, 182 insertions, 51 deletions
diff --git a/net-im/telegram-desktop/files/2.1.0-kde-dir.patch b/net-im/telegram-desktop/files/2.1.0-kde-dir.patch
deleted file mode 100644
index b936275e3613..000000000000
--- a/net-im/telegram-desktop/files/2.1.0-kde-dir.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From 7bc86cc9af28ba3d04a5cb69f6f7c16bfe7f8719 Mon Sep 17 00:00:00 2001
-From: Ilya Fedin <fedin-ilja2010@ya.ru>
-Date: Tue, 21 Apr 2020 23:05:17 +0400
-Subject: [PATCH] Fix directory opening with portal and use them by default
- with KDE
-
----
- .../SourceFiles/platform/linux/file_utilities_linux.cpp | 6 +++---
- Telegram/SourceFiles/platform/linux/specific_linux.cpp | 2 +-
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp
-index 47dd56a411..88f8a69a91 100644
---- a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp
-+++ b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp
-@@ -83,11 +83,11 @@ constexpr auto kPreviewHeight = 512;
- using Type = ::FileDialog::internal::Type;
-
- #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
--bool NativeSupported() {
-+bool NativeSupported(Type type = Type::ReadFile) {
- #ifndef TDESKTOP_FORCE_GTK_FILE_DIALOG
- return false;
- #endif // TDESKTOP_FORCE_GTK_FILE_DIALOG
-- return !Platform::UseXDGDesktopPortal()
-+ return (!Platform::UseXDGDesktopPortal() || type == Type::ReadFolder)
- && Platform::internal::GdkHelperLoaded()
- && (Libs::gtk_widget_hide_on_delete != nullptr)
- && (Libs::gtk_clipboard_store != nullptr)
-@@ -192,7 +192,7 @@ bool Get(
- parent = parent->window();
- }
- #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
-- if (NativeSupported()) {
-+ if (NativeSupported(type)) {
- return GetNative(
- parent,
- files,
-diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp
-index 0bb3963420..c12e5a0780 100644
---- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp
-+++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp
-@@ -266,7 +266,7 @@ bool UseXDGDesktopPortal() {
- const auto envVar = qEnvironmentVariableIsSet("TDESKTOP_USE_PORTAL");
- const auto portalPresent = IsXDGDesktopPortalPresent();
-
-- return envVar && portalPresent;
-+ return (DesktopEnvironment::IsKDE() || envVar) && portalPresent;
- }();
-
- return UsePortal;
diff --git a/net-im/telegram-desktop/files/tdesktop-4.10.0-system-cppgir.patch b/net-im/telegram-desktop/files/tdesktop-4.10.0-system-cppgir.patch
new file mode 100644
index 000000000000..39f30ff0d2d2
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-4.10.0-system-cppgir.patch
@@ -0,0 +1,32 @@
+Use system cppgir
+
+https://github.com/desktop-app/cmake_helpers/issues/282
+https://github.com/desktop-app/cmake_helpers/pull/305
+--- tdesktop-4.10.0-full.orig/cmake/external/glib/CMakeLists.txt
++++ tdesktop-4.10.0-full/cmake/external/glib/CMakeLists.txt
+@@ -7,14 +7,6 @@
+ add_library(external_glib INTERFACE IMPORTED GLOBAL)
+ add_library(desktop-app::external_glib ALIAS external_glib)
+
+-function(add_cppgir) # isolate scope
+- set(BUILD_TESTING OFF)
+- set(BUILD_DOC OFF)
+- set(BUILD_EXAMPLES OFF)
+- add_subdirectory(cppgir EXCLUDE_FROM_ALL)
+-endfunction()
+-add_cppgir()
+-
+ include(generate_cppgir.cmake)
+ generate_cppgir(external_glib Gio-2.0)
+
+--- tdesktop-4.10.0-full.orig/cmake/external/glib/generate_cppgir.cmake
++++ tdesktop-4.10.0-full/cmake/external/glib/generate_cppgir.cmake
+@@ -4,6 +4,8 @@
+ # For license and copyright information please follow this link:
+ # https://github.com/desktop-app/legal/blob/master/LEGAL
+
++find_package(CppGir REQUIRED)
++
+ function(generate_cppgir target_name gir)
+ # cppgir generates all the dependent headers everytime, better to have a global folder
+ set(gen_dst ${CMAKE_BINARY_DIR}/gen)
diff --git a/net-im/telegram-desktop/files/tdesktop-4.10.5-qt_compare.patch b/net-im/telegram-desktop/files/tdesktop-4.10.5-qt_compare.patch
new file mode 100644
index 000000000000..f481ddd74d7c
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-4.10.5-qt_compare.patch
@@ -0,0 +1,12 @@
+diff --git a/Telegram/lib_base/base/qt/qt_compare.h b/Telegram/lib_base/base/qt/qt_compare.h
+index ca03fa2..d1eb6ab 100644
+--- a/Telegram/lib_base/base/qt/qt_compare.h
++++ b/Telegram/lib_base/base/qt/qt_compare.h
+@@ -10,6 +10,7 @@
+ #include <gsl/pointers>
+
+ #include <QString>
++#include <variant>
+
+ #if !defined(__apple_build_version__) || (__apple_build_version__ > 12000032)
+
diff --git a/net-im/telegram-desktop/files/tdesktop-4.2.4-jemalloc-only-telegram-r1.patch b/net-im/telegram-desktop/files/tdesktop-4.2.4-jemalloc-only-telegram-r1.patch
new file mode 100644
index 000000000000..d56bacea69f8
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-4.2.4-jemalloc-only-telegram-r1.patch
@@ -0,0 +1,43 @@
+Only link jemalloc for the Telegram binary
+
+Some combination of factors is making the different codegen tools hang when
+jemalloc is linked for those, and they're ran under portage's sandbox. Since
+this is only used during build-time, and jemalloc is merely necessary to
+improve runtime memory use, it's unnecessary to use it for anything else.
+
+https://bugs.gentoo.org/802624
+
+--- tdesktop-4.2.4-full.orig/Telegram/CMakeLists.txt
++++ tdesktop-4.2.4-full/Telegram/CMakeLists.txt
+@@ -1478,6 +1478,14 @@
+ desktop-app::external_wayland_client
+ )
+ endif()
++
++ if (NOT DESKTOP_APP_DISABLE_JEMALLOC)
++ target_link_libraries(Telegram
++ PRIVATE
++ $<TARGET_OBJECTS:desktop-app::linux_jemalloc_helper>
++ $<LINK_ONLY:desktop-app::external_jemalloc>
++ )
++ endif()
+ endif()
+
+ if (build_macstore)
+--- tdesktop-4.2.4-full.orig/cmake/options_linux.cmake
++++ tdesktop-4.2.4-full/cmake/options_linux.cmake
+@@ -78,14 +78,6 @@
+ )
+ endif()
+
+-if (NOT DESKTOP_APP_DISABLE_JEMALLOC)
+- target_link_libraries(common_options
+- INTERFACE
+- $<TARGET_OBJECTS:desktop-app::linux_jemalloc_helper>
+- $<LINK_ONLY:desktop-app::external_jemalloc>
+- )
+-endif()
+-
+ if (DESKTOP_APP_USE_ALLOCATION_TRACER)
+ target_link_options(common_options
+ INTERFACE
diff --git a/net-im/telegram-desktop/files/tdesktop-5.0.1-qt6-no-wayland.patch b/net-im/telegram-desktop/files/tdesktop-5.0.1-qt6-no-wayland.patch
new file mode 100644
index 000000000000..2c10ceb9b388
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-5.0.1-qt6-no-wayland.patch
@@ -0,0 +1,95 @@
+Allow disabling wayland integration for Qt6 builds
+
+Upstream has removed the required toggle for wayland integration, and instead
+is forcing it when the program is being built with Qt6 version 6.5.0 or higher.
+
+Currently this is simple to work around, but its future feasibility remains to
+be seen, depending on what upstream thinks about this.
+
+https://bugs.gentoo.org/928451
+https://github.com/desktop-app/cmake_helpers/commit/a428df5440e76a726abc30924766ac7da0cb381c
+
+--- a/Telegram/lib_base/base/platform/linux/base_linux_xdg_activation_token.cpp
++++ b/Telegram/lib_base/base/platform/linux/base_linux_xdg_activation_token.cpp
+@@ -15,7 +15,7 @@
+ namespace base::Platform {
+
+ void RunWithXdgActivationToken(Fn<void(QString)> callback) {
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
++#if !defined DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION && QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+ const auto window = QGuiApplication::focusWindow();
+ if (!window) {
+ callback({});
+--- a/Telegram/lib_ui/ui/platform/linux/ui_utility_linux.cpp
++++ b/Telegram/lib_ui/ui/platform/linux/ui_utility_linux.cpp
+@@ -413,7 +413,7 @@
+ }
+ #endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
+
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
++#if !defined DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION && QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+ void ShowWaylandWindowMenu(not_null<QWidget*> widget, const QPoint &point) {
+ static const auto wl_proxy_marshal_array = [] {
+ void (*result)(
+@@ -533,7 +533,7 @@
+ }
+
+ bool WindowMarginsSupported() {
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
++#if !defined DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION && QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+ static const auto WaylandResult = [] {
+ using namespace QNativeInterface::Private;
+ QWindow window;
+@@ -560,7 +560,7 @@
+ }
+
+ void SetWindowMargins(not_null<QWidget*> widget, const QMargins &margins) {
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
++#if !defined DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION && QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+ using namespace QNativeInterface::Private;
+ const auto window = not_null(widget->windowHandle());
+ const auto platformWindow = not_null(window->handle());
+@@ -582,7 +582,7 @@
+ }
+
+ void UnsetWindowMargins(not_null<QWidget*> widget) {
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
++#if !defined DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION && QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+ using namespace QNativeInterface::Private;
+ if (const auto native = not_null(widget->windowHandle())
+ ->nativeInterface<QWaylandWindow>()) {
+@@ -600,7 +600,7 @@
+ }
+
+ void ShowWindowMenu(not_null<QWidget*> widget, const QPoint &point) {
+-#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
++#if !defined DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION && QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
+ if (::Platform::IsWayland()) {
+ ShowWaylandWindowMenu(widget, point);
+ return;
+--- a/cmake/options.cmake
++++ b/cmake/options.cmake
+@@ -23,6 +23,13 @@
+ )
+ endif()
+
++if (DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION)
++ target_compile_definitions(common_options
++ INTERFACE
++ DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION
++ )
++endif()
++
+ if (WIN32)
+ include(cmake/options_win.cmake)
+ elseif (APPLE)
+--- a/cmake/variables.cmake
++++ b/cmake/variables.cmake
+@@ -21,6 +21,7 @@
+
+ option(DESKTOP_APP_LOTTIE_USE_CACHE "Use caching in lottie animations." ON)
+ cmake_dependent_option(DESKTOP_APP_DISABLE_X11_INTEGRATION "Disable all code for X11 integration." OFF LINUX ON)
++cmake_dependent_option(DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION "Disable all code for Wayland integration." OFF LINUX ON)
+ cmake_dependent_option(DESKTOP_APP_USE_ALLOCATION_TRACER "Use simple allocation tracer." OFF LINUX OFF)
+ cmake_dependent_option(DESKTOP_APP_USE_PACKAGED_LAZY "Bundle recommended Qt plugins for self-contained packages." OFF LINUX OFF)
+ option(DESKTOP_APP_USE_PACKAGED_FONTS "Use preinstalled fonts instead of bundled patched ones." OFF)