~ruther/guix-local

8ee64639cd78e3c26e8360bdba4f33f94f668e2f — dan 5 months ago 920133b
gnu: telegram-desktop: Update to 6.2.3.

* gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch: Remove
file.
* gnu/local.mk (dist_patch_DATA): Unregister it.
* gnu/packages/patches/telegram-desktop-unbundle-cppgir.patch: Rebase patch.
* gnu/packages/glib.scm (cppgir-for-telegram-desktop): Update to revision used
by 6.2.3.
* gnu/packages/telegram.scm (%telegram-version): Update to 6.2.3.
(cmake-helpers-for-telegram-desktop): Update to revision used by v6.2.3.
(codegen-for-telegram-desktop lib-base-for-telegram-desktop)
(lib-lottie-for-telegram-desktop, lib-spellcheck-for-telegram-desktop)
(lib-tl-for-telegram-desktop, lib-ui-for-telegram-desktop)
(lib-webrtc-for-telegram-desktop, lib-webview-for-telegram-desktop)
(tgcalls-for-telegram-desktop): Likewise.
(tde2e): New variable.
(telegram-desktop): Update to 6.2.3.
[patches]: Remove obsolete patch.
[#:configure-flags]: Adjust according to upstream changes.
[inputs]: Add libavif, libjxl, openh264 and tde2e.

Change-Id: I570fdb6af0e8b605d3b270801bdd4cf81238e816
Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
5 files changed, 91 insertions(+), 216 deletions(-)

M gnu/local.mk
M gnu/packages/glib.scm
D gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch
M gnu/packages/patches/telegram-desktop-unbundle-cppgir.patch
M gnu/packages/telegram.scm
M gnu/local.mk => gnu/local.mk +0 -1
@@ 2344,7 2344,6 @@ dist_patch_DATA =						\
  %D%/packages/patches/tensorflow-c-api-fix.patch		\
  %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-hashmap-incomplete-value.patch	\
  %D%/packages/patches/telegram-desktop-qguiapp.patch		\
  %D%/packages/patches/telegram-desktop-unbundle-cppgir.patch   \

M gnu/packages/glib.scm => gnu/packages/glib.scm +3 -3
@@ 1620,8 1620,8 @@ namespaces, classes and other types that together form a C++ binding.")

;; telegram-desktop requires a more recent version of cppgir
(define-public cppgir-for-telegram-desktop
  (let ((commit "2e96cab8ed40df326815b87b1e4b449e0c1a5947")
        (revision "0"))
  (let ((commit "2a7d9cef68202a29d5e8a679ce9519c76eb26dc3")
        (revision "1"))
    (package
      (inherit cppgir)
      (name "cppgir-for-telegram-desktop")


@@ 1635,4 1635,4 @@ namespaces, classes and other types that together form a C++ binding.")
           (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0rdcgnriw8s5fqyx2v4218ii647l4fl1s9crnm9ihzf9bpl2p5p9")))))))
          (base32 "1zi4zfzk0cnyz3ahynr1ann1hdxkgfy6mxqpryvdywbx12fag92f")))))))

D gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch => gnu/packages/patches/telegram-desktop-allow-disable-libtgvoip.patch +0 -123
@@ 1,123 0,0 @@
From 322d2c452bf1a4df7b9fe161d4991a347043550c 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 008c71b15..291305909 100644
--- a/Telegram/CMakeLists.txt
+++ b/Telegram/CMakeLists.txt
@@ -26,7 +26,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)
@@ -49,9 +51,7 @@ set_target_properties(Telegram PROPERTIES AUTOMOC ON)
 
 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 5fe9ac677..bebf48e70 100644
--- a/Telegram/SourceFiles/calls/calls_call.cpp
+++ b/Telegram/SourceFiles/calls/calls_call.cpp
@@ -39,7 +39,9 @@ class InstanceImpl;
 class InstanceV2Impl;
 class InstanceV2ReferenceImpl;
+#ifndef TDESKTOP_DISABLE_LEGACY_TGVOIP
 class InstanceImplLegacy;
 void SetLegacyGlobalServerConfig(const std::string &serverConfig);
+#endif
 } // namespace tgcalls
 
 namespace Calls {
@@ -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>();
+#ifndef TDESKTOP_DISABLE_LEGACY_TGVOIP
 const auto RegisterLegacy = tgcalls::Register<tgcalls::InstanceImplLegacy>();
+#endif
 
 [[nodiscard]] base::flat_set<int64> CollectEndpointIds(
 		const QVector<MTPPhoneConnection> &list) {
@@ -1332,7 +1336,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 94cfdb856..9ac4fe479 100644
--- a/Telegram/cmake/lib_tgcalls.cmake
+++ b/Telegram/cmake/lib_tgcalls.cmake
@@ -268,6 +268,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 a5a6d9405..2eb9953f2 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.")
 
@@ -36,6 +38,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_AUTOUPDATE)
     target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_AUTOUPDATE)
 endif()
-- 
2.39.2


M gnu/packages/patches/telegram-desktop-unbundle-cppgir.patch => gnu/packages/patches/telegram-desktop-unbundle-cppgir.patch +46 -59
@@ 1,34 1,41 @@
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
Upstream-status: https://github.com/desktop-app/cmake_helpers/pull/305

From fa47432aeccb2cf657a79f8e1a3af1ef0663b4c6 Mon Sep 17 00:00:00 2001
From: dan <i@dan.games>
Date: Sun, 12 Oct 2025 18:45:40 +0800
Subject: [PATCH] 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(-)
 external/glib/CMakeLists.txt        |  7 ++++---
 external/glib/generate_cppgir.cmake | 16 +++++++++++-----
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/external/glib/CMakeLists.txt b/external/glib/CMakeLists.txt
index 3c6fe4be..c862705f 100644
index 9b80f23..1a2e9b7 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()
@@ -21,14 +21,15 @@ INTERFACE
     GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_56
 )
 
 include(generate_cppgir.cmake)
-block()
+include(generate_cppgir.cmake)
+
+if (NOT CppGir_FOUND)
+    add_cppgir()
     set(BUILD_TESTING OFF)
     set(BUILD_DOC OFF)
     set(BUILD_EXAMPLES OFF)
     add_subdirectory(cppgir EXCLUDE_FROM_ALL)
-endblock()
+endif()
 generate_cppgir(external_glib Gio-2.0)
 
 find_package(PkgConfig REQUIRED)
-include(generate_cppgir.cmake)
 
 if (DESKTOP_APP_GLIB2_gio-unix-2.0_VERSION VERSION_GREATER_EQUAL 2.86)
     generate_cppgir(external_glib GioUnix-2.0)
diff --git a/external/glib/generate_cppgir.cmake b/external/glib/generate_cppgir.cmake
index c15d3f9e..9b0a5ac8 100644
index c4475c6..012fd52 100644
--- a/external/glib/generate_cppgir.cmake
+++ b/external/glib/generate_cppgir.cmake
@@ -4,6 +4,8 @@


@@ 40,42 47,7 @@ index c15d3f9e..9b0a5ac8 100644
 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)
@@ -13,10 +15,14 @@ function(generate_cppgir target_name gir)
 
     set(gen_timestamp ${gen_dst}/${target_name}_cppgir.timestamp)
 


@@ 83,13 55,28 @@ index 9b0a5ac8..2ad82277 100644
-        ${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()
+        set(ignare_files) # rely on default ignore list
+    endif()
 
     add_custom_command(
     OUTPUT
@@ -28,7 +34,7 @@ function(generate_cppgir target_name gir)
         --class
         --class-full
         --expected
-        --ignore
+        "$<$<BOOL:${ignore_files}>:--ignore>"
         "$<JOIN:${ignore_files},:>"
         --output
         ${gen_dst}

base-commit: c7e0493dea2b870fb1b8e26604201fdb9e8c1ee5
-- 
2.49.0


M gnu/packages/telegram.scm => gnu/packages/telegram.scm +42 -30
@@ 5,7 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>
;;; Copyright © 2024, 2025 dan <i@dan.games>
;;; Copyright © 2025 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; Copyright © 2025 Zheng Junjie <z572@z572.online>
;;;


@@ 55,6 55,7 @@
  #:use-module (gnu packages llvm)
  #:use-module (gnu packages lxqt)
  #:use-module (gnu packages lua)
  #:use-module (gnu packages messaging)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages protobuf)


@@ 84,9 85,10 @@
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system meson)
  #:use-module (guix build-system python)
  #:use-module (guix build-system qt))
  #:use-module (guix build-system qt)
  #:use-module (guix utils))

(define %telegram-version "5.12.3")
(define %telegram-version "6.2.3")

(define libyuv-for-telegram-desktop
  (let ((commit "04821d1e7d60845525e8db55c7bcd41ef5be9406")


@@ 108,7 110,7 @@
    (method git-fetch)
    (uri (git-reference
          (url "https://github.com/desktop-app/cmake_helpers.git")
          (commit "90e6d73100a9fd2dc4c30a270c3bbc1d35924f32")))
          (commit "c7e0493dea2b870fb1b8e26604201fdb9e8c1ee5")))
    (file-name
     (git-file-name "cmake-helpers-for-telegram-desktop" %telegram-version))
    (patches


@@ 116,31 118,31 @@
     (search-patches "telegram-desktop-unbundle-cppgir.patch"))
    (sha256
     (base32
      "0mpz0adsyzsr5crxcjfr96x133yl4j55nm5f3gv5w1q1g1vk283r"))))
      "1lzh5jlxss0p5n28d29y86z7pzlvmcq1kg9ijyrvm059xx08n1ri"))))

(define codegen-for-telegram-desktop
  (origin
    (method git-fetch)
    (uri (git-reference
          (url "https://github.com/desktop-app/codegen.git")
          (commit "4155b9ae2d4c5a37b9738afa8ef9fa20d8fdcb44")))
          (commit "7576bcd417d51b5d99ed1401d099a924fcf99237")))
    (file-name
     (git-file-name "codegen-for-telegram-desktop" %telegram-version))
    (sha256
     (base32
      "1h45rsi4nrkr3j312ji8qlkbzsb948nszmnylwimh5v65n90p21a"))))
      "1wj39mj5ar3f4famjp53ggkcajww8j6hgl36c77vjn68vm4sfx03"))))

(define lib-base-for-telegram-desktop
  (origin
    (method git-fetch)
    (uri (git-reference
          (url "https://github.com/desktop-app/lib_base.git")
          (commit "b28088164b7a46c70ae2cfd9daf865f6425610b2")))
          (commit "42b01c4726b25bb09bf16ad4d1503a7875483519")))
    (file-name
     (git-file-name "lib-base-for-telegram-desktop" %telegram-version))
    (sha256
     (base32
      "1dwqdnasn3igr7i14hkx1glxj0gn6rd852bj0w3k1ai9j295wnfz"))))
      "0z9sl55f3kj7pzqq27d6wb5nazfffhvninriy1cy8qc2mghmym3b"))))

(define lib-crl-for-telegram-desktop
  (origin


@@ 159,12 161,12 @@
    (method git-fetch)
    (uri (git-reference
          (url "https://github.com/desktop-app/lib_lottie.git")
          (commit "3eb4a97f1dd038bc4b6bd2884262242382a37e79")))
          (commit "4fc3ac0ea52f271cc9b108481f83d56fd76ab0ed")))
    (file-name
     (git-file-name "lib-lottie-for-telegram-desktop" %telegram-version))
    (sha256
     (base32
      "04sgbspp0wngpr5w2wjfl1hwk1kiy8kwk2sz841f1yj231s7v6xw"))))
      "0q8k2i00kg1l4ivaarhyfaf1jpjv71pynjrg3cmgwama7g0n7zj4"))))

(define lib-qr-for-telegram-desktop
  (origin


@@ 195,12 197,12 @@
    (method git-fetch)
    (uri (git-reference
          (url "https://github.com/desktop-app/lib_spellcheck.git")
          (commit "8809cc72d07087ec61a1e8569de4da95aac45474")))
          (commit "81297706b32a6ec829a7dff5461ff458f82fb602")))
    (file-name
     (git-file-name "lib-spellcheck-for-telegram-desktop" %telegram-version))
    (sha256
     (base32
      "0zxk7vxr29f8scdi2ymvvz4zh9zkln8r57y1n65x0vfi8vdihn1a"))))
      "1jwyzgia1g8z5xq6chf2jb91zclx778z6pic579djx383mf8srd9"))))

(define lib-storage-for-telegram-desktop
  (origin


@@ 219,62 221,62 @@
    (method git-fetch)
    (uri (git-reference
          (url "https://github.com/desktop-app/lib_tl.git")
          (commit "237cbeb9d1c637759f89a508c1d854caf16e1984")))
          (commit "783052514ea6bd9ed0b7ddb4e5adb8c0077e5b9a")))
    (file-name
     (git-file-name "lib-tl-for-telegram-desktop" %telegram-version))
    (patches
     (search-patches "lib-tl-for-telegram-memcpy.patch"))
    (sha256
     (base32
      "1ji3gypy4yf9knsgylnyz5gc2kii7lls5ymj1rkf0daixdz931cm"))))
      "18vfjwv5h0j8a7lw1qcrsl16kbnnfjhgb7ay6ibi433kbddbdw5l"))))

(define lib-ui-for-telegram-desktop
  (origin
    (method git-fetch)
    (uri (git-reference
          (url "https://github.com/desktop-app/lib_ui.git")
          (commit "ba969667301ae4d8da2c2f6c4528bea63443f607")))
          (commit "3e254ffe1bc1fce081d56fbf8c2c9d7f1218bd3d")))
    (file-name
     (git-file-name "lib-ui-for-telegram-desktop" %telegram-version))
    (sha256
     (base32
      "17h6awwna9qn98a0zk85xhh8ibgh3g7665khpgd752pya4jg27jw"))))
      "0glixlmik6afbpyp80nc3nm79bjj2zbnk3dm1zx717bklh0x6f5p"))))

(define lib-webrtc-for-telegram-desktop
  (origin
    (method git-fetch)
    (uri (git-reference
          (url "https://github.com/desktop-app/lib_webrtc.git")
          (commit "169ba6b1d5e58e9d1cfa7b7d5c85c119e6c6e2db")))
          (commit "792c7a5b4846c489753deb5b87f67b3d11b399cf")))
    (file-name
     (git-file-name "lib-webrtc-for-telegram-desktop" %telegram-version))
    (sha256
     (base32
      "0xh24qdy82j9mricja4ahzrsw9bgiklqy2mc0r891cblmmm2d90j"))))
      "140jkpgnld5byjypld439qs9nblh31p147a7rm86r1cmhm5zhljv"))))

(define lib-webview-for-telegram-desktop
  (origin
    (method git-fetch)
    (uri (git-reference
          (url "https://github.com/desktop-app/lib_webview.git")
          (commit "f546969919a5946d49a504f8159041fa5b55c3df")))
          (commit "eae72ff70db2de76c344ca5ccd208c1841a67a0e")))
    (file-name
     (git-file-name "lib-webview-for-telegram-desktop" %telegram-version))
    (sha256
     (base32
      "178mf6lvgj4y5lscb68pc0yn3jcn66g04zszj74hpya18zjbmavw"))))
      "095zrnyb4ywj64dd29hf8173k9mn59zsvamjilz3ym2wms47cg4x"))))

(define tgcalls-for-telegram-desktop
  (origin
    (method git-fetch)
    (uri (git-reference
          (url "https://github.com/TelegramMessenger/tgcalls.git")
          (commit "9bf4065ea00cbed5e63cec348457ed13143459d0")))
          (commit "24694f64b03e301ec2c90792566046e61a2c4967")))
    (file-name
     (git-file-name "tgcalls-for-telegram-desktop" %telegram-version))
    (sha256
     (base32
      "1p563a11w8jrid96xf03dg6j39ciz28n5f4r6g28lxhiphbqzfym"))))
      "0b4q0wadx906i4b3xm1qqyd2mr9svmm6zgmvsg7fv5sz1l4c5hpn"))))

(define-public webrtc-for-telegram-desktop
  (let ((commit "8c233a4c12d6ec1f2aa87991564ac28cc996c57a")


@@ 436,6 438,17 @@ and not propagated to upstream.")
    (base32
     "0fg4x4ikj7f3706bmfvkwq4smxc98qr3cgpm25w48n4ys6wfgadg"))))

(define tde2e
  (let ((base tdlib))
    (package
      (inherit base)
      (name "tde2e")
      (arguments
       (substitute-keyword-arguments (package-arguments base)
         ((#:tests? _ #f) #f)
         ((#:configure-flags flags #~'())
          #~(list "-DTD_E2E_ONLY=ON")))))))

(define-public telegram-desktop
  (package
    (name "telegram-desktop")


@@ 451,11 464,9 @@ and not propagated to upstream.")
       (file-name
        (git-file-name name version))
       (sha256
        (base32 "16dfk36xfsizrxmxcid9kwj2dvxfp42382hqcan9rsrgjlqm6ymy"))
        (base32 "1p0mmivz48ab56qfc661l20p1gp1zk4rndaqv8zi7vzq3i5m6z8f"))
       (patches
        (search-patches
         ;; https://github.com/telegramdesktop/tdesktop/pull/24126
         "telegram-desktop-allow-disable-libtgvoip.patch"
         ;; Make it compatible with GCC 11.
         "telegram-desktop-qguiapp.patch"
         "telegram-desktop-hashmap-incomplete-value.patch"))


@@ 497,13 508,10 @@ and not propagated to upstream.")
              ;; also stored in <#$source/snap/snapcraft.yaml>.
              "-DTDESKTOP_API_ID=611335"
              "-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c"
              "-DTDESKTOP_DISABLE_LEGACY_TGVOIP=ON"
              "-DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON"
              "-DDESKTOP_APP_DISABLE_AUTOUPDATE=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")
              "-DDESKTOP_APP_DISABLE_QT_PLUGINS=ON")
           #:phases
           #~(modify-phases %standard-phases
               (add-after 'unpack 'unpack-additional-sources


@@ 577,15 585,18 @@ and not propagated to upstream.")
           hunspell
           kcoreaddons
           kimageformats
           libavif
           libdispatch
           libexpected
           libjpeg-turbo
           libjxl
           libvpx
           libxcb
           lz4
           minizip
           nimf
           openal
           openh264
           openssl
           opus
           plasma-wayland-protocols


@@ 599,6 610,7 @@ and not propagated to upstream.")
           range-v3
           rlottie-for-telegram-desktop
           rnnoise
           tde2e
           wayland
           wayland-protocols
           webkitgtk-for-gtk3