diff mbox series

[bug#57675,v11,7/8] gnu: telegram-desktop: Update to 4.2.0.

Message ID y76czblcklw.wl-hako@ultrarare.space
State Accepted
Headers show
Series gnu: telegram-desktop: Update to 4.2.0. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Hilton Chain Sept. 24, 2022, 7:11 a.m. UTC
* gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Add patch.
* gnu/packages/telegram.scm (dispatch-for-telegram-desktop): New variable.
(tgcalls-for-telegram-desktop,codegen-for-telegram-desktop)
(lib-base-for-telegram-desktop,lib-crl-for-telegram-desktop)
(lib-lottie-for-telegram-desktop,lib-qr-for-telegram-desktop)
(lib-rpl-for-telegram-desktop,lib-spellcheck-for-telegram-desktop)
(lib-storage-for-telegram-desktop,lib-tl-for-telegram-desktop)
(lib-ui-for-telegram-desktop,lib-webrtc-for-telegram-desktop)
(lib-webview-for-telegram-desktop,cmake-helpers-for-telegram-desktop): Bump to
source checkout.
(rlottie-for-telegram-desktop): Bump to submodule checkout.
[snippet]: Switch off werror.
[arguments]: Use inherited ones.
(telegram-desktop): Update to 4.2.0.
[patches]: Add telegram-desktop-allow-disable-libtgvoip.patch.
[arguments]<#:configure-flags>: Unbundle rlottie.
<#:phases>: Adjusted accordingly.
[native-inputs]: Add clang-toolchain.
Remove cmake-shared, extra-cmake-modules and qttools-5.
[inputs]: Replace qtbase-5 with qtbase.
Add abseil-cpp-cxxstd17, kcoreaddons, libvpx, qt5compat, wayland, webkitgtk.
Remove catch2, fcitx-qt5, fcitx5-qt, gtk+, hime, kwayland, libdbusmenu-qt,
libtgvoip-for-telegram-desktop, libx11, materialdecoration, nimf and qt5ct.
[propagated-inputs]: Remove dconf.
[license]: Adjusted accordingly.
---
 gnu/local.mk                                  |   1 +
 ...gram-desktop-allow-disable-libtgvoip.patch | 125 ++++++++++++
 gnu/packages/telegram.scm                     | 185 ++++++++----------
 3 files changed, 213 insertions(+), 98 deletions(-)
 create mode 100644 gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch

Comments

Liliana Marie Prikler Sept. 24, 2022, 7:58 a.m. UTC | #1
Am Samstag, dem 24.09.2022 um 15:11 +0800 schrieb Hilton Chain:
> * gnu/packages/telegram.scm (dispatch-for-telegram-desktop): New
> variable.
Please introduce this in an earlier commit.  Also, since this is a
third-party package, not a telegram-owned one, it'd be nice if we could
use upstream versioning, but that seems tied to another package too
(swift in particular).  Alternatively, you could simply use "1.3" as
per CMakeLists as a base point.

Cheers
Hilton Chain Sept. 24, 2022, 11:52 p.m. UTC | #2
On Sat, 24 Sep 2022 15:58:33 +0800,
Liliana Marie Prikler wrote:
> Please introduce this in an earlier commit.  Also, since this is a
> third-party package, not a telegram-owned one, it'd be nice if we could
> use upstream versioning, but that seems tied to another package too
> (swift in particular).  Alternatively, you could simply use "1.3" as
> per CMakeLists as a base point.

I'd tried packaging both crc32c and libdispatch, are those two names suitable? And then, what's the
proper place to place libdispatch in?

Applied Gentoo's patch (for unbundling crc32c) to webrtc-for-telegram-desktop, however when
configuring telegram-desktop with this, it errors out as follows, what should I do next?

#+BEGIN_QUOTE
CMake Error at Telegram/CMakeLists.txt:7 (add_executable):
  Target "Telegram" links to target "Crc32c::crc32c" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


CMake Error at Telegram/cmake/lib_tgcalls.cmake:7 (add_library):
  Target "lib_tgcalls" links to target "Crc32c::crc32c" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?
Call Stack (most recent call first):
  Telegram/CMakeLists.txt:34 (include)


CMake Error at Telegram/cmake/td_ui.cmake:7 (add_library):
  Target "td_ui" links to target "Crc32c::crc32c" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?
Call Stack (most recent call first):
  Telegram/CMakeLists.txt:39 (include)
#+END_QUOTE

Thanks
Liliana Marie Prikler Sept. 25, 2022, 5:54 a.m. UTC | #3
Am Sonntag, dem 25.09.2022 um 07:52 +0800 schrieb Hilton Chain:
> On Sat, 24 Sep 2022 15:58:33 +0800,
> Liliana Marie Prikler wrote:
> > Please introduce this in an earlier commit.  Also, since this is a
> > third-party package, not a telegram-owned one, it'd be nice if we
> > could use upstream versioning, but that seems tied to another
> > package too (swift in particular).  Alternatively, you could simply
> > use "1.3" as per CMakeLists as a base point.
> 
> I'd tried packaging both crc32c and libdispatch, are those two names
> suitable? And then, what's the proper place to place libdispatch in?
Probably maybe. I'm not aware of any other project taking their name
(apart from forks, obviously), and they're more than 3 letters each, so
I think it'll be fine. As for the location of libdispatch, if we had a
swift.scm (which we probably won't until someone packages swift), it'd
go there, but for now c.scm is fine imho.

> Applied Gentoo's patch (for unbundling crc32c) to webrtc-for-
> telegram-desktop, however when
> configuring telegram-desktop with this, it errors out as follows,
> what should I do next?
Uhm... which patch is "Gentoo's patch"?  I don't see anything relevant
here [1].

> #+BEGIN_QUOTE
> CMake Error at Telegram/CMakeLists.txt:7 (add_executable):
>   Target "Telegram" links to target "Crc32c::crc32c" but the target
> was not
>   found.  Perhaps a find_package() call is missing for an IMPORTED
> target, or
>   an ALIAS target is missing?
> 
> CMake Error at Telegram/cmake/lib_tgcalls.cmake:7 (add_library):
>   Target "lib_tgcalls" links to target "Crc32c::crc32c" but the
> target was
>   not found.  Perhaps a find_package() call is missing for an
> IMPORTED
>   target, or an ALIAS target is missing?
> Call Stack (most recent call first):
>   Telegram/CMakeLists.txt:34 (include)
> 
> 
> CMake Error at Telegram/cmake/td_ui.cmake:7 (add_library):
>   Target "td_ui" links to target "Crc32c::crc32c" but the target was
> not
>   found.  Perhaps a find_package() call is missing for an IMPORTED
> target, or
>   an ALIAS target is missing?
> Call Stack (most recent call first):
>   Telegram/CMakeLists.txt:39 (include)
> #+END_QUOTE
Hmm, I think you'll have to patch the CMakeLists, which expect a
slightly different version.  You could also try packaging a second
crc32c, which inherits from upstream, but uses the Telegram-blessed
commit.

Cheers

[1] https://gitweb.gentoo.org/repo/gentoo.git/tree/net-im/telegram-desktop/files
Hilton Chain Sept. 25, 2022, 6:15 a.m. UTC | #4
On Sun, 25 Sep 2022 13:54:18 +0800,
Liliana Marie Prikler wrote:
> Uhm... which patch is "Gentoo's patch"?  I don't see anything relevant
> here [1].

It's here:
https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/tg_owt/files
Liliana Marie Prikler Sept. 25, 2022, 6:31 a.m. UTC | #5
Am Sonntag, dem 25.09.2022 um 14:15 +0800 schrieb Hilton Chain:
> On Sun, 25 Sep 2022 13:54:18 +0800,
> Liliana Marie Prikler wrote:
> > Uhm... which patch is "Gentoo's patch"?  I don't see anything
> > relevant
> > here [1].
> 
> It's here:
> https://gitweb.gentoo.org/repo/gentoo.git/tree/media-libs/tg_owt/files

This hunk
> function(link_crc32c target_name)
>     if (TG_OWT_PACKAGED_BUILD)
>         find_package(Crc32c)
>         set(Crc32c_FOUND ${Crc32c_FOUND} PARENT_SCOPE)
>         if (Crc32c_FOUND)
>             target_link_libraries(${target_name} PRIVATE
> Crc32c::crc32c)
>         endif()
>     endif()
>     if (NOT Crc32c_FOUND)
>         target_link_libraries(${target_name} PRIVATE
> tg_owt::libcrc32c)
>     endif()
> endfunction()
looks like the culprit, but also sane; maybe your Crc32c "package"
according to CMake is missing the crc32c library?  Are you actually
building it as a package and using it as regular input?

Cheers
Hilton Chain Sept. 25, 2022, 6:43 a.m. UTC | #6
On Sun, 25 Sep 2022 14:31:47 +0800,
Liliana Marie Prikler wrote:
> looks like the culprit, but also sane; maybe your Crc32c "package"
> according to CMake is missing the crc32c library?  Are you actually
> building it as a package and using it as regular input?

Just found out I built it as a static library... Orz
Hilton Chain Sept. 25, 2022, 1:11 p.m. UTC | #7
It turns out that static or dynamic is actually unrelated.

>+if (NOT Crc32c_FOUND)
>+    list(APPEND export_targets libcrc32c)
>+endif()

Don't know why but Crc32c_FOUND seems to be false here.
diff mbox series

Patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 84246dbdef..6f3ab36db9 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1870,6 +1870,7 @@  dist_patch_DATA =						\
   %D%/packages/patches/teensy-loader-cli-help.patch		\
   %D%/packages/patches/tensorflow-c-api-fix.patch		\
   %D%/packages/patches/texinfo-5-perl-compat.patch		\
+  %D%/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch   \
   %D%/packages/patches/telegram-purple-adjust-test.patch	\
   %D%/packages/patches/texi2html-document-encoding.patch	\
   %D%/packages/patches/texi2html-i18n.patch			\
diff --git a/gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch b/gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch
new file mode 100644
index 0000000000..3c062cbd9a
--- /dev/null
+++ b/gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch
@@ -0,0 +1,125 @@ 
+From 4d1a8351ee82728912fcf7ad0070049b2910c393 Mon Sep 17 00:00:00 2001
+From: Klemens Nanni <klemens@posteo.de>
+Date: Wed, 2 Mar 2022 01:07:48 +0100
+Subject: [PATCH] Introduce TDESKTOP_DISABLE_LEGACY_TGVOIP
+
+Originally from Alt Linux[0], OpenBSD has so far adapted the removal of
+tgvoip in the official net/tdesktop build.
+
+tgcalls provides everything needed for calls;  audio/video/desktop
+sharing calls have been working fine across different operating systems
+and telegram desktop/mobile versions without problems.
+
+0: http://www.sisyphus.ru/cgi-bin/srpm.pl/Sisyphus/telegram-desktop/getpatch/1
+---
+ Telegram/CMakeLists.txt                   | 6 +++---
+ Telegram/SourceFiles/calls/calls_call.cpp | 6 ++++++
+ Telegram/cmake/lib_tgcalls.cmake          | 4 ++++
+ Telegram/cmake/telegram_options.cmake     | 8 ++++++++
+ 4 files changed, 21 insertions(+), 3 deletions(-)
+
+diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt
+index fb2bf370f..5d9578f2d 100644
+--- a/Telegram/CMakeLists.txt
++++ b/Telegram/CMakeLists.txt
+@@ -28,7 +28,9 @@ get_filename_component(res_loc Resources REALPATH)
+ include(cmake/telegram_options.cmake)
+ include(cmake/lib_ffmpeg.cmake)
+ include(cmake/lib_stripe.cmake)
+-include(cmake/lib_tgvoip.cmake)
++if (NOT TDESKTOP_DISABLE_LEGACY_TGVOIP)
++    include(cmake/lib_tgvoip.cmake)
++endif()
+ include(cmake/lib_tgcalls.cmake)
+ include(cmake/td_export.cmake)
+ include(cmake/td_mtproto.cmake)
+@@ -52,9 +54,7 @@ target_prepare_qrc(Telegram)
+ 
+ target_link_libraries(Telegram
+ PRIVATE
+-    tdesktop::lib_tgcalls_legacy
+     tdesktop::lib_tgcalls
+-    tdesktop::lib_tgvoip
+ 
+     # Order in this list defines the order of include paths in command line.
+     # We need to place desktop-app::external_minizip this early to have its
+diff --git a/Telegram/SourceFiles/calls/calls_call.cpp b/Telegram/SourceFiles/calls/calls_call.cpp
+index 6894d5d90..cd03620e7 100644
+--- a/Telegram/SourceFiles/calls/calls_call.cpp
++++ b/Telegram/SourceFiles/calls/calls_call.cpp
+@@ -39,8 +39,10 @@ class InstanceImpl;
+ class InstanceV2Impl;
+ class InstanceV2ReferenceImpl;
+ class InstanceV2_4_0_0Impl;
++#ifndef TDESKTOP_DISABLE_LEGACY_TGVOIP
+ class InstanceImplLegacy;
+ void SetLegacyGlobalServerConfig(const std::string &serverConfig);
++#endif
+ } // namespace tgcalls
+ 
+ namespace Calls {
+@@ -56,7 +58,9 @@ const auto Register = tgcalls::Register<tgcalls::InstanceImpl>();
+ const auto RegisterV2 = tgcalls::Register<tgcalls::InstanceV2Impl>();
+ const auto RegV2Ref = tgcalls::Register<tgcalls::InstanceV2ReferenceImpl>();
+ const auto RegisterV240 = tgcalls::Register<tgcalls::InstanceV2_4_0_0Impl>();
++#ifndef TDESKTOP_DISABLE_LEGACY_TGVOIP
+ const auto RegisterLegacy = tgcalls::Register<tgcalls::InstanceImplLegacy>();
++#endif
+ 
+ [[nodiscard]] base::flat_set<int64> CollectEndpointIds(
+ 		const QVector<MTPPhoneConnection> &list) {
+@@ -1322,7 +1326,9 @@ Call::~Call() {
+ }
+ 
+ void UpdateConfig(const std::string &data) {
++#ifndef TDESKTOP_DISABLE_LEGACY_TGVOIP
+ 	tgcalls::SetLegacyGlobalServerConfig(data);
++#endif
+ }
+ 
+ } // namespace Calls
+diff --git a/Telegram/cmake/lib_tgcalls.cmake b/Telegram/cmake/lib_tgcalls.cmake
+index 34a5ba418..8a784be2c 100644
+--- a/Telegram/cmake/lib_tgcalls.cmake
++++ b/Telegram/cmake/lib_tgcalls.cmake
+@@ -267,6 +267,10 @@ PRIVATE
+     ${tgcalls_loc}
+ )
+ 
++if (TDESKTOP_DISABLE_LEGACY_TGVOIP)
++    return()
++endif()
++
+ add_library(lib_tgcalls_legacy STATIC)
+ init_target(lib_tgcalls_legacy)
+ 
+diff --git a/Telegram/cmake/telegram_options.cmake b/Telegram/cmake/telegram_options.cmake
+index 1c3c25431..033f2bc95 100644
+--- a/Telegram/cmake/telegram_options.cmake
++++ b/Telegram/cmake/telegram_options.cmake
+@@ -4,7 +4,9 @@
+ # For license and copyright information please follow this link:
+ # https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
+ 
++option(TDESKTOP_DISABLE_LEGACY_TGVOIP "Disable legacy tgvoip support." OFF)
+ option(TDESKTOP_API_TEST "Use test API credentials." OFF)
++
+ set(TDESKTOP_API_ID "0" CACHE STRING "Provide 'api_id' for the Telegram API access.")
+ set(TDESKTOP_API_HASH "" CACHE STRING "Provide 'api_hash' for the Telegram API access.")
+ 
+@@ -40,6 +42,12 @@ if (TDESKTOP_API_ID STREQUAL "0" OR TDESKTOP_API_HASH STREQUAL "")
+     " ")
+ endif()
+ 
++if (TDESKTOP_DISABLE_LEGACY_TGVOIP)
++    target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_LEGACY_TGVOIP)
++else()
++    target_link_libraries(Telegram PRIVATE tdesktop::lib_tgcalls_legacy tdesktop::lib_tgvoip)
++endif()
++
+ if (DESKTOP_APP_DISABLE_SPELLCHECK)
+     target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_SPELLCHECK)
+ else()
+-- 
+2.37.3
+
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 17b60b1484..d0954f83a4 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -1,5 +1,6 @@ 
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
+;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -43,6 +44,7 @@  (define-module (gnu packages telegram)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libreoffice)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages llvm)
   #:use-module (gnu packages lxqt)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages perl)
@@ -60,6 +62,7 @@  (define-module (gnu packages telegram)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages web)
+  #:use-module (gnu packages webkit)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
@@ -75,7 +78,7 @@  (define-module (gnu packages telegram)
   #:use-module (guix build-system python)
   #:use-module (guix build-system qt))
 
-(define %telegram-version "2.9.3")
+(define %telegram-version "4.2.0")
 
 (define libyuv-for-telegram-desktop
   (let ((commit "ad890067f661dc747a975bc55ba3767fe30d4452")
@@ -112,72 +115,72 @@  (define cmake-helpers-for-telegram-desktop
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/cmake_helpers.git")
-          (commit "4d44d822e01b3b5fbec3ce824e01f56aa35d7f72")))
+          (commit "b9f1b6036329e44ec61f51f0b363fe2319158b84")))
     (file-name
      (git-file-name "cmake-helpers-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "0h6cjiqy014h2mz90h1z5a7plb3ihbnds4bja8994ybr1dy3m7m5"))))
+      "0sgp1nlmcm2imgpssqxrwinafnmicmq0qikgdnhs1d44hrwxbws3"))))
 
 (define codegen-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/codegen.git")
-          (commit "248614b49cd7d5aff69d75a737f2e35b79fbb119")))
+          (commit "8815d7aec9b901191d08445f29e2edd0aeba7b2c")))
     (file-name
      (git-file-name "codegen-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "00f7g2z6xmkbkrmi3q27hscjl44mg66wf9q0mz3rhy3jaa6cfdrk"))))
+      "1ly958mjk25kfcpa174kvg134p9r751ixi275afj5kr57by9mbq2"))))
 
 (define lib-base-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_base.git")
-          (commit "a23c05c44e4f01dc4428f4d75d4db98c59d313a6")))
+          (commit "cc5550de2766657ced8d0bb4d2db3f050363d3d5")))
     (file-name
      (git-file-name "lib-base-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "0vh5zgxwalmbnvz8lzlnba87ch8vnpmcz6nvf56w09f3nlxvvq78"))))
+      "16x5qp5w51igk213rhl49x256vjvpkjkgi2ziwzxnsj0pzdd4y27"))))
 
 (define lib-crl-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_crl.git")
-          (commit "3ccf2ed5095442e5874bba8852cb7dc4efeae29f")))
+          (commit "4e620bc383d032aadea8e6af02661f8c76695cec")))
     (file-name
      (git-file-name "lib-crl-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "11my7q54m4lvvlgma6pbdyjxi1cv1adk1gph2j50mh18sqlm8myz"))))
+      "17bngj247qwq0dg4h37xdi5v1mk22y4yp7sp6ph3irmnz4awah0x"))))
 
 (define lib-lottie-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_lottie.git")
-          (commit "0770df009db7928df1d0cad0900dc5110106d229")))
+          (commit "6ed1c22ed60692d2f288c9222fafd7d5cd62f904")))
     (file-name
      (git-file-name "lib-lottie-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "1gj56ymlbk5dnk82jw674808m511lv9dky8891a5wm4gp3pph5jb"))))
+      "0l57ibfij9xm4ww4s9cc63q1x8xzpc6ablwaji1krrn3xxksqdd4"))))
 
 (define lib-qr-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_qr.git")
-          (commit "2b08c71c6edcfc3e31f7d7f518cc963493b6e189")))
+          (commit "501f4c3502fd872ab4d777df8911bdac32de7c48")))
     (file-name
      (git-file-name "lib-qr-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "05hrkmwgrczyjv87r507i2r7m1zr6k2i43mq3my0s6j4szr1rjq0"))))
+      "0hmwqj7a9vcy8wq7pd1qprl68im3zl5f1wzcn2zzk2wvi0389k9f"))))
 
 (define lib-rlottie-for-telegram-desktop
   (origin
@@ -196,60 +199,60 @@  (define lib-rpl-for-telegram-desktop
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_rpl.git")
-          (commit "df721be3fa14a27dfc230d2e3c42bb1a7c9d0617")))
+          (commit "fd31f5bf382d2679eccdb1abaf8240a56c6a7abe")))
     (file-name
      (git-file-name "lib-rpl-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "15fnv3ssn7rn5d0j52gggdvyqc2wm464678dj7v2x9h8lka2jjxn"))))
+      "1fpq8nyh8wx6zkb3sjjrx9ydqzyhw4483bdk1i9blp0ijn9xxdxf"))))
 
 (define lib-spellcheck-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_spellcheck.git")
-          (commit "68c9b788958904aea7de79f986a0f82ec8c5b094")))
+          (commit "0e386e22cb6ba8a114b569840a635e096dcb645e")))
     (file-name
      (git-file-name "lib-spellcheck-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "0d8s4wwk6fxf536mhzq2vb9qw3j0m8nqia7ylvvpsbc4kh09dadn"))))
+      "06js7ccv6z3nbd4v2p4hp2prrlmz5ww46y3yb922pp7gm317dwyw"))))
 
 (define lib-storage-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_storage.git")
-          (commit "403df6c4a29562bd417c92d410e49819f5a48cc1")))
+          (commit "839609369d04615475cb1518636de3619106a917")))
     (file-name
      (git-file-name "lib-storage-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "1zxvzfrxbj4d395fzyb5pm9wn3n8jyimxx88cyqjcdd46sx4h7r5"))))
+      "1l26h2fmqp9dcpr6pfvdd5sjb68j7yh0ms2lnr8na7jf5xqmkwwm"))))
 
 (define lib-tl-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_tl.git")
-          (commit "45faed44e7f4d11fec79b7a70e4a35dc91ef3fdb")))
+          (commit "36fb95c4de1339d2c8921ad6b2911858c3d0e0fa")))
     (file-name
      (git-file-name "lib-tl-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "0h43xvzklda02494d466jp52hl8c1kmav9f12dyld10dpf1w6c7m"))))
+      "03rngnssnqwr7ad05qn64mwgji5fb0r3fp5ybkf951p8phr1jvzk"))))
 
 (define lib-ui-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_ui.git")
-          (commit "1b590f9e16eb9571a039f072d6fea66c607e419f")))
+          (commit "f82162f05a72352bfee0fb79f9e50c350b3a98f3")))
     (file-name
      (git-file-name "lib-ui-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "0ighyhfp29h9h8c7vr70pnhcv2xnsr9ln084pssn8hb5z4pmb62f"))))
+      "1zv29i7hxv70dsq36zrvkvaraff5zcb7sccpncqfl51s59kfsnz5"))))
 
 (define lib-waylandshells-for-telegram-desktop
   (origin
@@ -268,36 +271,36 @@  (define lib-webrtc-for-telegram-desktop
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_webrtc.git")
-          (commit "ef49f953f12b112008a094a719f40939aaf39db4")))
+          (commit "9b11599c3c56047cfa4c68b69f1fcc93b602c33a")))
     (file-name
      (git-file-name "lib-webrtc-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "15k4xs3462p3ddp5cn9im3nvdiaijmxir8wxsf5yrj70ghy26ibw"))))
+      "0158jx8hj4fv6qpw5pgcr2mdlihj0dxs060dg3iy61zz6q68z5dq"))))
 
 (define lib-webview-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_webview.git")
-          (commit "e06427c624515485774e2e2181d4afeb05ad5a67")))
+          (commit "546df65eb2424550ed84ce14fc9c5d1bb3586f35")))
     (file-name
      (git-file-name "lib-webview-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "148z7xzfscynwwwqssdsd97npax6yn8zrd64xw8qzbwff2g2r7k4"))))
+      "0zzjwyw82bggncmmsw969lnjl04pklmqjqm77jjzadinivl52z0l"))))
 
 (define tgcalls-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/TelegramMessenger/tgcalls.git")
-          (commit "81e97fa52e25b7775b62ce07bb653533d81e91b3")))
+          (commit "82c4921045c440b727c38e464f3a0539708423ff")))
     (file-name
      (git-file-name "tgcalls-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "0fvad87hyxli83xn19mgf8jjrrh6y6iaig14pckpbkg33vf4wqkj"))))
+      "1109r17abh66yz91b65fn2g4ryfybnsr5g6075sjhbah1gccv9mk"))))
 
 (define-public webrtc-for-telegram-desktop
   (let ((commit "621f3da55331733bf0d1b223786b96b68c03dca1")
@@ -392,8 +395,8 @@  (define-public webrtc-for-telegram-desktop
          license:bsd-3))))))
 
 (define-public rlottie-for-telegram-desktop
-  (let ((commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")
-        (revision "671"))
+  (let ((commit "8c69fc20cf2e150db304311f1233a4b55a8892d7")
+        (revision "678"))
     (hidden-package
      (package
        (inherit rlottie)
@@ -409,21 +412,12 @@  (define-public rlottie-for-telegram-desktop
           (file-name
            (git-file-name "rlottie-for-telegram-desktop" version))
           (sha256
-           (base32 "1lxpbgbhps9rmck036mgmiknqrzpjxpas8n7qxykv6pwzn0c8n0c"))))
-       (arguments
-        `(#:configure-flags
-          (list
-           "-Dlog=true"
-           "-Ddumptree=true"
-           "-Dtest=true")
-          #:phases
-          (modify-phases %standard-phases
-            (add-after 'unpack 'patch-cxx-flags
-              (lambda _
-                (substitute* "meson.build"
-                  (("werror=true")
-                   "werror=false"))
-                #t)))))))))
+           (base32 "14gwg3sn6xdx9ymnx5r0vfm4pk8dwk92s10a1wdvfbjpyrxll64i"))
+          (modules '((guix build utils)))
+          (snippet
+           #~(begin
+               (substitute* "meson.build"
+                 (("werror=true") "werror=false"))))))))))
 
 (define-public libtgvoip-for-telegram-desktop
   (let ((commit "13a5fcb16b04472d808ce122abd695dbf5d206cd")
@@ -481,15 +475,19 @@  (define-public telegram-desktop
        (file-name
         (git-file-name name version))
        (sha256
-        (base32 "0dzf1y3xhqvizg29bd1kya48cjbkq073d2x10ynwcmmx396l4nd8"))
+        (base32 "16xhng5m3aw4j4ax74nydpxjnx5z3ga21vmrznlm4lbk9ivyn7vx"))
+       (patches
+        (search-patches
+         ;; https://github.com/telegramdesktop/tdesktop/pull/24126
+         "telegram-desktop-allow-disable-libtgvoip.patch"))
        (modules '((guix build utils)
                   (ice-9 ftw)
                   (srfi srfi-1)))
        (snippet
         #~(begin
             (let ((keep
-                   '( ;; Not available in Guix.
-                     "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+                   '(;; Not available in Guix.
+                     "dispatch" "tgcalls")))
               (with-directory-excursion "Telegram/ThirdParty"
                 (for-each delete-file-recursively
                           (lset-difference string=?
@@ -509,23 +507,22 @@  (define-public telegram-desktop
              (ice-9 match))
            #:configure-flags
            #~(list
-              ;; Client applications must provide their own API-ID and API-HASH,
-              ;; see also <https://core.telegram.org/api/obtaining_api_id>.
-              ;; Here, we snarf the keys from the official Snaps, which are
-              ;; also stored in <#$source/snap/snapcraft.yaml>.
+              ;; Client applications need an API ID and hash, see also:
+              ;; <https://core.telegram.org/api/obtaining_api_id>. Here, we
+              ;; use the ones given by the official Snap package, see:
+              ;; <https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml>.
               "-DTDESKTOP_API_ID=611335"
               "-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c"
-              ;; Disable WebkitGTK support as it fails to link
-              "-DDESKTOP_APP_DISABLE_WEBKITGTK=ON"
-              ;; Use bundled fonts as fallback.
-              "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
+              "-DTDESKTOP_DISABLE_LEGACY_TGVOIP=ON"
+              "-DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON"
+              "-DDESKTOP_APP_DISABLE_AUTOUPDATE=ON"
+              "-DDESKTOP_APP_USE_PACKAGED_RLOTTIE=ON"
+              (string-append "-DTDESKTOP_LAUTCHER_BASENAME=" #$name))
            #:phases
            #~(modify-phases %standard-phases
-               (add-after 'unpack 'make-writable
-                 (lambda _
-                   (for-each make-file-writable (find-files "."))))
-               (add-after 'make-writable 'copy-inputs
+               (add-after 'unpack 'unpack-additional-sources
                  (lambda _
+                   (for-each make-file-writable (find-files "."))
                    (for-each
                     (match-lambda
                       ((dst src)
@@ -537,81 +534,73 @@  (define-public telegram-desktop
                       ("Telegram/lib_crl" #$lib-crl-for-telegram-desktop)
                       ("Telegram/lib_lottie" #$lib-lottie-for-telegram-desktop)
                       ("Telegram/lib_qr" #$lib-qr-for-telegram-desktop)
-                      ("Telegram/lib_rlottie" #$lib-rlottie-for-telegram-desktop)
                       ("Telegram/lib_rpl" #$lib-rpl-for-telegram-desktop)
                       ("Telegram/lib_spellcheck" #$lib-spellcheck-for-telegram-desktop)
                       ("Telegram/lib_storage" #$lib-storage-for-telegram-desktop)
                       ("Telegram/lib_tl" #$lib-tl-for-telegram-desktop)
                       ("Telegram/lib_ui" #$lib-ui-for-telegram-desktop)
-                      ("Telegram/lib_waylandshells" #$lib-waylandshells-for-telegram-desktop)
                       ("Telegram/lib_webrtc" #$lib-webrtc-for-telegram-desktop)
                       ("Telegram/lib_webview" #$lib-webview-for-telegram-desktop)
+                      ("Telegram/ThirdParty/dispatch" #$dispatch-for-telegram-desktop)
                       ("Telegram/ThirdParty/tgcalls" #$tgcalls-for-telegram-desktop)))))
-               (add-before 'configure 'patch-cxx-flags
-                 (lambda _
-                   (substitute* "cmake/options_linux.cmake" (("class-memaccess") "all"))))
                (add-after 'install 'glib-or-gtk-compile-schemas
                  (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
                (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
                  (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
     (native-inputs
-     (list cmake-shared
-           extra-cmake-modules
-           `(,glib "bin")
+     (list `(,glib "bin")
            `(,gtk+ "bin")
+           clang-toolchain
            pkg-config
-           python-wrapper
-           qttools-5))
+           python-wrapper))
     (inputs
-     (list alsa-lib
+     (list abseil-cpp-cxxstd17
+           alsa-lib
            c++-gsl
-           catch2
-           libexpected
-           fcitx-qt5
-           fcitx5-qt
            ffmpeg
-           glib
-           glibmm-2.64
-           gtk+
-           hime
-           hunspell
            jemalloc
-           kwayland
-           libdbusmenu-qt
+           kcoreaddons
+           libexpected
            libjpeg-turbo
-           libtgvoip-for-telegram-desktop
-           lz4
-           materialdecoration
+           libvpx
            minizip
-           nimf
            openal
            openssl
            opus
            pulseaudio
            qrcodegen-cpp
-           qtbase-5
-           qtsvg-5
-           qt5ct
+           qt5compat
+           qtbase
            qtimageformats
-           qtwayland
+           qtsvg-5
            range-v3
            rlottie-for-telegram-desktop
            rnnoise
            webrtc-for-telegram-desktop
-           libx11
-           libxcb
-           xcb-util-keysyms
            xxhash
-           zlib))
-    (propagated-inputs (list dconf))
+           zlib
+           ;; DESKTOP_APP_DISABLE_DBUS_INTEGRATION
+           glibmm-2.64
+           ;; DESKTOP_APP_DISABLE_SPELLCHECK
+           hunspell
+           ;; DESKTOP_APP_LOTTIE_USE_CACHE
+           lz4
+           ;; DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION
+           qtwayland wayland
+           ;; DESKTOP_APP_DISABLE_X11_INTEGRATION
+           libxcb xcb-util-keysyms
+           ;; Optional
+           webkitgtk))
     (synopsis "Telegram Desktop")
     (description "Telegram desktop is the official desktop version of the
 Telegram instant messenger.")
     (home-page "https://desktop.telegram.org/")
     (license
      (list
-      ;; ThirdParty
-      license:lgpl2.1+
+      ;; Telegram/ThirdParty/dispatch
+      license:asl2.0
+      ;; Telegram/ThirdParty/tgcalls
+      license:lgpl3
       ;; Others
       license:gpl3+))))