diff mbox series

[bug#71897,v8,8/8] gnu: telegram-desktop: Update to 5.5.5.

Message ID ed35bc6462937261818a90a7d516ac87bd48e041.1726930328.git.i@dan.games
State New
Headers show
Series [bug#71897,v8,1/8] gnu: xdg-desktop-portal: Update to 1.18.4. | expand

Commit Message

dan Sept. 21, 2024, 2:53 p.m. UTC
* gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch: Update patch file to match upstream changes.
* gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch: Update patch file to match upstream changes.
* gnu/packages/patches/telegram-desktop-unbundle-cppgir.patch: New file.
* gnu/packages/patches/telegram-desktop-unbundle-gsl.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register them.
* gnu/packages/telegram.scm:
(libyuv-for-telegram-desktop, cmake-helpers-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-storage-for-telegram-desktop)
(lib-tl-for-telegram-desktop, lib-webrtc-for-telegram-desktop)
(tgcalls-for-telegram-desktop, webrtc-for-telegram-desktop): Bump to submodule checkout.
(cmake-helpers-for-telegram-desktop)[origin]: Add patches to unbundle gsl and cppgir.
(libprisma-for-telegram-desktop): Use %telegram-version.
(telegram-desktop): Update to 5.5.5.
[:configure-flags]: Add disable jemalloc flag.
[#:phases]<unpack-additional-sources>: Add libprisma-for-telegram-desktop.
<patch-gir-ignore-paths>: New phase.
<use-system-xdg-desktop-portal>: New phase.
<patch-libwebview>: New phase.
[native-inputs]: Add cpp-ada-url-parser, gobject-introspection and xdg-desktop-portal.
[inputs]: Add boost, cppgir-for-telegram-desktop, expected-lite and remove jemalloc.

Change-Id: I0ea3ea5a3e416a9d5b2b5b7b55ca1af679bc3d38
---
 gnu/local.mk                                  |   2 +
 ...gram-desktop-allow-disable-libtgvoip.patch |   6 +-
 .../telegram-desktop-unbundle-cppgir.patch    |  95 +++++++++++++++
 .../telegram-desktop-unbundle-gsl.patch       |  31 +++++
 ...or-telegram-desktop-unbundle-libsrtp.patch |   7 +-
 gnu/packages/telegram.scm                     | 112 +++++++++++-------
 6 files changed, 205 insertions(+), 48 deletions(-)
 create mode 100644 gnu/packages/patches/telegram-desktop-unbundle-cppgir.patch
 create mode 100644 gnu/packages/patches/telegram-desktop-unbundle-gsl.patch

Comments

Maxim Cournoyer Sept. 22, 2024, 3:22 a.m. UTC | #1
Hi,

dan <i@dan.games> writes:

> * gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch:
> Update patch file to match upstream changes.
> *
> gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch:
> Update patch file to match upstream changes.
> * gnu/packages/patches/telegram-desktop-unbundle-cppgir.patch: New file.
> * gnu/packages/patches/telegram-desktop-unbundle-gsl.patch: New file.

I suppose these patches are from upstream?  For extra origin tracking, I
like to add a URL to the upstream URL they were fetched from, or at
least a comment mentioning this is committed but unreleased in the main
repo.

[...]

>  (define-public webrtc-for-telegram-desktop
> -  (let ((commit "0532942ac6176a66ef184fb728a4cbb02958fc0b")
> -        (revision "389"))
> +  (let ((commit "c425281150317753d7bc5182c6572abe20f9a784")
> +        (revision "456"))
>      (hidden-package
>       (package
>         (name "webrtc-for-telegram-desktop")
> @@ -285,7 +291,7 @@ (define-public webrtc-for-telegram-desktop
>            (file-name
>             (git-file-name name version))
>            (sha256
> -           (base32 "0fary99yl1ddk5zjpfy0pyb5brd268j41plcnvv9qjyf0wj9hf2k"))
> +           (base32 "1fj48iq56awnrckncy1qc3zhdzifl725hbb6an7wg2v3zmagvrwn"))
>            (patches
>             (search-patches
>              ;; https://github.com/desktop-app/tg_owt/pull/123
> @@ -407,7 +413,7 @@ (define libprisma-for-telegram-desktop
>           (url "https://github.com/desktop-app/libprisma")
>           (commit "23b0d70f9709da9b38561d5706891a134d18df76")))
>     (file-name
> -    (git-file-name "libprisma-for-telegram-desktop" "5.3.2"))
> +    (git-file-name "libprisma-for-telegram-desktop" %telegram-version))
>     (sha256
>      (base32
>       "0fg4x4ikj7f3706bmfvkwq4smxc98qr3cgpm25w48n4ys6wfgadg"))))
> @@ -427,7 +433,7 @@ (define-public telegram-desktop
>         (file-name
>          (git-file-name name version))
>         (sha256
> -        (base32 "0g47ffamh1csp79yzkv28v3qjkhjacj0c7pjf53n1ks80j5hc2j0"))
> +        (base32 "12fdybn085s3i3a8hwi0bmdns7jxvg0k662n04jgffirgsz8n54m"))
>         (patches
>          (search-patches
>           ;; https://github.com/telegramdesktop/tdesktop/pull/24126
> @@ -468,7 +474,10 @@ (define-public telegram-desktop
>                "-DTDESKTOP_DISABLE_LEGACY_TGVOIP=ON"
>                "-DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON"
>                "-DDESKTOP_APP_DISABLE_AUTOUPDATE=ON"
> -              "-DDESKTOP_APP_USE_PACKAGED_RLOTTIE=ON")
> +              "-DDESKTOP_APP_USE_PACKAGED_RLOTTIE=ON"
> +              ;; enabling jemalloc causes SIGSEGV.  this probably happened
> +              ;; after upgrading to glibc 2.39.
> +              "-DDESKTOP_APP_DISABLE_JEMALLOC=ON")

Nitpick: Please use fully punctuated complete sentences for stand alone
comments (the ones on their own lines -- inline comments (trailing at
the end of line are OK to be incomplete sentence))

>             #:phases
>             #~(modify-phases %standard-phases
>                 (add-after 'unpack 'unpack-additional-sources
> @@ -493,21 +502,45 @@ (define-public telegram-desktop
>                        ("Telegram/lib_webrtc" #$lib-webrtc-for-telegram-desktop)
>                        ("Telegram/lib_webview" #$lib-webview-for-telegram-desktop)
>                        ("Telegram/ThirdParty/cld3" #$cld3-for-telegram-desktop)
> +                      ("Telegram/ThirdParty/libprisma" #$libprisma-for-telegram-desktop)
>                        ("Telegram/ThirdParty/tgcalls" #$tgcalls-for-telegram-desktop)))))
> +               (add-after 'unpack-additional-sources 'patch-gir-ignore-paths
> +                 (lambda _
> +                   (substitute* "cmake/external/glib/generate_cppgir.cmake"
> +                     (("\\$\\{cmake_helpers_loc\\}/external/glib/cppgir/data")
> +                      (string-append #$(this-package-input "cppgir") "/share/cppgir")))))
> +               (add-after 'unpack-additional-sources 'use-system-xdg-desktop-portal
> +                 (lambda _
> +                   (substitute* (list "Telegram/CMakeLists.txt"
> +                                      "Telegram/lib_base/CMakeLists.txt")
> +                     (("\\$\\{third_party_loc\\}/xdg-desktop-portal/data")
> +                      (string-append #$(this-package-native-input "xdg-desktop-portal")
> +                                     "/share/dbus-1/interfaces")))))
> +               ;; has to remove this constexpr otherwise cannot compile with gcc-final

Ditto (same comment as above).

> +               (add-after 'use-system-xdg-desktop-portal 'patch-libwebview
> +                 (lambda _
> +                   (substitute* "Telegram/lib_webview/webview/webview_interface.h"
> +                     (("constexpr ") ""))))

GCC should know about constexpr; perhaps the wrong C++ standard (can be
provided via a CMake flag) is being selected, or alternatively you could
provide a newer gcc compiler native inputs?

>                 (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 `(,glib "bin")
> +     (list cpp-ada-url-parser
> +           `(,glib "bin")
> +           gobject-introspection
>             `(,gtk+ "bin")
>             pkg-config
> -           python-wrapper))
> +           python-wrapper
> +           xdg-desktop-portal))
>      (inputs
>       (list abseil-cpp-cxxstd17
>             alsa-lib
> +           boost
>             c++-gsl
> +           cppgir-for-telegram-desktop
>             crc32c
> +           expected-lite
>             fcitx-qt5
>             fcitx5-qt
>             ffmpeg
> @@ -516,7 +549,6 @@ (define-public telegram-desktop
>             gtk+

No GTK 4 support yet?

>             hime
>             hunspell
> -           jemalloc
>             kcoreaddons-5
>             kimageformats-5
>             libdispatch

Thanks for this undertaking.  It looks nearly good to go, with my little
comments/concerns ideally addressed.
dan Sept. 22, 2024, 3:51 a.m. UTC | #2
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

>> +               (add-after 'use-system-xdg-desktop-portal 
>> 'patch-libwebview
>> +                 (lambda _
>> +                   (substitute* 
>> "Telegram/lib_webview/webview/webview_interface.h"
>> +                     (("constexpr ") ""))))
>
> GCC should know about constexpr; perhaps the wrong C++ standard 
> (can be
> provided via a CMake flag) is being selected, or alternatively 
> you could
> provide a newer gcc compiler native inputs?

Mentioned in a previous cover letter, when trying to build 
telegram-desktop with a newer version of gcc (I've tried gcc-12, 
gcc-13 and gcc-14), I ran into an issue which is similar to:
https://issues.guix.gnu.org/43579.

--8<---------------cut here---------------start------------->8---
/tmp/guix-build-telegram-desktop-5.5.5.drv-0/source/Telegram/lib_base/base/algorithm.cpp:21:47: 
error: ?FE_ALL_EXCEPT? was not declared in this scope
   21 |         const auto errors = 
   std::fetestexcept(FE_ALL_EXCEPT);
      | 
      ^~~~~~~~~~~~~
/tmp/guix-build-telegram-desktop-5.5.5.drv-0/source/Telegram/lib_base/base/algorithm.cpp:28:14: 
error: ?feclearexcept? is not a member of ?std?
   28 |         std::feclearexcept(FE_ALL_EXCEPT);
      |              ^~~~~~~~~~~~~
--8<---------------cut here---------------end--------------->8---
dan Sept. 22, 2024, 4:09 a.m. UTC | #3
Hi Maxim,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

>> +               (add-after 'use-system-xdg-desktop-portal 
>> 'patch-libwebview
>> +                 (lambda _
>> +                   (substitute* 
>> "Telegram/lib_webview/webview/webview_interface.h"
>> +                     (("constexpr ") ""))))
>
> GCC should know about constexpr; perhaps the wrong C++ standard 
> (can be
> provided via a CMake flag) is being selected, or alternatively 
> you could
> provide a newer gcc compiler native inputs?

The original compilation error is:
--8<---------------cut here---------------start------------->8---
/tmp/guix-build-telegram-desktop-5.5.5.drv-0/source/Telegram/lib_webview/webview/webview_interface.h:34:38: 
error: call to non-?constexpr? function ?typename 
__gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, bool>::__type 
std::operator==(const std::__cxx11::basic_string<_CharT>&, const 
std::__cxx11::basic_string<_CharT>&) [with _CharT = char; typename 
__gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, bool>::__type 
= bool]?
   34 |         friend inline constexpr bool operator==(
      |                                      ^~~~~~~~
In file included from 
/gnu/store/86fc8bi3mciljxz7c79jx8zr4wsx7xw8-gcc-11.4.0/include/c++/string:55,
                 from 
                 /gnu/store/86fc8bi3mciljxz7c79jx8zr4wsx7xw8-gcc-11.4.0/include/c++/bits/locale_classes.h:40,
                 from 
                 /gnu/store/86fc8bi3mciljxz7c79jx8zr4wsx7xw8-gcc-11.4.0/include/c++/bits/ios_base.h:41,
                 from 
                 /gnu/store/86fc8bi3mciljxz7c79jx8zr4wsx7xw8-gcc-11.4.0/include/c++/streambuf:41,
                 from 
                 /gnu/store/86fc8bi3mciljxz7c79jx8zr4wsx7xw8-gcc-11.4.0/include/c++/bits/streambuf_iterator.h:35,
                 from 
                 /gnu/store/86fc8bi3mciljxz7c79jx8zr4wsx7xw8-gcc-11.4.0/include/c++/iterator:66,
                 from 
                 /gnu/store/86fc8bi3mciljxz7c79jx8zr4wsx7xw8-gcc-11.4.0/include/c++/bits/ranges_algobase.h:36,
                 from 
                 /gnu/store/86fc8bi3mciljxz7c79jx8zr4wsx7xw8-gcc-11.4.0/include/c++/bits/ranges_algo.h:35,
                 from 
                 /gnu/store/86fc8bi3mciljxz7c79jx8zr4wsx7xw8-gcc-11.4.0/include/c++/algorithm:64,
                 from 
                 /gnu/store/mz9sf8vsp2qksx1vb4fz8mrz4pkypfmc-qtbase-5.15.10/include/qt5/QtCore/qglobal.h:142,
                 from 
                 /gnu/store/mz9sf8vsp2qksx1vb4fz8mrz4pkypfmc-qtbase-5.15.10/include/qt5/QtCore/qiterator.h:43,
                 from 
                 /gnu/store/mz9sf8vsp2qksx1vb4fz8mrz4pkypfmc-qtbase-5.15.10/include/qt5/QtCore/qmap.h:43,
                 from 
                 /gnu/store/mz9sf8vsp2qksx1vb4fz8mrz4pkypfmc-qtbase-5.15.10/include/qt5/QtCore/QMap:1,
                 from 
                 /tmp/guix-build-telegram-desktop-5.5.5.drv-0/source/Telegram/lib_base/base/ordered_set.h:9,
                 from 
                 /tmp/guix-build-telegram-desktop-5.5.5.drv-0/source/Telegram/lib_base/base/basic_types.h:10,
                 from 
                 /tmp/guix-build-telegram-desktop-5.5.5.drv-0/source/Telegram/lib_webview/webview/webview_common.h:9,
                 from 
                 /tmp/guix-build-telegram-desktop-5.5.5.drv-0/source/Telegram/lib_webview/webview/webview_interface.h:9,
                 from 
                 /tmp/guix-build-telegram-desktop-5.5.5.drv-0/source/Telegram/lib_webview/webview/platform/linux/webview_linux.h:9,
                 from 
                 /tmp/guix-build-telegram-desktop-5.5.5.drv-0/source/Telegram/lib_webview/webview/platform/linux/webview_linux_webkitgtk.h:9,
                 from 
                 /tmp/guix-build-telegram-desktop-5.5.5.drv-0/source/Telegram/lib_webview/webview/platform/linux/webview_linux_webkitgtk.cpp:7:
/gnu/store/86fc8bi3mciljxz7c79jx8zr4wsx7xw8-gcc-11.4.0/include/c++/bits/basic_string.h:6234:5: 
note: ?typename 
__gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, bool>::__type 
std::operator==(const std::__cxx11::basic_string<_CharT>&, const 
std::__cxx11::basic_string<_CharT>&) [with _CharT = char; typename 
__gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, bool>::__type 
= bool]? declared here
 6234 |     operator==(const basic_string<_CharT>& __lhs,
      |     ^~~~~~~~
--8<---------------cut here---------------end--------------->8---

The problematic code in telegram-desktop is:
--8<---------------cut here---------------start------------->8---
struct NavigationHistoryState {
	std::string url;
	std::string title;
	bool canGoBack : 1 = false;
	bool canGoForward : 1 = false;

	friend inline constexpr bool operator==(
		NavigationHistoryState,
		NavigationHistoryState) = default;
};
--8<---------------cut here---------------end--------------->8---

And the code in 
/gnu/store/86fc8bi3mciljxz7c79jx8zr4wsx7xw8-gcc-11.4.0/include/c++/bits/basic_string.h 
is:
--8<---------------cut here---------------start------------->8---
  template<typename _CharT>
    inline
    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, 
    bool>::__type
    operator==(const basic_string<_CharT>& __lhs,
	       const basic_string<_CharT>& __rhs) 
	       _GLIBCXX_NOEXCEPT
    { return (__lhs.size() == __rhs.size()
	      && !std::char_traits<_CharT>::compare(__lhs.data(), 
	      __rhs.data(),
						    __lhs.size())); 
						    }
--8<---------------cut here---------------end--------------->8---

In gcc-12, the code looks like this:
--8<---------------cut here---------------start------------->8---
  template<typename _CharT>
    _GLIBCXX20_CONSTEXPR
    inline
    typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, 
    bool>::__type
    operator==(const basic_string<_CharT>& __lhs,
	       const basic_string<_CharT>& __rhs) 
	       _GLIBCXX_NOEXCEPT
    { return (__lhs.size() == __rhs.size()
	      && !std::char_traits<_CharT>::compare(__lhs.data(), 
	      __rhs.data(),
						    __lhs.size())); 
						    }
--8<---------------cut here---------------end--------------->8---
Which indeed has the constexpr.

But as I explained in previous reply, I failed at using a newer 
version of gcc.  Thus, I think trivially remove the constexpr from 
telegram-desktop's source is the easiest fix here.
dan Sept. 22, 2024, 4:14 a.m. UTC | #4
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> Hi,
>
> dan <i@dan.games> writes:
>
>> * 
>> gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch:
>> Update patch file to match upstream changes.
>> *
>> gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch:
>> Update patch file to match upstream changes.
>> * gnu/packages/patches/telegram-desktop-unbundle-cppgir.patch: 
>> New file.
>> * gnu/packages/patches/telegram-desktop-unbundle-gsl.patch: New 
>> file.
>
> I suppose these patches are from upstream?  For extra origin 
> tracking, I
> like to add a URL to the upstream URL they were fetched from, or 
> at
> least a comment mentioning this is committed but unreleased in 
> the main
> repo.
>
> [...]
>
>>  (define-public webrtc-for-telegram-desktop
>> -  (let ((commit "0532942ac6176a66ef184fb728a4cbb02958fc0b")
>> -        (revision "389"))
>> +  (let ((commit "c425281150317753d7bc5182c6572abe20f9a784")
>> +        (revision "456"))
>>      (hidden-package
>>       (package
>>         (name "webrtc-for-telegram-desktop")
>> @@ -285,7 +291,7 @@ (define-public webrtc-for-telegram-desktop
>>            (file-name
>>             (git-file-name name version))
>>            (sha256
>> -           (base32 
>> "0fary99yl1ddk5zjpfy0pyb5brd268j41plcnvv9qjyf0wj9hf2k"))
>> +           (base32 
>> "1fj48iq56awnrckncy1qc3zhdzifl725hbb6an7wg2v3zmagvrwn"))
>>            (patches
>>             (search-patches
>>              ;; https://github.com/desktop-app/tg_owt/pull/123
>> @@ -407,7 +413,7 @@ (define libprisma-for-telegram-desktop
>>           (url "https://github.com/desktop-app/libprisma")
>>           (commit "23b0d70f9709da9b38561d5706891a134d18df76")))

The upstream pull request URLs were added as comments in the 
package definition.  Do you think this is sufficient? Or do you 
suggest me adding them in the patch file directly, or in the 
commit message?
Maxim Cournoyer Sept. 24, 2024, 5:59 a.m. UTC | #5
Hi Dan,

dan <i@dan.games> writes:

[...]

> The upstream pull request URLs were added as comments in the package
> definition.  Do you think this is sufficient? Or do you suggest me
> adding them in the patch file directly, or in the commit message?

I'd suggest adding the source 6formation in the patch files directly; I
think 'guix lint' looks if there's some comment/url there, and it can't
be missed when looking to update the patch.
Maxim Cournoyer Sept. 24, 2024, 6 a.m. UTC | #6
Hi Dan,

dan <i@dan.games> writes:

[...]

> In gcc-12, the code looks like this:
>
>   template<typename _CharT>
>     _GLIBCXX20_CONSTEXPR
>     inline
>     typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value, 
>     bool>::__type
>     operator==(const basic_string<_CharT>& __lhs,
> 	       const basic_string<_CharT>& __rhs) 
> 	       _GLIBCXX_NOEXCEPT
>     { return (__lhs.size() == __rhs.size()
> 	      && !std::char_traits<_CharT>::compare(__lhs.data(), 
> 	      __rhs.data(),
> 						    __lhs.size())); 
> 						    }
>
> Which indeed has the constexpr.
>
> But as I explained in previous reply, I failed at using a newer 
> version of gcc.  Thus, I think trivially remove the constexpr from 
> telegram-desktop's source is the easiest fix here.

I see.  I thisk it'd be nice if a short summary of this was added to a
comment in the phase patching out the constexpr keyword.
diff mbox series

Patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 829c5e166e..623da8c3ff 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2197,6 +2197,8 @@  dist_patch_DATA =						\
   %D%/packages/patches/texinfo-headings-single.patch		\
   %D%/packages/patches/texinfo-5-perl-compat.patch		\
   %D%/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch   \
+  %D%/packages/patches/telegram-desktop-unbundle-cppgir.patch   \
+  %D%/packages/patches/telegram-desktop-unbundle-gsl.patch      \
   %D%/packages/patches/telegram-purple-adjust-test.patch	\
   %D%/packages/patches/teuchos-remove-duplicate-using.patch	\
   %D%/packages/patches/texi2html-document-encoding.patch	\
diff --git a/gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch b/gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch
index a603bc9d72..1354a1e9cd 100644
--- a/gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch
+++ b/gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch
@@ -47,10 +47,9 @@  diff --git a/Telegram/SourceFiles/calls/calls_call.cpp b/Telegram/SourceFiles/ca
 index 5fe9ac677..bebf48e70 100644
 --- a/Telegram/SourceFiles/calls/calls_call.cpp
 +++ b/Telegram/SourceFiles/calls/calls_call.cpp
-@@ -39,8 +39,10 @@ class InstanceImpl;
+@@ -39,7 +39,9 @@ class InstanceImpl;
  class InstanceV2Impl;
  class InstanceV2ReferenceImpl;
- class InstanceV2_4_0_0Impl;
 +#ifndef TDESKTOP_DISABLE_LEGACY_TGVOIP
  class InstanceImplLegacy;
  void SetLegacyGlobalServerConfig(const std::string &serverConfig);
@@ -58,10 +57,9 @@  index 5fe9ac677..bebf48e70 100644
  } // namespace tgcalls
  
  namespace Calls {
-@@ -56,7 +58,9 @@ const auto Register = tgcalls::Register<tgcalls::InstanceImpl>();
+@@ -56,6 +58,8 @@ 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
diff --git a/gnu/packages/patches/telegram-desktop-unbundle-cppgir.patch b/gnu/packages/patches/telegram-desktop-unbundle-cppgir.patch
new file mode 100644
index 0000000000..a24dbe25bb
--- /dev/null
+++ b/gnu/packages/patches/telegram-desktop-unbundle-cppgir.patch
@@ -0,0 +1,95 @@ 
+From a5c42e07ae223d440ff11347e0cf1fd58fd383df Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <nicholas@guriev.su>
+Date: Sat, 26 Aug 2023 18:23:53 +0300
+Subject: [PATCH 1/2] Look for system-wide cppgir before fallback to the
+ bundled copy
+
+Closes: #282
+---
+ external/glib/CMakeLists.txt        | 4 +++-
+ external/glib/generate_cppgir.cmake | 7 ++++++-
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/external/glib/CMakeLists.txt b/external/glib/CMakeLists.txt
+index 3c6fe4be..c862705f 100644
+--- a/external/glib/CMakeLists.txt
++++ b/external/glib/CMakeLists.txt
+@@ -13,9 +13,11 @@ function(add_cppgir) # isolate scope
+     set(BUILD_EXAMPLES OFF)
+     add_subdirectory(cppgir EXCLUDE_FROM_ALL)
+ endfunction()
+-add_cppgir()
+ 
+ include(generate_cppgir.cmake)
++if (NOT CppGir_FOUND)
++    add_cppgir()
++endif()
+ generate_cppgir(external_glib Gio-2.0)
+ 
+ find_package(PkgConfig REQUIRED)
+diff --git a/external/glib/generate_cppgir.cmake b/external/glib/generate_cppgir.cmake
+index c15d3f9e..9b0a5ac8 100644
+--- a/external/glib/generate_cppgir.cmake
++++ b/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 2.0)
++
+ function(generate_cppgir target_name gir)
+     set(cppgir_loc ${cmake_helpers_loc}/external/glib/cppgir)
+ 
+@@ -17,6 +19,9 @@ function(generate_cppgir target_name gir)
+         ${cppgir_loc}/data/cppgir.ignore
+         ${cppgir_loc}/data/cppgir_unix.ignore
+     )
++    if (CppGir_FOUND)
++        set(ignore_files)  # rely on default ignore list
++    endif()
+ 
+     set(gir_path)
+     if (IS_ABSOLUTE "${gir}")
+@@ -33,7 +38,7 @@ function(generate_cppgir target_name gir)
+         --class
+         --class-full
+         --expected
+-        --ignore
++        "$<$<BOOL:${ignore_files}>:--ignore>"
+         "$<JOIN:${ignore_files},:>"
+         --output
+         ${gen_dst}
+
+From eed39522952c15f448c54290454806dd011c4996 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <nicholas@guriev.su>
+Date: Sat, 26 Aug 2023 18:23:53 +0300
+Subject: [PATCH 2/2] Look for system-wide cppgir before fallback to the
+ bundled copy
+
+Closes: #282
+---
+ external/glib/generate_cppgir.cmake | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/external/glib/generate_cppgir.cmake b/external/glib/generate_cppgir.cmake
+index 9b0a5ac8..2ad82277 100644
+--- a/external/glib/generate_cppgir.cmake
++++ b/external/glib/generate_cppgir.cmake
+@@ -15,11 +15,12 @@ function(generate_cppgir target_name gir)
+ 
+     set(gen_timestamp ${gen_dst}/${target_name}_cppgir.timestamp)
+ 
+-    set(ignore_files
+-        ${cppgir_loc}/data/cppgir.ignore
+-        ${cppgir_loc}/data/cppgir_unix.ignore
+-    )
+-    if (CppGir_FOUND)
++    if (NOT CppGir_FOUND)
++        set(ignore_files
++            ${cppgir_loc}/data/cppgir.ignore
++            ${cppgir_loc}/data/cppgir_unix.ignore
++        )
++    else()
+         set(ignore_files)  # rely on default ignore list
+     endif()
+ 
diff --git a/gnu/packages/patches/telegram-desktop-unbundle-gsl.patch b/gnu/packages/patches/telegram-desktop-unbundle-gsl.patch
new file mode 100644
index 0000000000..f89d326a5c
--- /dev/null
+++ b/gnu/packages/patches/telegram-desktop-unbundle-gsl.patch
@@ -0,0 +1,31 @@ 
+From a3ac6df0441b4caca28b1df87febc420e18942ce Mon Sep 17 00:00:00 2001
+From: Zephyr Lykos <git@mochaa.ws>
+Date: Mon, 23 Oct 2023 15:55:24 +0800
+Subject: [PATCH] Revert "Force usage of GSL fork because of a libstdc++ bug."
+
+This reverts commit 982546b169df3d479e6511425870327559b38a89.
+<https://github.com/microsoft/GSL/commit/e64c97fc2cfc11992098bb38eda932de275e3f4d>
+---
+ external/gsl/CMakeLists.txt | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/external/gsl/CMakeLists.txt b/external/gsl/CMakeLists.txt
+index 8eaf19c5..344f9488 100644
+--- a/external/gsl/CMakeLists.txt
++++ b/external/gsl/CMakeLists.txt
+@@ -7,7 +7,6 @@
+ add_library(external_gsl INTERFACE IMPORTED GLOBAL)
+ add_library(desktop-app::external_gsl ALIAS external_gsl)
+ 
+-#[[
+ if (DESKTOP_APP_USE_PACKAGED)
+     if (DESKTOP_APP_USE_PACKAGED_LAZY)
+         find_package(Microsoft.GSL 4.0.0 QUIET)
+@@ -20,7 +19,6 @@ if (DESKTOP_APP_USE_PACKAGED)
+         return()
+     endif()
+ endif()
+-]]
+ 
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/25222
+ if (NOT EXISTS ${third_party_loc}/GSL/include)
diff --git a/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch b/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch
index 486f0b1aa5..3317d0a9c1 100644
--- a/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch
+++ b/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch
@@ -17,10 +17,9 @@  diff --git a/CMakeLists.txt b/CMakeLists.txt
 index af7d24c21..66bec8fdf 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -2647,6 +2647,9 @@ if (TG_OWT_USE_PROTOBUF)
-     list(APPEND export_targets proto)
- endif()
- 
+@@ -2647,5 +2647,8 @@ if (APPLE)
+     libyuv
+ )
 +if (LIBSRTP_FOUND)
 +    target_compile_definitions(tg_owt PRIVATE HAVE_LIBSRTP)
 +endif()
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index af16d4840b..327fd0d2b3 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -5,6 +5,7 @@ 
 ;;; Copyright © 2023 Lu Hui <luhux76@gmail.com>
 ;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@riseup.net>
 ;;; Copyright © 2024 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2024 dan <i@dan.games>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -28,6 +29,7 @@  (define-module (gnu packages telegram)
   #:use-module (gnu packages assembly)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
@@ -44,7 +46,6 @@  (define-module (gnu packages telegram)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages hunspell)
   #:use-module (gnu packages image)
-  #:use-module (gnu packages jemalloc)
   #:use-module (gnu packages kde-frameworks)
   #:use-module (gnu packages language)
   #:use-module (gnu packages libevent)
@@ -82,11 +83,11 @@  (define-module (gnu packages telegram)
   #:use-module (guix build-system python)
   #:use-module (guix build-system qt))
 
-(define %telegram-version "4.8.1")
+(define %telegram-version "5.5.5")
 
 (define libyuv-for-telegram-desktop
-  (let ((commit "77c2121f7e6b8e694d6e908bbbe9be24214097da")
-        (revision "2439"))
+  (let ((commit "04821d1e7d60845525e8db55c7bcd41ef5be9406")
+        (revision "2440"))
     (origin
       (method git-fetch)
       (uri (git-reference
@@ -97,79 +98,84 @@  (define libyuv-for-telegram-desktop
                   (git-version "0" revision commit)))
       (sha256
        (base32
-        "1b4k8yskr9ffl5k8s9i0af1gn1pavsfixla26vh8bij69rdr7f9c")))))
+        "1fsvc0f8mckrdzys8lnlnbw6676mjamm6p3ghr2h9liqfa83s6wg")))))
 
 (define cmake-helpers-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/cmake_helpers.git")
-          (commit "6ab5543b3dd1e40979d258e46d03376931b6c37b")))
+          (commit "05a7db2e2d2a59ecf42483debca4944d09154b5b")))
     (file-name
      (git-file-name "cmake-helpers-for-telegram-desktop" %telegram-version))
+    (patches
+     ;; https://github.com/desktop-app/cmake_helpers/pull/320
+     ;; https://github.com/desktop-app/cmake_helpers/pull/305
+     (search-patches "telegram-desktop-unbundle-gsl.patch"
+                     "telegram-desktop-unbundle-cppgir.patch"))
     (sha256
      (base32
-      "0y96mvzs113zh8bdw1h3i6l0pgwg93rigrday8kfdg4magz686k6"))))
+      "1gapyk5a8rsl8vigbz0l8h9858f2lkhkd2pjy72zivp0mrq8w0hr"))))
 
 (define codegen-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/codegen.git")
-          (commit "1a969faa0afb29d53af03e530775eccdfb8433f1")))
+          (commit "0af136124083369073b8fdaf45f0816fd2b10bad")))
     (file-name
      (git-file-name "codegen-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "1xmw8dfm51p5g20rlmzqnr72a14ngyxwq09an8clf1v5s6mmwvak"))))
+      "057bwn9smrgnyfb1vraf50ihbkhjc4d72msl7vnbqc4h5sg8dav9"))))
 
 (define lib-base-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_base.git")
-          (commit "fd9adb30ee906ea02c125eaa58fcfae773fdc677")))
+          (commit "547e7f2914d9b5548dd17e70a3a7bf5d6606afc3")))
     (file-name
      (git-file-name "lib-base-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "1m760mcfvgzia53nrs6wvjn353jvzlzln7c9fkx2dhpkigiynz83"))))
+      "0sgm2prhd4fw89afh62k7i4i7mj60n170kqz50b0mad927zngxvn"))))
 
 (define lib-crl-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_crl.git")
-          (commit "3d7e1e1f1321c3defd21c01882d674e485ecd8df")))
+          (commit "c1d6b0273653095b10b4d0f4f7c30b614b690fd5")))
     (file-name
      (git-file-name "lib-crl-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "06mzafnjpfr5ih297dh7bxm6bgpg0wy0gv2r2732n5szyrg9sdl6"))))
+      "1sxn3qccsfbx1289z0fdrb4cggs16a8r75ic6wi81c6lnkrdi3wl"))))
 
 (define lib-lottie-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_lottie.git")
-          (commit "3e9c2f1026e4b5aa3202fca4cc67ece36c7cebb2")))
+          (commit "1a700e5a0d7c3e2f617530354ff2a47c5c72bb4a")))
     (file-name
      (git-file-name "lib-lottie-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "0l57ibfij9xm4ww4s9cc63q1x8xzpc6ablwaji1krrn3xxksqdd4"))))
+      "18w35sz6k3wcv07v0szx3avpfdl0rjby6yqm1fzmx7fqw2jn6wpl"))))
 
 (define lib-qr-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_qr.git")
-          (commit "501f4c3502fd872ab4d777df8911bdac32de7c48")))
+          (commit "6fdf60461444ba150e13ac36009c0ffce72c4c83")))
     (file-name
      (git-file-name "lib-qr-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "0hmwqj7a9vcy8wq7pd1qprl68im3zl5f1wzcn2zzk2wvi0389k9f"))))
+      "1i5n3qvjkf4nv8k75cc0a71xyvpklc4nzg4k2zsfr2pxk0cy7hkw"))))
 
 (define lib-rpl-for-telegram-desktop
   (origin
@@ -188,88 +194,88 @@  (define lib-spellcheck-for-telegram-desktop
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_spellcheck.git")
-          (commit "ae89fefd239ecc47d4dab7ba29f9e230376a57d3")))
+          (commit "e76981e133a1d29f3ceb557f53850a8d822f439a")))
     (file-name
      (git-file-name "lib-spellcheck-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "147xbbcza5q4wcdipk5jplajzkc48971kg2s7qv5jlz33sxkw1lq"))))
+      "0dslsy3d6gmxaj6yv49zjgl2b2mh75j7fpnbynglr02h3m2fdj96"))))
 
 (define lib-storage-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_storage.git")
-          (commit "839609369d04615475cb1518636de3619106a917")))
+          (commit "ccdc72548a5065b5991b4e06e610d76bc4f6023e")))
     (file-name
      (git-file-name "lib-storage-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "1l26h2fmqp9dcpr6pfvdd5sjb68j7yh0ms2lnr8na7jf5xqmkwwm"))))
+      "0b11ix95dzpkz335q0a6b5yg8qhj33s4fgj9ppl37pszcqq1j3wi"))))
 
 (define lib-tl-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_tl.git")
-          (commit "36fb95c4de1339d2c8921ad6b2911858c3d0e0fa")))
+          (commit "237cbeb9d1c637759f89a508c1d854caf16e1984")))
     (file-name
      (git-file-name "lib-tl-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "03rngnssnqwr7ad05qn64mwgji5fb0r3fp5ybkf951p8phr1jvzk"))))
+      "1ji3gypy4yf9knsgylnyz5gc2kii7lls5ymj1rkf0daixdz931cm"))))
 
 (define lib-ui-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_ui.git")
-          (commit "37531086ec21a8569deddedb11b402f8a3157b90")))
+          (commit "c4e3a08e6fb90a6174c8b592d9eb747dd4d3f9c5")))
     (file-name
      (git-file-name "lib-ui-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "0l4baalwdiwcwzn3wgrbyiaryi70lswillbpkzcjpavaa2pjg6b0"))))
+      "1lbfy4fbb52lklfwn6kxny3mwl653r4vc80k922kwjfgbcy9c25f"))))
 
 (define lib-webrtc-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_webrtc.git")
-          (commit "b68a95ad4d1ae9a1827671100a7fd76cbe448c3f")))
+          (commit "8751e27d50d2f26b5d20673e5ddba38e90953570")))
     (file-name
      (git-file-name "lib-webrtc-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "1c8jwdnn26n13yp0rp0l71q6xlxa6wp3cspbm3pnghw964jwgp3z"))))
+      "0f05pqb83qckghzlhnwqbi9qfi9xw7qsv8jampl4qyaq9q0w9p20"))))
 
 (define lib-webview-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/desktop-app/lib_webview.git")
-          (commit "f632fc84cbc62ae8abbbd05f81d472757a337c11")))
+          (commit "2de655f58dc327e40d5d9df71300a0d0fdb39c9f")))
     (file-name
      (git-file-name "lib-webview-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "0idsfkxq7l9kgyrhifys5l4jkhvbyxkgkp0qdq9218h7g0ldw84i"))))
+      "12vrif0685vb068mj5sd7cknav1n66jysp18j21nlp0am9pw7ydj"))))
 
 (define tgcalls-for-telegram-desktop
   (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/TelegramMessenger/tgcalls.git")
-          (commit "2e2797648aac2588e7fe479c2e8b4455ec65c5e6")))
+          (commit "9bf4065ea00cbed5e63cec348457ed13143459d0")))
     (file-name
      (git-file-name "tgcalls-for-telegram-desktop" %telegram-version))
     (sha256
      (base32
-      "193m2gkvipijqbfd6a8mhg9nd63wlnshzgspk3pip57vk21l709z"))))
+      "1p563a11w8jrid96xf03dg6j39ciz28n5f4r6g28lxhiphbqzfym"))))
 
 (define-public webrtc-for-telegram-desktop
-  (let ((commit "0532942ac6176a66ef184fb728a4cbb02958fc0b")
-        (revision "389"))
+  (let ((commit "c425281150317753d7bc5182c6572abe20f9a784")
+        (revision "456"))
     (hidden-package
      (package
        (name "webrtc-for-telegram-desktop")
@@ -285,7 +291,7 @@  (define-public webrtc-for-telegram-desktop
           (file-name
            (git-file-name name version))
           (sha256
-           (base32 "0fary99yl1ddk5zjpfy0pyb5brd268j41plcnvv9qjyf0wj9hf2k"))
+           (base32 "1fj48iq56awnrckncy1qc3zhdzifl725hbb6an7wg2v3zmagvrwn"))
           (patches
            (search-patches
             ;; https://github.com/desktop-app/tg_owt/pull/123
@@ -407,7 +413,7 @@  (define libprisma-for-telegram-desktop
          (url "https://github.com/desktop-app/libprisma")
          (commit "23b0d70f9709da9b38561d5706891a134d18df76")))
    (file-name
-    (git-file-name "libprisma-for-telegram-desktop" "5.3.2"))
+    (git-file-name "libprisma-for-telegram-desktop" %telegram-version))
    (sha256
     (base32
      "0fg4x4ikj7f3706bmfvkwq4smxc98qr3cgpm25w48n4ys6wfgadg"))))
@@ -427,7 +433,7 @@  (define-public telegram-desktop
        (file-name
         (git-file-name name version))
        (sha256
-        (base32 "0g47ffamh1csp79yzkv28v3qjkhjacj0c7pjf53n1ks80j5hc2j0"))
+        (base32 "12fdybn085s3i3a8hwi0bmdns7jxvg0k662n04jgffirgsz8n54m"))
        (patches
         (search-patches
          ;; https://github.com/telegramdesktop/tdesktop/pull/24126
@@ -468,7 +474,10 @@  (define-public telegram-desktop
               "-DTDESKTOP_DISABLE_LEGACY_TGVOIP=ON"
               "-DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON"
               "-DDESKTOP_APP_DISABLE_AUTOUPDATE=ON"
-              "-DDESKTOP_APP_USE_PACKAGED_RLOTTIE=ON")
+              "-DDESKTOP_APP_USE_PACKAGED_RLOTTIE=ON"
+              ;; enabling jemalloc causes SIGSEGV.  this probably happened
+              ;; after upgrading to glibc 2.39.
+              "-DDESKTOP_APP_DISABLE_JEMALLOC=ON")
            #:phases
            #~(modify-phases %standard-phases
                (add-after 'unpack 'unpack-additional-sources
@@ -493,21 +502,45 @@  (define-public telegram-desktop
                       ("Telegram/lib_webrtc" #$lib-webrtc-for-telegram-desktop)
                       ("Telegram/lib_webview" #$lib-webview-for-telegram-desktop)
                       ("Telegram/ThirdParty/cld3" #$cld3-for-telegram-desktop)
+                      ("Telegram/ThirdParty/libprisma" #$libprisma-for-telegram-desktop)
                       ("Telegram/ThirdParty/tgcalls" #$tgcalls-for-telegram-desktop)))))
+               (add-after 'unpack-additional-sources 'patch-gir-ignore-paths
+                 (lambda _
+                   (substitute* "cmake/external/glib/generate_cppgir.cmake"
+                     (("\\$\\{cmake_helpers_loc\\}/external/glib/cppgir/data")
+                      (string-append #$(this-package-input "cppgir") "/share/cppgir")))))
+               (add-after 'unpack-additional-sources 'use-system-xdg-desktop-portal
+                 (lambda _
+                   (substitute* (list "Telegram/CMakeLists.txt"
+                                      "Telegram/lib_base/CMakeLists.txt")
+                     (("\\$\\{third_party_loc\\}/xdg-desktop-portal/data")
+                      (string-append #$(this-package-native-input "xdg-desktop-portal")
+                                     "/share/dbus-1/interfaces")))))
+               ;; has to remove this constexpr otherwise cannot compile with gcc-final
+               (add-after 'use-system-xdg-desktop-portal 'patch-libwebview
+                 (lambda _
+                   (substitute* "Telegram/lib_webview/webview/webview_interface.h"
+                     (("constexpr ") ""))))
                (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 `(,glib "bin")
+     (list cpp-ada-url-parser
+           `(,glib "bin")
+           gobject-introspection
            `(,gtk+ "bin")
            pkg-config
-           python-wrapper))
+           python-wrapper
+           xdg-desktop-portal))
     (inputs
      (list abseil-cpp-cxxstd17
            alsa-lib
+           boost
            c++-gsl
+           cppgir-for-telegram-desktop
            crc32c
+           expected-lite
            fcitx-qt5
            fcitx5-qt
            ffmpeg
@@ -516,7 +549,6 @@  (define-public telegram-desktop
            gtk+
            hime
            hunspell
-           jemalloc
            kcoreaddons-5
            kimageformats-5
            libdispatch