summaryrefslogtreecommitdiff
path: root/net-im/telegram-desktop
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-06-15 14:57:03 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-06-15 14:57:03 +0100
commitd18bf1e01b65ee4bf0c804e2843b282d3d4e5d7c (patch)
tree4a95cbc6ffdf13bad6ecbc7f8d5af99631984123 /net-im/telegram-desktop
parente748ba9741f6540f4675c23e3e37b73e822c13a4 (diff)
gentoo resync : 15.06.2021
Diffstat (limited to 'net-im/telegram-desktop')
-rw-r--r--net-im/telegram-desktop/Manifest13
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.1-fix-disable-dbus-integration.patch2
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.3-disable-webkit-separately.patch80
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.3-webview-include-gdkx.patch2
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.4-disable-webkit-separately.patch72
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.4-fix-disable-dbus-integration.patch21
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.4-voice-crash.patch262
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.4-voice-ffmpeg44.patch25
-rw-r--r--net-im/telegram-desktop/files/tdesktop-2.7.4-webview-fix-gcc11.patch14
-rw-r--r--net-im/telegram-desktop/telegram-desktop-2.7.4-r1.ebuild (renamed from net-im/telegram-desktop/telegram-desktop-2.7.4.ebuild)12
10 files changed, 407 insertions, 96 deletions
diff --git a/net-im/telegram-desktop/Manifest b/net-im/telegram-desktop/Manifest
index ee46de7bec6d..4589a88d71ba 100644
--- a/net-im/telegram-desktop/Manifest
+++ b/net-im/telegram-desktop/Manifest
@@ -1,10 +1,13 @@
AUX fix-tgcalls-gcc10.patch 949 BLAKE2B 7a065fcbf5b8e7b49b6b866d199c67315484312ca527a517a09f890f09d39fa0c97787c586990ba92c0ce2ee83e7c2387eef100f630a74f003ddc06adb93c379 SHA512 dbc61a8520f3698fdeec6c9849cfd8241b8b778589f89277f82d6c748d8ed7a81db90daa0a69dedc3ab2b81bba848ee68e1df79a9cb3fb055f99bd7d19f46e5d
-AUX tdesktop-2.7.1-fix-disable-dbus-integration.patch 632 BLAKE2B 92aa9006febe4cb52e4273233f8592827e5d74afebc9d996c41cfc33588c0040b3b573a3730d0541ba8e0641e6733c491861c1bb60a5dc0f26f53b7941bf4572 SHA512 74557a9ac798f47d76cc9a0a514d3891c1a9f3c0667d5938be11d53d44704390dbf97d1e7be3c304cce2c9b8e3110ee04e6759ed28bf5f39d1cfee9f5c77f703
-AUX tdesktop-2.7.3-disable-webkit-separately.patch 3536 BLAKE2B 1bf255ba137c12a4d4a75321763327192f6cff81879843f042716daef0a9f9eb18b2a88e3048917adc5f36b9e4959be2a2c757f74a6aeeb9ca312ffcd7f55554 SHA512 aa62ae0319ad5ec86334e763e4c751f6508d7768a8916661fb217b91bf6a897802bc8f4820d058dc341bae69f6a0f0c34321e2a97e63bd0c715d36aa56532fef
-AUX tdesktop-2.7.3-webview-include-gdkx.patch 570 BLAKE2B 4d92c1e14e9df4609ab332c057977a9485867b3a23fc96c46a97d092a5f7083fccb479f87681bfc66964e4be13b4883c0d86ee079e9fd67e932daa2140c9610b SHA512 446a59387f3a76270d9242a19648d86acc0e589833e3aaedff708da0a90d5b55ae0108f28d79da45b4c8dc68c5ac6f6af4ec50203b411c0fcf2eccf4f8c9c753
-AUX tdesktop-2.7.4-webview-fix-gcc11.patch 880 BLAKE2B 581425190b3951d1027c572587e1039d0cf2c5b91d0cebe6be8bd25943eedc3b9e481729f94c920e699526d864ac660d295b4a50ad6aba9ef178513a00b08099 SHA512 7098bca2a1538f66badac21639b3e10a3988acf1e16e50b3f32ed06571687493e87280b992ea1c24fcbd3e3215ccc6e27f327eec8acc7318f9c53b5dfa290c90
+AUX tdesktop-2.7.1-fix-disable-dbus-integration.patch 482 BLAKE2B 70ea7d327b5e26433193f96ce6ad9f3daf534fd127277e58f9564aa88d49046ebb03b51359c84ab9063fef98468aa10b317842f4648357c8a9b225ec230e986e SHA512 8c788e21b674d02e4241c2c9699c69bbd03f8e8e3254f4c70ceb59e7f64823ba9a9dae60660598a7daea95bcc06de8a08c805d71ce74935d1cc3280b241752c8
+AUX tdesktop-2.7.3-webview-include-gdkx.patch 404 BLAKE2B cb9d282c79bfb7441b5eddf7fa1f3255ed1bee03d00fc71682f6b7acc2624a60d034a536e07c77f01433c93c8afa3383b1e57ba1a474de66078623ce2231b37b SHA512 92a60a59724597ce5daabe6a327a445182d6eac91ed009d72f833216393c7e55789caf88b914b0aa8d62eb11e6449b58c24239372d655af1fbe18a30c72b4ade
+AUX tdesktop-2.7.4-disable-webkit-separately.patch 2804 BLAKE2B 71feb3b5ed92fc136236d1c4638330003f7d57427404c72d8e0f83676c58c244b5dd58612b45dd7987615e0f87a5ec9ed29fcd9e75334750b401a4b58ba1137f SHA512 21061e74a54cac1621b701cfdb06c2212136cf135fcb94747dc7c5cdce0f2704e22a16500b360e67cc1bfcd401c143b8f26bccb4bdf18ef0f151ea84e4aead24
+AUX tdesktop-2.7.4-fix-disable-dbus-integration.patch 494 BLAKE2B 75e8be933873cc19a863423cb3996d14512586442abeb56ea83ef1a0ce3b58265611044285a6ebde390581e8206677136b97bd2361eaf612702ebd44411f2eed SHA512 bd223c7afabb72cacb89e689707aaff01509aafa1271aac5533f57ab88b52624b1f08647be51ea5c40123262eaeb3ea5646cecd00872465d5afd66f262e4bd98
+AUX tdesktop-2.7.4-voice-crash.patch 8437 BLAKE2B 6d03b16e8d60318e135340feeb39d6a077bc935f3ca6789da72ab063575128f356f8d4187552ac1ae1c270aed857802375016f84f8d2666facb7ea89c72284c3 SHA512 cabdadddc7a6873c7c6fc8128ceddf2712c0c73d3316520482162e5c67937bda2a627ddb2f078558a52e812c2a876351196488a5a75381d84a43815b873bac5b
+AUX tdesktop-2.7.4-voice-ffmpeg44.patch 1118 BLAKE2B 21b34c6fbb002be362beb807a8323119b46bf6875de3367006a981808d4648fa56e859728ee10ae51a5655fc921e49412ac4bb81e17667b2e28017a64a10a3f2 SHA512 72ef9bddef1f40e09b9c4334153f1ab8aaddf63d95d9f25dc1b0a0826b7f2ae24f7c5fc4cb5ce90aae2c3144a5d52c4cb870d643f447d654190c4a2c78079354
+AUX tdesktop-2.7.4-webview-fix-gcc11.patch 1035 BLAKE2B 929ff52fdadc65d7ce8bc53850adc48ec17c80d6f1e450a50e421c2fc28ee4f07ca88f1371f9812f3e7e2ef402d465418755ce392abd60fe032fa31c216c2753 SHA512 545e307974eff96ff27d9e99ba1272ff0094c403bcbfed4f67f72d8c45c2c6d0682edcee873a11d6aaed8d4f2b7dd820cbc13dc89e7c1072e04105b99a638831
DIST tdesktop-2.7.1-full.tar.gz 36770178 BLAKE2B 21379cc970da07725e7a46d18a4f0bc459b1da1b730587595448b8f78133ce701e374e7faefc649a973342c203eee510872b5a4ed2ff6be92daec25157e400a4 SHA512 dffd184c4369c5c5947b1ca085add533e54313ce39aebcdca4f0958431a305aa5e95c2f2b48592f6992e666b2d33eeba5697f9e09f6048a53b807f2950fbd17b
DIST tdesktop-2.7.4-full.tar.gz 36894673 BLAKE2B e04749fb0168f8bae69a9ad85c5bff315faf0b355ff5f3a85a34ee36e3305c6b550553284d5179aff9283bbd1a94f9ec3c41e293d0ad8c86e4d08283189e42b3 SHA512 0a796d7a8c5e5982bc60f19c41da53996a609bf794fad224e7beea5fc3816b5cf35f16b0ec2cc7279085c69996063a44085f48e1596dfe746d260a2e8f1b2d14
EBUILD telegram-desktop-2.7.1-r2.ebuild 3955 BLAKE2B ebd8a7ce7cbb217f7277879a0b65cf13d99a78af157fb85f7453f8239fce90523ac0644146cc7a0ad8f87e66eb327c061896df4fafbf40931475713e693f5d9c SHA512 6a388a597113e102213b591f91395a59eef26458d4d4173d6a2e6e8d76c45a1f6e4b34dd83ae495bf4ff1d2639861608a73031460c43f9af97542eb9c755a68a
-EBUILD telegram-desktop-2.7.4.ebuild 4266 BLAKE2B b7102112ec4afb170ff44ec54b34e0795d361e07dec623e7e3775ef4d993b8e0562124f5ec9dd74453aff20758f0ce7ef56c6dbfb5fd7cdcaba96191314f734d SHA512 d213159ee7e55e19d59aa693e841cf71df6a637e50d4eaea35a67af00a4f091d378c69a9e587925b3b59f538223f27b51a10affcec93c61635e84c24eb74475b
+EBUILD telegram-desktop-2.7.4-r1.ebuild 4589 BLAKE2B fee2f81578a4c774fe33592641a6a19592e8fd67623f3424ea599c2adbf425861478f34f01fad970fca31d9fe7545f15fe3d53ec195f60933e701fe287fa59d5 SHA512 ed7de5b99a43621b38ee7589a1f842647f7a9e2619b6984d061183ea3ec5d891c55df2cc5e04568924e30252de26bd3450ec1abce6e8d8edd2ff8be6104900dd
MISC metadata.xml 587 BLAKE2B 1f49c91d650d26ba9fd95e9cbcb793ed527d58bf0ccc81ebddb624d54c4af38cc7aff3cf799814932a69b2a6f36dad7fe1c5ce4eb82e562e46dcebca9b751308 SHA512 5e74bb555b2b1a513bd8c7450a3db2f46daa426eecc0d3cebf11d46e58124ef117697bc422f7fccd8757f2e6e8ce6bd8ff0e317b58740dd302c1ea2f2476ff3f
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.1-fix-disable-dbus-integration.patch b/net-im/telegram-desktop/files/tdesktop-2.7.1-fix-disable-dbus-integration.patch
index 5351a808ec4c..8563ee5fdca0 100644
--- a/net-im/telegram-desktop/files/tdesktop-2.7.1-fix-disable-dbus-integration.patch
+++ b/net-im/telegram-desktop/files/tdesktop-2.7.1-fix-disable-dbus-integration.patch
@@ -1,5 +1,3 @@
-Index: tdesktop-2.7.1-full/Telegram/SourceFiles/platform/linux/specific_linux.cpp
-===================================================================
--- tdesktop-2.7.1-full.orig/Telegram/SourceFiles/platform/linux/specific_linux.cpp
+++ tdesktop-2.7.1-full/Telegram/SourceFiles/platform/linux/specific_linux.cpp
@@ -754,10 +754,12 @@ void InstallLauncher(bool force) {
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.3-disable-webkit-separately.patch b/net-im/telegram-desktop/files/tdesktop-2.7.3-disable-webkit-separately.patch
deleted file mode 100644
index a143071401a9..000000000000
--- a/net-im/telegram-desktop/files/tdesktop-2.7.3-disable-webkit-separately.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-Index: tdesktop-2.7.3-full/Telegram/lib_webview/CMakeLists.txt
-===================================================================
---- tdesktop-2.7.3-full.orig/Telegram/lib_webview/CMakeLists.txt
-+++ tdesktop-2.7.3-full/Telegram/lib_webview/CMakeLists.txt
-@@ -116,7 +116,7 @@ if (WIN32)
- desktop-app::lib_webview_winrt
- )
- elseif (LINUX)
-- if (NOT DESKTOP_APP_DISABLE_GTK_INTEGRATION)
-+ if (NOT DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION)
- find_package(PkgConfig REQUIRED)
-
- if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
-Index: tdesktop-2.7.3-full/Telegram/lib_webview/webview/platform/linux/webview_linux.cpp
-===================================================================
---- tdesktop-2.7.3-full.orig/Telegram/lib_webview/webview/platform/linux/webview_linux.cpp
-+++ tdesktop-2.7.3-full/Telegram/lib_webview/webview/platform/linux/webview_linux.cpp
-@@ -11,14 +11,14 @@
- namespace Webview {
-
- Available Availability() {
--#ifndef DESKTOP_APP_DISABLE_GTK_INTEGRATION
-+#ifndef DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION
- return WebKit2Gtk::Availability();
--#else // !DESKTOP_APP_DISABLE_GTK_INTEGRATION
-+#else // !DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION
- return Available{
- .error = Available::Error::NoGtkOrWebkit2Gtk,
- .details = "This feature was disabled at build time.",
- };
--#endif // DESKTOP_APP_DISABLE_GTK_INTEGRATION
-+#endif // DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION
- }
-
- bool SupportsEmbedAfterCreate() {
-@@ -26,11 +26,11 @@ bool SupportsEmbedAfterCreate() {
- }
-
- std::unique_ptr<Interface> CreateInstance(Config config) {
--#ifndef DESKTOP_APP_DISABLE_GTK_INTEGRATION
-+#ifndef DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION
- return WebKit2Gtk::CreateInstance(std::move(config));
--#else // !DESKTOP_APP_DISABLE_GTK_INTEGRATION
-+#else // !DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION
- return nullptr;
--#endif // DESKTOP_APP_DISABLE_GTK_INTEGRATION
-+#endif // DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION
- }
-
- } // namespace Webview
-Index: tdesktop-2.7.3-full/cmake/options.cmake
-===================================================================
---- tdesktop-2.7.3-full.orig/cmake/options.cmake
-+++ tdesktop-2.7.3-full/cmake/options.cmake
-@@ -49,6 +49,13 @@ if (DESKTOP_APP_DISABLE_GTK_INTEGRATION)
- )
- endif()
-
-+if (DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION)
-+ target_compile_definitions(common_options
-+ INTERFACE
-+ DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION
-+ )
-+endif()
-+
- if (DESKTOP_APP_USE_PACKAGED)
- target_compile_definitions(common_options
- INTERFACE
-Index: tdesktop-2.7.3-full/cmake/variables.cmake
-===================================================================
---- tdesktop-2.7.3-full.orig/cmake/variables.cmake
-+++ tdesktop-2.7.3-full/cmake/variables.cmake
-@@ -32,6 +32,7 @@ option(DESKTOP_APP_DISABLE_DBUS_INTEGRAT
- option(DESKTOP_APP_DISABLE_X11_INTEGRATION "Disable all code for X11 integration (Linux only)." OFF)
- option(DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION "Disable all code for Wayland integration (Linux only)." OFF)
- option(DESKTOP_APP_DISABLE_GTK_INTEGRATION "Disable all code for GTK integration (Linux only)." OFF)
-+option(DESKTOP_APP_DISABLE_WEBKIT_INTEGRATION "Disable all code for WebkitGTK integration (Linux only)." OFF)
- option(DESKTOP_APP_USE_GLIBC_WRAPS "Use wraps for new GLIBC features." OFF)
- option(DESKTOP_APP_USE_PACKAGED "Find libraries using CMake instead of exact paths." ${no_special_target})
- option(DESKTOP_APP_USE_PACKAGED_LAZY "Bundle recommended Qt plugins for self-contained packages. (Linux only)" OFF)
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.3-webview-include-gdkx.patch b/net-im/telegram-desktop/files/tdesktop-2.7.3-webview-include-gdkx.patch
index 2f06bda3272a..491a8cd3e1dc 100644
--- a/net-im/telegram-desktop/files/tdesktop-2.7.3-webview-include-gdkx.patch
+++ b/net-im/telegram-desktop/files/tdesktop-2.7.3-webview-include-gdkx.patch
@@ -1,5 +1,3 @@
-Index: tdesktop-2.7.3-full/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h
-===================================================================
--- tdesktop-2.7.3-full.orig/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h
+++ tdesktop-2.7.3-full/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h
@@ -12,6 +12,7 @@ extern "C" {
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.4-disable-webkit-separately.patch b/net-im/telegram-desktop/files/tdesktop-2.7.4-disable-webkit-separately.patch
new file mode 100644
index 000000000000..e54aca2ffa05
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-2.7.4-disable-webkit-separately.patch
@@ -0,0 +1,72 @@
+--- tdesktop-2.7.4-full.orig/Telegram/lib_webview/CMakeLists.txt
++++ tdesktop-2.7.4-full/Telegram/lib_webview/CMakeLists.txt
+@@ -116,7 +116,7 @@
+ desktop-app::lib_webview_winrt
+ )
+ elseif (LINUX)
+- if (NOT DESKTOP_APP_DISABLE_GTK_INTEGRATION)
++ if (NOT DESKTOP_APP_DISABLE_WEBKIT)
+ find_package(PkgConfig REQUIRED)
+
+ if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
+--- tdesktop-2.7.4-full.orig/Telegram/lib_webview/webview/platform/linux/webview_linux.cpp
++++ tdesktop-2.7.4-full/Telegram/lib_webview/webview/platform/linux/webview_linux.cpp
+@@ -11,14 +11,14 @@
+ namespace Webview {
+
+ Available Availability() {
+-#ifndef DESKTOP_APP_DISABLE_GTK_INTEGRATION
++#ifndef DESKTOP_APP_DISABLE_WEBKIT
+ return WebKit2Gtk::Availability();
+-#else // !DESKTOP_APP_DISABLE_GTK_INTEGRATION
++#else // !DESKTOP_APP_DISABLE_WEBKIT
+ return Available{
+ .error = Available::Error::NoGtkOrWebkit2Gtk,
+ .details = "This feature was disabled at build time.",
+ };
+-#endif // DESKTOP_APP_DISABLE_GTK_INTEGRATION
++#endif // DESKTOP_APP_DISABLE_WEBKIT
+ }
+
+ bool SupportsEmbedAfterCreate() {
+@@ -26,11 +26,11 @@
+ }
+
+ std::unique_ptr<Interface> CreateInstance(Config config) {
+-#ifndef DESKTOP_APP_DISABLE_GTK_INTEGRATION
++#ifndef DESKTOP_APP_DISABLE_WEBKIT
+ return WebKit2Gtk::CreateInstance(std::move(config));
+-#else // !DESKTOP_APP_DISABLE_GTK_INTEGRATION
++#else // !DESKTOP_APP_DISABLE_WEBKIT
+ return nullptr;
+-#endif // DESKTOP_APP_DISABLE_GTK_INTEGRATION
++#endif // DESKTOP_APP_DISABLE_WEBKIT
+ }
+
+ } // namespace Webview
+--- tdesktop-2.7.4-full.orig/cmake/options.cmake
++++ tdesktop-2.7.4-full/cmake/options.cmake
+@@ -49,6 +49,13 @@
+ )
+ endif()
+
++if (DESKTOP_APP_DISABLE_WEBKIT)
++ target_compile_definitions(common_options
++ INTERFACE
++ DESKTOP_APP_DISABLE_WEBKIT
++ )
++endif()
++
+ if (DESKTOP_APP_USE_PACKAGED)
+ target_compile_definitions(common_options
+ INTERFACE
+--- tdesktop-2.7.4-full.orig/cmake/variables.cmake
++++ tdesktop-2.7.4-full/cmake/variables.cmake
+@@ -38,6 +38,7 @@
+ option(DESKTOP_APP_USE_PACKAGED_LAZY_PLATFORMTHEMES "Bundle recommended Qt platform themes for self-contained packages. (Linux only)" ${DESKTOP_APP_USE_PACKAGED_LAZY})
+ option(DESKTOP_APP_USE_PACKAGED_FFMPEG_STATIC "Link ffmpeg statically in packaged mode." OFF)
+ option(DESKTOP_APP_DISABLE_SPELLCHECK "Disable spellcheck library." ${osx_special_target})
++option(DESKTOP_APP_DISABLE_WEBKIT "Disable WebkitGTK library (Linux only)." OFF)
+ option(DESKTOP_APP_DISABLE_CRASH_REPORTS "Disable crash report generation." ${no_special_target})
+ option(DESKTOP_APP_DISABLE_AUTOUPDATE "Disable autoupdate." ${disable_autoupdate})
+ option(DESKTOP_APP_USE_HUNSPELL_ONLY "Disable system spellchecker and use bundled Hunspell only. (For debugging purposes)" OFF)
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.4-fix-disable-dbus-integration.patch b/net-im/telegram-desktop/files/tdesktop-2.7.4-fix-disable-dbus-integration.patch
new file mode 100644
index 000000000000..941a4ecc09cb
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-2.7.4-fix-disable-dbus-integration.patch
@@ -0,0 +1,21 @@
+--- tdesktop-2.7.4-full.orig/Telegram/SourceFiles/platform/linux/notifications_manager_linux_dummy.cpp
++++ tdesktop-2.7.4-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux_dummy.cpp
+@@ -13,15 +13,15 @@
+ namespace Platform {
+ namespace Notifications {
+
+-bool SkipAudio() {
++bool SkipAudioForCustom() {
+ return false;
+ }
+
+-bool SkipToast() {
++bool SkipToastForCustom() {
+ return false;
+ }
+
+-bool SkipFlashBounce() {
++bool SkipFlashBounceForCustom() {
+ return false;
+ }
+
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.4-voice-crash.patch b/net-im/telegram-desktop/files/tdesktop-2.7.4-voice-crash.patch
new file mode 100644
index 000000000000..41e447989cb2
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-2.7.4-voice-crash.patch
@@ -0,0 +1,262 @@
+From 71deaa48afab2bcf9df67b9b347b1f44aad3a9ce Mon Sep 17 00:00:00 2001
+From: John Preston <johnprestonmail@gmail.com>
+Date: Thu, 13 May 2021 15:17:54 +0400
+Subject: [PATCH] Don't crash on voice recording error.
+
+Fixes #16217.
+---
+ .../media/audio/media_audio_capture.cpp | 89 +++++++++++--------
+ 1 file changed, 54 insertions(+), 35 deletions(-)
+
+diff --git a/Telegram/SourceFiles/media/audio/media_audio_capture.cpp b/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
+index a5965e0d1988..deb2474d7891 100644
+--- a/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
++++ b/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
+@@ -47,17 +47,17 @@ class Instance::Inner final : public QObject {
+ void start(Fn<void(Update)> updated, Fn<void()> error);
+ void stop(Fn<void(Result&&)> callback = nullptr);
+
+- void timeout();
+-
+ private:
+- void processFrame(int32 offset, int32 framesize);
++ void process();
++
++ [[nodiscard]] bool processFrame(int32 offset, int32 framesize);
+ void fail();
+
+- void writeFrame(AVFrame *frame);
++ [[nodiscard]] bool writeFrame(AVFrame *frame);
+
+ // Writes the packets till EAGAIN is got from av_receive_packet()
+ // Returns number of packets written or -1 on error
+- int writePackets();
++ [[nodiscard]] int writePackets();
+
+ Fn<void(Update)> _updated;
+ Fn<void()> _error;
+@@ -150,6 +150,7 @@ struct Instance::Inner::Private {
+ AVCodec *codec = nullptr;
+ AVCodecContext *codecContext = nullptr;
+ bool opened = false;
++ bool processing = false;
+
+ int srcSamples = 0;
+ int dstSamples = 0;
+@@ -217,7 +218,7 @@ struct Instance::Inner::Private {
+
+ Instance::Inner::Inner(QThread *thread)
+ : d(std::make_unique<Private>())
+-, _timer(thread, [=] { timeout(); }) {
++, _timer(thread, [=] { process(); }) {
+ moveToThread(thread);
+ }
+
+@@ -226,10 +227,10 @@ Instance::Inner::~Inner() {
+ }
+
+ void Instance::Inner::fail() {
+- Expects(_error != nullptr);
+-
+ stop();
+- _error();
++ if (const auto error = base::take(_error)) {
++ InvokeQueued(this, error);
++ }
+ }
+
+ void Instance::Inner::start(Fn<void(Update)> updated, Fn<void()> error) {
+@@ -384,13 +385,21 @@ void Instance::Inner::stop(Fn<void(Result&&)> callback) {
+ }
+ _timer.cancel();
+
+- if (d->device) {
++ const auto needResult = (callback != nullptr);
++ const auto hadDevice = (d->device != nullptr);
++ if (hadDevice) {
+ alcCaptureStop(d->device);
+- timeout(); // get last data
++ if (d->processing) {
++ Assert(!needResult); // stop in the middle of processing - error.
++ } else {
++ process(); // get last data
++ }
++ alcCaptureCloseDevice(d->device);
++ d->device = nullptr;
+ }
+
+ // Write what is left
+- if (!_captured.isEmpty()) {
++ if (needResult && !_captured.isEmpty()) {
+ auto fadeSamples = kCaptureFadeInDuration * kCaptureFrequency / 1000;
+ auto capturedSamples = static_cast<int>(_captured.size() / sizeof(short));
+ if ((_captured.size() % sizeof(short)) || (d->fullSamples + capturedSamples < kCaptureFrequency) || (capturedSamples < fadeSamples)) {
+@@ -414,11 +423,13 @@ void Instance::Inner::stop(Fn<void(Result&&)> callback) {
+
+ int32 framesize = d->srcSamples * d->codecContext->channels * sizeof(short), encoded = 0;
+ while (_captured.size() >= encoded + framesize) {
+- processFrame(encoded, framesize);
++ if (!processFrame(encoded, framesize)) {
++ break;
++ }
+ encoded += framesize;
+ }
+- writeFrame(nullptr); // drain the codec
+- if (encoded != _captured.size()) {
++ // Drain the codec.
++ if (!writeFrame(nullptr) || encoded != _captured.size()) {
+ d->fullSamples = 0;
+ d->dataPos = 0;
+ d->data.clear();
+@@ -436,14 +447,14 @@ void Instance::Inner::stop(Fn<void(Result&&)> callback) {
+ _captured = QByteArray();
+
+ // Finish stream
+- if (d->device) {
++ if (needResult && hadDevice) {
+ av_write_trailer(d->fmtContext);
+ }
+
+ QByteArray result = d->fullSamples ? d->data : QByteArray();
+ VoiceWaveform waveform;
+ qint32 samples = d->fullSamples;
+- if (samples && !d->waveform.isEmpty()) {
++ if (needResult && samples && !d->waveform.isEmpty()) {
+ int64 count = d->waveform.size(), sum = 0;
+ if (count >= Player::kWaveformSamplesCount) {
+ QVector<uint16> peaks;
+@@ -472,11 +483,7 @@ void Instance::Inner::stop(Fn<void(Result&&)> callback) {
+ }
+ }
+ }
+- if (d->device) {
+- alcCaptureStop(d->device);
+- alcCaptureCloseDevice(d->device);
+- d->device = nullptr;
+-
++ if (hadDevice) {
+ if (d->codecContext) {
+ avcodec_free_context(&d->codecContext);
+ d->codecContext = nullptr;
+@@ -528,12 +535,17 @@ void Instance::Inner::stop(Fn<void(Result&&)> callback) {
+ d->waveform.clear();
+ }
+
+- if (callback) {
++ if (needResult) {
+ callback({ result, waveform, samples });
+ }
+ }
+
+-void Instance::Inner::timeout() {
++void Instance::Inner::process() {
++ Expects(!d->processing);
++
++ d->processing = true;
++ const auto guard = gsl::finally([&] { d->processing = false; });
++
+ if (!d->device) {
+ _timer.cancel();
+ return;
+@@ -582,7 +594,9 @@ void Instance::Inner::timeout() {
+ // Write frames
+ int32 framesize = d->srcSamples * d->codecContext->channels * sizeof(short), encoded = 0;
+ while (uint32(_captured.size()) >= encoded + framesize + fadeSamples * sizeof(short)) {
+- processFrame(encoded, framesize);
++ if (!processFrame(encoded, framesize)) {
++ return;
++ }
+ encoded += framesize;
+ }
+
+@@ -597,13 +611,13 @@ void Instance::Inner::timeout() {
+ }
+ }
+
+-void Instance::Inner::processFrame(int32 offset, int32 framesize) {
++bool Instance::Inner::processFrame(int32 offset, int32 framesize) {
+ // Prepare audio frame
+
+ if (framesize % sizeof(short)) { // in the middle of a sample
+ LOG(("Audio Error: Bad framesize in writeFrame() for capture, framesize %1, %2").arg(framesize));
+ fail();
+- return;
++ return false;
+ }
+ auto samplesCnt = static_cast<int>(framesize / sizeof(short));
+
+@@ -650,7 +664,7 @@ void Instance::Inner::processFrame(int32 offset, int32 framesize) {
+ if ((res = av_samples_alloc(d->dstSamplesData, 0, d->codecContext->channels, d->dstSamples, d->codecContext->sample_fmt, 1)) < 0) {
+ LOG(("Audio Error: Unable to av_samples_alloc for capture, error %1, %2").arg(res).arg(av_make_error_string(err, sizeof(err), res)));
+ fail();
+- return;
++ return false;
+ }
+ d->dstSamplesSize = av_samples_get_buffer_size(0, d->codecContext->channels, d->maxDstSamples, d->codecContext->sample_fmt, 0);
+ }
+@@ -658,7 +672,7 @@ void Instance::Inner::processFrame(int32 offset, int32 framesize) {
+ if ((res = swr_convert(d->swrContext, d->dstSamplesData, d->dstSamples, (const uint8_t **)srcSamplesData, d->srcSamples)) < 0) {
+ LOG(("Audio Error: Unable to swr_convert for capture, error %1, %2").arg(res).arg(av_make_error_string(err, sizeof(err), res)));
+ fail();
+- return;
++ return false;
+ }
+
+ // Write audio frame
+@@ -670,45 +684,50 @@ void Instance::Inner::processFrame(int32 offset, int32 framesize) {
+
+ avcodec_fill_audio_frame(frame, d->codecContext->channels, d->codecContext->sample_fmt, d->dstSamplesData[0], d->dstSamplesSize, 0);
+
+- writeFrame(frame);
++ if (!writeFrame(frame)) {
++ return false;
++ }
+
+ d->fullSamples += samplesCnt;
+
+ av_frame_free(&frame);
++ return true;
+ }
+
+-void Instance::Inner::writeFrame(AVFrame *frame) {
++bool Instance::Inner::writeFrame(AVFrame *frame) {
+ int res = 0;
+ char err[AV_ERROR_MAX_STRING_SIZE] = { 0 };
+
+ res = avcodec_send_frame(d->codecContext, frame);
+ if (res == AVERROR(EAGAIN)) {
+- int packetsWritten = writePackets();
++ const auto packetsWritten = writePackets();
+ if (packetsWritten < 0) {
+ if (frame && packetsWritten == AVERROR_EOF) {
+ LOG(("Audio Error: EOF in packets received when EAGAIN was got in avcodec_send_frame()"));
+ fail();
+ }
+- return;
++ return false;
+ } else if (!packetsWritten) {
+ LOG(("Audio Error: No packets received when EAGAIN was got in avcodec_send_frame()"));
+ fail();
+- return;
++ return false;
+ }
+ res = avcodec_send_frame(d->codecContext, frame);
+ }
+ if (res < 0) {
+ LOG(("Audio Error: Unable to avcodec_send_frame for capture, error %1, %2").arg(res).arg(av_make_error_string(err, sizeof(err), res)));
+ fail();
+- return;
++ return false;
+ }
+
+ if (!frame) { // drain
+ if ((res = writePackets()) != AVERROR_EOF) {
+ LOG(("Audio Error: not EOF in packets received when draining the codec, result %1").arg(res));
+ fail();
++ return false;
+ }
+ }
++ return true;
+ }
+
+ int Instance::Inner::writePackets() {
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.4-voice-ffmpeg44.patch b/net-im/telegram-desktop/files/tdesktop-2.7.4-voice-ffmpeg44.patch
new file mode 100644
index 000000000000..4156956032d4
--- /dev/null
+++ b/net-im/telegram-desktop/files/tdesktop-2.7.4-voice-ffmpeg44.patch
@@ -0,0 +1,25 @@
+From a8807bc915f2439acc7c84f06d931d96d6ca602a Mon Sep 17 00:00:00 2001
+From: John Preston <johnprestonmail@gmail.com>
+Date: Thu, 13 May 2021 15:33:42 +0400
+Subject: [PATCH] Fix voice recoding with FFmpeg 4.4.
+
+Fixes #16217.
+---
+ Telegram/SourceFiles/media/audio/media_audio_capture.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/Telegram/SourceFiles/media/audio/media_audio_capture.cpp b/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
+index deb2474d789..d129168783d 100644
+--- a/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
++++ b/Telegram/SourceFiles/media/audio/media_audio_capture.cpp
+@@ -679,6 +679,10 @@ bool Instance::Inner::processFrame(int32 offset, int32 framesize) {
+
+ AVFrame *frame = av_frame_alloc();
+
++ frame->format = d->codecContext->sample_fmt;
++ frame->channels = d->codecContext->channels;
++ frame->channel_layout = d->codecContext->channel_layout;
++ frame->sample_rate = d->codecContext->sample_rate;
+ frame->nb_samples = d->dstSamples;
+ frame->pts = av_rescale_q(d->fullSamples, AVRational { 1, d->codecContext->sample_rate }, d->codecContext->time_base);
+
diff --git a/net-im/telegram-desktop/files/tdesktop-2.7.4-webview-fix-gcc11.patch b/net-im/telegram-desktop/files/tdesktop-2.7.4-webview-fix-gcc11.patch
index 0188eaf76f8a..7f4b3f2601f5 100644
--- a/net-im/telegram-desktop/files/tdesktop-2.7.4-webview-fix-gcc11.patch
+++ b/net-im/telegram-desktop/files/tdesktop-2.7.4-webview-fix-gcc11.patch
@@ -1,5 +1,13 @@
-Index: tdesktop-2.7.4-full/Telegram/lib_webview/webview/webview_embed.cpp
-===================================================================
+--- tdesktop-2.7.4-full.orig/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.cpp
++++ tdesktop-2.7.4-full/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.cpp
+@@ -6,6 +6,7 @@
+ //
+ #include "webview/platform/linux/webview_linux_webkit_gtk.h"
+
++#include "base/optional.h"
+ #include "base/platform/linux/base_linux_gtk_integration.h"
+ #include "base/platform/linux/base_linux_gtk_integration_p.h"
+
--- tdesktop-2.7.4-full.orig/Telegram/lib_webview/webview/webview_embed.cpp
+++ tdesktop-2.7.4-full/Telegram/lib_webview/webview/webview_embed.cpp
@@ -14,7 +14,6 @@
@@ -10,8 +18,6 @@ Index: tdesktop-2.7.4-full/Telegram/lib_webview/webview/webview_embed.cpp
namespace Webview {
namespace {
-Index: tdesktop-2.7.4-full/Telegram/lib_webview/webview/webview_embed.h
-===================================================================
--- tdesktop-2.7.4-full.orig/Telegram/lib_webview/webview/webview_embed.h
+++ tdesktop-2.7.4-full/Telegram/lib_webview/webview/webview_embed.h
@@ -9,6 +9,8 @@
diff --git a/net-im/telegram-desktop/telegram-desktop-2.7.4.ebuild b/net-im/telegram-desktop/telegram-desktop-2.7.4-r1.ebuild
index 8081b9da583e..1f51780319cc 100644
--- a/net-im/telegram-desktop/telegram-desktop-2.7.4.ebuild
+++ b/net-im/telegram-desktop/telegram-desktop-2.7.4-r1.ebuild
@@ -15,7 +15,7 @@ SRC_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v${PV}/${
LICENSE="BSD GPL-3-with-openssl-exception LGPL-2+"
SLOT="0"
-KEYWORDS="~amd64 ~ppc64"
+KEYWORDS="amd64 ~ppc64"
IUSE="+dbus enchant +gtk +hunspell +spell wayland webkit +X"
RDEPEND="
@@ -61,6 +61,7 @@ REQUIRED_USE="
spell? (
^^ ( enchant hunspell )
)
+ webkit? ( gtk )
"
S="${WORKDIR}/${MY_P}"
@@ -68,11 +69,16 @@ S="${WORKDIR}/${MY_P}"
PATCHES=(
# https://github.com/desktop-app/cmake_helpers/pull/91
# https://github.com/desktop-app/lib_webview/pull/2
- "${FILESDIR}/tdesktop-2.7.3-disable-webkit-separately.patch"
+ "${FILESDIR}/tdesktop-2.7.4-disable-webkit-separately.patch"
# https://github.com/desktop-app/lib_webview/commit/0b4100d7cecc4e748c51f3f51ebfd1392ec3978a
"${FILESDIR}/tdesktop-2.7.3-webview-include-gdkx.patch"
# https://github.com/desktop-app/lib_webview/pull/3
"${FILESDIR}/tdesktop-2.7.4-webview-fix-gcc11.patch"
+ # https://github.com/telegramdesktop/tdesktop/issues/16217
+ "${FILESDIR}/tdesktop-2.7.4-voice-crash.patch"
+ "${FILESDIR}/tdesktop-2.7.4-voice-ffmpeg44.patch"
+ # https://github.com/telegramdesktop/tdesktop/commit/404538c98968d44d207671de3adde91b8df50721
+ "${FILESDIR}/tdesktop-2.7.4-fix-disable-dbus-integration.patch"
)
pkg_pretend() {
@@ -103,7 +109,7 @@ src_configure() {
-DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=$(usex wayland OFF ON)
-DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=$(usex dbus OFF ON)
-DDESKTOP_APP_DISABLE_GTK_INTEGRATION=$(usex gtk OFF ON)
- -DDESKTOP_APP_DISABLE_WEBKIT_INTEGRATION=$(usex webkit OFF ON)
+ -DDESKTOP_APP_DISABLE_WEBKIT=$(usex webkit OFF ON)
-DDESKTOP_APP_DISABLE_SPELLCHECK=$(usex spell OFF ON) # enables hunspell (recommended)
-DDESKTOP_APP_USE_ENCHANT=$(usex enchant ON OFF) # enables enchant and disables hunspell
)