[PATCH v2 0/5] gnu: telegram-desktop: Update to 4.1.1.

DoneSubmitted by Hilton Chain.
Details
2 participants
  • Hilton Chain
  • Liliana Marie Prikler
Owner
unassigned
Severity
normal
H
H
Hilton Chain wrote on 8 Sep 14:38 +0200
(address . guix-patches@gnu.org)
y76fsh26nxq.wl-hako@ultrarare.space
Hello Guix!

These patches update Telegram Desktop to its latest release, changes are
detailed in commit messages.

One noticable point is that I leave libtgvoip's build within telegram-desktop's
environment, since I'm unable to build it with all features enabled neither via
autotools nor cmake.

Actually bundled building of that's Telegram's prefered way "since it's a
legacy library and its upstream build scripts aren't adapted to build with
tg_owt"[fn:1]

That's all, have a good day! =D


Hilton Chain (5):
gnu: Add abseil-cpp-for-webrtc-for-telegram-desktop.
gnu: webrtc-for-telegram-desktop: Update to a5fbc9.
gnu: Remove rlottie-for-telegram-desktop.
gnu: Remove libtgvoip-for-telegram-desktop.
gnu: telegram-desktop: Update to 4.1.1.

gnu/local.mk | 3 +
...se-for-telegram-desktop-support-musl.patch | 35 +
...telegram-desktop-add-missing-cstdint.patch | 21 +
...telegram-desktop-allow-disabling-X11.patch | 123 +++
gnu/packages/telegram.scm | 995 +++++++++---------
5 files changed, 702 insertions(+), 475 deletions(-)
create mode 100644 gnu/packages/patches/lib-base-for-telegram-desktop-support-musl.patch
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-add-missing-cstdint.patch
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-allow-disabling-X11.patch


base-commit: b45a44eaad890f31d9418dbb8cb14e3ee1d83c19
--
2.37.2
H
H
Hilton Chain wrote on 8 Sep 14:40 +0200
[PATCH v2 1/5] gnu: Add abseil-cpp-for-webrtc-for-telegram-desktop.
(address . 57675@debbugs.gnu.org)
y76edwm6ntz.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (abseil-cpp-for-webrtc-for-telegram-desktop):
New variable.
---
gnu/packages/telegram.scm | 13 +++++++++++++
1 file changed, 13 insertions(+)

Toggle diff (31 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 4976acbc0c..d41ace6181 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -62,6 +62,7 @@ (define-module (gnu packages telegram)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
+  #:use-module (guix utils)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system copy)
@@ -71,6 +72,18 @@ (define-module (gnu packages telegram)
   #:use-module (guix build-system python)
   #:use-module (guix build-system qt))

+(define-public abseil-cpp-for-webrtc-for-telegram-desktop
+  (let ((base abseil-cpp))
+    ;; Abseil built with pre C++17 standards enforcing would cause a linking
+    ;; issue when building Telegram Destop. (Currently it's by default 11, and
+    ;; has changed to 14 upstream.)
+    (hidden-package
+     (package/inherit base
+       (arguments
+        (substitute-keyword-arguments (package-arguments base)
+          ((#:configure-flags flags)
+           `(cons* "-DCMAKE_CXX_STANDARD=17" ,flags))))))))
+
 (define-public webrtc-for-telegram-desktop
   (let ((commit "91d836dc84a16584c6ac52b36c04c0de504d9c34")
         (revision "166"))
--
2.37.2
H
H
Hilton Chain wrote on 8 Sep 14:41 +0200
[PATCH v2 2/5] gnu: webrtc-for-telegram-desktop: Update to a5fbc9.
(address . 57675@debbugs.gnu.org)
y76czc66nsw.wl-hako@ultrarare.space
* gnu/packages/patches/webrtc-for-telegram-desktop-add-missing-cstdint.patch:
New file.
* gnu/packages/patches/webrtc-for-telegram-desktop-allow-disabling-X11.patch:
New file.
* gnu/local.mk: Add patches.
* gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to a5fbc9
and simplify inputs style.
[source]:
1. Bump version to a5fbc9123e056e611e69acf0ceb4252ddd838adb.
2. Patch: Add missing <cstdint.h> header.
3. Patch: Add configure flag TG_OWT_USE_X11 for disabling X11.
4. Bundled 3rd-party libraries: Remove openh264 and libvpx for building with
system libraries, Drop usrsctp which is no longer available in source.
[#:configure-flags]:
1. Available flags with default values are written and commented out.
[#:phases]:
1. Drop the use of libvpx source.
2. Add crc32c source (which is intended to be checked out recursively).
3. Build and install with cmake utility.
[inputs]:
1. Use abseil-cpp-for-webrtc-for-telegram-desktop for abseil-cpp.
2. Use variable external-sources to manage source chekouts.
3. Add crc32c checkout.
4. Catalog inputs required by certain configure flags.
5. Drop unneeded inputs.
[native-inputs]:
1. Add ninja for use with cmake.
2. Drop perl.
[propagated-inputs]:
1. Move libraries also required by telegram-desktop here from inputs.
[license]:
1. Sync with source tree changes.
---
gnu/local.mk | 2 +
...telegram-desktop-add-missing-cstdint.patch | 21 +++
...telegram-desktop-allow-disabling-X11.patch | 123 +++++++++++++
gnu/packages/telegram.scm | 172 ++++++++++--------
4 files changed, 243 insertions(+), 75 deletions(-)
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-add-missing-cstdint.patch
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-allow-disabling-X11.patch

Toggle diff (415 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 19102113c9..d0e5aeb125 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1966,6 +1966,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/warsow-qfusion-fix-bool-return-type.patch	\
   %D%/packages/patches/webkitgtk-adjust-bubblewrap-paths.patch	\
   %D%/packages/patches/webrtc-audio-processing-big-endian.patch	\
+  %D%/packages/patches/webrtc-for-telegram-desktop-add-missing-cstdint.patch \
+  %D%/packages/patches/webrtc-for-telegram-desktop-allow-disabling-X11.patch \
   %D%/packages/patches/websocketpp-fix-for-cmake-3.15.patch	\
   %D%/packages/patches/widelands-add-missing-map-include.patch	\
   %D%/packages/patches/widelands-system-wide_minizip.patch	\
diff --git a/gnu/packages/patches/webrtc-for-telegram-desktop-add-missing-cstdint.patch b/gnu/packages/patches/webrtc-for-telegram-desktop-add-missing-cstdint.patch
new file mode 100644
index 0000000000..9dee9cf8e3
--- /dev/null
+++ b/gnu/packages/patches/webrtc-for-telegram-desktop-add-missing-cstdint.patch
@@ -0,0 +1,21 @@
+From 86d2bcd7afb8706663d29e30f65863de5a626142 Mon Sep 17 00:00:00 2001
+From: Xiretza <xiretza@xiretza.xyz>
+Date: Sun, 15 May 2022 12:47:41 +0200
+Subject: [PATCH] fix(h265_pps_parser): fix missing cstdint include
+
+---
+ src/common_video/h265/h265_pps_parser.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/common_video/h265/h265_pps_parser.h b/src/common_video/h265/h265_pps_parser.h
+index 28c95ea9..c180b1b9 100644
+--- a/src/common_video/h265/h265_pps_parser.h
++++ b/src/common_video/h265/h265_pps_parser.h
+@@ -12,6 +12,7 @@
+ #define COMMON_VIDEO_H265_PPS_PARSER_H_
+
+ #include "absl/types/optional.h"
++#include <cstdint>
+
+ namespace rtc {
+ class BitBuffer;
diff --git a/gnu/packages/patches/webrtc-for-telegram-desktop-allow-disabling-X11.patch b/gnu/packages/patches/webrtc-for-telegram-desktop-allow-disabling-X11.patch
new file mode 100644
index 0000000000..977f72475f
--- /dev/null
+++ b/gnu/packages/patches/webrtc-for-telegram-desktop-allow-disabling-X11.patch
@@ -0,0 +1,123 @@
+Add -DTG_OWT_USE_X11
+
+Allows disabling X11 desktop capturing independently of pipewire support, for
+the few people that run wayland without any X11 support whatsoever.
+
+This setup is untested, but supported by the GNI build system, see:
+* src/modules/desktop_capture/BUILD.gn (option rtc_use_x11_extensions)
+
+Toggling the WEBRTC_USE_X11 define also affects some files under
+src/modules/audio_device, but that falls under "X11 support", regardless...
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2e081ae7..c269177b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -24,13 +24,14 @@ endif()
+
+ option(BUILD_SHARED_LIBS "Builds shared libraries instead of static." OFF)
+ option(TG_OWT_USE_PROTOBUF "Use protobuf to generate additional headers. Useful for packaged build." ${BUILD_SHARED_LIBS})
++cmake_dependent_option(TG_OWT_USE_X11 "Use X11 for desktop capture on non-Apple Unix."  ON "UNIX; NOT APPLE" OFF)
+ cmake_dependent_option(TG_OWT_USE_PIPEWIRE "Use pipewire for desktop capture." ON "UNIX; NOT APPLE" OFF)
+ cmake_dependent_option(TG_OWT_DLOPEN_PIPEWIRE "dlopen pipewire for desktop capture." ${not_packaged_build} TG_OWT_USE_PIPEWIRE OFF)
+ option(TG_OWT_BUILD_AUDIO_BACKENDS "Build webrtc audio backends." OFF)
+
+ if (BUILD_SHARED_LIBS)
+     set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+-    message(WARNING
++    message(DEBUG
+         "tg_owt is a fork of Google's webrtc library and is developed by them as a static library without stable ABI in mind."
+         "The feature of building tg_owt as a shared library is community maintained, it may and will break at any time without guarantee to work again."
+         "Please reconsider your decision. Good luck."
+@@ -96,6 +97,10 @@ endif()
+ add_library(tg_owt)
+ init_target(tg_owt)
+
++if (TG_OWT_USE_X11)
++    link_x11(tg_owt)
++endif()
++
+ if (TG_OWT_USE_PIPEWIRE)
+     if (TG_OWT_DLOPEN_PIPEWIRE)
+         include(cmake/generate_stubs.cmake)
+@@ -188,10 +193,6 @@ endif()
+ include(cmake/libwebrtcbuild.cmake)
+ target_link_libraries(tg_owt PUBLIC tg_owt::libwebrtcbuild)
+
+-if (UNIX AND NOT APPLE)
+-    link_x11(tg_owt)
+-endif()
+-
+ function(add_sublibrary postfix)
+     add_library(tg_owt_${postfix} OBJECT)
+     init_feature_target(tg_owt_${postfix} ${postfix})
+@@ -2369,6 +2370,39 @@ if (NOT TG_OWT_USE_PROTOBUF)
+     )
+ endif()
+
++if (NOT TG_OWT_USE_X11)
++    remove_target_sources(tg_owt ${webrtc_loc}
++        # src/modules/desktop_capture/BUILD.gn (rtc_use_x11_extensions)
++        modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.cc
++        modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.h
++        modules/desktop_capture/linux/x11/screen_capturer_x11.cc
++        modules/desktop_capture/linux/x11/screen_capturer_x11.h
++        modules/desktop_capture/linux/x11/shared_x_display.cc
++        modules/desktop_capture/linux/x11/shared_x_display.h
++        modules/desktop_capture/linux/x11/window_capturer_x11.cc
++        modules/desktop_capture/linux/x11/window_capturer_x11.h
++        modules/desktop_capture/linux/x11/window_finder_x11.cc
++        modules/desktop_capture/linux/x11/window_finder_x11.h
++        modules/desktop_capture/linux/x11/window_list_utils.cc
++        modules/desktop_capture/linux/x11/window_list_utils.h
++        modules/desktop_capture/linux/x11/x_atom_cache.cc
++        modules/desktop_capture/linux/x11/x_atom_cache.h
++        modules/desktop_capture/linux/x11/x_error_trap.cc
++        modules/desktop_capture/linux/x11/x_error_trap.h
++        modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc
++        modules/desktop_capture/linux/x11/x_server_pixel_buffer.h
++        modules/desktop_capture/linux/x11/x_window_property.cc
++        modules/desktop_capture/linux/x11/x_window_property.h
++
++        # screen_drawer_linux.cc depends on x11, rest are revdeps
++        modules/desktop_capture/screen_drawer.cc
++        modules/desktop_capture/screen_drawer.h
++        modules/desktop_capture/screen_drawer_linux.cc
++        modules/desktop_capture/screen_drawer_lock_posix.cc
++        modules/desktop_capture/screen_drawer_lock_posix.h
++    )
++endif()
++
+ if (NOT TG_OWT_USE_PIPEWIRE)
+     remove_target_sources(tg_owt ${webrtc_loc}
+         modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc
+diff --git a/cmake/libwebrtcbuild.cmake b/cmake/libwebrtcbuild.cmake
+index 4d037f4b..388b7aa9 100644
+--- a/cmake/libwebrtcbuild.cmake
++++ b/cmake/libwebrtcbuild.cmake
+@@ -29,6 +29,13 @@ INTERFACE
+     BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0
+ )
+
++if (TG_OWT_USE_X11)
++    target_compile_definitions(libwebrtcbuild
++    INTERFACE
++        WEBRTC_USE_X11
++    )
++endif()
++
+ if (TG_OWT_USE_PIPEWIRE)
+     target_compile_definitions(libwebrtcbuild
+     INTERFACE
+@@ -65,11 +72,6 @@ else()
+         INTERFACE
+             WEBRTC_MAC
+         )
+-    else()
+-        target_compile_definitions(libwebrtcbuild
+-        INTERFACE
+-            WEBRTC_USE_X11
+-        )
+     endif()
+
+     if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index d41ace6181..d66a286167 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -30,6 +30,7 @@ (define-module (gnu packages telegram)
   #:use-module (gnu packages digest)
   #:use-module (gnu packages fcitx)
   #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gnupg)
@@ -43,6 +44,7 @@ (define-module (gnu packages telegram)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lxqt)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages ninja)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
@@ -58,11 +60,13 @@ (define-module (gnu packages telegram)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages web)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix utils)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system copy)
@@ -84,9 +88,12 @@ (define-public abseil-cpp-for-webrtc-for-telegram-desktop
           ((#:configure-flags flags)
            `(cons* "-DCMAKE_CXX_STANDARD=17" ,flags))))))))

+;; NOTE: Here's Telegram Desktop's official build guide.
+;; https://github.com/telegramdesktop/tdesktop/wiki/The-Packaged-Building-Mode
 (define-public webrtc-for-telegram-desktop
-  (let ((commit "91d836dc84a16584c6ac52b36c04c0de504d9c34")
-        (revision "166"))
+  (let ((abseil-cpp abseil-cpp-for-webrtc-for-telegram-desktop)
+        (commit "a5fbc9123e056e611e69acf0ceb4252ddd838adb")
+        (revision "167"))
     (hidden-package
      (package
        (name "webrtc-for-telegram-desktop")
@@ -97,94 +104,111 @@ (define-public webrtc-for-telegram-desktop
           (method git-fetch)
           (uri
            (git-reference
-            (url "https://github.com/desktop-app/tg_owt.git")
+            (url "https://github.com/desktop-app/tg_owt")
             (commit commit)))
           (file-name
            (git-file-name name version))
           (sha256
-           (base32 "0plwdp6xgxi27hif5j7kpq425cidxyxbbga3z2f64dsninwy5p1x"))
+           (base32 "12qirihhabv46vn27dpw7dz0smlngb7wqjpypa9fm6k2zvf5py32"))
           (modules '((guix build utils)
                      (ice-9 ftw)
                      (srfi srfi-1)))
+          (patches
+           (search-patches
+            ;; https://github.com/desktop-app/tg_owt/pull/101
+            "webrtc-for-telegram-desktop-add-missing-cstdint.patch"
+            ;; Picked from Gentoo's repository, there's also a patch to use
+            ;; standalone crc32c(not packaged yet).
+            "webrtc-for-telegram-desktop-allow-disabling-X11.patch"))
           (snippet
            `(begin
               (let ((keep
-                     '( ;; Custom forks which are incompatible with the ones in Guix.
-                       "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                     '(;; Custom forks which are incompatible with the ones in Guix.
+                       "abseil-cpp" "libsrtp" "rnnoise"
                        ;; Not available in Guix.
-                       "pffft" "usrsctp"
-                       ;; Has cmake support files for libvpx input.
-                       "libvpx")))
+                       "pffft")))
                 (with-directory-excursion "src/third_party"
                   (for-each delete-file-recursively
                             (lset-difference string=?
                                              (scandir ".")
-                                             (cons* "." ".." keep))))
-                #t)))))
+                                             (cons* "." ".." keep)))))
+              ;; Force using standalone openh264.
+              (substitute* "CMakeLists.txt"
+                (("\\include\\(cmake\\/libopenh264\\.cmake\\)")""))))))
        (build-system cmake-build-system)
        (arguments
-        `(#:tests? #f                   ; No target
-          #:configure-flags
-          (list
-           "-DCMAKE_C_FLAGS=-fPIC"
-           "-DCMAKE_CXX_FLAGS=-fPIC")
-          #:phases
-          (modify-phases %standard-phases
-            (add-after 'unpack 'copy-inputs
-              (lambda* (#:key inputs outputs #:allow-other-keys)
-                (let* ((libvpx-from (assoc-ref inputs "libvpx"))
-                       (libyuv-from (assoc-ref inputs "libyuv"))
-                       (libvpx-to (string-append (getcwd)
-                                                 "/src/third_party/libvpx/source/libvpx"))
-                       (libyuv-to (string-append (getcwd)
-                                                 "/src/third_party/libyuv")))
-                  (copy-recursively libvpx-from libvpx-to)
-                  (copy-recursively libyuv-from libyuv-to))
-                #t)))))
-       (native-inputs
-        `(("perl" ,perl)
-          ("pkg-config" ,pkg-config)
-          ("python" ,python-wrapper)
-          ("yasm" ,yasm)))
+        (list #:tests? #f       ; No target
+              ;; NOTE: Options commented are default values.
+              ;; See also: comments in inputs.
+              ;; #:configure-flags
+              ;; #~'("-DTG_OWT_USE_PIPEWIRE=ON"
+              ;;     "-DTG_OWT_USE_X11=ON"
+              ;;     "-DTG_OWT_USE_PROTOBUF=ON")
+              #:phases
+              #~(modify-phases %standard-phases
+                  (add-after 'unpack 'copy-inputs
+                    (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (let* ((libyuv-from (assoc-ref inputs "libyuv"))
+                             (crc32c-from (assoc-ref inputs "crc32c"))
+                             (libyuv-to (string-append (getcwd)
+                                                       "/src/third_party/libyuv"))
+                             (crc32c-to (string-append (getcwd)
+                                                       "/src/third_party/crc32c/src")))
+                        (copy-recursively libyuv-from libyuv-to)
+                        (copy-recursively crc32c-from crc32c-to))))
+                  (replace 'build
+                    (lambda* (#:key (make-flags '()) (parallel-build? #t)
+                              #:allow-other-keys)
+                      (apply invoke "cmake" "--build" "."
+                             `(,@(if parallel-build?
+                                     `("-j" ,(number->string (parallel-job-count)))
+                                     '())
+                               ,@make-flags))))
+                  (replace 'install
+                    (lambda* (#:key (make-flags '()) #:allow-other-keys)
+                      (apply invoke "cmake" "--install" "." make-flags))))))
        (inputs
-        `(("alsa" ,alsa-lib)
-          ("ffmpeg" ,ffmpeg)
-          ("libjpeg" ,libjpeg-turbo)
-          ("glib" ,glib)
-          ("libvpx"
-           ,(origin
-              (method git-fetch)
-              (uri
-               (git-reference
-                (url "https://chromium.googlesource.com/webm/libvpx")
-                (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
-              (file-name
-               (git-file-name "libvpx-for-webrtc-for-telegram-desktop" version))
-              (sha256
-               (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
-          ("libyuv"
-           ,(origin
-              (method git-fetch)
-              (uri
-               (git-reference
-                (url "https://chromium.googlesource.com/libyuv/libyuv")
-                (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
-              (file-name
-               (git-file-name "libyuv-for-webrtc-for-telegram-desktop" version))
-              (sha256
-               (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
-          ("libxcomposite" ,libxcomposite)
-          ("libxdamage" ,libxdamage)
-          ("libxrender" ,libxrender)
-          ("libxrandr" ,libxrandr)
-          ("openssl" ,openssl)
-          ("opus" ,opus)
-          ("pipewire" ,pipewire)
-          ("protobuf" ,protobuf)
-          ("pulseaudio" ,pulseaudio)
-          ("x11" ,libx11)
-          ("xext" ,libxext)
-          ("xtst" ,libxtst)))
+        (let ((external-sources
+               `(("libyuv"
+                  ,(origin
+                     (method git-fetch)
+                     (uri (git-reference
+                           (url "https://chromium.googlesource.com/libyuv/libyuv")
+                           (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+                     (file-name
+                      (git-file-name "libyuv-for-webrtc-for-telegram-desktop" version))
+                     (sha256
+                      (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
+                 ("crc32c"
+                  ,(origin
+                     (method git-fetch)
+                     (uri (git-reference
+                           (url "https://github.com/google/crc32c")
+                           (commit "21fc8ef30415a635e7351ffa0e5d5367943d4a94")))
+                     (file-name
+                      (git-file-name "crc32c-for-webrtc-for-telegram-desktop" version))
+                     (sha256
+                      (base32 "0cddf8z7v33gfb2k60lkzwa97g20m1v81cnvllm3q9ylpnx8g6f4")))))))
+          (modify-inputs external-sources
+            (prepend openh264           ;Required
+                     protobuf           ;TG_OWT_USE_PROTOBUF
+
+                     glib               ;TG_OWT_USE_PIPEWIRE
+                     libdrm
+                     libglvnd
+                     mesa
+                     pipewire-0.3
+
+                     libxcomposite      ;TG_OWT_USE_X11
+                     libxdamage
+                     libxext
+                     libxfixes
+                     libxrandr
+                     libxrender
+                     libxtst))))
+       (native-inputs (list ninja python-wrapper pkg-config yasm))
+       (propagated-inputs
+        (list abseil-cpp ffmpeg libjpeg-turbo libvpx openssl opus))
        (synopsis "WebRTC support for Telegram Desktop")
        (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by
 Telegram project, for its use in telegram desktop client.")
@@ -195,13 +219,11 @@ (define-public webrtc-for-telegram-desktop
          license:asl2.0
          ;; LibYuv
          (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
-         ;; OpenH264
-         license:bsd-2
          ;; PFFFT
          (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
          ;; RnNoise
          license:gpl3
-         ;; LibSRTP, LibVPx, UsrSCTP and Others
+         ;; LibSRTP, Crc32c and Others
          license:bsd-3))))))

 (define-public rlottie-for-telegram-desktop
--
2.37.2
H
H
Hilton Chain wrote on 8 Sep 14:42 +0200
[PATCH v2 3/5] gnu: Remove rlottie-for-telegram-desktop.
(address . 57675@debbugs.gnu.org)
y76bkrq6ns7.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (rlottie-for-telegram-desktop): Delete variable.
---
gnu/packages/telegram.scm | 34 ----------------------------------
1 file changed, 34 deletions(-)

Toggle diff (45 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index d66a286167..c6db1e61ac 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -226,40 +226,6 @@ (define-public webrtc-for-telegram-desktop
          ;; LibSRTP, Crc32c and Others
          license:bsd-3))))))

-(define-public rlottie-for-telegram-desktop
-  (let ((commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")
-        (revision "671"))
-    (hidden-package
-     (package
-       (inherit rlottie)
-       (version
-        (git-version "0.0.1" revision commit))
-       (source
-        (origin
-          (method git-fetch)
-          (uri
-           (git-reference
-            (url "https://github.com/desktop-app/rlottie.git")
-            (commit commit)))
-          (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)))))))))
-
 (define-public libtgvoip-for-telegram-desktop
   (let ((commit "13a5fcb16b04472d808ce122abd695dbf5d206cd")
         (revision "88"))
--
2.37.2
H
H
Hilton Chain wrote on 8 Sep 14:42 +0200
[PATCH v2 4/5] gnu: Remove libtgvoip-for-telegram-desktop.
(address . 57675@debbugs.gnu.org)
y76a67a6nrc.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (libtgvoip-for-telegram-desktop): Delete variable.
---
gnu/packages/telegram.scm | 41 ---------------------------------------
1 file changed, 41 deletions(-)

Toggle diff (52 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index c6db1e61ac..78ec2558c7 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -226,47 +226,6 @@ (define-public webrtc-for-telegram-desktop
          ;; LibSRTP, Crc32c and Others
          license:bsd-3))))))

-(define-public libtgvoip-for-telegram-desktop
-  (let ((commit "13a5fcb16b04472d808ce122abd695dbf5d206cd")
-        (revision "88"))
-    (hidden-package
-     (package
-       (inherit libtgvoip)
-       (version
-        (git-version "2.4.4" revision commit))
-       (source
-        (origin
-          (method git-fetch)
-          (uri
-           (git-reference
-            (url "https://github.com/telegramdesktop/libtgvoip.git")
-            (commit commit)))
-          (file-name
-           (git-file-name "libtgvoip-for-telegram-desktop" version))
-          (sha256
-           (base32 "12p6s7vxkf1gh1spdckkdxrx7bjzw881ds9bky7l5fw751cwb3xd"))))
-       (arguments
-        `(#:configure-flags
-          (list
-           "--disable-static"
-           "--disable-dsp"              ; FIXME
-           "--enable-audio-callback"
-           "--with-alsa"
-           "--with-pulse")
-          #:phases
-          (modify-phases %standard-phases
-            (add-after 'unpack 'patch-linkers
-              (lambda _
-                (substitute* "Makefile.am"
-                  (("\\$\\(CRYPTO_LIBS\\) \\$\\(OPUS_LIBS\\)")
-                   "$(CRYPTO_LIBS) $(OPUS_LIBS) $(ALSA_LIBS) $(PULSE_LIBS)"))
-                (substitute* "tgvoip.pc.in"
-                  (("libcrypto opus")
-                   "libcrypto opus alsa libpulse"))
-                #t)))))
-       (native-inputs
-        (list autoconf automake libtool pkg-config))))))
-
 (define-public telegram-desktop
   (package
     (name "telegram-desktop")
--
2.37.2
H
H
Hilton Chain wrote on 8 Sep 14:42 +0200
[PATCH v2 5/5] gnu: telegram-desktop: Update to 4.1.1.
(address . 57675@debbugs.gnu.org)
y768rmu6nqr.wl-hako@ultrarare.space
* gnu/packages/patches/lib-base-for-telegram-desktop-support-musl.patch: New
file.
* gnu/local.mk: Add patch.
* gnu/packages/telegram.scm (telegram-desktop): Update to 4.1.1 and simplify
inputs style.
[source]:
1. Patch: Add support for musl.
2. Bundled 3rd-party libraries: Add rlottie, libtgvoip and dispatch. Remove
SPMediaKeyTap and statusnotifieritem which are no longer available in source.
[#:configure-flags]:
1. Available flags with default values are written and commented out.
2. Use Telegram's API id for their Snap builds.
3. Build a generic package with DESKTOP_APP_USE_PACKAGED_LAZY on.
[#:phases]:
1. Copy checkouts for dispatch, fcitx-qt5, fcitx5-qt, hime, nimf, rlottie and
libtgvoip into source.
2. Build and install with cmake utility.
3. Don't patch C++ flags as they are not there any more.
[native-inputs]
1. Use variable external-sources to manage source chekouts.
2. Bump cmake-helpers checkout.
3. Add ninja for use with cmake.
4. Add clang-toolchain as it's suggested by Telegram, cmake would used it
automatically.
5. Drop cmake-shared, extra-cmake-modules, glib:bin, gobject-introspection,
gtk+:bin and qttools-5.
[inputs]
1. Use variable external-sources to manage source chekouts.
2. Add checkouts for dispatch, fcitx-qt5, fcitx5-qt, hime, nimf, rlottie and
libtgvoip.
3. Bump checkouts for codegen, lib_base, lib_crl, lib_lottie, lib_qr, lib_rpl,
lib_spellcheck,lib_storage, lib_tl, lib_ui, lib_waylandshells, lib_webrtc,
lib_webview and tgcalls.
4. Patch lib_base for musl support.
5. Drop unneeded inputs.
[license]
1. Sync with source tree changes.
---
gnu/local.mk | 1 +
...se-for-telegram-desktop-support-musl.patch | 35 +
gnu/packages/telegram.scm | 735 ++++++++++--------
3 files changed, 446 insertions(+), 325 deletions(-)
create mode 100644 gnu/packages/patches/lib-base-for-telegram-desktop-support-musl.patch

Toggle diff (836 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index d0e5aeb125..aa2fa69ddd 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1354,6 +1354,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/julia-tracker-16-compat.patch		\
   %D%/packages/patches/julia-allow-parallel-build.patch		\
   %D%/packages/patches/kdbusaddons-kinit-file-name.patch	\
+  %D%/packages/patches/lib-base-for-telegram-desktop-support-musl.patch	\
   %D%/packages/patches/libffi-3.3-powerpc-fixes.patch		\
   %D%/packages/patches/libffi-float128-powerpc64le.patch	\
   %D%/packages/patches/libobjc2-unbundle-robin-map.patch	\
diff --git a/gnu/packages/patches/lib-base-for-telegram-desktop-support-musl.patch b/gnu/packages/patches/lib-base-for-telegram-desktop-support-musl.patch
new file mode 100644
index 0000000000..1a3a70286f
--- /dev/null
+++ b/gnu/packages/patches/lib-base-for-telegram-desktop-support-musl.patch
@@ -0,0 +1,35 @@
+Stub out some glibc-specific functions
+
+This allows support for alternative libcs like musl
+
+diff --git a/base/platform/linux/base_info_linux.cpp b/base/platform/linux/base_info_linux.cpp
+index 714d8dc..b70cc23 100644
+--- a/base/platform/linux/base_info_linux.cpp
++++ b/base/platform/linux/base_info_linux.cpp
+@@ -22,7 +22,7 @@
+
+ #include <sys/utsname.h>
+
+-#ifdef Q_OS_LINUX
++#if defined(Q_OS_LINUX) && defined(__GLIBC__)
+ #include <gnu/libc-version.h>
+ #endif // Q_OS_LINUX
+
+@@ -200,7 +200,7 @@ QString AutoUpdateKey() {
+ }
+
+ QString GetLibcName() {
+-#ifdef Q_OS_LINUX
++#if defined(Q_OS_LINUX) && defined(__GLIBC__)
+ 	return "glibc";
+ #endif // Q_OS_LINUX
+
+@@ -208,7 +208,7 @@ QString GetLibcName() {
+ }
+
+ QString GetLibcVersion() {
+-#ifdef Q_OS_LINUX
++#if defined(Q_OS_LINUX) && defined(__GLIBC__)
+ 	static const auto result = [&] {
+ 		const auto version = QString::fromLatin1(gnu_get_libc_version());
+ 		return QVersionNumber::fromString(version).isNull() ? QString() : version;
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 78ec2558c7..24f9b9bbfc 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.
 ;;;
@@ -28,8 +29,10 @@ (define-module (gnu packages telegram)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages digest)
+  #:use-module (gnu packages enchant)
   #:use-module (gnu packages fcitx)
   #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
@@ -42,6 +45,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 ninja)
@@ -60,6 +64,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)
@@ -229,339 +234,419 @@ (define-public webrtc-for-telegram-desktop
 (define-public telegram-desktop
   (package
     (name "telegram-desktop")
-    (version "2.9.3")
-    (source
-     (origin
-       (method git-fetch)
-       (uri
-        (git-reference
-         (url "https://github.com/telegramdesktop/tdesktop.git")
-         (commit
-          (string-append "v" version))))
-       (file-name
-        (git-file-name name version))
-       (sha256
-        (base32 "0dzf1y3xhqvizg29bd1kya48cjbkq073d2x10ynwcmmx396l4nd8"))
-       (modules '((guix build utils)
-                  (ice-9 ftw)
-                  (srfi srfi-1)))
-       (snippet
-        `(begin
-           (let ((keep
-                  '( ;; Not available in Guix.
-                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
-             (with-directory-excursion "Telegram/ThirdParty"
-               (for-each delete-file-recursively
-                         (lset-difference string=?
-                                          (scandir ".")
-                                          (cons* "." ".." keep))))
-             #t)))))
+    (version "4.1.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/telegramdesktop/tdesktop")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0zhwaql1fk0nqr1x2lchcswz61x7sb2297qdxiysgqamr0fk9ppn"))
+              (modules '((guix build utils)
+                         (ice-9 ftw)
+                         (srfi srfi-1)))
+              (snippet #~(begin
+                           (let ((keep
+                                  '(;; Custom fork
+                                    "rlottie" "libtgvoip"
+                                    ;; Not available in Guix.
+                                    "dispatch" "tgcalls")))
+                             (with-directory-excursion "Telegram/ThirdParty"
+                               (for-each delete-file-recursively
+                                         (lset-difference string=?
+                                                          (scandir ".")
+                                                          (cons* "." ".." keep)))))))))
     (build-system qt-build-system)
     (arguments
-     `(#:tests? #f                      ; No target
-       #:imported-modules
-       (,@%qt-build-system-modules
-        (guix build glib-or-gtk-build-system))
-       #:modules
-       ((guix build qt-build-system)
-        ((guix build glib-or-gtk-build-system)
-         #:prefix glib-or-gtk:)
-        (guix build utils)
-        (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>.
-        ;; In case, that the credentials below fail to work, contact
-        ;;   Raghav Gururajan <rg@raghavgururajan.name>
-        "-DTDESKTOP_API_ID=2791056"
-        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
-        ;; Disable WebkitGTK support as it fails to link
-        "-DDESKTOP_APP_DISABLE_WEBKITGTK=ON"
-        ;; Use bundled fonts as fallback.
-        "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'make-writable
-           (lambda _
-             (for-each make-file-writable (find-files "."))
-             #t))
-         (add-after 'make-writable 'copy-inputs
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (for-each
-              (match-lambda
-                ((dst src)
-                 (copy-recursively src dst)
-                 (for-each make-file-writable (find-files dst))))
-              `(("cmake" ,(assoc-ref inputs "cmake-helpers"))
-                ("Telegram/codegen" ,(assoc-ref inputs "codegen-source"))
-                ("Telegram/lib_base" ,(assoc-ref inputs "lib-base-source"))
-                ("Telegram/lib_crl" ,(assoc-ref inputs "lib-crl-source"))
-                ("Telegram/lib_lottie"
-                 ,(assoc-ref inputs "lib-lottie-source"))
-                ("Telegram/lib_qr" ,(assoc-ref inputs "lib-qr-source"))
-                ("Telegram/lib_rlottie"
-                 ,(assoc-ref inputs "lib-rlottie-source"))
-                ("Telegram/lib_rpl" ,(assoc-ref inputs "lib-rpl-source"))
-                ("Telegram/lib_spellcheck"
-                 ,(assoc-ref inputs "lib-spellcheck-source"))
-                ("Telegram/lib_storage"
-                 ,(assoc-ref inputs "lib-storage-source"))
-                ("Telegram/lib_tl" ,(assoc-ref inputs "lib-tl-source"))
-                ("Telegram/lib_ui" ,(assoc-ref inputs "lib-ui-source"))
-                ("Telegram/lib_waylandshells" ,(assoc-ref inputs "lib-waylandshells-source"))
-                ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source"))
-                ("Telegram/lib_webview" ,(assoc-ref inputs "lib-webview-source"))
-                ("Telegram/ThirdParty/tgcalls"
-                 ,(assoc-ref inputs "tgcalls-source"))))
-             #t))
-         (add-before 'configure 'patch-cxx-flags
-           (lambda _
-             (substitute* "cmake/options_linux.cmake"
-               (("class-memaccess") "all"))
-             #t))
-         (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)))))
+     (list #:tests? #f                  ;No target
+           #:imported-modules
+           `(,@%qt-build-system-modules
+             (guix build glib-or-gtk-build-system))
+           #:modules
+           '((guix build qt-build-system)
+             ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
+             (guix build utils)
+             (ice-9 match))
+           #:configure-flags
+           #~`(;; https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml
+               ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+               "-DTDESKTOP_API_ID=611335"
+               "-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c"
+               ,(string-append "-DTDESKTOP_LAUTCHER_BASENAME=" #$name)
+
+               ;; NOTE: Options commented are default values.
+               ;; See also: comments in inputs.
+
+               ;; "-DDESKTOP_APP_USE_PACKAGED=ON"
+               ;; "-DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=OFF"
+               ;; "-DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=OFF"
+               ;; "-DDESKTOP_APP_DISABLE_X11_INTEGRATION=OFF"
+               ;; "-DDESKTOP_APP_DISABLE_SPELLCHECK=OFF"
+               ;; "-DDESKTOP_APP_USE_ENCHANT=OFF"
+               ;; "-DDESKTOP_APP_LOTTIE_USE_CACHE=ON"
+
+               ;; "-DLIBTGVOIP_DISABLE_ALSA=OFF"
+               ;; "-DLIBTGVOIP_DISABLE_PULSEAUDIO=OFF"
+
+               ;; Build all the available detected features in the build
+               ;; environment.
+               "-DDESKTOP_APP_USE_PACKAGED_LAZY=ON")
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'make-writable
+                 (lambda _
+                   (for-each make-file-writable (find-files "."))))
+               (add-after 'make-writable 'copy-inputs
+                 (lambda* (#:key inputs outputs #:allow-other-keys)
+                   (for-each
+                    (match-lambda
+                      ((dst src)
+                       (copy-recursively src dst)
+                       (for-each make-file-writable (find-files dst))))
+                    `(("cmake" ,(assoc-ref inputs "cmake-helpers"))
+                      ("Telegram/codegen" ,(assoc-ref inputs "codegen-source"))
+                      ("Telegram/lib_base" ,(assoc-ref inputs "lib-base-source"))
+                      ("Telegram/lib_crl" ,(assoc-ref inputs "lib-crl-source"))
+                      ("Telegram/lib_lottie" ,(assoc-ref inputs "lib-lottie-source"))
+                      ("Telegram/lib_qr" ,(assoc-ref inputs "lib-qr-source"))
+                      ("Telegram/lib_rpl" ,(assoc-ref inputs "lib-rpl-source"))
+                      ("Telegram/lib_spellcheck" ,(assoc-ref inputs "lib-spellcheck-source"))
+                      ("Telegram/lib_storage" ,(assoc-ref inputs "lib-storage-source"))
+                      ("Telegram/lib_tl" ,(assoc-ref inputs "lib-tl-source"))
+                      ("Telegram/lib_ui" ,(assoc-ref inputs "lib-ui-source"))
+                      ("Telegram/lib_waylandshells" ,(assoc-ref inputs "lib-waylandshells-source"))
+                      ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source"))
+                      ("Telegram/lib_webview" ,(assoc-ref inputs "lib-webview-source"))
+                      ("Telegram/ThirdParty/dispatch" ,(assoc-ref inputs "dispatch-source"))
+                      ("Telegram/ThirdParty/fcitx-qt5" ,(assoc-ref inputs "fcitx-qt5-source"))
+                      ("Telegram/ThirdParty/fcitx5-qt" ,(assoc-ref inputs "fcitx5-qt-source"))
+                      ("Telegram/ThirdParty/hime" ,(assoc-ref inputs "hime-source"))
+                      ("Telegram/ThirdParty/nimf" ,(assoc-ref inputs "nimf-source"))
+                      ("Telegram/ThirdParty/rlottie" ,(assoc-ref inputs "rlottie-source"))
+                      ("Telegram/ThirdParty/tgcalls" ,(assoc-ref inputs "tgcalls-source"))
+                      ("Telegram/ThirdParty/libtgvoip" ,(assoc-ref inputs "libtgvoip-source"))))))
+               (replace 'build
+                 (lambda* (#:key (make-flags '())
+                           (parallel-build? #t) #:allow-other-keys)
+                   (apply invoke "cmake" "--build" "."
+                          `(,@(if parallel-build?
+                                  `("-j" ,(number->string (parallel-job-count)))
+                                  '())
+                             ,@make-flags))))
+               (replace 'install
+                 (lambda* (#:key (make-flags '()) #:allow-other-keys)
+                   (apply invoke "cmake" "--install" "." make-flags)))
+               (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
-     `(("cmake-helpers"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/cmake_helpers.git")
-             (commit "4d44d822e01b3b5fbec3ce824e01f56aa35d7f72")))
-           (file-name
-            (git-file-name "cmake-helpers-for-telegram-desktop" version))
-           (sha256
-            (base32 "0h6cjiqy014h2mz90h1z5a7plb3ihbnds4bja8994ybr1dy3m7m5"))))
-       ("cmake-shared" ,cmake-shared)
-       ("extra-cmake-modules" ,extra-cmake-modules)
-       ("glib:bin" ,glib "bin")
-       ("gobject-introspection" ,gobject-introspection)
-       ("gtk+:bin" ,gtk+ "bin")
-       ("pkg-config" ,pkg-config)
-       ("python" ,python-wrapper)
-       ("qttools-5" ,qttools-5)))
+     (let ((external-sources
+            `(("cmake-helpers"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/cmake_helpers")
+                        (commit "0702ef4cdd8ab888fdadaa4f5b2eb0c9d5844b69")))
+                  (file-name
+                   (git-file-name "cmake-helpers-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "16lsm3pb8md4ksr2ps3bnkvr0jygdamkxyirxgz214n6wa281zk1")))))))
+       (modify-inputs external-sources
+         (append clang-toolchain ninja pkg-config python-wrapper))))
     (inputs
-     `(("alsa" ,alsa-lib)
-       ("c++-gsl" ,c++-gsl)
-       ("catch" ,catch-framework2)
-       ("codegen-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/codegen.git")
-             (commit "248614b49cd7d5aff69d75a737f2e35b79fbb119")))
-           (file-name
-            (git-file-name "codegen" version))
-           (sha256
-            (base32 "00f7g2z6xmkbkrmi3q27hscjl44mg66wf9q0mz3rhy3jaa6cfdrk"))))
-       ("expected" ,libexpected)
-       ("fcitx-qt5" ,fcitx-qt5)
-       ("fcitx5-qt" ,fcitx5-qt)
-       ("ffmpeg" ,ffmpeg)
-       ("glib" ,glib)
-       ("glibmm" ,glibmm-2.64)
-       ("gtk+" ,gtk+)
-       ("hime" ,hime)
-       ("hunspell" ,hunspell)
-       ("jemalloc" ,jemalloc)
-       ("kwayland" ,kwayland)
-       ("lib-base-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_base.git")
-             (commit "a23c05c44e4f01dc4428f4d75d4db98c59d313a6")))
-           (file-name
-            (git-file-name "lib-base-for-telegram-desktop" version))
-           (sha256
-            (base32 "0vh5zgxwalmbnvz8lzlnba87ch8vnpmcz6nvf56w09f3nlxvvq78"))))
-       ("lib-crl-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_crl.git")
-             (commit "3ccf2ed5095442e5874bba8852cb7dc4efeae29f")))
-           (file-name
-            (git-file-name "lib-crl-for-telegram-desktop" version))
-           (sha256
-            (base32 "11my7q54m4lvvlgma6pbdyjxi1cv1adk1gph2j50mh18sqlm8myz"))))
-       ("lib-lottie-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_lottie.git")
-             (commit "0770df009db7928df1d0cad0900dc5110106d229")))
-           (file-name
-            (git-file-name "lib-lottie-for-telegram-desktop" version))
-           (sha256
-            (base32 "1gj56ymlbk5dnk82jw674808m511lv9dky8891a5wm4gp3pph5jb"))))
-       ("lib-qr-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_qr.git")
-             (commit "2b08c71c6edcfc3e31f7d7f518cc963493b6e189")))
-           (file-name
-            (git-file-name "lib-qr-for-telegram-desktop" version))
-           (sha256
-            (base32 "05hrkmwgrczyjv87r507i2r7m1zr6k2i43mq3my0s6j4szr1rjq0"))))
-       ("lib-rlottie-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_rlottie.git")
-             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
-           (file-name
-            (git-file-name "lib-rlottie-for-telegram-desktop" version))
-           (sha256
-            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
-       ("lib-rpl-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_rpl.git")
-             (commit "df721be3fa14a27dfc230d2e3c42bb1a7c9d0617")))
-           (file-name
-            (git-file-name "lib-rpl-for-telegram-desktop" version))
-           (sha256
-            (base32 "15fnv3ssn7rn5d0j52gggdvyqc2wm464678dj7v2x9h8lka2jjxn"))))
-       ("lib-spellcheck-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_spellcheck.git")
-             (commit "68c9b788958904aea7de79f986a0f82ec8c5b094")))
-           (file-name
-            (git-file-name "lib-spellcheck-for-telegram-desktop" version))
-           (sha256
-            (base32 "0d8s4wwk6fxf536mhzq2vb9qw3j0m8nqia7ylvvpsbc4kh09dadn"))))
-       ("lib-storage-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_storage.git")
-             (commit "403df6c4a29562bd417c92d410e49819f5a48cc1")))
-           (file-name
-            (git-file-name "lib-storage-for-telegram-desktop" version))
-           (sha256
-            (base32 "1zxvzfrxbj4d395fzyb5pm9wn3n8jyimxx88cyqjcdd46sx4h7r5"))))
-       ("lib-tl-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_tl.git")
-             (commit "45faed44e7f4d11fec79b7a70e4a35dc91ef3fdb")))
-           (file-name
-            (git-file-name "lib-tl-for-telegram-desktop" version))
-           (sha256
-            (base32 "0h43xvzklda02494d466jp52hl8c1kmav9f12dyld10dpf1w6c7m"))))
-       ("lib-ui-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_ui.git")
-             (commit "1b590f9e16eb9571a039f072d6fea66c607e419f")))
-           (file-name
-            (git-file-name "lib-ui-for-telegram-desktop" version))
-           (sha256
-            (base32 "0ighyhfp29h9h8c7vr70pnhcv2xnsr9ln084pssn8hb5z4pmb62f"))))
-       ("lib-waylandshells-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_waylandshells.git")
-             (commit "59b0ee55a68976d27f1bf7cec0e11d5939e185e7")))
-           (file-name
-            (git-file-name "lib-waylandshells-for-telegram-desktop" version))
-           (sha256
-            (base32 "0l2xrpc5mvvdlsj333pmkgfvn9wi1ijfdaaz8skfnw9icw52faaf"))))
-       ("lib-webrtc-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_webrtc.git")
-             (commit "ef49f953f12b112008a094a719f40939aaf39db4")))
-           (file-name
-            (git-file-name "lib-webrtc-for-telegram-desktop" version))
-           (sha256
-            (base32 "15k4xs3462p3ddp5cn9im3nvdiaijmxir8wxsf5yrj70ghy26ibw"))))
-       ("lib-webview-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_webview.git")
-             (commit "e06427c624515485774e2e2181d4afeb05ad5a67")))
-           (file-name
-            (git-file-name "lib-webview-for-telegram-desktop" version))
-           (sha256
-            (base32 "148z7xzfscynwwwqssdsd97npax6yn8zrd64xw8qzbwff2g2r7k4"))))
-       ("libdbusmenu-qt" ,libdbusmenu-qt)
-       ("libjpeg" ,libjpeg-turbo)
-       ("libtgvoip" ,libtgvoip-for-telegram-desktop)
-       ("lz4" ,lz4)
-       ("materialdecoration" ,materialdecoration)
-       ("minizip" ,minizip)
-       ("nimf" ,nimf)
-       ("openal" ,openal)
-       ("openssl" ,openssl)
-       ("opus" ,opus)
-       ("pulseaudio" ,pulseaudio)
-       ("qrcodegen" ,qrcodegen-cpp)
-       ("qt" ,qtbase-5)
-       ("qtsvg-5" ,qtsvg-5)
-       ("qt5ct" ,qt5ct)
-       ("qtimageformats" ,qtimageformats)
-       ("qtwayland" ,qtwayland)
-       ("range-v3" ,range-v3)
-       ("rlottie" ,rlottie-for-telegram-desktop)
-       ("rnnoise" ,rnnoise)
-       ("tgcalls-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/TelegramMessenger/tgcalls.git")
-             (commit "81e97fa52e25b7775b62ce07bb653533d81e91b3")))
-           (file-name
-            (git-file-name "tgcalls-for-telegram-desktop" version))
-           (sha256
-            (base32 "0fvad87hyxli83xn19mgf8jjrrh6y6iaig14pckpbkg33vf4wqkj"))))
-       ("webrtc" ,webrtc-for-telegram-desktop)
-       ("x11" ,libx11)
-       ("xcb" ,libxcb)
-       ("xcb-keysyms" ,xcb-util-keysyms)
-       ("xxhash" ,xxhash)
-       ("zlib" ,zlib)))
-    (propagated-inputs
-     (list dconf))
+     (let ((external-sources
+            `(("codegen-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/codegen")
+                        (commit "8815d7aec9b901191d08445f29e2edd0aeba7b2c")))
+                  (file-name
+                   (git-file-name "codegen" version))
+                  (sha256
+                   (base32 "1ly958mjk25kfcpa174kvg134p9r751ixi275afj5kr57by9mbq2"))))
+              ("lib-base-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/lib_base")
+                        (commit "37fab6b4da32c91bc5d049baad2e9ad51cfcd195")))
+                  (file-name
+                   (git-file-name "lib-base-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "1b2zc0ag5w46vwjz2240yj9aniyv09yjyrwif32994drfq6l10k5"))
+                  (patches
+                   (search-patches "lib-base-for-telegram-desktop-support-musl.patch"))))
+              ("lib-crl-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/lib_crl")
+                        (commit "4e620bc383d032aadea8e6af02661f8c76695cec")))
+                  (file-name
+                   (git-file-name "lib-crl-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "17bngj247qwq0dg4h37xdi5v1mk22y4yp7sp6ph3irmnz4awah0x"))))
+              ("lib-lottie-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/lib_lottie")
+                        (commit "f3563bc6b0e042095d4d667d013f62cb8ae62b65")))
+                  (file-name
+                   (git-file-name "lib-lottie-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "0i0w6lcrmqln7axnlazcqkaj4z0lzn0gl3z59hng40ard76cgvsg"))))
+              ("lib-qr-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/lib_qr")
+                        (commit "501f4c3502fd872ab4d777df8911bdac32de7c48")))
+                  (file-name
+                   (git-file-name "lib-qr-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "0hmwqj7a9vcy8wq7pd1qprl68im3zl5f1wzcn2zzk2wvi0389k9f"))))
+              ("lib-rpl-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/lib_rpl")
+                        (commit "fd31f5bf382d2679eccdb1abaf8240a56c6a7abe")))
+                  (file-name
+                   (git-file-name "lib-rpl-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "1fpq8nyh8wx6zkb3sjjrx9ydqzyhw4483bdk1i9blp0ijn9xxdxf"))))
+              ("lib-spellcheck-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/lib_spellcheck")
+                        (commit "b2f2b7b6bce60bc1c6429a6b5ec4bc5891baa060")))
+                  (file-name
+                   (git-file-name "lib-spellcheck-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "1v8xdbwza457wmjkfmpys46g5g1aw7yabjab6knxd4p4vhyjhbwh"))))
+              ("lib-storage-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/lib_storage")
+                        (commit "839609369d04615475cb1518636de3619106a917")))
+                  (file-name
+                   (git-file-name "lib-storage-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "1l26h2fmqp9dcpr6pfvdd5sjb68j7yh0ms2lnr8na7jf5xqmkwwm"))))
+              ("lib-tl-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/lib_tl")
+                        (commit "0d234b5aabf43d598e0cb0867566ee570d9e2755")))
+                  (file-name
+                   (git-file-name "lib-tl-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "1wc8d94h4ga36yl9g8h67j914xwpwv7rmkrrvvslgbgxb7sxcd96"))))
+              ("lib-ui-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/lib_ui")
+                        (commit "2f5d5e0e79bf52ab04047bc93a4b624d6d33d46a")))
+                  (file-name
+                   (git-file-name "lib-ui-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "09kmc1igh37wafngwk6raqx2wrlxg10lf9p72j84sxs05hbybfcn"))))
+              ("lib-waylandshells-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/lib_waylandshells")
+                        (commit "271290b93c65b6fb634cb9c69bff97f51b74f3a7")))
+                  (file-name
+                   (git-file-name "lib-waylandshells-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "02d966kbpqf029wwma17vicmc8n5iaksibaq6d81jmh770p2vsc9"))))
+              ("lib-webrtc-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/lib_webrtc")
+                        (commit "9b11599c3c56047cfa4c68b69f1fcc93b602c33a")))
+                  (file-name
+                   (git-file-name "lib-webrtc-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "0158jx8hj4fv6qpw5pgcr2mdlihj0dxs060dg3iy61zz6q68z5dq"))))
+              ("lib-webview-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/lib_webview")
+                        (commit "546df65eb2424550ed84ce14fc9c5d1bb3586f35")))
+                  (file-name
+                   (git-file-name "lib-webview-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "0zzjwyw82bggncmmsw969lnjl04pklmqjqm77jjzadinivl52z0l"))))
+              ("tgcalls-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/TelegramMessenger/tgcalls")
+                        (commit "82c4921045c440b727c38e464f3a0539708423ff")))
+                  (file-name
+                   (git-file-name "tgcalls-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "1109r17abh66yz91b65fn2g4ryfybnsr5g6075sjhbah1gccv9mk"))))
+              ("libtgvoip-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/telegramdesktop/libtgvoip")
+                        (commit "78a8e22bedb0d06004da8bafeba88b7474cb89a4")))
+                  (file-name
+                   (git-file-name "libtgvoip-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "1y1jvm4i0i4fkl6c0bgcv2cpzziyyn1pywxqz726q008hwki941h"))))
+              ("dispatch-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/apple/swift-corelibs-libdispatch")
+                        (commit "ecc678d79f38cf63d24b6d16e18f69a9117d8d73")))
+                  (file-name
+                   (git-file-name "dispatch-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "0hy4q6x3bgphazmpl3v62995abc9fpi8y7yg9aiblzsqkxmgjmqn"))))
+              ("fcitx-qt5-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/fcitx/fcitx-qt5")
+                        (commit "c2feea444ab79e6a8d6d205d4c7b13ab1db353c9")))
+                  (file-name
+                   (git-file-name "fcitx-qt5-for-telegram-desktop" version))
+                  (sha256
+                   (base32
+                    "1y10n2l0rbzpvsryw0mikyv9hic8wxd8gwr0ax37niwjbkil2zv8"))))
+              ("fcitx5-qt-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/fcitx/fcitx5-qt")
+                        (commit "fd06094f48e8281b6dc3fd4aaadfcd216c426a5a")))
+                  (file-name
+                   (git-file-name "fcitx5-qt-for-telegram-desktop" version))
+                  (sha256
+                   (base32
+                    "15mhcv3m39fi375ccd05hr8va4js9lkj0vllypnq90v43fcvawr1"))))
+              ("hime-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/hime-ime/hime")
+                        (commit "9b3e6f9ab59d1fe4d9de73d3bf0fed7789f921c5")))
+                  (file-name
+                   (git-file-name "hime-for-telegram-desktop" version))
+                  (sha256
+                   (base32
+                    "1b98ql30ihbqz1zwlm0c3c1qmxp3gdz96wsic3h6ypqcr3xyj28f"))))
+              ("nimf-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/hamonikr/nimf")
+                        (commit "181f9467fc1883c228fc272330ab2f000bfae163")))
+                  (file-name
+                   (git-file-name "nimf-for-telegram-desktop" version))
+                  (sha256
+                   (base32
+                    "0kk430bx3w9n8c1d42ng5gicx44gi9bsjd60n2927wdpm6jxm2yl"))))
+              ("rlottie-source"
+               ,(origin
+                  (method git-fetch)
+                  (uri (git-reference
+                        (url "https://github.com/desktop-app/rlottie")
+                        (commit "8c69fc20cf2e150db304311f1233a4b55a8892d7")))
+                  (file-name
+                   (git-file-name "rlottie-for-telegram-desktop" version))
+                  (sha256
+                   (base32 "14gwg3sn6xdx9ymnx5r0vfm4pk8dwk92s10a1wdvfbjpyrxll64i")))))))
+       (modify-inputs external-sources
+         (append c++-gsl                ;Required
+                 jemalloc
+                 libexpected
+                 minizip
+                 openal
+                 qrcodegen-cpp
+                 qt5compat
+                 qtbase
+                 qtimageformats
+                 qtsvg-5
+                 range-v3
+                 rnnoise
+                 webrtc-for-telegram-desktop
+                 xxhash
+                 zlib
+                 ;; Has options
+                 fcitx-qt5            ;DESKTOP_APP_USE_PACKAGED_LAZY
+                 fcitx5-qt
+                 hime
+                 nimf
+                 glibmm-2.64          ;DESKTOP_APP_DISABLE_DBUS_INTEGRATION
+                 enchant              ;DESKTOP_APP_USE_ENCHANT
+                 hunspell             ;DESKTOP_APP_DISABLE_SPELLCHECK
+                 lz4                  ;DESKTOP_APP_LOTTIE_USE_CACHE
+                 alsa-lib             ;LIBTGVOIP_DISABLE_ALSA
+                 pulseaudio           ;LIBTGVOIP_DISABLE_PULSEAUDIO
+                 qtwayland            ;DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION
+                 wayland
+                 libxcb               ;DESKTOP_APP_DISABLE_X11_INTEGRATION
+                 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+
-      ;; Others
-      license:gpl3+))))
+    (license (list
+              ;; Telegram/ThirdParty/dispatch
+              license:asl2.0
+
+              ;; Telegram/ThirdParty/fcitx-qt5 (platform input context plugin)
+              ;; Telegram/ThirdParty/fcitx5-qt (Fcitx5Qt4DBusAddons library
+              ;; and input context plugin, Fcitx5Qt5DBusAddons library and Qt5
+              ;; platform input context plugin)
+              license:bsd-3
+
+              ;; Telegram/ThirdParty/rlottie/src/vector/pixman
+              ;; Telegram/ThirdParty/rlottie/src/vector/stb
+              ;; Telegram/ThirdParty/rlottie/src/vector/rapidjson
+              license:expat
+
+              ;; Telegram/ThirdParty/rlottie/src/vector/freetype
+              license:freetype
+
+              ;; Telegram/ThirdParty/hime (files not mentioned below)
+              license:lgpl2.1
+
+              ;; Telegram/ThirdParty/fcitx5-qt (files not mentioned above)
+              ;; Telegram/ThirdParty/rlottie
+              ;; Telegram/ThirdParty/rlottie/src/vector
+              license:lgpl2.1+
+
+              ;; Telegram/ThirdParty/nimf
+              ;; Telegram/ThirdParty/tgcalls
+              license:lgpl3
+
+              ;; Telegram/ThirdParty/fcitx-qt5 (files not mentioned above)
+              ;; Telegram/ThirdParty/hime (Qt immodules)
+              license:gpl2
+
+              ;; Others
+              license:gpl3+))))

 (define-public tl-parser
   (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06")
--
2.37.2
H
H
Hilton Chain wrote on 11 Sep 12:10 +0200
[PATCH v3 0/7] gnu: telegram-desktop: Update to 4.1.1.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76illu8bmr.wl-hako@ultrarare.space
v2 -> v3: Clone recursively instead of define every single git submodule...

I said "tomorrow", what a long day XDDDDDDDD.

Hilton Chain (7):
gnu: webrtc-for-telegram-desktop: Simplify inputs.
gnu: telegram-desktop: Simplify inputs.
gnu: Add abseil-cpp-cxxstd17.
gnu: webrtc-for-telegram-desktop: Update to a5fbc9.
gnu: telegram-desktop: Update to 4.1.1.
gnu: Remove rlottie-for-telegram-desktop.
gnu: Remove libtgvoip-for-telegram-desktop.

gnu/local.mk | 3 +
.../telegram-desktop-fix-gcc12-cstdint.patch | 10 +
...telegram-desktop-allow-disabling-X11.patch | 138 ++++
...r-telegram-desktop-fix-gcc12-cstdint.patch | 21 +
gnu/packages/telegram.scm | 632 +++++-------------
5 files changed, 347 insertions(+), 457 deletions(-)
create mode 100644 gnu/packages/patches/telegram-desktop-fix-gcc12-cstdint.patch
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-allow-disabling-X11.patch
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch


base-commit: 072cc8d1415a2abf66b36249c61658a828dead88
--
2.37.3
H
H
Hilton Chain wrote on 11 Sep 12:11 +0200
[PATCH v3 1/7] gnu: webrtc-for-telegram-desktop: Simplify inputs.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76h71e8bln.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Simplify inputs.
---
gnu/packages/telegram.scm | 84 +++++++++++----------------------------
1 file changed, 23 insertions(+), 61 deletions(-)

Toggle diff (119 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 4976acbc0c..9bef94788b 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -85,11 +85,12 @@ (define-public webrtc-for-telegram-desktop
           (uri
            (git-reference
             (url "https://github.com/desktop-app/tg_owt.git")
-            (commit commit)))
+            (commit commit)
+            (recursive? #t)))
           (file-name
            (git-file-name name version))
           (sha256
-           (base32 "0plwdp6xgxi27hif5j7kpq425cidxyxbbga3z2f64dsninwy5p1x"))
+           (base32 "1ir4svv5mijpzr0rmx65088iikck83vhcdqrpf9dnk6yp4j9v4v2"))
           (modules '((guix build utils)
                      (ice-9 ftw)
                      (srfi srfi-1)))
@@ -99,79 +100,40 @@ (define-public webrtc-for-telegram-desktop
                      '( ;; Custom forks which are incompatible with the ones in Guix.
                        "abseil-cpp" "libsrtp" "openh264" "rnnoise"
                        ;; Not available in Guix.
-                       "pffft" "usrsctp"
+                       "pffft" "usrsctp" "libyuv"
                        ;; Has cmake support files for libvpx input.
                        "libvpx")))
                 (with-directory-excursion "src/third_party"
                   (for-each delete-file-recursively
                             (lset-difference string=?
                                              (scandir ".")
-                                             (cons* "." ".." keep))))
-                #t)))))
+                                             (cons* "." ".." keep)))))))))
        (build-system cmake-build-system)
        (arguments
         `(#:tests? #f                   ; No target
           #:configure-flags
           (list
            "-DCMAKE_C_FLAGS=-fPIC"
-           "-DCMAKE_CXX_FLAGS=-fPIC")
-          #:phases
-          (modify-phases %standard-phases
-            (add-after 'unpack 'copy-inputs
-              (lambda* (#:key inputs outputs #:allow-other-keys)
-                (let* ((libvpx-from (assoc-ref inputs "libvpx"))
-                       (libyuv-from (assoc-ref inputs "libyuv"))
-                       (libvpx-to (string-append (getcwd)
-                                                 "/src/third_party/libvpx/source/libvpx"))
-                       (libyuv-to (string-append (getcwd)
-                                                 "/src/third_party/libyuv")))
-                  (copy-recursively libvpx-from libvpx-to)
-                  (copy-recursively libyuv-from libyuv-to))
-                #t)))))
+           "-DCMAKE_CXX_FLAGS=-fPIC")))
        (native-inputs
-        `(("perl" ,perl)
-          ("pkg-config" ,pkg-config)
-          ("python" ,python-wrapper)
-          ("yasm" ,yasm)))
+        (list perl pkg-config python-wrapper yasm))
        (inputs
-        `(("alsa" ,alsa-lib)
-          ("ffmpeg" ,ffmpeg)
-          ("libjpeg" ,libjpeg-turbo)
-          ("glib" ,glib)
-          ("libvpx"
-           ,(origin
-              (method git-fetch)
-              (uri
-               (git-reference
-                (url "https://chromium.googlesource.com/webm/libvpx")
-                (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
-              (file-name
-               (git-file-name "libvpx-for-webrtc-for-telegram-desktop" version))
-              (sha256
-               (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
-          ("libyuv"
-           ,(origin
-              (method git-fetch)
-              (uri
-               (git-reference
-                (url "https://chromium.googlesource.com/libyuv/libyuv")
-                (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
-              (file-name
-               (git-file-name "libyuv-for-webrtc-for-telegram-desktop" version))
-              (sha256
-               (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
-          ("libxcomposite" ,libxcomposite)
-          ("libxdamage" ,libxdamage)
-          ("libxrender" ,libxrender)
-          ("libxrandr" ,libxrandr)
-          ("openssl" ,openssl)
-          ("opus" ,opus)
-          ("pipewire" ,pipewire)
-          ("protobuf" ,protobuf)
-          ("pulseaudio" ,pulseaudio)
-          ("x11" ,libx11)
-          ("xext" ,libxext)
-          ("xtst" ,libxtst)))
+        (list alsa-lib
+              ffmpeg
+              libjpeg-turbo
+              glib
+              libxcomposite
+              libxdamage
+              libxrender
+              libxrandr
+              openssl
+              opus
+              pipewire
+              protobuf
+              pulseaudio
+              libx11
+              libxext
+              libxtst))
        (synopsis "WebRTC support for Telegram Desktop")
        (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by
 Telegram project, for its use in telegram desktop client.")
--
2.37.3
H
H
Hilton Chain wrote on 11 Sep 12:11 +0200
[PATCH v3 2/7] gnu: telegram-desktop: Simplify inputs.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76fsgy8bl1.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (telegram-desktop): Simplify inputs.
---
gnu/packages/telegram.scm | 315 +++++++-------------------------------
1 file changed, 53 insertions(+), 262 deletions(-)

Toggle diff (352 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 9bef94788b..6e7fa4a2ec 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -238,12 +238,12 @@ (define-public telegram-desktop
        (uri
         (git-reference
          (url "https://github.com/telegramdesktop/tdesktop.git")
-         (commit
-          (string-append "v" version))))
+         (commit (string-append "v" version))
+         (recursive? #t)))
        (file-name
         (git-file-name name version))
        (sha256
-        (base32 "0dzf1y3xhqvizg29bd1kya48cjbkq073d2x10ynwcmmx396l4nd8"))
+        (base32 "07mw09gmxy2pcga856wbsqmbgl2l5a3ix0hr5p6hlvk7pq260s36"))
        (modules '((guix build utils)
                   (ice-9 ftw)
                   (srfi srfi-1)))
@@ -256,8 +256,7 @@ (define-public telegram-desktop
                (for-each delete-file-recursively
                          (lset-difference string=?
                                           (scandir ".")
-                                          (cons* "." ".." keep))))
-             #t)))))
+                                          (cons* "." ".." keep)))))))))
     (build-system qt-build-system)
     (arguments
      `(#:tests? #f                      ; No target
@@ -286,272 +285,64 @@ (define-public telegram-desktop
        (modify-phases %standard-phases
          (add-after 'unpack 'make-writable
            (lambda _
-             (for-each make-file-writable (find-files "."))
-             #t))
-         (add-after 'make-writable 'copy-inputs
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (for-each
-              (match-lambda
-                ((dst src)
-                 (copy-recursively src dst)
-                 (for-each make-file-writable (find-files dst))))
-              `(("cmake" ,(assoc-ref inputs "cmake-helpers"))
-                ("Telegram/codegen" ,(assoc-ref inputs "codegen-source"))
-                ("Telegram/lib_base" ,(assoc-ref inputs "lib-base-source"))
-                ("Telegram/lib_crl" ,(assoc-ref inputs "lib-crl-source"))
-                ("Telegram/lib_lottie"
-                 ,(assoc-ref inputs "lib-lottie-source"))
-                ("Telegram/lib_qr" ,(assoc-ref inputs "lib-qr-source"))
-                ("Telegram/lib_rlottie"
-                 ,(assoc-ref inputs "lib-rlottie-source"))
-                ("Telegram/lib_rpl" ,(assoc-ref inputs "lib-rpl-source"))
-                ("Telegram/lib_spellcheck"
-                 ,(assoc-ref inputs "lib-spellcheck-source"))
-                ("Telegram/lib_storage"
-                 ,(assoc-ref inputs "lib-storage-source"))
-                ("Telegram/lib_tl" ,(assoc-ref inputs "lib-tl-source"))
-                ("Telegram/lib_ui" ,(assoc-ref inputs "lib-ui-source"))
-                ("Telegram/lib_waylandshells" ,(assoc-ref inputs "lib-waylandshells-source"))
-                ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source"))
-                ("Telegram/lib_webview" ,(assoc-ref inputs "lib-webview-source"))
-                ("Telegram/ThirdParty/tgcalls"
-                 ,(assoc-ref inputs "tgcalls-source"))))
-             #t))
+             (for-each make-file-writable (find-files "."))))
          (add-before 'configure 'patch-cxx-flags
            (lambda _
              (substitute* "cmake/options_linux.cmake"
-               (("class-memaccess") "all"))
-             #t))
+               (("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
-     `(("cmake-helpers"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/cmake_helpers.git")
-             (commit "4d44d822e01b3b5fbec3ce824e01f56aa35d7f72")))
-           (file-name
-            (git-file-name "cmake-helpers-for-telegram-desktop" version))
-           (sha256
-            (base32 "0h6cjiqy014h2mz90h1z5a7plb3ihbnds4bja8994ybr1dy3m7m5"))))
-       ("cmake-shared" ,cmake-shared)
-       ("extra-cmake-modules" ,extra-cmake-modules)
-       ("glib:bin" ,glib "bin")
-       ("gobject-introspection" ,gobject-introspection)
-       ("gtk+:bin" ,gtk+ "bin")
-       ("pkg-config" ,pkg-config)
-       ("python" ,python-wrapper)
-       ("qttools-5" ,qttools-5)))
+     (list cmake-shared
+           extra-cmake-modules
+           `(,glib "bin")
+           `(,gtk+ "bin")
+           pkg-config
+           python-wrapper
+           qttools-5))
     (inputs
-     `(("alsa" ,alsa-lib)
-       ("c++-gsl" ,c++-gsl)
-       ("catch" ,catch-framework2)
-       ("codegen-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/codegen.git")
-             (commit "248614b49cd7d5aff69d75a737f2e35b79fbb119")))
-           (file-name
-            (git-file-name "codegen" version))
-           (sha256
-            (base32 "00f7g2z6xmkbkrmi3q27hscjl44mg66wf9q0mz3rhy3jaa6cfdrk"))))
-       ("expected" ,libexpected)
-       ("fcitx-qt5" ,fcitx-qt5)
-       ("fcitx5-qt" ,fcitx5-qt)
-       ("ffmpeg" ,ffmpeg)
-       ("glib" ,glib)
-       ("glibmm" ,glibmm-2.64)
-       ("gtk+" ,gtk+)
-       ("hime" ,hime)
-       ("hunspell" ,hunspell)
-       ("jemalloc" ,jemalloc)
-       ("kwayland" ,kwayland)
-       ("lib-base-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_base.git")
-             (commit "a23c05c44e4f01dc4428f4d75d4db98c59d313a6")))
-           (file-name
-            (git-file-name "lib-base-for-telegram-desktop" version))
-           (sha256
-            (base32 "0vh5zgxwalmbnvz8lzlnba87ch8vnpmcz6nvf56w09f3nlxvvq78"))))
-       ("lib-crl-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_crl.git")
-             (commit "3ccf2ed5095442e5874bba8852cb7dc4efeae29f")))
-           (file-name
-            (git-file-name "lib-crl-for-telegram-desktop" version))
-           (sha256
-            (base32 "11my7q54m4lvvlgma6pbdyjxi1cv1adk1gph2j50mh18sqlm8myz"))))
-       ("lib-lottie-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_lottie.git")
-             (commit "0770df009db7928df1d0cad0900dc5110106d229")))
-           (file-name
-            (git-file-name "lib-lottie-for-telegram-desktop" version))
-           (sha256
-            (base32 "1gj56ymlbk5dnk82jw674808m511lv9dky8891a5wm4gp3pph5jb"))))
-       ("lib-qr-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_qr.git")
-             (commit "2b08c71c6edcfc3e31f7d7f518cc963493b6e189")))
-           (file-name
-            (git-file-name "lib-qr-for-telegram-desktop" version))
-           (sha256
-            (base32 "05hrkmwgrczyjv87r507i2r7m1zr6k2i43mq3my0s6j4szr1rjq0"))))
-       ("lib-rlottie-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_rlottie.git")
-             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
-           (file-name
-            (git-file-name "lib-rlottie-for-telegram-desktop" version))
-           (sha256
-            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
-       ("lib-rpl-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_rpl.git")
-             (commit "df721be3fa14a27dfc230d2e3c42bb1a7c9d0617")))
-           (file-name
-            (git-file-name "lib-rpl-for-telegram-desktop" version))
-           (sha256
-            (base32 "15fnv3ssn7rn5d0j52gggdvyqc2wm464678dj7v2x9h8lka2jjxn"))))
-       ("lib-spellcheck-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_spellcheck.git")
-             (commit "68c9b788958904aea7de79f986a0f82ec8c5b094")))
-           (file-name
-            (git-file-name "lib-spellcheck-for-telegram-desktop" version))
-           (sha256
-            (base32 "0d8s4wwk6fxf536mhzq2vb9qw3j0m8nqia7ylvvpsbc4kh09dadn"))))
-       ("lib-storage-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_storage.git")
-             (commit "403df6c4a29562bd417c92d410e49819f5a48cc1")))
-           (file-name
-            (git-file-name "lib-storage-for-telegram-desktop" version))
-           (sha256
-            (base32 "1zxvzfrxbj4d395fzyb5pm9wn3n8jyimxx88cyqjcdd46sx4h7r5"))))
-       ("lib-tl-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_tl.git")
-             (commit "45faed44e7f4d11fec79b7a70e4a35dc91ef3fdb")))
-           (file-name
-            (git-file-name "lib-tl-for-telegram-desktop" version))
-           (sha256
-            (base32 "0h43xvzklda02494d466jp52hl8c1kmav9f12dyld10dpf1w6c7m"))))
-       ("lib-ui-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_ui.git")
-             (commit "1b590f9e16eb9571a039f072d6fea66c607e419f")))
-           (file-name
-            (git-file-name "lib-ui-for-telegram-desktop" version))
-           (sha256
-            (base32 "0ighyhfp29h9h8c7vr70pnhcv2xnsr9ln084pssn8hb5z4pmb62f"))))
-       ("lib-waylandshells-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_waylandshells.git")
-             (commit "59b0ee55a68976d27f1bf7cec0e11d5939e185e7")))
-           (file-name
-            (git-file-name "lib-waylandshells-for-telegram-desktop" version))
-           (sha256
-            (base32 "0l2xrpc5mvvdlsj333pmkgfvn9wi1ijfdaaz8skfnw9icw52faaf"))))
-       ("lib-webrtc-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_webrtc.git")
-             (commit "ef49f953f12b112008a094a719f40939aaf39db4")))
-           (file-name
-            (git-file-name "lib-webrtc-for-telegram-desktop" version))
-           (sha256
-            (base32 "15k4xs3462p3ddp5cn9im3nvdiaijmxir8wxsf5yrj70ghy26ibw"))))
-       ("lib-webview-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_webview.git")
-             (commit "e06427c624515485774e2e2181d4afeb05ad5a67")))
-           (file-name
-            (git-file-name "lib-webview-for-telegram-desktop" version))
-           (sha256
-            (base32 "148z7xzfscynwwwqssdsd97npax6yn8zrd64xw8qzbwff2g2r7k4"))))
-       ("libdbusmenu-qt" ,libdbusmenu-qt)
-       ("libjpeg" ,libjpeg-turbo)
-       ("libtgvoip" ,libtgvoip-for-telegram-desktop)
-       ("lz4" ,lz4)
-       ("materialdecoration" ,materialdecoration)
-       ("minizip" ,minizip)
-       ("nimf" ,nimf)
-       ("openal" ,openal)
-       ("openssl" ,openssl)
-       ("opus" ,opus)
-       ("pulseaudio" ,pulseaudio)
-       ("qrcodegen" ,qrcodegen-cpp)
-       ("qt" ,qtbase-5)
-       ("qtsvg-5" ,qtsvg-5)
-       ("qt5ct" ,qt5ct)
-       ("qtimageformats" ,qtimageformats)
-       ("qtwayland" ,qtwayland)
-       ("range-v3" ,range-v3)
-       ("rlottie" ,rlottie-for-telegram-desktop)
-       ("rnnoise" ,rnnoise)
-       ("tgcalls-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/TelegramMessenger/tgcalls.git")
-             (commit "81e97fa52e25b7775b62ce07bb653533d81e91b3")))
-           (file-name
-            (git-file-name "tgcalls-for-telegram-desktop" version))
-           (sha256
-            (base32 "0fvad87hyxli83xn19mgf8jjrrh6y6iaig14pckpbkg33vf4wqkj"))))
-       ("webrtc" ,webrtc-for-telegram-desktop)
-       ("x11" ,libx11)
-       ("xcb" ,libxcb)
-       ("xcb-keysyms" ,xcb-util-keysyms)
-       ("xxhash" ,xxhash)
-       ("zlib" ,zlib)))
+     (list alsa-lib
+           c++-gsl
+           catch-framework2
+           libexpected
+           fcitx-qt5
+           fcitx5-qt
+           ffmpeg
+           glib
+           glibmm-2.64
+           gtk+
+           hime
+           hunspell
+           jemalloc
+           kwayland
+           libdbusmenu-qt
+           libjpeg-turbo
+           libtgvoip-for-telegram-desktop
+           lz4
+           materialdecoration
+           minizip
+           nimf
+           openal
+           openssl
+           opus
+           pulseaudio
+           qrcodegen-cpp
+           qtbase-5
+           qtsvg-5
+           qt5ct
+           qtimageformats
+           qtwayland
+           range-v3
+           rlottie-for-telegram-desktop
+           rnnoise
+           webrtc-for-telegram-desktop
+           libx11
+           libxcb
+           xcb-util-keysyms
+           xxhash
+           zlib))
     (propagated-inputs
      (list dconf))
     (synopsis "Telegram Desktop")
--
2.37.3
H
H
Hilton Chain wrote on 11 Sep 12:11 +0200
[PATCH v3 3/7] gnu: Add abseil-cpp-cxxstd17.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76edwi8bki.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (abseil-cpp-cxxstd17): New variable.
---
gnu/packages/telegram.scm | 13 +++++++++++++
1 file changed, 13 insertions(+)

Toggle diff (31 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 6e7fa4a2ec..3b0444025c 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -62,6 +62,7 @@ (define-module (gnu packages telegram)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
+  #:use-module (guix utils)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system copy)
@@ -71,6 +72,18 @@ (define-module (gnu packages telegram)
   #:use-module (guix build-system python)
   #:use-module (guix build-system qt))

+(define-public abseil-cpp-cxxstd17
+  (let ((base abseil-cpp))
+    ;; Abseil built with pre C++17 standards enforcing would cause a linking
+    ;; issue when building Telegram Destop. (Currently it's by default 11, and
+    ;; has changed to 14 upstream.)
+    (hidden-package
+     (package/inherit base
+       (arguments
+        (substitute-keyword-arguments (package-arguments base)
+          ((#:configure-flags flags)
+           `(cons* "-DCMAKE_CXX_STANDARD=17" ,flags))))))))
+
 (define-public webrtc-for-telegram-desktop
   (let ((commit "91d836dc84a16584c6ac52b36c04c0de504d9c34")
         (revision "166"))
--
2.37.3
H
H
Hilton Chain wrote on 11 Sep 12:12 +0200
[PATCH v3 4/7] gnu: webrtc-for-telegram-desktop: Update to a5fbc9.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76czc28bk0.wl-hako@ultrarare.space
* gnu/packages/patches/webrtc-for-telegram-desktop-allow-disabling-X11.patch:
New file.
* gnu/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch:
New file.
* gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to a5fbc9123
e056e611e69acf0ceb4252ddd838adb.
[patches]: Add webrtc-for-telegram-desktop-allow-disabling-X11.patch.
Add webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch.
[snippet]: Sync with source tree.
Unbundle openh264 and libvpx.
[arguments]: Comment out to default values.
[native-inputs]: Drop perl.
[inputs]: Drop alsa-lib, pulseaudio, libx11.
Add abseil-cpp-cxxstd17, libvpx, openh264, libdrm, libglvnd, mesa.
Replace pipewire with pipewire-0.3.
[license]: Sync with source tree.
* gnu/local.mk: Add patches
---
gnu/local.mk | 2 +
...telegram-desktop-allow-disabling-X11.patch | 138 ++++++++++++++++++
...r-telegram-desktop-fix-gcc12-cstdint.patch | 21 +++
gnu/packages/telegram.scm | 68 +++++----
4 files changed, 202 insertions(+), 27 deletions(-)
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-allow-disabling-X11.patch
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch

Toggle diff (320 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 19102113c9..683f6bfe0d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1966,6 +1966,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/warsow-qfusion-fix-bool-return-type.patch	\
   %D%/packages/patches/webkitgtk-adjust-bubblewrap-paths.patch	\
   %D%/packages/patches/webrtc-audio-processing-big-endian.patch	\
+  %D%/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch   \
+  %D%/packages/patches/webrtc-for-telegram-desktop-allow-disabling-X11.patch \
   %D%/packages/patches/websocketpp-fix-for-cmake-3.15.patch	\
   %D%/packages/patches/widelands-add-missing-map-include.patch	\
   %D%/packages/patches/widelands-system-wide_minizip.patch	\
diff --git a/gnu/packages/patches/webrtc-for-telegram-desktop-allow-disabling-X11.patch b/gnu/packages/patches/webrtc-for-telegram-desktop-allow-disabling-X11.patch
new file mode 100644
index 0000000000..801b64a554
--- /dev/null
+++ b/gnu/packages/patches/webrtc-for-telegram-desktop-allow-disabling-X11.patch
@@ -0,0 +1,138 @@
+From 6c28002ae4326db71980a3bfdf214d5df53d5b62 Mon Sep 17 00:00:00 2001
+From: Hilton Chain <hako@ultrarare.space>
+Date: Fri, 9 Sep 2022 22:28:23 +0800
+Subject: [PATCH] Allow disabling X11 desktop capturing independently.
+
+Squashed commit of the following:
+
+commit 253b09a07520a3cecb3b88b2b7e8889ab3d9158d
+Author: Hilton Chain <hako@ultrarare.space>
+Date:   Fri Sep 9 22:13:15 2022 +0800
+
+    Adapt the patch with cmake_dependent_option.
+
+commit f6631bb43f353c9eafe1b1aba093e116518aa12a
+Author: Esteve Varela Colominas <esteve.varela@gmail.com>
+Date:   Sun, 27 Jun 2021 23:57:04 +0200
+
+    Add -DTG_OWT_USE_X11
+
+    Allows disabling X11 desktop capturing independently of pipewire support, for
+    the few people that run wayland without any X11 support whatsoever.
+
+    This setup is untested, but supported by the GNI build system, see:
+    * src/modules/desktop_capture/BUILD.gn (option rtc_use_x11_extensions)
+
+    Toggling the WEBRTC_USE_X11 define also affects some files under
+    src/modules/audio_device, but that falls under "X11 support", regardless...
+
+    Use cmake_dependent_option to better declare variables that relate on other variables
+---
+ CMakeLists.txt             | 42 ++++++++++++++++++++++++++++++++++----
+ cmake/libwebrtcbuild.cmake | 12 ++++++-----
+ 2 files changed, 45 insertions(+), 9 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2e081ae7..2b09682a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -24,6 +24,7 @@ endif()
+
+ option(BUILD_SHARED_LIBS "Builds shared libraries instead of static." OFF)
+ option(TG_OWT_USE_PROTOBUF "Use protobuf to generate additional headers. Useful for packaged build." ${BUILD_SHARED_LIBS})
++cmake_dependent_option(TG_OWT_USE_X11 "Use X11 for desktop capture on non-Apple Unix."  ON "UNIX; NOT APPLE" OFF)
+ cmake_dependent_option(TG_OWT_USE_PIPEWIRE "Use pipewire for desktop capture." ON "UNIX; NOT APPLE" OFF)
+ cmake_dependent_option(TG_OWT_DLOPEN_PIPEWIRE "dlopen pipewire for desktop capture." ${not_packaged_build} TG_OWT_USE_PIPEWIRE OFF)
+ option(TG_OWT_BUILD_AUDIO_BACKENDS "Build webrtc audio backends." OFF)
+@@ -96,6 +97,10 @@ endif()
+ add_library(tg_owt)
+ init_target(tg_owt)
+
++if (TG_OWT_USE_X11)
++    link_x11(tg_owt)
++endif()
++
+ if (TG_OWT_USE_PIPEWIRE)
+     if (TG_OWT_DLOPEN_PIPEWIRE)
+         include(cmake/generate_stubs.cmake)
+@@ -188,10 +193,6 @@ endif()
+ include(cmake/libwebrtcbuild.cmake)
+ target_link_libraries(tg_owt PUBLIC tg_owt::libwebrtcbuild)
+
+-if (UNIX AND NOT APPLE)
+-    link_x11(tg_owt)
+-endif()
+-
+ function(add_sublibrary postfix)
+     add_library(tg_owt_${postfix} OBJECT)
+     init_feature_target(tg_owt_${postfix} ${postfix})
+@@ -2369,6 +2370,39 @@ if (NOT TG_OWT_USE_PROTOBUF)
+     )
+ endif()
+
++if (NOT TG_OWT_USE_X11)
++    remove_target_sources(tg_owt ${webrtc_loc}
++        # src/modules/desktop_capture/BUILD.gn (rtc_use_x11_extensions)
++        modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.cc
++        modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.h
++        modules/desktop_capture/linux/x11/screen_capturer_x11.cc
++        modules/desktop_capture/linux/x11/screen_capturer_x11.h
++        modules/desktop_capture/linux/x11/shared_x_display.cc
++        modules/desktop_capture/linux/x11/shared_x_display.h
++        modules/desktop_capture/linux/x11/window_capturer_x11.cc
++        modules/desktop_capture/linux/x11/window_capturer_x11.h
++        modules/desktop_capture/linux/x11/window_finder_x11.cc
++        modules/desktop_capture/linux/x11/window_finder_x11.h
++        modules/desktop_capture/linux/x11/window_list_utils.cc
++        modules/desktop_capture/linux/x11/window_list_utils.h
++        modules/desktop_capture/linux/x11/x_atom_cache.cc
++        modules/desktop_capture/linux/x11/x_atom_cache.h
++        modules/desktop_capture/linux/x11/x_error_trap.cc
++        modules/desktop_capture/linux/x11/x_error_trap.h
++        modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc
++        modules/desktop_capture/linux/x11/x_server_pixel_buffer.h
++        modules/desktop_capture/linux/x11/x_window_property.cc
++        modules/desktop_capture/linux/x11/x_window_property.h
++
++        # screen_drawer_linux.cc depends on x11, rest are revdeps
++        modules/desktop_capture/screen_drawer.cc
++        modules/desktop_capture/screen_drawer.h
++        modules/desktop_capture/screen_drawer_linux.cc
++        modules/desktop_capture/screen_drawer_lock_posix.cc
++        modules/desktop_capture/screen_drawer_lock_posix.h
++    )
++endif()
++
+ if (NOT TG_OWT_USE_PIPEWIRE)
+     remove_target_sources(tg_owt ${webrtc_loc}
+         modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc
+diff --git a/cmake/libwebrtcbuild.cmake b/cmake/libwebrtcbuild.cmake
+index 4d037f4b..388b7aa9 100644
+--- a/cmake/libwebrtcbuild.cmake
++++ b/cmake/libwebrtcbuild.cmake
+@@ -29,6 +29,13 @@ INTERFACE
+     BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0
+ )
+
++if (TG_OWT_USE_X11)
++    target_compile_definitions(libwebrtcbuild
++    INTERFACE
++        WEBRTC_USE_X11
++    )
++endif()
++
+ if (TG_OWT_USE_PIPEWIRE)
+     target_compile_definitions(libwebrtcbuild
+     INTERFACE
+@@ -65,11 +72,6 @@ else()
+         INTERFACE
+             WEBRTC_MAC
+         )
+-    else()
+-        target_compile_definitions(libwebrtcbuild
+-        INTERFACE
+-            WEBRTC_USE_X11
+-        )
+     endif()
+
+     if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
diff --git a/gnu/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch b/gnu/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch
new file mode 100644
index 0000000000..f1fd29d0d3
--- /dev/null
+++ b/gnu/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch
@@ -0,0 +1,21 @@
+From 86d2bcd7afb8706663d29e30f65863de5a626142 Mon Sep 17 00:00:00 2001
+From: Xiretza <xiretza@xiretza.xyz>
+Date: Sun, 15 May 2022 12:47:41 +0200
+Subject: [PATCH] fix(h265_pps_parser): fix missing cstdint include
+
+---
+ src/common_video/h265/h265_pps_parser.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/common_video/h265/h265_pps_parser.h b/src/common_video/h265/h265_pps_parser.h
+index 28c95ea9..c180b1b9 100644
+--- a/src/common_video/h265/h265_pps_parser.h
++++ b/src/common_video/h265/h265_pps_parser.h
+@@ -12,6 +12,7 @@
+ #define COMMON_VIDEO_H265_PPS_PARSER_H_
+
+ #include "absl/types/optional.h"
++#include <cstdint>
+
+ namespace rtc {
+ class BitBuffer;
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 3b0444025c..cdd3816082 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -30,6 +30,8 @@ (define-module (gnu packages telegram)
   #:use-module (gnu packages digest)
   #:use-module (gnu packages fcitx)
   #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gnupg)
@@ -58,10 +60,12 @@ (define-module (gnu packages telegram)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages video)
   #:use-module (gnu packages web)
+  #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
+  #:use-module (guix gexp)
   #:use-module (guix utils)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
@@ -85,8 +89,8 @@ (define-public abseil-cpp-cxxstd17
            `(cons* "-DCMAKE_CXX_STANDARD=17" ,flags))))))))

 (define-public webrtc-for-telegram-desktop
-  (let ((commit "91d836dc84a16584c6ac52b36c04c0de504d9c34")
-        (revision "166"))
+  (let ((commit "a5fbc9123e056e611e69acf0ceb4252ddd838adb")
+        (revision "167"))
     (hidden-package
      (package
        (name "webrtc-for-telegram-desktop")
@@ -103,49 +107,61 @@ (define-public webrtc-for-telegram-desktop
           (file-name
            (git-file-name name version))
           (sha256
-           (base32 "1ir4svv5mijpzr0rmx65088iikck83vhcdqrpf9dnk6yp4j9v4v2"))
+           (base32 "1hzck63spjjkqzkj0mlrxygrix4lw0n3i5cmc0vkxaphfzawz74n"))
           (modules '((guix build utils)
                      (ice-9 ftw)
                      (srfi srfi-1)))
+          (patches
+           (search-patches
+            ;; https://github.com/desktop-app/tg_owt/pull/101
+            "webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch"
+            ;; https://github.com/desktop-app/tg_owt/pull/107
+            "webrtc-for-telegram-desktop-allow-disabling-X11.patch"))
           (snippet
            `(begin
               (let ((keep
                      '( ;; Custom forks which are incompatible with the ones in Guix.
-                       "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                       "abseil-cpp" "libsrtp" "rnnoise"
                        ;; Not available in Guix.
-                       "pffft" "usrsctp" "libyuv"
-                       ;; Has cmake support files for libvpx input.
-                       "libvpx")))
+                       "crc32c" "libyuv" "pffft")))
                 (with-directory-excursion "src/third_party"
                   (for-each delete-file-recursively
                             (lset-difference string=?
                                              (scandir ".")
-                                             (cons* "." ".." keep)))))))))
+                                             (cons* "." ".." keep)))))
+              ;; Force using standalone openh264.
+              (substitute* "CMakeLists.txt"
+                (("\\include\\(cmake\\/libopenh264\\.cmake\\)")""))))))
        (build-system cmake-build-system)
        (arguments
-        `(#:tests? #f                   ; No target
-          #:configure-flags
-          (list
-           "-DCMAKE_C_FLAGS=-fPIC"
-           "-DCMAKE_CXX_FLAGS=-fPIC")))
-       (native-inputs
-        (list perl pkg-config python-wrapper yasm))
+        (list #:tests? #f       ; No target
+              ;; NOTE: Options commented are default values.
+              ;; See also: comments in inputs.
+              ;; #:configure-flags
+              ;; #~'("-DTG_OWT_USE_PIPEWIRE=ON"
+              ;;     "-DTG_OWT_USE_X11=ON"
+              ;;     "-DTG_OWT_USE_PROTOBUF=ON")
+              ))
+       (native-inputs (list pkg-config python-wrapper yasm))
        (inputs
-        (list alsa-lib
+        (list abseil-cpp-cxxstd17
               ffmpeg
               libjpeg-turbo
-              glib
-              libxcomposite
-              libxdamage
-              libxrender
-              libxrandr
+              libvpx
+              openh264
               openssl
               opus
-              pipewire
+              ;; TG_OWT_USE_PROTOBUF
               protobuf
-              pulseaudio
-              libx11
+              ;; TG_OWT_USE_PIPEWIRE
+              glib libdrm libglvnd mesa pipewire-0.3
+              ;; TG_OWT_USE_X11
+              libxcomposite
+              libxdamage
               libxext
+              libxfixes
+              libxrandr
+              libxrender
               libxtst))
        (synopsis "WebRTC support for Telegram Desktop")
        (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by
@@ -157,13 +173,11 @@ (define-public webrtc-for-telegram-desktop
          license:asl2.0
          ;; LibYuv
          (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
-         ;; OpenH264
-         license:bsd-2
          ;; PFFFT
          (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
          ;; RnNoise
          license:gpl3
-         ;; LibSRTP, LibVPx, UsrSCTP and Others
+         ;; LibSRTP, Crc32c and Others
          license:bsd-3))))))

 (define-public rlottie-for-telegram-desktop
--
2.37.3
H
H
Hilton Chain wrote on 11 Sep 12:12 +0200
[PATCH v3 5/7] gnu: telegram-desktop: Update to 4.1.1.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76bkrm8bjf.wl-hako@ultrarare.space
* gnu/packages/patches/telegram-desktop-fix-gcc12-cstdint.patch: New file.
* gnu/packages/telegram.scm (telegram-desktop): Update to 4.1.1.
[patches]: Add telegram-desktop-fix-gcc12-cstdint.patch.
[snippet]: Sync with source tree.
Add libtgvoip, rlottie and dispatch.
[arguments]: Use App ID from Telegram's official Snap builds.
Comment out to default configurations.
Drop unneeded phases.
[native-inputs]: Drop cmake-shared, extra-cmake-modules, glib:bin, gtk+:bin
and qttools-5.
[inputs]: Drop libexpected, fcitx-qt5, fcitx5-qt, glib, hime, gtk+, kwayland,
libx11, catch-framework2, materialdecoration, nimf, qt5ct, libdbusmenu-qt,
qtbase-5, libtgvoip-for-telegram-desktop and rlottie-for-telegram-desktop.
Add abseil-cpp-cxxstd17, qt5compat, qtbase, qtwayland, wayland, webkitgtk and
libvpx.
[propageted-inputs]: Drop dconf.
[license]: Sync with source tree.
* gnu/local.mk: Add patch.
---
gnu/local.mk | 1 +
.../telegram-desktop-fix-gcc12-cstdint.patch | 10 +
gnu/packages/telegram.scm | 175 ++++++++++--------
3 files changed, 105 insertions(+), 81 deletions(-)
create mode 100644 gnu/packages/patches/telegram-desktop-fix-gcc12-cstdint.patch

Toggle diff (275 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 683f6bfe0d..1247a09a8e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1868,6 +1868,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-fix-gcc12-cstdint.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-fix-gcc12-cstdint.patch b/gnu/packages/patches/telegram-desktop-fix-gcc12-cstdint.patch
new file mode 100644
index 0000000000..a3d67e0c9a
--- /dev/null
+++ b/gnu/packages/patches/telegram-desktop-fix-gcc12-cstdint.patch
@@ -0,0 +1,10 @@
+--- a/Telegram/ThirdParty/tgcalls/tgcalls/utils/gzip.h
++++ b/Telegram/ThirdParty/tgcalls/tgcalls/utils/gzip.h
+@@ -2,6 +2,7 @@
+ #define TGCALLS_UTILS_GZIP_H
+
+ #include <absl/types/optional.h>
++#include <cstdint>
+ #include <vector>
+
+ namespace tgcalls {
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index cdd3816082..b943b3c4a2 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -1,6 +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.
 ;;;
 ;;; GNU Guix is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@ (define-module (gnu packages telegram)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages digest)
+  #:use-module (gnu packages enchant)
   #:use-module (gnu packages fcitx)
   #:use-module (gnu packages fcitx5)
   #:use-module (gnu packages freedesktop)
@@ -60,6 +61,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)
@@ -258,7 +260,7 @@ (define-public libtgvoip-for-telegram-desktop
 (define-public telegram-desktop
   (package
     (name "telegram-desktop")
-    (version "2.9.3")
+    (version "4.1.1")
     (source
      (origin
        (method git-fetch)
@@ -269,16 +271,25 @@ (define-public telegram-desktop
          (recursive? #t)))
        (file-name
         (git-file-name name version))
+       (patches
+        (search-patches
+         ;; Cherry-picked from upstream, remove when bumping.
+         "telegram-desktop-fix-gcc12-cstdint.patch"))
        (sha256
-        (base32 "07mw09gmxy2pcga856wbsqmbgl2l5a3ix0hr5p6hlvk7pq260s36"))
+        (base32 "0b8nwimks6hfnb3bqik8d4s9z689hhj4p9ykqgc36pmpr54nyma8"))
        (modules '((guix build utils)
                   (ice-9 ftw)
                   (srfi srfi-1)))
        (snippet
         `(begin
            (let ((keep
-                  '( ;; Not available in Guix.
-                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+                  '(;; Own fork, legacy library only used for backward
+                    ;; compatibility.
+                    "libtgvoip"
+                    ;; Own fork with custom API.
+                    "rlottie"
+                    ;; Not available in Guix.
+                    "dispatch" "tgcalls")))
              (with-directory-excursion "Telegram/ThirdParty"
                (for-each delete-file-recursively
                          (lset-difference string=?
@@ -286,102 +297,104 @@ (define-public telegram-desktop
                                           (cons* "." ".." keep)))))))))
     (build-system qt-build-system)
     (arguments
-     `(#:tests? #f                      ; No target
-       #:imported-modules
-       (,@%qt-build-system-modules
-        (guix build glib-or-gtk-build-system))
-       #:modules
-       ((guix build qt-build-system)
-        ((guix build glib-or-gtk-build-system)
-         #:prefix glib-or-gtk:)
-        (guix build utils)
-        (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>.
-        ;; In case, that the credentials below fail to work, contact
-        ;;   Raghav Gururajan <rg@raghavgururajan.name>
-        "-DTDESKTOP_API_ID=2791056"
-        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
-        ;; Disable WebkitGTK support as it fails to link
-        "-DDESKTOP_APP_DISABLE_WEBKITGTK=ON"
-        ;; Use bundled fonts as fallback.
-        "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'make-writable
-           (lambda _
-             (for-each make-file-writable (find-files "."))))
-         (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")
-           `(,gtk+ "bin")
-           pkg-config
-           python-wrapper
-           qttools-5))
+     (list #:tests? #f                  ;No target
+           #:imported-modules
+           `(,@%qt-build-system-modules
+             (guix build glib-or-gtk-build-system))
+           #:modules
+           '((guix build qt-build-system)
+             ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
+             (guix build utils)
+             (ice-9 match))
+           #:configure-flags
+           #~`(;; https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml
+               ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+               "-DTDESKTOP_API_ID=611335"
+               "-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c"
+               ,(string-append "-DTDESKTOP_LAUTCHER_BASENAME=" #$name)
+               "-DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON"
+               "-DDESKTOP_APP_DISABLE_AUTOUPDATE=ON"
+               ;; NOTE: Options commented are default values.
+               ;; See also: comments in inputs.
+               ;; "-DDESKTOP_APP_LOTTIE_USE_CACHE=ON"
+               ;; "-DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=OFF"
+               ;; "-DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=OFF"
+               ;; "-DDESKTOP_APP_DISABLE_X11_INTEGRATION=OFF"
+               ;; "-DDESKTOP_APP_USE_ALLOCATION_TRACER=OFF"
+               ;; "-DDESKTOP_APP_USE_PACKAGED=ON"
+               ;; "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF"
+               ;; "-DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF"
+               ;; "-DDESKTOP_APP_DISABLE_SPELLCHECK=OFF"
+               ;; "-DDESKTOP_APP_USE_HUNSPELL_ONLY=OFF"
+               ;; "-DDESKTOP_APP_USE_ENCHANT=OFF"
+               ;; "-DDESKTOP_APP_NO_PDB=OFF"
+               ;; "-DDESKTOP_APP_DISABLE_JEMALLOC=OFF"
+               )
+           #:phases
+           #~(modify-phases %standard-phases
+               (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 pkg-config python-wrapper))
     (inputs
-     (list alsa-lib
+     (list abseil-cpp-cxxstd17
+           alsa-lib
            c++-gsl
-           catch-framework2
-           libexpected
-           fcitx-qt5
-           fcitx5-qt
            ffmpeg
-           glib
-           glibmm-2.64
-           gtk+
-           hime
-           hunspell
            jemalloc
-           kwayland
-           libdbusmenu-qt
+           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_USE_ENCHANT
+           ;; enchant
+           ;; 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+
-      ;; Others
-      license:gpl3+))))
+    (license (list
+              ;; Telegram/ThirdParty/dispatch
+              license:asl2.0
+              ;; Telegram/ThirdParty/rlottie/src/vector/pixman
+              ;; Telegram/ThirdParty/rlottie/src/vector/stb
+              ;; Telegram/ThirdParty/rlottie/src/vector/rapidjson
+              license:expat
+              ;; Telegram/ThirdParty/rlottie/src/vector/freetype
+              license:freetype
+              ;; Telegram/ThirdParty/rlottie
+              ;; Telegram/ThirdParty/rlottie/src/vector
+              license:lgpl2.1+
+              ;; Telegram/ThirdParty/tgcalls
+              license:lgpl3
+              ;; Others
+              license:gpl3+))))

 (define-public tl-parser
   (let ((commit "1933e76f8f4fb74311be723b432e4c56e3a5ec06")
--
2.37.3
H
H
Hilton Chain wrote on 11 Sep 12:12 +0200
[PATCH v3 6/7] gnu: Remove rlottie-for-telegram-desktop.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76a6768biw.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (rlottie-for-telegram-desktop): Delete variable.
---
gnu/packages/telegram.scm | 34 ----------------------------------
1 file changed, 34 deletions(-)

Toggle diff (45 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index b943b3c4a2..16937de86b 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -182,40 +182,6 @@ (define-public webrtc-for-telegram-desktop
          ;; LibSRTP, Crc32c and Others
          license:bsd-3))))))

-(define-public rlottie-for-telegram-desktop
-  (let ((commit "cbd43984ebdf783e94c8303c41385bf82aa36d5b")
-        (revision "671"))
-    (hidden-package
-     (package
-       (inherit rlottie)
-       (version
-        (git-version "0.0.1" revision commit))
-       (source
-        (origin
-          (method git-fetch)
-          (uri
-           (git-reference
-            (url "https://github.com/desktop-app/rlottie.git")
-            (commit commit)))
-          (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)))))))))
-
 (define-public libtgvoip-for-telegram-desktop
   (let ((commit "13a5fcb16b04472d808ce122abd695dbf5d206cd")
         (revision "88"))
--
2.37.3
H
H
Hilton Chain wrote on 11 Sep 12:13 +0200
[PATCH v3 7/7] gnu: Remove libtgvoip-for-telegram-desktop.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y768rmq8bi8.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (libtgvoip-for-telegram-desktop): Delete variable.
---
gnu/packages/telegram.scm | 41 ---------------------------------------
1 file changed, 41 deletions(-)

Toggle diff (52 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 16937de86b..94c0492294 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -182,47 +182,6 @@ (define-public webrtc-for-telegram-desktop
          ;; LibSRTP, Crc32c and Others
          license:bsd-3))))))

-(define-public libtgvoip-for-telegram-desktop
-  (let ((commit "13a5fcb16b04472d808ce122abd695dbf5d206cd")
-        (revision "88"))
-    (hidden-package
-     (package
-       (inherit libtgvoip)
-       (version
-        (git-version "2.4.4" revision commit))
-       (source
-        (origin
-          (method git-fetch)
-          (uri
-           (git-reference
-            (url "https://github.com/telegramdesktop/libtgvoip.git")
-            (commit commit)))
-          (file-name
-           (git-file-name "libtgvoip-for-telegram-desktop" version))
-          (sha256
-           (base32 "12p6s7vxkf1gh1spdckkdxrx7bjzw881ds9bky7l5fw751cwb3xd"))))
-       (arguments
-        `(#:configure-flags
-          (list
-           "--disable-static"
-           "--disable-dsp"              ; FIXME
-           "--enable-audio-callback"
-           "--with-alsa"
-           "--with-pulse")
-          #:phases
-          (modify-phases %standard-phases
-            (add-after 'unpack 'patch-linkers
-              (lambda _
-                (substitute* "Makefile.am"
-                  (("\\$\\(CRYPTO_LIBS\\) \\$\\(OPUS_LIBS\\)")
-                   "$(CRYPTO_LIBS) $(OPUS_LIBS) $(ALSA_LIBS) $(PULSE_LIBS)"))
-                (substitute* "tgvoip.pc.in"
-                  (("libcrypto opus")
-                   "libcrypto opus alsa libpulse"))
-                #t)))))
-       (native-inputs
-        (list autoconf automake libtool pkg-config))))))
-
 (define-public telegram-desktop
   (package
     (name "telegram-desktop")
--
2.37.3
L
L
Liliana Marie Prikler wrote on 11 Sep 13:10 +0200
Re: [PATCH v3 0/7] gnu: telegram-desktop: Update to 4.1.1.
9caf83d695217482c175fa0de38d5e43f80aa05a.camel@gmail.com
Am Sonntag, dem 11.09.2022 um 18:10 +0800 schrieb Hilton Chain:
Toggle quote (3 lines)
>
> v2 -> v3: Clone recursively instead of define every single git
> submodule...
Hard pass. We ought to decrease bundling, not make it worse.
L
L
Liliana Marie Prikler wrote on 11 Sep 13:13 +0200
Re: [PATCH v3 3/7] gnu: Add abseil-cpp-cxxstd17.
7c230e2aaa6493ab4b1445b83f6387bb01a156b8.camel@gmail.com
Am Sonntag, dem 11.09.2022 um 18:11 +0800 schrieb Hilton Chain:
Toggle quote (36 lines)
>
> * gnu/packages/telegram.scm (abseil-cpp-cxxstd17): New variable.
> ---
>  gnu/packages/telegram.scm | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
> index 6e7fa4a2ec..3b0444025c 100644
> --- a/gnu/packages/telegram.scm
> +++ b/gnu/packages/telegram.scm
> @@ -62,6 +62,7 @@ (define-module (gnu packages telegram)
>    #:use-module (gnu packages xorg)
>    #:use-module ((guix licenses) #:prefix license:)
>    #:use-module (guix packages)
> +  #:use-module (guix utils)
>    #:use-module (guix git-download)
>    #:use-module (guix build-system cmake)
>    #:use-module (guix build-system copy)
> @@ -71,6 +72,18 @@ (define-module (gnu packages telegram)
>    #:use-module (guix build-system python)
>    #:use-module (guix build-system qt))
>
> +(define-public abseil-cpp-cxxstd17
> +  (let ((base abseil-cpp))
> +    ;; Abseil built with pre C++17 standards enforcing would cause a
> linking
> +    ;; issue when building Telegram Destop. (Currently it's by
> default 11, and
> +    ;; has changed to 14 upstream.)
> +    (hidden-package
> +     (package/inherit base
> +       (arguments
> +        (substitute-keyword-arguments (package-arguments base)
> +          ((#:configure-flags flags)
> +           `(cons* "-DCMAKE_CXX_STANDARD=17" ,flags))))))))
> +
For the record, this ought to be placed near abseil-cpp, because the
semantics of inheritance can screw you over cross-module.

Cheers
L
L
Liliana Marie Prikler wrote on 11 Sep 13:17 +0200
Re: [PATCH v3 5/7] gnu: telegram-desktop: Update to 4.1.1.
4820bedb4b029d22a07ec734356495d774173f9c.camel@gmail.com
Am Sonntag, dem 11.09.2022 um 18:12 +0800 schrieb Hilton Chain:
Toggle quote (1 lines)
> [arguments]: Use App ID from Telegram's official Snap builds.
This patch should probably be separated from the rest here. As for the
rest, the same complaints as in v2 apply.

Cheers
H
H
Hilton Chain wrote on 11 Sep 15:41 +0200
Re: [PATCH v3 0/7] gnu: telegram-desktop: Update to 4.1.1.
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)(address . 57675@debbugs.gnu.org)
y76zgf6rpsz.wl-hako@ultrarare.space
hmmm..., then how about those bunch of stuff named in lib_xxx (other than libs contained in a "Third
Party" directory)? I don't think it's necessary to define a variable for each of them...

Thanks
L
L
Liliana Marie Prikler wrote on 11 Sep 16:08 +0200
(name . Hilton Chain)(address . hako@ultrarare.space)(address . 57675@debbugs.gnu.org)
97e039b27ea6cb2b4fdc4c4d9e6bab7489657157.camel@gmail.com
Am Sonntag, dem 11.09.2022 um 21:41 +0800 schrieb Hilton Chain:
Toggle quote (4 lines)
> hmmm..., then how about those bunch of stuff named in lib_xxx (other
> than libs contained in a "Third
> Party" directory)? I don't think it's necessary to define a variable
> for each of them...
You could declare a variable for all of them, a list of origins, and
then unpack them with a for-each as is currently done.

Cheers
H
H
Hilton Chain wrote on 19 Sep 08:09 +0200
[PATCH v4 00/10] gnu: telegram-desktop: Update to 4.2.0.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76edw7rj2v.wl-hako@ultrarare.space
v3 -> v4:
1. Move abseil-cpp-cxxstd17 to cpp.scm.
2. Split commits.
3. Define variables for sources.
4. Update kcoreaddons.
5. Bump to 4.2.0.

Hilton Chain (10):
gnu: webrtc-for-telegram-desktop: Simplify inputs.
gnu: telegram-desktop: Simplify inputs.
gnu: telegram-desktop: Change Api ID.
gnu: webrtc-for-telegram-desktop: Use gexp.
gnu: telegram-desktop: Use gexp.
gnu: Add abseil-cpp-cxxstd17.
gnu: extra-cmake-modules: Update to 5.98.0.
gnu: kcoreaddons: Update to 5.98.0.
gnu: webrtc-for-telegram-desktop: Update to 621f3d.
gnu: telegram-desktop: Update to 4.2.0.

gnu/local.mk | 1 +
gnu/packages/cpp.scm | 9 +
gnu/packages/kde-frameworks.scm | 23 +-
...r-telegram-desktop-fix-gcc12-cstdint.patch | 21 +
gnu/packages/telegram.scm | 804 ++++++++----------
5 files changed, 395 insertions(+), 463 deletions(-)
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch


base-commit: f7565101e49102da6f87ad92e4644ae7996515ab
--
2.37.3
H
H
Hilton Chain wrote on 19 Sep 08:10 +0200
[PATCH v4 01/10] gnu: webrtc-for-telegram-desktop: Simplify inputs.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76czbrrj1a.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (webrtc-for-telegram-desktop)[source,#:phases]:
Remove unneeded #t.
[native-inputs,inputs]: Simplify inputs.
---
gnu/packages/telegram.scm | 93 +++++++++++++++++++--------------------
1 file changed, 46 insertions(+), 47 deletions(-)

Toggle diff (112 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 1a22d230d2..3a46ab086c 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -106,8 +106,7 @@ (define-public webrtc-for-telegram-desktop
                   (for-each delete-file-recursively
                             (lset-difference string=?
                                              (scandir ".")
-                                             (cons* "." ".." keep))))
-                #t)))))
+                                             (cons* "." ".." keep)))))))))
        (build-system cmake-build-system)
        (arguments
         `(#:tests? #f                   ; No target
@@ -126,52 +125,52 @@ (define-public webrtc-for-telegram-desktop
                        (libyuv-to (string-append (getcwd)
                                                  "/src/third_party/libyuv")))
                   (copy-recursively libvpx-from libvpx-to)
-                  (copy-recursively libyuv-from libyuv-to))
-                #t)))))
-       (native-inputs
-        `(("perl" ,perl)
-          ("pkg-config" ,pkg-config)
-          ("python" ,python-wrapper)
-          ("yasm" ,yasm)))
+                  (copy-recursively libyuv-from libyuv-to)))))))
+       (native-inputs (list perl pkg-config python-wrapper yasm))
        (inputs
-        `(("alsa" ,alsa-lib)
-          ("ffmpeg" ,ffmpeg)
-          ("libjpeg" ,libjpeg-turbo)
-          ("glib" ,glib)
-          ("libvpx"
-           ,(origin
-              (method git-fetch)
-              (uri
-               (git-reference
-                (url "https://chromium.googlesource.com/webm/libvpx")
-                (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
-              (file-name
-               (git-file-name "libvpx-for-webrtc-for-telegram-desktop" version))
-              (sha256
-               (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
-          ("libyuv"
-           ,(origin
-              (method git-fetch)
-              (uri
-               (git-reference
-                (url "https://chromium.googlesource.com/libyuv/libyuv")
-                (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
-              (file-name
-               (git-file-name "libyuv-for-webrtc-for-telegram-desktop" version))
-              (sha256
-               (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
-          ("libxcomposite" ,libxcomposite)
-          ("libxdamage" ,libxdamage)
-          ("libxrender" ,libxrender)
-          ("libxrandr" ,libxrandr)
-          ("openssl" ,openssl)
-          ("opus" ,opus)
-          ("pipewire" ,pipewire)
-          ("protobuf" ,protobuf)
-          ("pulseaudio" ,pulseaudio)
-          ("x11" ,libx11)
-          ("xext" ,libxext)
-          ("xtst" ,libxtst)))
+        (modify-inputs
+            `(("libvpx"
+               ,(origin
+                  (method git-fetch)
+                  (uri
+                   (git-reference
+                    (url "https://chromium.googlesource.com/webm/libvpx")
+                    (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
+                  (file-name
+                   (git-file-name
+                    "libvpx-for-webrtc-for-telegram-desktop" version))
+                  (sha256
+                   (base32
+                    "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
+              ("libyuv"
+               ,(origin
+                  (method git-fetch)
+                  (uri
+                   (git-reference
+                    (url "https://chromium.googlesource.com/libyuv/libyuv")
+                    (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
+                  (file-name
+                   (git-file-name
+                    "libyuv-for-webrtc-for-telegram-desktop" version))
+                  (sha256
+                   (base32
+                    "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll")))))
+          (append alsa-lib
+                  ffmpeg
+                  libjpeg-turbo
+                  glib
+                  libxcomposite
+                  libxdamage
+                  libxrender
+                  libxrandr
+                  openssl
+                  opus
+                  pipewire
+                  protobuf
+                  pulseaudio
+                  libx11
+                  libxext
+                  libxtst)))
        (synopsis "WebRTC support for Telegram Desktop")
        (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by
 Telegram project, for its use in telegram desktop client.")
--
2.37.3
H
H
Hilton Chain wrote on 19 Sep 08:11 +0200
[PATCH v4 02/10] gnu: telegram-desktop: Simplify inputs.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76bkrbrj0j.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (telegram-desktop)[source,#:phases]: Remove
unneeded #t.
[native-inputs,inputs]: Simplify inputs.
---
gnu/packages/telegram.scm | 468 +++++++++++++++++++-------------------
1 file changed, 232 insertions(+), 236 deletions(-)

Toggle diff (501 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 3a46ab086c..cd25897634 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -293,8 +293,7 @@ (define-public telegram-desktop
                (for-each delete-file-recursively
                          (lset-difference string=?
                                           (scandir ".")
-                                          (cons* "." ".." keep))))
-             #t)))))
+                                          (cons* "." ".." keep)))))))))
     (build-system qt-build-system)
     (arguments
      `(#:tests? #f                      ; No target
@@ -323,8 +322,7 @@ (define-public telegram-desktop
        (modify-phases %standard-phases
          (add-after 'unpack 'make-writable
            (lambda _
-             (for-each make-file-writable (find-files "."))
-             #t))
+             (for-each make-file-writable (find-files "."))))
          (add-after 'make-writable 'copy-inputs
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (for-each
@@ -351,246 +349,244 @@ (define-public telegram-desktop
                 ("Telegram/lib_waylandshells" ,(assoc-ref inputs "lib-waylandshells-source"))
                 ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source"))
                 ("Telegram/lib_webview" ,(assoc-ref inputs "lib-webview-source"))
-                ("Telegram/ThirdParty/tgcalls"
-                 ,(assoc-ref inputs "tgcalls-source"))))
-             #t))
+                ("Telegram/ThirdParty/tgcalls" ,(assoc-ref inputs "tgcalls-source"))))))
          (add-before 'configure 'patch-cxx-flags
            (lambda _
-             (substitute* "cmake/options_linux.cmake"
-               (("class-memaccess") "all"))
-             #t))
+             (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
-     `(("cmake-helpers"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/cmake_helpers.git")
-             (commit "4d44d822e01b3b5fbec3ce824e01f56aa35d7f72")))
-           (file-name
-            (git-file-name "cmake-helpers-for-telegram-desktop" version))
-           (sha256
-            (base32 "0h6cjiqy014h2mz90h1z5a7plb3ihbnds4bja8994ybr1dy3m7m5"))))
-       ("cmake-shared" ,cmake-shared)
-       ("extra-cmake-modules" ,extra-cmake-modules)
-       ("glib:bin" ,glib "bin")
-       ("gobject-introspection" ,gobject-introspection)
-       ("gtk+:bin" ,gtk+ "bin")
-       ("pkg-config" ,pkg-config)
-       ("python" ,python-wrapper)
-       ("qttools-5" ,qttools-5)))
+     (modify-inputs
+         `(("cmake-helpers"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/cmake_helpers.git")
+                 (commit "4d44d822e01b3b5fbec3ce824e01f56aa35d7f72")))
+               (file-name
+                (git-file-name
+                 "cmake-helpers-for-telegram-desktop" version))
+               (sha256
+                (base32
+                 "0h6cjiqy014h2mz90h1z5a7plb3ihbnds4bja8994ybr1dy3m7m5")))))
+       (append cmake-shared
+               extra-cmake-modules
+               `(,glib "bin")
+               `(,gtk+ "bin")
+               pkg-config
+               python-wrapper
+               qttools-5)))
     (inputs
-     `(("alsa" ,alsa-lib)
-       ("c++-gsl" ,c++-gsl)
-       ("catch" ,catch2)
-       ("codegen-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/codegen.git")
-             (commit "248614b49cd7d5aff69d75a737f2e35b79fbb119")))
-           (file-name
-            (git-file-name "codegen" version))
-           (sha256
-            (base32 "00f7g2z6xmkbkrmi3q27hscjl44mg66wf9q0mz3rhy3jaa6cfdrk"))))
-       ("expected" ,libexpected)
-       ("fcitx-qt5" ,fcitx-qt5)
-       ("fcitx5-qt" ,fcitx5-qt)
-       ("ffmpeg" ,ffmpeg)
-       ("glib" ,glib)
-       ("glibmm" ,glibmm-2.64)
-       ("gtk+" ,gtk+)
-       ("hime" ,hime)
-       ("hunspell" ,hunspell)
-       ("jemalloc" ,jemalloc)
-       ("kwayland" ,kwayland)
-       ("lib-base-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_base.git")
-             (commit "a23c05c44e4f01dc4428f4d75d4db98c59d313a6")))
-           (file-name
-            (git-file-name "lib-base-for-telegram-desktop" version))
-           (sha256
-            (base32 "0vh5zgxwalmbnvz8lzlnba87ch8vnpmcz6nvf56w09f3nlxvvq78"))))
-       ("lib-crl-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_crl.git")
-             (commit "3ccf2ed5095442e5874bba8852cb7dc4efeae29f")))
-           (file-name
-            (git-file-name "lib-crl-for-telegram-desktop" version))
-           (sha256
-            (base32 "11my7q54m4lvvlgma6pbdyjxi1cv1adk1gph2j50mh18sqlm8myz"))))
-       ("lib-lottie-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_lottie.git")
-             (commit "0770df009db7928df1d0cad0900dc5110106d229")))
-           (file-name
-            (git-file-name "lib-lottie-for-telegram-desktop" version))
-           (sha256
-            (base32 "1gj56ymlbk5dnk82jw674808m511lv9dky8891a5wm4gp3pph5jb"))))
-       ("lib-qr-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_qr.git")
-             (commit "2b08c71c6edcfc3e31f7d7f518cc963493b6e189")))
-           (file-name
-            (git-file-name "lib-qr-for-telegram-desktop" version))
-           (sha256
-            (base32 "05hrkmwgrczyjv87r507i2r7m1zr6k2i43mq3my0s6j4szr1rjq0"))))
-       ("lib-rlottie-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_rlottie.git")
-             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
-           (file-name
-            (git-file-name "lib-rlottie-for-telegram-desktop" version))
-           (sha256
-            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
-       ("lib-rpl-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_rpl.git")
-             (commit "df721be3fa14a27dfc230d2e3c42bb1a7c9d0617")))
-           (file-name
-            (git-file-name "lib-rpl-for-telegram-desktop" version))
-           (sha256
-            (base32 "15fnv3ssn7rn5d0j52gggdvyqc2wm464678dj7v2x9h8lka2jjxn"))))
-       ("lib-spellcheck-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_spellcheck.git")
-             (commit "68c9b788958904aea7de79f986a0f82ec8c5b094")))
-           (file-name
-            (git-file-name "lib-spellcheck-for-telegram-desktop" version))
-           (sha256
-            (base32 "0d8s4wwk6fxf536mhzq2vb9qw3j0m8nqia7ylvvpsbc4kh09dadn"))))
-       ("lib-storage-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_storage.git")
-             (commit "403df6c4a29562bd417c92d410e49819f5a48cc1")))
-           (file-name
-            (git-file-name "lib-storage-for-telegram-desktop" version))
-           (sha256
-            (base32 "1zxvzfrxbj4d395fzyb5pm9wn3n8jyimxx88cyqjcdd46sx4h7r5"))))
-       ("lib-tl-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_tl.git")
-             (commit "45faed44e7f4d11fec79b7a70e4a35dc91ef3fdb")))
-           (file-name
-            (git-file-name "lib-tl-for-telegram-desktop" version))
-           (sha256
-            (base32 "0h43xvzklda02494d466jp52hl8c1kmav9f12dyld10dpf1w6c7m"))))
-       ("lib-ui-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_ui.git")
-             (commit "1b590f9e16eb9571a039f072d6fea66c607e419f")))
-           (file-name
-            (git-file-name "lib-ui-for-telegram-desktop" version))
-           (sha256
-            (base32 "0ighyhfp29h9h8c7vr70pnhcv2xnsr9ln084pssn8hb5z4pmb62f"))))
-       ("lib-waylandshells-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_waylandshells.git")
-             (commit "59b0ee55a68976d27f1bf7cec0e11d5939e185e7")))
-           (file-name
-            (git-file-name "lib-waylandshells-for-telegram-desktop" version))
-           (sha256
-            (base32 "0l2xrpc5mvvdlsj333pmkgfvn9wi1ijfdaaz8skfnw9icw52faaf"))))
-       ("lib-webrtc-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_webrtc.git")
-             (commit "ef49f953f12b112008a094a719f40939aaf39db4")))
-           (file-name
-            (git-file-name "lib-webrtc-for-telegram-desktop" version))
-           (sha256
-            (base32 "15k4xs3462p3ddp5cn9im3nvdiaijmxir8wxsf5yrj70ghy26ibw"))))
-       ("lib-webview-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_webview.git")
-             (commit "e06427c624515485774e2e2181d4afeb05ad5a67")))
-           (file-name
-            (git-file-name "lib-webview-for-telegram-desktop" version))
-           (sha256
-            (base32 "148z7xzfscynwwwqssdsd97npax6yn8zrd64xw8qzbwff2g2r7k4"))))
-       ("libdbusmenu-qt" ,libdbusmenu-qt)
-       ("libjpeg" ,libjpeg-turbo)
-       ("libtgvoip" ,libtgvoip-for-telegram-desktop)
-       ("lz4" ,lz4)
-       ("materialdecoration" ,materialdecoration)
-       ("minizip" ,minizip)
-       ("nimf" ,nimf)
-       ("openal" ,openal)
-       ("openssl" ,openssl)
-       ("opus" ,opus)
-       ("pulseaudio" ,pulseaudio)
-       ("qrcodegen" ,qrcodegen-cpp)
-       ("qt" ,qtbase-5)
-       ("qtsvg-5" ,qtsvg-5)
-       ("qt5ct" ,qt5ct)
-       ("qtimageformats" ,qtimageformats)
-       ("qtwayland" ,qtwayland)
-       ("range-v3" ,range-v3)
-       ("rlottie" ,rlottie-for-telegram-desktop)
-       ("rnnoise" ,rnnoise)
-       ("tgcalls-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/TelegramMessenger/tgcalls.git")
-             (commit "81e97fa52e25b7775b62ce07bb653533d81e91b3")))
-           (file-name
-            (git-file-name "tgcalls-for-telegram-desktop" version))
-           (sha256
-            (base32 "0fvad87hyxli83xn19mgf8jjrrh6y6iaig14pckpbkg33vf4wqkj"))))
-       ("webrtc" ,webrtc-for-telegram-desktop)
-       ("x11" ,libx11)
-       ("xcb" ,libxcb)
-       ("xcb-keysyms" ,xcb-util-keysyms)
-       ("xxhash" ,xxhash)
-       ("zlib" ,zlib)))
-    (propagated-inputs
-     (list dconf))
+     (modify-inputs
+         `(("codegen-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/codegen.git")
+                 (commit "248614b49cd7d5aff69d75a737f2e35b79fbb119")))
+               (file-name
+                (git-file-name "codegen" version))
+               (sha256
+                (base32 "00f7g2z6xmkbkrmi3q27hscjl44mg66wf9q0mz3rhy3jaa6cfdrk"))))
+           ("lib-base-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/lib_base.git")
+                 (commit "a23c05c44e4f01dc4428f4d75d4db98c59d313a6")))
+               (file-name
+                (git-file-name "lib-base-for-telegram-desktop" version))
+               (sha256
+                (base32 "0vh5zgxwalmbnvz8lzlnba87ch8vnpmcz6nvf56w09f3nlxvvq78"))))
+           ("lib-crl-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/lib_crl.git")
+                 (commit "3ccf2ed5095442e5874bba8852cb7dc4efeae29f")))
+               (file-name
+                (git-file-name "lib-crl-for-telegram-desktop" version))
+               (sha256
+                (base32 "11my7q54m4lvvlgma6pbdyjxi1cv1adk1gph2j50mh18sqlm8myz"))))
+           ("lib-lottie-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/lib_lottie.git")
+                 (commit "0770df009db7928df1d0cad0900dc5110106d229")))
+               (file-name
+                (git-file-name "lib-lottie-for-telegram-desktop" version))
+               (sha256
+                (base32 "1gj56ymlbk5dnk82jw674808m511lv9dky8891a5wm4gp3pph5jb"))))
+           ("lib-qr-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/lib_qr.git")
+                 (commit "2b08c71c6edcfc3e31f7d7f518cc963493b6e189")))
+               (file-name
+                (git-file-name "lib-qr-for-telegram-desktop" version))
+               (sha256
+                (base32 "05hrkmwgrczyjv87r507i2r7m1zr6k2i43mq3my0s6j4szr1rjq0"))))
+           ("lib-rlottie-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/lib_rlottie.git")
+                 (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
+               (file-name
+                (git-file-name "lib-rlottie-for-telegram-desktop" version))
+               (sha256
+                (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
+           ("lib-rpl-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/lib_rpl.git")
+                 (commit "df721be3fa14a27dfc230d2e3c42bb1a7c9d0617")))
+               (file-name
+                (git-file-name "lib-rpl-for-telegram-desktop" version))
+               (sha256
+                (base32 "15fnv3ssn7rn5d0j52gggdvyqc2wm464678dj7v2x9h8lka2jjxn"))))
+           ("lib-spellcheck-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/lib_spellcheck.git")
+                 (commit "68c9b788958904aea7de79f986a0f82ec8c5b094")))
+               (file-name
+                (git-file-name "lib-spellcheck-for-telegram-desktop" version))
+               (sha256
+                (base32 "0d8s4wwk6fxf536mhzq2vb9qw3j0m8nqia7ylvvpsbc4kh09dadn"))))
+           ("lib-storage-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/lib_storage.git")
+                 (commit "403df6c4a29562bd417c92d410e49819f5a48cc1")))
+               (file-name
+                (git-file-name "lib-storage-for-telegram-desktop" version))
+               (sha256
+                (base32 "1zxvzfrxbj4d395fzyb5pm9wn3n8jyimxx88cyqjcdd46sx4h7r5"))))
+           ("lib-tl-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/lib_tl.git")
+                 (commit "45faed44e7f4d11fec79b7a70e4a35dc91ef3fdb")))
+               (file-name
+                (git-file-name "lib-tl-for-telegram-desktop" version))
+               (sha256
+                (base32 "0h43xvzklda02494d466jp52hl8c1kmav9f12dyld10dpf1w6c7m"))))
+           ("lib-ui-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/lib_ui.git")
+                 (commit "1b590f9e16eb9571a039f072d6fea66c607e419f")))
+               (file-name
+                (git-file-name "lib-ui-for-telegram-desktop" version))
+               (sha256
+                (base32 "0ighyhfp29h9h8c7vr70pnhcv2xnsr9ln084pssn8hb5z4pmb62f"))))
+           ("lib-waylandshells-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/lib_waylandshells.git")
+                 (commit "59b0ee55a68976d27f1bf7cec0e11d5939e185e7")))
+               (file-name
+                (git-file-name "lib-waylandshells-for-telegram-desktop" version))
+               (sha256
+                (base32 "0l2xrpc5mvvdlsj333pmkgfvn9wi1ijfdaaz8skfnw9icw52faaf"))))
+           ("lib-webrtc-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/lib_webrtc.git")
+                 (commit "ef49f953f12b112008a094a719f40939aaf39db4")))
+               (file-name
+                (git-file-name "lib-webrtc-for-telegram-desktop" version))
+               (sha256
+                (base32 "15k4xs3462p3ddp5cn9im3nvdiaijmxir8wxsf5yrj70ghy26ibw"))))
+           ("lib-webview-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/desktop-app/lib_webview.git")
+                 (commit "e06427c624515485774e2e2181d4afeb05ad5a67")))
+               (file-name
+                (git-file-name "lib-webview-for-telegram-desktop" version))
+               (sha256
+                (base32 "148z7xzfscynwwwqssdsd97npax6yn8zrd64xw8qzbwff2g2r7k4"))))
+           ("tgcalls-source"
+            ,(origin
+               (method git-fetch)
+               (uri
+                (git-reference
+                 (url "https://github.com/TelegramMessenger/tgcalls.git")
+                 (commit "81e97fa52e25b7775b62ce07bb653533d81e91b3")))
+               (file-name
+                (git-file-name "tgcalls-for-telegram-desktop" version))
+               (sha256
+                (base32 "0fvad87hyxli83xn19mgf8jjrrh6y6iaig14pckpbkg33vf4wqkj")))))
+       (append alsa-lib
+               c++-gsl
+               catch2
+               libexpected
+               fcitx-qt5
+               fcitx5-qt
+               ffmpeg
+               glib
+               glibmm-2.64
+               gtk+
+               hime
+               hunspell
+               jemalloc
+               kwayland
+               libdbusmenu-qt
+               libjpeg-turbo
+               libtgvoip-for-telegram-desktop
+               lz4
+               materialdecoration
+               minizip
+               nimf
+               openal
+               openssl
+               opus
+               pulseaudio
+               qrcodegen-cpp
+               qtbase-5
+               qtsvg-5
+               qt5ct
+               qtimageformats
+               qtwayland
+               range-v3
+               rlottie-for-telegram-desktop
+               rnnoise
+               webrtc-for-telegram-desktop
+               libx11
+               libxcb
+               xcb-util-keysyms
+               xxhash
+               zlib)))
+    (propagated-inputs (list dconf))
     (synopsis "Telegram Desktop")
     (description "Telegram desktop is the official desktop version of the
 Telegram instant messenger.")
--
2.37.3
H
H
Hilton Chain wrote on 19 Sep 08:11 +0200
[PATCH v4 03/10] gnu: telegram-desktop: Change API ID.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76a66vrizk.wl-hako@ultrarare.space
[#:configure-flags]: Use API ID from Telegram's official Snap builds.
---
gnu/packages/telegram.scm | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

Toggle diff (20 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index cd25897634..cfa0d1c673 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -308,12 +308,10 @@ (define-public telegram-desktop
         (ice-9 match))
        #:configure-flags
        (list
-        ;; Client applications must provide their own API-ID and API-HASH,
+        ;; https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml
         ;; see also <https://core.telegram.org/api/obtaining_api_id>.
-        ;; In case, that the credentials below fail to work, contact
-        ;;   Raghav Gururajan <rg@raghavgururajan.name>
-        "-DTDESKTOP_API_ID=2791056"
-        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
+        "-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.
--
2.37.3
H
H
Hilton Chain wrote on 19 Sep 08:12 +0200
[PATCH v4 04/10] gnu: webrtc-for-telegram-desktop: Use gexp.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y768rmfriyl.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (source-for-telegram-desktop,
libvpx-for-telegram-desktop,libyuv-for-telegram-desktop): New variables.
(webrtc-for-telegram-desktop)[#:phases]: Copy sources with gexp.
[inputs]: Remove sources in flavor of variables.
---
gnu/packages/telegram.scm | 116 ++++++++++++++++++--------------------
1 file changed, 56 insertions(+), 60 deletions(-)

Toggle diff (143 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index cfa0d1c673..e6766d84eb 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -62,6 +62,7 @@ (define-module (gnu packages telegram)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system copy)
@@ -71,6 +72,33 @@ (define-module (gnu packages telegram)
   #:use-module (guix build-system python)
   #:use-module (guix build-system qt))

+(define* (source-for-telegram-desktop #:key name url revision commit hash)
+  (let ((name (string-append name "-for-telegram-desktop"))
+        (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url url)
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256 (base32 hash)))))
+
+(define libvpx-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://chromium.googlesource.com/webm/libvpx"
+   #:revision "0"
+   #:commit "5b63f0f821e94f8072eb483014cfc33b05978bb9"
+   #:hash "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"
+   #:name "libvpx"))
+
+(define libyuv-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://chromium.googlesource.com/libyuv/libyuv"
+   #:revision "0"
+   #:commit "ad890067f661dc747a975bc55ba3767fe30d4452"
+   #:hash "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"
+   #:name "libyuv"))
+
 (define-public webrtc-for-telegram-desktop
   (let ((commit "91d836dc84a16584c6ac52b36c04c0de504d9c34")
         (revision "166"))
@@ -109,68 +137,36 @@ (define-public webrtc-for-telegram-desktop
                                              (cons* "." ".." keep)))))))))
        (build-system cmake-build-system)
        (arguments
-        `(#:tests? #f                   ; No target
-          #:configure-flags
-          (list
-           "-DCMAKE_C_FLAGS=-fPIC"
-           "-DCMAKE_CXX_FLAGS=-fPIC")
-          #:phases
-          (modify-phases %standard-phases
-            (add-after 'unpack 'copy-inputs
-              (lambda* (#:key inputs outputs #:allow-other-keys)
-                (let* ((libvpx-from (assoc-ref inputs "libvpx"))
-                       (libyuv-from (assoc-ref inputs "libyuv"))
-                       (libvpx-to (string-append (getcwd)
-                                                 "/src/third_party/libvpx/source/libvpx"))
-                       (libyuv-to (string-append (getcwd)
-                                                 "/src/third_party/libyuv")))
-                  (copy-recursively libvpx-from libvpx-to)
-                  (copy-recursively libyuv-from libyuv-to)))))))
+        (list #:tests? #f               ; No target
+              #:configure-flags
+              #~`("-DCMAKE_C_FLAGS=-fPIC"
+                  "-DCMAKE_CXX_FLAGS=-fPIC")
+              #:phases
+              #~(modify-phases %standard-phases
+                  (add-after 'unpack 'copy-sources
+                    (lambda _
+                      (let* ((libvpx-to (string-append (getcwd) "/src/third_party/libvpx/source/libvpx"))
+                             (libyuv-to (string-append (getcwd) "/src/third_party/libyuv")))
+                        (copy-recursively #$libvpx-for-telegram-desktop libvpx-to)
+                        (copy-recursively #$libyuv-for-telegram-desktop libyuv-to)))))))
        (native-inputs (list perl pkg-config python-wrapper yasm))
        (inputs
-        (modify-inputs
-            `(("libvpx"
-               ,(origin
-                  (method git-fetch)
-                  (uri
-                   (git-reference
-                    (url "https://chromium.googlesource.com/webm/libvpx")
-                    (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
-                  (file-name
-                   (git-file-name
-                    "libvpx-for-webrtc-for-telegram-desktop" version))
-                  (sha256
-                   (base32
-                    "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
-              ("libyuv"
-               ,(origin
-                  (method git-fetch)
-                  (uri
-                   (git-reference
-                    (url "https://chromium.googlesource.com/libyuv/libyuv")
-                    (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
-                  (file-name
-                   (git-file-name
-                    "libyuv-for-webrtc-for-telegram-desktop" version))
-                  (sha256
-                   (base32
-                    "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll")))))
-          (append alsa-lib
-                  ffmpeg
-                  libjpeg-turbo
-                  glib
-                  libxcomposite
-                  libxdamage
-                  libxrender
-                  libxrandr
-                  openssl
-                  opus
-                  pipewire
-                  protobuf
-                  pulseaudio
-                  libx11
-                  libxext
-                  libxtst)))
+        (list alsa-lib
+              ffmpeg
+              libjpeg-turbo
+              glib
+              libxcomposite
+              libxdamage
+              libxrender
+              libxrandr
+              openssl
+              opus
+              pipewire
+              protobuf
+              pulseaudio
+              libx11
+              libxext
+              libxtst))
        (synopsis "WebRTC support for Telegram Desktop")
        (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by
 Telegram project, for its use in telegram desktop client.")
--
2.37.3
H
H
Hilton Chain wrote on 19 Sep 08:12 +0200
[PATCH v4 05/10] gnu: telegram-desktop: Use gexp.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y767d1zrixz.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (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-rlottie-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-waylandshells-for-telegram-desktop,
lib-webrtc-for-telegram-desktop,lib-webview-for-telegram-desktop,
tgcalls-for-telegram-desktop): New variables.
(telegram-desktop)[#:phases]: Copy sources with gexp.
[native-inputs,inputs]: Remove sources in flavor of variables.
---
gnu/packages/telegram.scm | 515 +++++++++++++++++---------------------
1 file changed, 229 insertions(+), 286 deletions(-)

Toggle diff (535 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index e6766d84eb..f56cbaf23a 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -99,6 +99,134 @@ (define libyuv-for-telegram-desktop
    #:hash "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"
    #:name "libyuv"))

+(define cmake-helpers-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/cmake_helpers.git"
+   #:revision "0"
+   #:commit "4d44d822e01b3b5fbec3ce824e01f56aa35d7f72"
+   #:hash "0h6cjiqy014h2mz90h1z5a7plb3ihbnds4bja8994ybr1dy3m7m5"
+   #:name "cmake-helpers"))
+
+(define codegen-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/codegen.git"
+   #:revision "0"
+   #:commit "248614b49cd7d5aff69d75a737f2e35b79fbb119"
+   #:hash "00f7g2z6xmkbkrmi3q27hscjl44mg66wf9q0mz3rhy3jaa6cfdrk"
+   #:name "codegen"))
+
+(define lib-base-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/lib_base.git"
+   #:revision "0"
+   #:commit "a23c05c44e4f01dc4428f4d75d4db98c59d313a6"
+   #:hash "0vh5zgxwalmbnvz8lzlnba87ch8vnpmcz6nvf56w09f3nlxvvq78"
+   #:name "lib-base"))
+
+(define lib-crl-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/lib_crl.git"
+   #:revision "0"
+   #:commit "3ccf2ed5095442e5874bba8852cb7dc4efeae29f"
+   #:hash "11my7q54m4lvvlgma6pbdyjxi1cv1adk1gph2j50mh18sqlm8myz"
+   #:name "lib-crl"))
+
+(define lib-lottie-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/lib_lottie.git"
+   #:revision "0"
+   #:commit "0770df009db7928df1d0cad0900dc5110106d229"
+   #:hash "1gj56ymlbk5dnk82jw674808m511lv9dky8891a5wm4gp3pph5jb"
+   #:name "lib-lottie"))
+
+(define lib-qr-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/lib_qr.git"
+   #:revision "0"
+   #:commit "2b08c71c6edcfc3e31f7d7f518cc963493b6e189"
+   #:hash "05hrkmwgrczyjv87r507i2r7m1zr6k2i43mq3my0s6j4szr1rjq0"
+   #:name "lib-qr"))
+
+(define lib-rlottie-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/lib_rlottie.git"
+   #:revision "0"
+   #:commit "0671bf70547381effcf442ec9618e04502a8adbc"
+   #:hash "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"
+   #:name "lib-rlottie"))
+
+(define lib-rpl-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/lib_rpl.git"
+   #:revision "0"
+   #:commit "df721be3fa14a27dfc230d2e3c42bb1a7c9d0617"
+   #:hash "15fnv3ssn7rn5d0j52gggdvyqc2wm464678dj7v2x9h8lka2jjxn"
+   #:name "lib-rpl"))
+
+(define lib-spellcheck-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/lib_spellcheck.git"
+   #:revision "0"
+   #:commit "68c9b788958904aea7de79f986a0f82ec8c5b094"
+   #:hash "0d8s4wwk6fxf536mhzq2vb9qw3j0m8nqia7ylvvpsbc4kh09dadn"
+   #:name "lib-spellcheck"))
+
+(define lib-storage-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/lib_storage.git"
+   #:revision "0"
+   #:commit "403df6c4a29562bd417c92d410e49819f5a48cc1"
+   #:hash "1zxvzfrxbj4d395fzyb5pm9wn3n8jyimxx88cyqjcdd46sx4h7r5"
+   #:name "lib-storage"))
+
+(define lib-tl-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/lib_tl.git"
+   #:revision "0"
+   #:commit "45faed44e7f4d11fec79b7a70e4a35dc91ef3fdb"
+   #:hash "0h43xvzklda02494d466jp52hl8c1kmav9f12dyld10dpf1w6c7m"
+   #:name "lib-tl"))
+
+(define lib-ui-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/lib_ui.git"
+   #:revision "0"
+   #:commit "1b590f9e16eb9571a039f072d6fea66c607e419f"
+   #:hash "0ighyhfp29h9h8c7vr70pnhcv2xnsr9ln084pssn8hb5z4pmb62f"
+   #:name "lib-ui"))
+
+(define lib-waylandshells-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/lib_waylandshells.git"
+   #:revision "0"
+   #:commit "59b0ee55a68976d27f1bf7cec0e11d5939e185e7"
+   #:hash "0l2xrpc5mvvdlsj333pmkgfvn9wi1ijfdaaz8skfnw9icw52faaf"
+   #:name "lib-waylandshells"))
+
+(define lib-webrtc-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/lib_webrtc.git"
+   #:revision "0"
+   #:commit "ef49f953f12b112008a094a719f40939aaf39db4"
+   #:hash "15k4xs3462p3ddp5cn9im3nvdiaijmxir8wxsf5yrj70ghy26ibw"
+   #:name "lib-webrtc"))
+
+(define lib-webview-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/desktop-app/lib_webview.git"
+   #:revision "0"
+   #:commit "e06427c624515485774e2e2181d4afeb05ad5a67"
+   #:hash "148z7xzfscynwwwqssdsd97npax6yn8zrd64xw8qzbwff2g2r7k4"
+   #:name "lib-webview"))
+
+(define tgcalls-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/TelegramMessenger/tgcalls.git"
+   #:revision "0"
+   #:commit "81e97fa52e25b7775b62ce07bb653533d81e91b3"
+   #:hash "0fvad87hyxli83xn19mgf8jjrrh6y6iaig14pckpbkg33vf4wqkj"
+   #:name "tgcalls"))
+
 (define-public webrtc-for-telegram-desktop
   (let ((commit "91d836dc84a16584c6ac52b36c04c0de504d9c34")
         (revision "166"))
@@ -292,294 +420,109 @@ (define-public telegram-desktop
                                           (cons* "." ".." keep)))))))))
     (build-system qt-build-system)
     (arguments
-     `(#:tests? #f                      ; No target
-       #:imported-modules
-       (,@%qt-build-system-modules
-        (guix build glib-or-gtk-build-system))
-       #:modules
-       ((guix build qt-build-system)
-        ((guix build glib-or-gtk-build-system)
-         #:prefix glib-or-gtk:)
-        (guix build utils)
-        (ice-9 match))
-       #:configure-flags
-       (list
-        ;; https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml
-        ;; see also <https://core.telegram.org/api/obtaining_api_id>.
-        "-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")
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'make-writable
-           (lambda _
-             (for-each make-file-writable (find-files "."))))
-         (add-after 'make-writable 'copy-inputs
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (for-each
-              (match-lambda
-                ((dst src)
-                 (copy-recursively src dst)
-                 (for-each make-file-writable (find-files dst))))
-              `(("cmake" ,(assoc-ref inputs "cmake-helpers"))
-                ("Telegram/codegen" ,(assoc-ref inputs "codegen-source"))
-                ("Telegram/lib_base" ,(assoc-ref inputs "lib-base-source"))
-                ("Telegram/lib_crl" ,(assoc-ref inputs "lib-crl-source"))
-                ("Telegram/lib_lottie"
-                 ,(assoc-ref inputs "lib-lottie-source"))
-                ("Telegram/lib_qr" ,(assoc-ref inputs "lib-qr-source"))
-                ("Telegram/lib_rlottie"
-                 ,(assoc-ref inputs "lib-rlottie-source"))
-                ("Telegram/lib_rpl" ,(assoc-ref inputs "lib-rpl-source"))
-                ("Telegram/lib_spellcheck"
-                 ,(assoc-ref inputs "lib-spellcheck-source"))
-                ("Telegram/lib_storage"
-                 ,(assoc-ref inputs "lib-storage-source"))
-                ("Telegram/lib_tl" ,(assoc-ref inputs "lib-tl-source"))
-                ("Telegram/lib_ui" ,(assoc-ref inputs "lib-ui-source"))
-                ("Telegram/lib_waylandshells" ,(assoc-ref inputs "lib-waylandshells-source"))
-                ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source"))
-                ("Telegram/lib_webview" ,(assoc-ref inputs "lib-webview-source"))
-                ("Telegram/ThirdParty/tgcalls" ,(assoc-ref inputs "tgcalls-source"))))))
-         (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)))))
+     (list #:tests? #f                      ; No target
+           #:imported-modules
+           `(,@%qt-build-system-modules
+             (guix build glib-or-gtk-build-system))
+           #:modules
+           '((guix build qt-build-system)
+             ((guix build glib-or-gtk-build-system)
+              #:prefix glib-or-gtk:)
+             (guix build utils)
+             (ice-9 match))
+           #:configure-flags
+           #~`(;; https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml
+               ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+               "-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")
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'make-writable
+                 (lambda _
+                   (for-each make-file-writable (find-files "."))))
+               (add-after 'make-writable 'copy-sources
+                 (lambda* (#:key inputs outputs #:allow-other-keys)
+                   (for-each
+                    (match-lambda
+                      ((dst src)
+                       (copy-recursively src dst)
+                       (for-each make-file-writable (find-files dst))))
+                    '(("cmake" #$cmake-helpers-for-telegram-desktop)
+                      ("Telegram/codegen" #$codegen-for-telegram-desktop)
+                      ("Telegram/lib_base" #$lib-base-for-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/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
-     (modify-inputs
-         `(("cmake-helpers"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/cmake_helpers.git")
-                 (commit "4d44d822e01b3b5fbec3ce824e01f56aa35d7f72")))
-               (file-name
-                (git-file-name
-                 "cmake-helpers-for-telegram-desktop" version))
-               (sha256
-                (base32
-                 "0h6cjiqy014h2mz90h1z5a7plb3ihbnds4bja8994ybr1dy3m7m5")))))
-       (append cmake-shared
-               extra-cmake-modules
-               `(,glib "bin")
-               `(,gtk+ "bin")
-               pkg-config
-               python-wrapper
-               qttools-5)))
+     (list cmake-shared
+           extra-cmake-modules
+           `(,glib "bin")
+           `(,gtk+ "bin")
+           pkg-config
+           python-wrapper
+           qttools-5))
     (inputs
-     (modify-inputs
-         `(("codegen-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/codegen.git")
-                 (commit "248614b49cd7d5aff69d75a737f2e35b79fbb119")))
-               (file-name
-                (git-file-name "codegen" version))
-               (sha256
-                (base32 "00f7g2z6xmkbkrmi3q27hscjl44mg66wf9q0mz3rhy3jaa6cfdrk"))))
-           ("lib-base-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/lib_base.git")
-                 (commit "a23c05c44e4f01dc4428f4d75d4db98c59d313a6")))
-               (file-name
-                (git-file-name "lib-base-for-telegram-desktop" version))
-               (sha256
-                (base32 "0vh5zgxwalmbnvz8lzlnba87ch8vnpmcz6nvf56w09f3nlxvvq78"))))
-           ("lib-crl-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/lib_crl.git")
-                 (commit "3ccf2ed5095442e5874bba8852cb7dc4efeae29f")))
-               (file-name
-                (git-file-name "lib-crl-for-telegram-desktop" version))
-               (sha256
-                (base32 "11my7q54m4lvvlgma6pbdyjxi1cv1adk1gph2j50mh18sqlm8myz"))))
-           ("lib-lottie-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/lib_lottie.git")
-                 (commit "0770df009db7928df1d0cad0900dc5110106d229")))
-               (file-name
-                (git-file-name "lib-lottie-for-telegram-desktop" version))
-               (sha256
-                (base32 "1gj56ymlbk5dnk82jw674808m511lv9dky8891a5wm4gp3pph5jb"))))
-           ("lib-qr-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/lib_qr.git")
-                 (commit "2b08c71c6edcfc3e31f7d7f518cc963493b6e189")))
-               (file-name
-                (git-file-name "lib-qr-for-telegram-desktop" version))
-               (sha256
-                (base32 "05hrkmwgrczyjv87r507i2r7m1zr6k2i43mq3my0s6j4szr1rjq0"))))
-           ("lib-rlottie-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/lib_rlottie.git")
-                 (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
-               (file-name
-                (git-file-name "lib-rlottie-for-telegram-desktop" version))
-               (sha256
-                (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
-           ("lib-rpl-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/lib_rpl.git")
-                 (commit "df721be3fa14a27dfc230d2e3c42bb1a7c9d0617")))
-               (file-name
-                (git-file-name "lib-rpl-for-telegram-desktop" version))
-               (sha256
-                (base32 "15fnv3ssn7rn5d0j52gggdvyqc2wm464678dj7v2x9h8lka2jjxn"))))
-           ("lib-spellcheck-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/lib_spellcheck.git")
-                 (commit "68c9b788958904aea7de79f986a0f82ec8c5b094")))
-               (file-name
-                (git-file-name "lib-spellcheck-for-telegram-desktop" version))
-               (sha256
-                (base32 "0d8s4wwk6fxf536mhzq2vb9qw3j0m8nqia7ylvvpsbc4kh09dadn"))))
-           ("lib-storage-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/lib_storage.git")
-                 (commit "403df6c4a29562bd417c92d410e49819f5a48cc1")))
-               (file-name
-                (git-file-name "lib-storage-for-telegram-desktop" version))
-               (sha256
-                (base32 "1zxvzfrxbj4d395fzyb5pm9wn3n8jyimxx88cyqjcdd46sx4h7r5"))))
-           ("lib-tl-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/lib_tl.git")
-                 (commit "45faed44e7f4d11fec79b7a70e4a35dc91ef3fdb")))
-               (file-name
-                (git-file-name "lib-tl-for-telegram-desktop" version))
-               (sha256
-                (base32 "0h43xvzklda02494d466jp52hl8c1kmav9f12dyld10dpf1w6c7m"))))
-           ("lib-ui-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/lib_ui.git")
-                 (commit "1b590f9e16eb9571a039f072d6fea66c607e419f")))
-               (file-name
-                (git-file-name "lib-ui-for-telegram-desktop" version))
-               (sha256
-                (base32 "0ighyhfp29h9h8c7vr70pnhcv2xnsr9ln084pssn8hb5z4pmb62f"))))
-           ("lib-waylandshells-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/lib_waylandshells.git")
-                 (commit "59b0ee55a68976d27f1bf7cec0e11d5939e185e7")))
-               (file-name
-                (git-file-name "lib-waylandshells-for-telegram-desktop" version))
-               (sha256
-                (base32 "0l2xrpc5mvvdlsj333pmkgfvn9wi1ijfdaaz8skfnw9icw52faaf"))))
-           ("lib-webrtc-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/lib_webrtc.git")
-                 (commit "ef49f953f12b112008a094a719f40939aaf39db4")))
-               (file-name
-                (git-file-name "lib-webrtc-for-telegram-desktop" version))
-               (sha256
-                (base32 "15k4xs3462p3ddp5cn9im3nvdiaijmxir8wxsf5yrj70ghy26ibw"))))
-           ("lib-webview-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/desktop-app/lib_webview.git")
-                 (commit "e06427c624515485774e2e2181d4afeb05ad5a67")))
-               (file-name
-                (git-file-name "lib-webview-for-telegram-desktop" version))
-               (sha256
-                (base32 "148z7xzfscynwwwqssdsd97npax6yn8zrd64xw8qzbwff2g2r7k4"))))
-           ("tgcalls-source"
-            ,(origin
-               (method git-fetch)
-               (uri
-                (git-reference
-                 (url "https://github.com/TelegramMessenger/tgcalls.git")
-                 (commit "81e97fa52e25b7775b62ce07bb653533d81e91b3")))
-               (file-name
-                (git-file-name "tgcalls-for-telegram-desktop" version))
-               (sha256
-                (base32 "0fvad87hyxli83xn19mgf8jjrrh6y6iaig14pckpbkg33vf4wqkj")))))
-       (append alsa-lib
-               c++-gsl
-               catch2
-               libexpected
-               fcitx-qt5
-               fcitx5-qt
-               ffmpeg
-               glib
-               glibmm-2.64
-               gtk+
-               hime
-               hunspell
-               jemalloc
-               kwayland
-               libdbusmenu-qt
-               libjpeg-turbo
-               libtgvoip-for-telegram-desktop
-               lz4
-               materialdecoration
-               minizip
-               nimf
-               openal
-               openssl
-               opus
-               pulseaudio
-               qrcodegen-cpp
-               qtbase-5
-               qtsvg-5
-               qt5ct
-               qtimageformats
-               qtwayland
-               range-v3
-               rlottie-for-telegram-desktop
-               rnnoise
-               webrtc-for-telegram-desktop
-               libx11
-               libxcb
-               xcb-util-keysyms
-               xxhash
-               zlib)))
+     (list alsa-lib
+           c++-gsl
+           catch2
+           libexpected
+           fcitx-qt5
+           fcitx5-qt
+           ffmpeg
+           glib
+           glibmm-2.64
+           gtk+
+           hime
+           hunspell
+           jemalloc
+           kwayland
+           libdbusmenu-qt
+           libjpeg-turbo
+           libtgvoip-for-telegram-desktop
+           lz4
+           materialdecoration
+           minizip
+           nimf
+           openal
+           openssl
+           opus
+           pulseaudio
+           qrcodegen-cpp
+           qtbase-5
+           qtsvg-5
+           qt5ct
+           qtimageformats
+           qtwayland
+           range-v3
+           rlottie-for-telegram-desktop
+           rnnoise
+           webrtc-for-telegram-desktop
+           libx11
+           libxcb
+           xcb-util-keysyms
+           xxhash
+           zlib))
     (propagated-inputs (list dconf))
     (synopsis "Telegram Desktop")
     (description "Telegram desktop is the official desktop version of the
--
2.37.3
H
H
Hilton Chain wrote on 19 Sep 08:13 +0200
[PATCH v4 06/10] gnu: Add abseil-cpp-cxxstd17.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y765yhjrixf.wl-hako@ultrarare.space
* gnu/packages/cpp.scm (abseil-cpp-cxxstd17): New variable.
---
gnu/packages/cpp.scm | 9 +++++++++
1 file changed, 9 insertions(+)

Toggle diff (20 lines)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index d03e0bc7e1..5e0646444c 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -1041,6 +1041,15 @@ (define-public abseil-cpp
           `(cons* "-DBUILD_TESTING=ON"
                   (delete "-DABSL_RUN_TESTS=ON" ,flags))))))))

+(define-public abseil-cpp-cxxstd17
+  (let ((base abseil-cpp))
+    (hidden-package
+     (package/inherit base
+       (arguments
+        (substitute-keyword-arguments (package-arguments base)
+          ((#:configure-flags flags)
+           #~(cons* "-DCMAKE_CXX_STANDARD=17" #$flags))))))))
+
 (define-public pegtl
   (package
     (name "pegtl")
--
2.37.3
H
H
Hilton Chain wrote on 19 Sep 08:13 +0200
[PATCH v4 07/10] gnu: extra-cmake-modules: Update to 5.98.0.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y764jx3riww.wl-hako@ultrarare.space
* gnu/packages/kde-frameworks.scm (extra-cmake-modules): Update to 5.98.0.
---
gnu/packages/kde-frameworks.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (22 lines)
diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index 738013fdba..52314fd0ff 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -88,7 +88,7 @@ (define-module (gnu packages kde-frameworks)
 (define-public extra-cmake-modules
   (package
     (name "extra-cmake-modules")
-    (version "5.91.0")
+    (version "5.98.0")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -97,7 +97,7 @@ (define-public extra-cmake-modules
                     name "-" version ".tar.xz"))
               (sha256
                (base32
-                "0k65rvxh926ya6qahzk2ns7g1fya1429648mlx7iipxa61g8h5wp"))))
+                "0669m98vqy4hpacfjs7xpgjj1bns24kjybrjipxzp82092g8y69w"))))
     (build-system cmake-build-system)
     (native-inputs
      ;; Add test dependency, except on armhf where building it is too
--
2.37.3
H
H
Hilton Chain wrote on 19 Sep 08:13 +0200
[PATCH v4 08/10] gnu: kcoreaddons: Update to 5.98.0.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y7635cnriwe.wl-hako@ultrarare.space
* gnu/packages/kde-frameworks.scm (kcoreaddons): Update to 5.98.0.
[#:phases]: Update blocklist for failing tests.
Remove unneeded #t.
---
gnu/packages/kde-frameworks.scm | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)

Toggle diff (47 lines)
diff --git a/gnu/packages/kde-frameworks.scm b/gnu/packages/kde-frameworks.scm
index 52314fd0ff..61cbf19bc4 100644
--- a/gnu/packages/kde-frameworks.scm
+++ b/gnu/packages/kde-frameworks.scm
@@ -574,7 +574,7 @@ (define-public kconfig
 (define-public kcoreaddons
   (package
     (name "kcoreaddons")
-    (version "5.70.0")
+    (version "5.98.0")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -583,7 +583,7 @@ (define-public kcoreaddons
                     name "-" version ".tar.xz"))
               (sha256
                (base32
-                "10a7zys3limsawl7lk9ggymk3msk2bp0y8hp0jmsvk3l405pd1ps"))))
+                "0lqmyxqsw7w1qgdgmax63v64cy7dwk7n4zi8k53xmrqjmd9jir52"))))
     (build-system cmake-build-system)
     (native-inputs
      (list extra-cmake-modules qttools-5 shared-mime-info
@@ -602,21 +602,12 @@ (define-public kcoreaddons
                  ;; FIXME: Make it pass.  Test failure caused by stout/stderr
                  ;; being interleaved.
                  (display "[test_channels]\n*\n")
-                 ;; This fails with ENOSPC because of too many inotify watches.
-                 (display "[benchNotifyWatcher]\n*\n")))
-             #t))
-         ;; See upstream commit ee424e9b62368485bba4193053cabb553a1d268e
-         (add-after 'unpack 'fix-broken-test
-           (lambda _
-             (substitute* "autotests/kdirwatch_unittest.cpp"
-               (("QVERIFY\\(waitForRecreationSignal\\(watch, existingFile\\)\\);" m)
-                (string-append m "\nwaitUntilNewSecond();")))
-             #t))
+                 ;; FIXME
+                 (display "[test_inheritance]\n*\n")))))
          (add-before 'check 'check-setup
            (lambda _
              (setenv "HOME" (getcwd))
-             (setenv "TMPDIR" (getcwd))
-             #t)))))
+             (setenv "TMPDIR" (getcwd)))))))
     (home-page "https://community.kde.org/Frameworks")
     (synopsis "Qt addon library with a collection of non-GUI utilities")
     (description "KCoreAddons provides classes built on top of QtCore to
--
2.37.3
H
H
Hilton Chain wrote on 19 Sep 08:13 +0200
[PATCH v4 09/10] gnu: webrtc-for-telegram-desktop: Update to 621f3d.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y761qs7rivt.wl-hako@ultrarare.space
* gnu/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Add patch.
* gnu/packages/telegram.scm (libvpx-for-telegram-desktop): Remove variable.
(crc32c-for-telegram-desktop): New variable.
(webrtc-for-telegram-desktop): Update to 621f3d.
[patches]: Add webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch.
use system openh264.
[#:configure-flags]: Comment out with default values.
[native-inputs]: Drop perl.
[inputs]: Replace pipewire with pipewire-0.3.
Drop alsa-lib, libx11 and pulseaudio.
Add abseil-cpp-cxxstd17, libvpx, openh264, libdrm, libglvnd, mesa, libxfixes.
[snippet,#:phases,license]: Sync with source tree.
---
gnu/local.mk | 1 +
...r-telegram-desktop-fix-gcc12-cstdint.patch | 21 ++++
gnu/packages/telegram.scm | 103 ++++++++++--------
3 files changed, 80 insertions(+), 45 deletions(-)
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch

Toggle diff (216 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 542c06e221..ddbfe7de30 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1967,6 +1967,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/warsow-qfusion-fix-bool-return-type.patch	\
   %D%/packages/patches/webkitgtk-adjust-bubblewrap-paths.patch	\
   %D%/packages/patches/webrtc-audio-processing-big-endian.patch	\
+  %D%/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch   \
   %D%/packages/patches/websocketpp-fix-for-cmake-3.15.patch	\
   %D%/packages/patches/widelands-add-missing-map-include.patch	\
   %D%/packages/patches/widelands-system-wide_minizip.patch	\
diff --git a/gnu/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch b/gnu/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch
new file mode 100644
index 0000000000..f1fd29d0d3
--- /dev/null
+++ b/gnu/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch
@@ -0,0 +1,21 @@
+From 86d2bcd7afb8706663d29e30f65863de5a626142 Mon Sep 17 00:00:00 2001
+From: Xiretza <xiretza@xiretza.xyz>
+Date: Sun, 15 May 2022 12:47:41 +0200
+Subject: [PATCH] fix(h265_pps_parser): fix missing cstdint include
+
+---
+ src/common_video/h265/h265_pps_parser.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/common_video/h265/h265_pps_parser.h b/src/common_video/h265/h265_pps_parser.h
+index 28c95ea9..c180b1b9 100644
+--- a/src/common_video/h265/h265_pps_parser.h
++++ b/src/common_video/h265/h265_pps_parser.h
+@@ -12,6 +12,7 @@
+ #define COMMON_VIDEO_H265_PPS_PARSER_H_
+
+ #include "absl/types/optional.h"
++#include <cstdint>
+
+ namespace rtc {
+ class BitBuffer;
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index f56cbaf23a..7542f6cd17 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -30,6 +30,8 @@ (define-module (gnu packages telegram)
   #:use-module (gnu packages digest)
   #:use-module (gnu packages fcitx)
   #:use-module (gnu packages fcitx5)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gnupg)
@@ -58,6 +60,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 xdisorg)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
@@ -83,14 +86,6 @@ (define* (source-for-telegram-desktop #:key name url revision commit hash)
       (file-name (git-file-name name version))
       (sha256 (base32 hash)))))

-(define libvpx-for-telegram-desktop
-  (source-for-telegram-desktop
-   #:url "https://chromium.googlesource.com/webm/libvpx"
-   #:revision "0"
-   #:commit "5b63f0f821e94f8072eb483014cfc33b05978bb9"
-   #:hash "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"
-   #:name "libvpx"))
-
 (define libyuv-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://chromium.googlesource.com/libyuv/libyuv"
@@ -99,6 +94,14 @@ (define libyuv-for-telegram-desktop
    #:hash "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"
    #:name "libyuv"))

+(define crc32c-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/google/crc32c"
+   #:revision "0"
+   #:commit "21fc8ef30415a635e7351ffa0e5d5367943d4a94"
+   #:hash "0cddf8z7v33gfb2k60lkzwa97g20m1v81cnvllm3q9ylpnx8g6f4"
+   #:name "crc32c"))
+
 (define cmake-helpers-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/desktop-app/cmake_helpers.git"
@@ -228,8 +231,8 @@ (define tgcalls-for-telegram-desktop
    #:name "tgcalls"))

 (define-public webrtc-for-telegram-desktop
-  (let ((commit "91d836dc84a16584c6ac52b36c04c0de504d9c34")
-        (revision "166"))
+  (let ((commit "621f3da55331733bf0d1b223786b96b68c03dca1")
+        (revision "167"))
     (hidden-package
      (package
        (name "webrtc-for-telegram-desktop")
@@ -245,55 +248,67 @@ (define-public webrtc-for-telegram-desktop
           (file-name
            (git-file-name name version))
           (sha256
-           (base32 "0plwdp6xgxi27hif5j7kpq425cidxyxbbga3z2f64dsninwy5p1x"))
+           (base32 "1ks1572k1jj7pmzwm79p2gdgi31dd4bs761bphnx32zyq4c6skxk"))
+          (patches
+           (search-patches
+            ;; https://github.com/desktop-app/tg_owt/pull/101
+            "webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch"))
           (modules '((guix build utils)
                      (ice-9 ftw)
                      (srfi srfi-1)))
           (snippet
-           `(begin
-              (let ((keep
-                     '( ;; Custom forks which are incompatible with the ones in Guix.
-                       "abseil-cpp" "libsrtp" "openh264" "rnnoise"
-                       ;; Not available in Guix.
-                       "pffft" "usrsctp"
-                       ;; Has cmake support files for libvpx input.
-                       "libvpx")))
-                (with-directory-excursion "src/third_party"
-                  (for-each delete-file-recursively
-                            (lset-difference string=?
-                                             (scandir ".")
-                                             (cons* "." ".." keep)))))))))
+           #~(begin
+               (let ((keep
+                      '("abseil-cpp" "libsrtp" "rnnoise"
+                        ;; Not available in Guix.
+                        "crc32c" "pffft")))
+                 (with-directory-excursion "src/third_party"
+                   (for-each delete-file-recursively
+                             (lset-difference string=?
+                                              (scandir ".")
+                                              (cons* "." ".." keep)))))
+               ;; Use system openh264.
+               (substitute* "CMakeLists.txt"
+                 (("\\include\\(cmake\\/libopenh264\\.cmake\\)")""))))))
        (build-system cmake-build-system)
        (arguments
-        (list #:tests? #f               ; No target
-              #:configure-flags
-              #~`("-DCMAKE_C_FLAGS=-fPIC"
-                  "-DCMAKE_CXX_FLAGS=-fPIC")
+        (list #:tests? #f       ; No target
+              ;; NOTE: Options commented are default values.
+              ;; See also: comments in inputs.
+              ;; #:configure-flags
+              ;; #~'("-DTG_OWT_USE_PIPEWIRE=ON"
+              ;;     "-DTG_OWT_USE_X11=ON"
+              ;;     "-DTG_OWT_USE_PROTOBUF=ON")
               #:phases
               #~(modify-phases %standard-phases
                   (add-after 'unpack 'copy-sources
                     (lambda _
-                      (let* ((libvpx-to (string-append (getcwd) "/src/third_party/libvpx/source/libvpx"))
-                             (libyuv-to (string-append (getcwd) "/src/third_party/libyuv")))
-                        (copy-recursively #$libvpx-for-telegram-desktop libvpx-to)
-                        (copy-recursively #$libyuv-for-telegram-desktop libyuv-to)))))))
-       (native-inputs (list perl pkg-config python-wrapper yasm))
+                      (copy-recursively
+                       #$libyuv-for-telegram-desktop
+                       (string-append (getcwd) "/src/third_party/libyuv"))
+                      (copy-recursively
+                       #$crc32c-for-telegram-desktop
+                       (string-append (getcwd) "/src/third_party/crc32c/src")))))))
+       (native-inputs (list pkg-config python-wrapper yasm))
        (inputs
-        (list alsa-lib
+        (list abseil-cpp-cxxstd17
               ffmpeg
               libjpeg-turbo
-              glib
-              libxcomposite
-              libxdamage
-              libxrender
-              libxrandr
+              libvpx
+              openh264
               openssl
               opus
-              pipewire
+              ;; TG_OWT_USE_PROTOBUF
               protobuf
-              pulseaudio
-              libx11
+              ;; TG_OWT_USE_PIPEWIRE
+              glib libdrm libglvnd mesa pipewire-0.3
+              ;; TG_OWT_USE_X11
+              libxcomposite
+              libxdamage
               libxext
+              libxfixes
+              libxrandr
+              libxrender
               libxtst))
        (synopsis "WebRTC support for Telegram Desktop")
        (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by
@@ -305,13 +320,11 @@ (define-public webrtc-for-telegram-desktop
          license:asl2.0
          ;; LibYuv
          (license:non-copyleft "file:///src/third_party/libyuv/LICENSE")
-         ;; OpenH264
-         license:bsd-2
          ;; PFFFT
          (license:non-copyleft "file:///src/third_party/pffft/LICENSE")
          ;; RnNoise
          license:gpl3
-         ;; LibSRTP, LibVPx, UsrSCTP and Others
+         ;; LibSRTP, Crc32c and Others
          license:bsd-3))))))

 (define-public rlottie-for-telegram-desktop
--
2.37.3
H
H
Hilton Chain wrote on 19 Sep 08:14 +0200
[PATCH v4 10/10] gnu: telegram-desktop: Update to 4.2.0.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76zgevq4av.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (cmake-helpers-for-telegram-desktop): Update to
b9f1b6.
(codegen-for-telegram-desktop): Update to 8815d7.
(lib-base-for-telegram-desktop): Update to cc5550.
(lib-crl-for-telegram-desktop): Update to 4e620b.
(lib-lottie-for-telegram-desktop): Update to 6ed1c2.
(lib-qr-for-telegram-desktop): Update to 501f4c.
(lib-rpl-for-telegram-desktop): Update to fd31f5.
(lib-spellcheck-for-telegram-desktop): Update to 0e386e.
(lib-storage-for-telegram-desktop): Update to 839609.
(lib-tl-for-telegram-desktop): Update to 36fb95.
(lib-ui-for-telegram-desktop): Update to f82162.
(lib-webrtc-for-telegram-desktop): Update to 9b1159.
(lib-webview-for-telegram-desktop): Update to 546df6.
(lib-rlottie-for-telegram-desktop,lib-waylandshells-for-telegram-desktop):
Remove variables.
(tgcalls-for-telegram-desktop): Update to 82c492.
(dispatch-for-telegram-desktop): New variable.
(rlottie-for-telegram-desktop): Update to 8c69fc.
[snippet]: Switch off werror.
[arguments]: Use inherited ones.
(libtgvoip-for-telegram-desktop): Update to 78a8e2.
Change to source.
(telegram-desktop): Update to 4.2.0.
[#:configure-flags]: Comment out with default vaules.
Use system rlottie
[native-inputs]: Add clang-toolchain.
Drop cmake-shared, extra-cmake-modules and qttools-5.
[inputs]: Add abseil-cpp-cxxstd17, kcoreaddons, libvpx, qt5compat, qtbase,
wayland and webkitgtk.
Drop catch2, fcitx-qt5, fcitx5-qt, gtk+, hime, kwayland, materialdecoration,
libdbusmenu-qt, libtgvoip-for-telegram-desktop, nimf, qtbase-5, qt5ct, libx11.
[propagated-inputs]: Drop dconf.
[snippet,#:phases,license]: Sync with source tree.
---
gnu/packages/telegram.scm | 313 +++++++++++++++++---------------------
1 file changed, 139 insertions(+), 174 deletions(-)

Toggle diff (514 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 7542f6cd17..7556513208 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -28,6 +28,7 @@ (define-module (gnu packages telegram)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages digest)
+  #:use-module (gnu packages enchant)
   #:use-module (gnu packages fcitx)
   #:use-module (gnu packages fcitx5)
   #:use-module (gnu packages freedesktop)
@@ -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,12 +62,14 @@ (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)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix gexp)
+  #:use-module (guix utils)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system copy)
@@ -105,131 +109,131 @@ (define crc32c-for-telegram-desktop
 (define cmake-helpers-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/desktop-app/cmake_helpers.git"
-   #:revision "0"
-   #:commit "4d44d822e01b3b5fbec3ce824e01f56aa35d7f72"
-   #:hash "0h6cjiqy014h2mz90h1z5a7plb3ihbnds4bja8994ybr1dy3m7m5"
+   #:revision "1"
+   #:commit "b9f1b6036329e44ec61f51f0b363fe2319158b84"
+   #:hash "0sgp1nlmcm2imgpssqxrwinafnmicmq0qikgdnhs1d44hrwxbws3"
    #:name "cmake-helpers"))

 (define codegen-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/desktop-app/codegen.git"
-   #:revision "0"
-   #:commit "248614b49cd7d5aff69d75a737f2e35b79fbb119"
-   #:hash "00f7g2z6xmkbkrmi3q27hscjl44mg66wf9q0mz3rhy3jaa6cfdrk"
+   #:revision "1"
+   #:commit "8815d7aec9b901191d08445f29e2edd0aeba7b2c"
+   #:hash "1ly958mjk25kfcpa174kvg134p9r751ixi275afj5kr57by9mbq2"
    #:name "codegen"))

 (define lib-base-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/desktop-app/lib_base.git"
-   #:revision "0"
-   #:commit "a23c05c44e4f01dc4428f4d75d4db98c59d313a6"
-   #:hash "0vh5zgxwalmbnvz8lzlnba87ch8vnpmcz6nvf56w09f3nlxvvq78"
+   #:revision "1"
+   #:commit "cc5550de2766657ced8d0bb4d2db3f050363d3d5"
+   #:hash "16x5qp5w51igk213rhl49x256vjvpkjkgi2ziwzxnsj0pzdd4y27"
    #:name "lib-base"))

 (define lib-crl-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/desktop-app/lib_crl.git"
-   #:revision "0"
-   #:commit "3ccf2ed5095442e5874bba8852cb7dc4efeae29f"
-   #:hash "11my7q54m4lvvlgma6pbdyjxi1cv1adk1gph2j50mh18sqlm8myz"
+   #:revision "1"
+   #:commit "4e620bc383d032aadea8e6af02661f8c76695cec"
+   #:hash "17bngj247qwq0dg4h37xdi5v1mk22y4yp7sp6ph3irmnz4awah0x"
    #:name "lib-crl"))

 (define lib-lottie-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/desktop-app/lib_lottie.git"
-   #:revision "0"
-   #:commit "0770df009db7928df1d0cad0900dc5110106d229"
-   #:hash "1gj56ymlbk5dnk82jw674808m511lv9dky8891a5wm4gp3pph5jb"
+   #:revision "1"
+   #:commit "6ed1c22ed60692d2f288c9222fafd7d5cd62f904"
+   #:hash "0l57ibfij9xm4ww4s9cc63q1x8xzpc6ablwaji1krrn3xxksqdd4"
    #:name "lib-lottie"))

 (define lib-qr-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/desktop-app/lib_qr.git"
-   #:revision "0"
-   #:commit "2b08c71c6edcfc3e31f7d7f518cc963493b6e189"
-   #:hash "05hrkmwgrczyjv87r507i2r7m1zr6k2i43mq3my0s6j4szr1rjq0"
+   #:revision "1"
+   #:commit "501f4c3502fd872ab4d777df8911bdac32de7c48"
+   #:hash "0hmwqj7a9vcy8wq7pd1qprl68im3zl5f1wzcn2zzk2wvi0389k9f"
    #:name "lib-qr"))

-(define lib-rlottie-for-telegram-desktop
-  (source-for-telegram-desktop
-   #:url "https://github.com/desktop-app/lib_rlottie.git"
-   #:revision "0"
-   #:commit "0671bf70547381effcf442ec9618e04502a8adbc"
-   #:hash "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"
-   #:name "lib-rlottie"))
-
 (define lib-rpl-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/desktop-app/lib_rpl.git"
-   #:revision "0"
-   #:commit "df721be3fa14a27dfc230d2e3c42bb1a7c9d0617"
-   #:hash "15fnv3ssn7rn5d0j52gggdvyqc2wm464678dj7v2x9h8lka2jjxn"
+   #:revision "1"
+   #:commit "fd31f5bf382d2679eccdb1abaf8240a56c6a7abe"
+   #:hash "1fpq8nyh8wx6zkb3sjjrx9ydqzyhw4483bdk1i9blp0ijn9xxdxf"
    #:name "lib-rpl"))

 (define lib-spellcheck-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/desktop-app/lib_spellcheck.git"
-   #:revision "0"
-   #:commit "68c9b788958904aea7de79f986a0f82ec8c5b094"
-   #:hash "0d8s4wwk6fxf536mhzq2vb9qw3j0m8nqia7ylvvpsbc4kh09dadn"
+   #:revision "1"
+   #:commit "0e386e22cb6ba8a114b569840a635e096dcb645e"
+   #:hash "06js7ccv6z3nbd4v2p4hp2prrlmz5ww46y3yb922pp7gm317dwyw"
    #:name "lib-spellcheck"))

 (define lib-storage-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/desktop-app/lib_storage.git"
-   #:revision "0"
-   #:commit "403df6c4a29562bd417c92d410e49819f5a48cc1"
-   #:hash "1zxvzfrxbj4d395fzyb5pm9wn3n8jyimxx88cyqjcdd46sx4h7r5"
+   #:revision "1"
+   #:commit "839609369d04615475cb1518636de3619106a917"
+   #:hash "1l26h2fmqp9dcpr6pfvdd5sjb68j7yh0ms2lnr8na7jf5xqmkwwm"
    #:name "lib-storage"))

 (define lib-tl-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/desktop-app/lib_tl.git"
-   #:revision "0"
-   #:commit "45faed44e7f4d11fec79b7a70e4a35dc91ef3fdb"
-   #:hash "0h43xvzklda02494d466jp52hl8c1kmav9f12dyld10dpf1w6c7m"
+   #:revision "1"
+   #:commit "36fb95c4de1339d2c8921ad6b2911858c3d0e0fa"
+   #:hash "03rngnssnqwr7ad05qn64mwgji5fb0r3fp5ybkf951p8phr1jvzk"
    #:name "lib-tl"))

 (define lib-ui-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/desktop-app/lib_ui.git"
-   #:revision "0"
-   #:commit "1b590f9e16eb9571a039f072d6fea66c607e419f"
-   #:hash "0ighyhfp29h9h8c7vr70pnhcv2xnsr9ln084pssn8hb5z4pmb62f"
+   #:revision "1"
+   #:commit "f82162f05a72352bfee0fb79f9e50c350b3a98f3"
+   #:hash "1zv29i7hxv70dsq36zrvkvaraff5zcb7sccpncqfl51s59kfsnz5"
    #:name "lib-ui"))

-(define lib-waylandshells-for-telegram-desktop
-  (source-for-telegram-desktop
-   #:url "https://github.com/desktop-app/lib_waylandshells.git"
-   #:revision "0"
-   #:commit "59b0ee55a68976d27f1bf7cec0e11d5939e185e7"
-   #:hash "0l2xrpc5mvvdlsj333pmkgfvn9wi1ijfdaaz8skfnw9icw52faaf"
-   #:name "lib-waylandshells"))
-
 (define lib-webrtc-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/desktop-app/lib_webrtc.git"
-   #:revision "0"
-   #:commit "ef49f953f12b112008a094a719f40939aaf39db4"
-   #:hash "15k4xs3462p3ddp5cn9im3nvdiaijmxir8wxsf5yrj70ghy26ibw"
+   #:revision "1"
+   #:commit "9b11599c3c56047cfa4c68b69f1fcc93b602c33a"
+   #:hash "0158jx8hj4fv6qpw5pgcr2mdlihj0dxs060dg3iy61zz6q68z5dq"
    #:name "lib-webrtc"))

 (define lib-webview-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/desktop-app/lib_webview.git"
-   #:revision "0"
-   #:commit "e06427c624515485774e2e2181d4afeb05ad5a67"
-   #:hash "148z7xzfscynwwwqssdsd97npax6yn8zrd64xw8qzbwff2g2r7k4"
+   #:revision "1"
+   #:commit "546df65eb2424550ed84ce14fc9c5d1bb3586f35"
+   #:hash "0zzjwyw82bggncmmsw969lnjl04pklmqjqm77jjzadinivl52z0l"
    #:name "lib-webview"))

 (define tgcalls-for-telegram-desktop
   (source-for-telegram-desktop
    #:url "https://github.com/TelegramMessenger/tgcalls.git"
-   #:revision "0"
-   #:commit "81e97fa52e25b7775b62ce07bb653533d81e91b3"
-   #:hash "0fvad87hyxli83xn19mgf8jjrrh6y6iaig14pckpbkg33vf4wqkj"
+   #:revision "1"
+   #:commit "82c4921045c440b727c38e464f3a0539708423ff"
+   #:hash "1109r17abh66yz91b65fn2g4ryfybnsr5g6075sjhbah1gccv9mk"
    #:name "tgcalls"))

+(define dispatch-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/apple/swift-corelibs-libdispatch.git"
+   #:revision "0"
+   #:commit "ecc678d79f38cf63d24b6d16e18f69a9117d8d73"
+   #:hash "0hy4q6x3bgphazmpl3v62995abc9fpi8y7yg9aiblzsqkxmgjmqn"
+   #:name "dispatch"))
+
+(define libtgvoip-for-telegram-desktop
+  (source-for-telegram-desktop
+   #:url "https://github.com/telegramdesktop/libtgvoip.git"
+   #:revision "0"
+   #:commit "78a8e22bedb0d06004da8bafeba88b7474cb89a4"
+   #:hash "1y1jvm4i0i4fkl6c0bgcv2cpzziyyn1pywxqz726q008hwki941h"
+   #:name "libtgvoip"))
+
 (define-public webrtc-for-telegram-desktop
   (let ((commit "621f3da55331733bf0d1b223786b96b68c03dca1")
         (revision "167"))
@@ -328,8 +332,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 "672"))
     (hidden-package
      (package
        (inherit rlottie)
@@ -345,102 +349,52 @@ (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)))))))))
-
-(define-public libtgvoip-for-telegram-desktop
-  (let ((commit "13a5fcb16b04472d808ce122abd695dbf5d206cd")
-        (revision "88"))
-    (hidden-package
-     (package
-       (inherit libtgvoip)
-       (version
-        (git-version "2.4.4" revision commit))
-       (source
-        (origin
-          (method git-fetch)
-          (uri
-           (git-reference
-            (url "https://github.com/telegramdesktop/libtgvoip.git")
-            (commit commit)))
-          (file-name
-           (git-file-name "libtgvoip-for-telegram-desktop" version))
-          (sha256
-           (base32 "12p6s7vxkf1gh1spdckkdxrx7bjzw881ds9bky7l5fw751cwb3xd"))))
-       (arguments
-        `(#:configure-flags
-          (list
-           "--disable-static"
-           "--disable-dsp"              ; FIXME
-           "--enable-audio-callback"
-           "--with-alsa"
-           "--with-pulse")
-          #:phases
-          (modify-phases %standard-phases
-            (add-after 'unpack 'patch-linkers
-              (lambda _
-                (substitute* "Makefile.am"
-                  (("\\$\\(CRYPTO_LIBS\\) \\$\\(OPUS_LIBS\\)")
-                   "$(CRYPTO_LIBS) $(OPUS_LIBS) $(ALSA_LIBS) $(PULSE_LIBS)"))
-                (substitute* "tgvoip.pc.in"
-                  (("libcrypto opus")
-                   "libcrypto opus alsa libpulse"))
-                #t)))))
-       (native-inputs
-        (list autoconf automake libtool pkg-config))))))
+           (base32 "14gwg3sn6xdx9ymnx5r0vfm4pk8dwk92s10a1wdvfbjpyrxll64i"))
+          (modules '((guix build utils)))
+          (snippet
+           #~(begin
+               (substitute* "meson.build"
+                 (("werror=true") "werror=false"))))))))))

 (define-public telegram-desktop
   (package
     (name "telegram-desktop")
-    (version "2.9.3")
+    (version "4.2.0")
     (source
      (origin
        (method git-fetch)
        (uri
         (git-reference
          (url "https://github.com/telegramdesktop/tdesktop.git")
-         (commit
-          (string-append "v" version))))
+         (commit (string-append "v" version))))
        (file-name
         (git-file-name name version))
        (sha256
-        (base32 "0dzf1y3xhqvizg29bd1kya48cjbkq073d2x10ynwcmmx396l4nd8"))
+        (base32 "16xhng5m3aw4j4ax74nydpxjnx5z3ga21vmrznlm4lbk9ivyn7vx"))
        (modules '((guix build utils)
                   (ice-9 ftw)
                   (srfi srfi-1)))
        (snippet
-        `(begin
-           (let ((keep
-                  '( ;; Not available in Guix.
-                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
-             (with-directory-excursion "Telegram/ThirdParty"
-               (for-each delete-file-recursively
-                         (lset-difference string=?
-                                          (scandir ".")
-                                          (cons* "." ".." keep)))))))))
+        #~(begin
+            (let ((keep
+                   '(;; Own fork, bundled build to avoid an addressing issue.
+                     "libtgvoip"
+                     ;; Not available in Guix.
+                     "dispatch" "tgcalls")))
+              (with-directory-excursion "Telegram/ThirdParty"
+                (for-each delete-file-recursively
+                          (lset-difference string=?
+                                           (scandir ".")
+                                           (cons* "." ".." keep)))))))))
     (build-system qt-build-system)
     (arguments
-     (list #:tests? #f                      ; No target
+     (list #:tests? #f                  ;No target
            #:imported-modules
            `(,@%qt-build-system-modules
              (guix build glib-or-gtk-build-system))
            #:modules
            '((guix build qt-build-system)
-             ((guix build glib-or-gtk-build-system)
-              #:prefix glib-or-gtk:)
+             ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
              (guix build utils)
              (ice-9 match))
            #:configure-flags
@@ -448,17 +402,31 @@ (define-public telegram-desktop
                ;; see also <https://core.telegram.org/api/obtaining_api_id>.
                "-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")
+               ,(string-append "-DTDESKTOP_LAUTCHER_BASENAME=" #$name)
+               ;; NOTE: Options commented are default values.
+               ;; See also: comments in inputs.
+               ;; "-DDESKTOP_APP_LOTTIE_USE_CACHE=ON"
+               ;; "-DDESKTOP_APP_DISABLE_DBUS_INTEGRATION=OFF"
+               ;; "-DDESKTOP_APP_DISABLE_WAYLAND_INTEGRATION=OFF"
+               ;; "-DDESKTOP_APP_DISABLE_X11_INTEGRATION=OFF"
+               ;; "-DDESKTOP_APP_USE_ALLOCATION_TRACER=OFF"
+               ;; "-DDESKTOP_APP_USE_PACKAGED=ON"
+               ;; "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF"
+               ;; "-DDESKTOP_APP_DISABLE_SPELLCHECK=OFF"
+               ;; "-DDESKTOP_APP_USE_HUNSPELL_ONLY=OFF"
+               ;; "-DDESKTOP_APP_USE_ENCHANT=OFF"
+               ;; "-DDESKTOP_APP_NO_PDB=OFF"
+               ;; "-DDESKTOP_APP_DISABLE_JEMALLOC=OFF"
+               "-DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON"
+               "-DDESKTOP_APP_DISABLE_AUTOUPDATE=ON"
+               "-DDESKTOP_APP_USE_PACKAGED_RLOTTIE=ON")
            #:phases
            #~(modify-phases %standard-phases
                (add-after 'unpack 'make-writable
                  (lambda _
                    (for-each make-file-writable (find-files "."))))
                (add-after 'make-writable 'copy-sources
-                 (lambda* (#:key inputs outputs #:allow-other-keys)
+                 (lambda _
                    (for-each
                     (match-lambda
                       ((dst src)
@@ -470,81 +438,78 @@ (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/libtgvoip" #$libtgvoip-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_USE_ENCHANT
+           ;; enchant
+           ;; 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/libtgvoip
+      license:unlicense
+      ;; Telegram/ThirdParty/tgcalls
+      license:lgpl3
       ;; Others
       license:gpl3+))))

--
2.37.3
L
L
Liliana Marie Prikler wrote on 19 Sep 19:07 +0200
Re: [PATCH v4 08/10] gnu: kcoreaddons: Update to 5.98.0.
771b8ac7cad0965f9471b3eef35101afa63c1bbd.camel@gmail.com
Am Montag, dem 19.09.2022 um 14:13 +0800 schrieb Hilton Chain:
Toggle quote (4 lines)
>
> * gnu/packages/kde-frameworks.scm (kcoreaddons): Update to 5.98.0.
> [#:phases]: Update blocklist for failing tests.
> Remove unneeded #t.
Split into two; one for cosmetics, one functional.

Also pardon me not replying to the list for the earlier ones, still
getting used to the new Evolution UI.
L
L
Liliana Marie Prikler wrote on 19 Sep 19:11 +0200
Re: [PATCH v4 10/10] gnu: telegram-desktop: Update to 4.2.0.
af5aa4b35cf32cd90b2342db9976d349b9be25d8.camel@gmail.com
Am Montag, dem 19.09.2022 um 14:14 +0800 schrieb Hilton Chain:
Toggle quote (28 lines)
>
> * gnu/packages/telegram.scm (cmake-helpers-for-telegram-desktop):
> Update to
> b9f1b6.
> (codegen-for-telegram-desktop): Update to 8815d7.
> (lib-base-for-telegram-desktop): Update to cc5550.
> (lib-crl-for-telegram-desktop): Update to 4e620b.
> (lib-lottie-for-telegram-desktop): Update to 6ed1c2.
> (lib-qr-for-telegram-desktop): Update to 501f4c.
> (lib-rpl-for-telegram-desktop): Update to fd31f5.
> (lib-spellcheck-for-telegram-desktop): Update to 0e386e.
> (lib-storage-for-telegram-desktop): Update to 839609.
> (lib-tl-for-telegram-desktop): Update to 36fb95.
> (lib-ui-for-telegram-desktop): Update to f82162.
> (lib-webrtc-for-telegram-desktop): Update to 9b1159.
> (lib-webview-for-telegram-desktop): Update to 546df6.
> (lib-rlottie-for-telegram-desktop,lib-waylandshells-for-telegram-
> desktop):
> Remove variables.
> (tgcalls-for-telegram-desktop): Update to 82c492.
> (dispatch-for-telegram-desktop): New variable.
> (rlottie-for-telegram-desktop): Update to 8c69fc.
> [snippet]: Switch off werror.
> [arguments]: Use inherited ones.
> (libtgvoip-for-telegram-desktop): Update to 78a8e2.
> Change to source.
> (telegram-desktop): Update to 4.2.0.
> [#:configure-flags]: Comment out with default vaules.
You don't need to add those comments – in fact, I'd posit that the
package is more readable without them.
Toggle quote (10 lines)
> Use system rlottie
> [native-inputs]: Add clang-toolchain.
> Drop cmake-shared, extra-cmake-modules and qttools-5.
> [inputs]: Add abseil-cpp-cxxstd17, kcoreaddons, libvpx, qt5compat,
> qtbase,
> wayland and webkitgtk.
> Drop catch2, fcitx-qt5, fcitx5-qt, gtk+, hime, kwayland,
> materialdecoration,
> libdbusmenu-qt, libtgvoip-for-telegram-desktop, nimf, qtbase-5,
> qt5ct, libx11.
Remember to keep the inputs sorted. Also, are you sure you can drop
all of those?
Toggle quote (2 lines)
> [propagated-inputs]: Drop dconf.
> [snippet,#:phases,license]: Sync with source tree.
H
H
Hilton Chain wrote on 20 Sep 01:32 +0200
[PATCH v5 00/11] gnu: telegram-desktop: Update to 4.2.0.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76mtavos7u.wl-hako@ultrarare.space
v4 -> v5:
1. Split commits deleting trailing #ts.
2. Change package style in one commit.
3. Use plain origin constructors in favour of a procedure.

The program works fine while dropping all those inputs, so as integration with
IMEs.

Thanks!

Hilton Chain (11):
gnu: webrtc-for-telegram-desktop: Delete trailing #t.
gnu: telegram-desktop: Delete trailing #t.
gnu: webrtc-for-telegram-desktop: Use modern package style.
gnu: telegram-desktop: Use modern package style.
gnu: telegram-desktop: Change Api ID.
gnu: Add abseil-cpp-cxxstd17.
gnu: extra-cmake-modules: Update to 5.98.0.
gnu: kcoreaddons: Remove trailing #t.
gnu: kcoreaddons: Update to 5.98.0.
gnu: webrtc-for-telegram-desktop: Update to 621f3d.
gnu: telegram-desktop: Update to 4.2.0.

gnu/local.mk | 1 +
gnu/packages/cpp.scm | 9 +
gnu/packages/kde-frameworks.scm | 23 +-
...r-telegram-desktop-fix-gcc12-cstdint.patch | 21 +
gnu/packages/telegram.scm | 897 +++++++++---------
5 files changed, 488 insertions(+), 463 deletions(-)
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch


base-commit: e58bafcca4f44e058c7e88de73aa6311be7a3b37
--
2.37.3
H
H
Hilton Chain wrote on 20 Sep 01:33 +0200
[PATCH v5 01/11] gnu: webrtc-for-telegram-desktop: Delete trailing #t.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76leqfos6y.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (webrtc-for-telegram-desktop)[source,#:phases]:
Delete trailing #t.
---
gnu/packages/telegram.scm | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 1a22d230d2..ae1b727df7 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -106,8 +106,7 @@ (define-public webrtc-for-telegram-desktop
                   (for-each delete-file-recursively
                             (lset-difference string=?
                                              (scandir ".")
-                                             (cons* "." ".." keep))))
-                #t)))))
+                                             (cons* "." ".." keep)))))))))
        (build-system cmake-build-system)
        (arguments
         `(#:tests? #f                   ; No target
@@ -126,8 +125,7 @@ (define-public webrtc-for-telegram-desktop
                        (libyuv-to (string-append (getcwd)
                                                  "/src/third_party/libyuv")))
                   (copy-recursively libvpx-from libvpx-to)
-                  (copy-recursively libyuv-from libyuv-to))
-                #t)))))
+                  (copy-recursively libyuv-from libyuv-to)))))))
        (native-inputs
         `(("perl" ,perl)
           ("pkg-config" ,pkg-config)
--
2.37.3
H
H
Hilton Chain wrote on 20 Sep 01:33 +0200
[PATCH v5 02/11] gnu: telegram-desktop: Delete trailing #t.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76k05zos6c.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (telegram-desktop)[source,#:phases]: Delete
trailing #t.
---
gnu/packages/telegram.scm | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)

Toggle diff (41 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index ae1b727df7..08a72d2e0f 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -292,8 +292,7 @@ (define-public telegram-desktop
                (for-each delete-file-recursively
                          (lset-difference string=?
                                           (scandir ".")
-                                          (cons* "." ".." keep))))
-             #t)))))
+                                          (cons* "." ".." keep)))))))))
     (build-system qt-build-system)
     (arguments
      `(#:tests? #f                      ; No target
@@ -322,8 +321,7 @@ (define-public telegram-desktop
        (modify-phases %standard-phases
          (add-after 'unpack 'make-writable
            (lambda _
-             (for-each make-file-writable (find-files "."))
-             #t))
+             (for-each make-file-writable (find-files "."))))
          (add-after 'make-writable 'copy-inputs
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (for-each
@@ -350,14 +348,10 @@ (define-public telegram-desktop
                 ("Telegram/lib_waylandshells" ,(assoc-ref inputs "lib-waylandshells-source"))
                 ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source"))
                 ("Telegram/lib_webview" ,(assoc-ref inputs "lib-webview-source"))
-                ("Telegram/ThirdParty/tgcalls"
-                 ,(assoc-ref inputs "tgcalls-source"))))
-             #t))
+                ("Telegram/ThirdParty/tgcalls" ,(assoc-ref inputs "tgcalls-source"))))))
          (add-before 'configure 'patch-cxx-flags
            (lambda _
-             (substitute* "cmake/options_linux.cmake"
-               (("class-memaccess") "all"))
-             #t))
+             (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
--
2.37.3
H
H
Hilton Chain wrote on 20 Sep 01:34 +0200
[PATCH v5 03/11] gnu: webrtc-for-telegram-desktop: Use modern package style.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76illjos59.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (libvpx-for-telegram-desktop,
libyuv-for-telegram-desktop): New variables.
(webrtc-for-telegram-desktop)[#:phases]: Copy sources with gexp.
[inputs]: Remove sources in flavor of variables.
---
gnu/packages/telegram.scm | 148 +++++++++++++++++++-------------------
1 file changed, 75 insertions(+), 73 deletions(-)

Toggle diff (176 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 08a72d2e0f..9e68965607 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -62,6 +62,7 @@ (define-module (gnu packages telegram)
   #:use-module (gnu packages xorg)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system copy)
@@ -71,6 +72,36 @@ (define-module (gnu packages telegram)
   #:use-module (guix build-system python)
   #:use-module (guix build-system qt))

+(define libvpx-for-telegram-desktop
+  (let* ((commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")
+         (revision "0")
+         (name "libvpx-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://chromium.googlesource.com/webm/libvpx")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68")))))
+
+(define libyuv-for-telegram-desktop
+  (let* ((commit "ad890067f661dc747a975bc55ba3767fe30d4452")
+         (revision "0")
+         (name "libyuv-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://chromium.googlesource.com/libyuv/libyuv")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll")))))
+
 (define-public webrtc-for-telegram-desktop
   (let ((commit "91d836dc84a16584c6ac52b36c04c0de504d9c34")
         (revision "166"))
@@ -94,82 +125,53 @@ (define-public webrtc-for-telegram-desktop
                      (ice-9 ftw)
                      (srfi srfi-1)))
           (snippet
-           `(begin
-              (let ((keep
-                     '( ;; Custom forks which are incompatible with the ones in Guix.
-                       "abseil-cpp" "libsrtp" "openh264" "rnnoise"
-                       ;; Not available in Guix.
-                       "pffft" "usrsctp"
-                       ;; Has cmake support files for libvpx input.
-                       "libvpx")))
-                (with-directory-excursion "src/third_party"
-                  (for-each delete-file-recursively
-                            (lset-difference string=?
-                                             (scandir ".")
-                                             (cons* "." ".." keep)))))))))
+           #~(begin
+               (let ((keep
+                      '( ;; Custom forks which are incompatible with the ones in Guix.
+                        "abseil-cpp" "libsrtp" "openh264" "rnnoise"
+                        ;; Not available in Guix.
+                        "pffft" "usrsctp"
+                        ;; Has cmake support files for libvpx input.
+                        "libvpx")))
+                 (with-directory-excursion "src/third_party"
+                   (for-each delete-file-recursively
+                             (lset-difference string=?
+                                              (scandir ".")
+                                              (cons* "." ".." keep)))))))))
        (build-system cmake-build-system)
        (arguments
-        `(#:tests? #f                   ; No target
-          #:configure-flags
-          (list
-           "-DCMAKE_C_FLAGS=-fPIC"
-           "-DCMAKE_CXX_FLAGS=-fPIC")
-          #:phases
-          (modify-phases %standard-phases
-            (add-after 'unpack 'copy-inputs
-              (lambda* (#:key inputs outputs #:allow-other-keys)
-                (let* ((libvpx-from (assoc-ref inputs "libvpx"))
-                       (libyuv-from (assoc-ref inputs "libyuv"))
-                       (libvpx-to (string-append (getcwd)
-                                                 "/src/third_party/libvpx/source/libvpx"))
-                       (libyuv-to (string-append (getcwd)
-                                                 "/src/third_party/libyuv")))
-                  (copy-recursively libvpx-from libvpx-to)
-                  (copy-recursively libyuv-from libyuv-to)))))))
-       (native-inputs
-        `(("perl" ,perl)
-          ("pkg-config" ,pkg-config)
-          ("python" ,python-wrapper)
-          ("yasm" ,yasm)))
+        (list #:tests? #f               ; No target
+              #:configure-flags
+              #~`("-DCMAKE_C_FLAGS=-fPIC"
+                  "-DCMAKE_CXX_FLAGS=-fPIC")
+              #:phases
+              #~(modify-phases %standard-phases
+                  (add-after 'unpack 'copy-inputs
+                    (lambda _
+                      (let* ((libvpx-to (string-append (getcwd)
+                                                       "/src/third_party/libvpx/source/libvpx"))
+                             (libyuv-to (string-append (getcwd)
+                                                       "/src/third_party/libyuv")))
+                        (copy-recursively #$libvpx-for-telegram-desktop libvpx-to)
+                        (copy-recursively #$libyuv-for-telegram-desktop libyuv-to)))))))
+       (native-inputs (list perl pkg-config python-wrapper yasm))
        (inputs
-        `(("alsa" ,alsa-lib)
-          ("ffmpeg" ,ffmpeg)
-          ("libjpeg" ,libjpeg-turbo)
-          ("glib" ,glib)
-          ("libvpx"
-           ,(origin
-              (method git-fetch)
-              (uri
-               (git-reference
-                (url "https://chromium.googlesource.com/webm/libvpx")
-                (commit "5b63f0f821e94f8072eb483014cfc33b05978bb9")))
-              (file-name
-               (git-file-name "libvpx-for-webrtc-for-telegram-desktop" version))
-              (sha256
-               (base32 "1psvxaddihlw1k5n0anxif3qli6zyw2sa2ywn6mkb8six9myrp68"))))
-          ("libyuv"
-           ,(origin
-              (method git-fetch)
-              (uri
-               (git-reference
-                (url "https://chromium.googlesource.com/libyuv/libyuv")
-                (commit "ad890067f661dc747a975bc55ba3767fe30d4452")))
-              (file-name
-               (git-file-name "libyuv-for-webrtc-for-telegram-desktop" version))
-              (sha256
-               (base32 "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll"))))
-          ("libxcomposite" ,libxcomposite)
-          ("libxdamage" ,libxdamage)
-          ("libxrender" ,libxrender)
-          ("libxrandr" ,libxrandr)
-          ("openssl" ,openssl)
-          ("opus" ,opus)
-          ("pipewire" ,pipewire)
-          ("protobuf" ,protobuf)
-          ("pulseaudio" ,pulseaudio)
-          ("x11" ,libx11)
-          ("xext" ,libxext)
-          ("xtst" ,libxtst)))
+        (list alsa-lib
+              ffmpeg
+              libjpeg-turbo
+              glib
+              libxcomposite
+              libxdamage
+              libxrender
+              libxrandr
+              openssl
+              opus
+              pipewire
+              protobuf
+              pulseaudio
+              libx11
+              libxext
+              libxtst))
        (synopsis "WebRTC support for Telegram Desktop")
        (description "WebRTC-for-Telegram-Desktop is a custom WebRTC fork by
 Telegram project, for its use in telegram desktop client.")
--
2.37.3
H
H
Hilton Chain wrote on 20 Sep 01:34 +0200
[PATCH v5 04/11] gnu: telegram-desktop: Use modern package style.
(address . 57675@debbugs.gnu.org)(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
y76h713os4q.wl-hako@ultrarare.space
* gnu/packages/telegram.scm (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-rlottie-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-waylandshells-for-telegram-desktop,
lib-webrtc-for-telegram-desktop,lib-webview-for-telegram-desktop,
tgcalls-for-telegram-desktop): New variables.
(telegram-desktop)[#:phases]: Copy sources with gexp.
[native-inputs,inputs]: Remove sources in flavor of variables.
---
gnu/packages/telegram.scm | 649 +++++++++++++++++++++-----------------
1 file changed, 353 insertions(+), 296 deletions(-)

Toggle diff (671 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 9e68965607..92c51ffe4b 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -102,6 +102,246 @@ (define libyuv-for-telegram-desktop
        (base32
         "01knnk4h247rq536097n9n3s3brxlbby3nv3ppdgsqfda3k159ll")))))

+(define cmake-helpers-for-telegram-desktop
+  (let* ((commit "4d44d822e01b3b5fbec3ce824e01f56aa35d7f72")
+         (revision "0")
+         (name "cmake-helpers-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/cmake_helpers.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "0h6cjiqy014h2mz90h1z5a7plb3ihbnds4bja8994ybr1dy3m7m5")))))
+
+(define codegen-for-telegram-desktop
+  (let* ((commit "248614b49cd7d5aff69d75a737f2e35b79fbb119")
+         (revision "0")
+         (name "codegen-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/codegen.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "00f7g2z6xmkbkrmi3q27hscjl44mg66wf9q0mz3rhy3jaa6cfdrk")))))
+
+(define lib-base-for-telegram-desktop
+  (let* ((commit "a23c05c44e4f01dc4428f4d75d4db98c59d313a6")
+         (revision "0")
+         (name "lib-base-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/lib_base.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "0vh5zgxwalmbnvz8lzlnba87ch8vnpmcz6nvf56w09f3nlxvvq78")))))
+
+(define lib-crl-for-telegram-desktop
+  (let* ((commit "3ccf2ed5095442e5874bba8852cb7dc4efeae29f")
+         (revision "0")
+         (name "lib-crl-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/lib_crl.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "11my7q54m4lvvlgma6pbdyjxi1cv1adk1gph2j50mh18sqlm8myz")))))
+
+(define lib-lottie-for-telegram-desktop
+  (let* ((commit "0770df009db7928df1d0cad0900dc5110106d229")
+         (revision "0")
+         (name "lib-lottie-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/lib_lottie.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "1gj56ymlbk5dnk82jw674808m511lv9dky8891a5wm4gp3pph5jb")))))
+
+(define lib-qr-for-telegram-desktop
+  (let* ((commit "2b08c71c6edcfc3e31f7d7f518cc963493b6e189")
+         (revision "0")
+         (name "lib-qr-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/lib_qr.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "05hrkmwgrczyjv87r507i2r7m1zr6k2i43mq3my0s6j4szr1rjq0")))))
+
+(define lib-rlottie-for-telegram-desktop
+  (let* ((commit "0671bf70547381effcf442ec9618e04502a8adbc")
+         (revision "0")
+         (name "lib-rlottie-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/lib_rlottie.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv")))))
+
+(define lib-rpl-for-telegram-desktop
+  (let* ((commit "df721be3fa14a27dfc230d2e3c42bb1a7c9d0617")
+         (revision "0")
+         (name "lib-rpl-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/lib_rpl.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "15fnv3ssn7rn5d0j52gggdvyqc2wm464678dj7v2x9h8lka2jjxn")))))
+
+(define lib-spellcheck-for-telegram-desktop
+  (let* ((commit "68c9b788958904aea7de79f986a0f82ec8c5b094")
+         (revision "0")
+         (name "lib-spellcheck-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/lib_spellcheck.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "0d8s4wwk6fxf536mhzq2vb9qw3j0m8nqia7ylvvpsbc4kh09dadn")))))
+
+(define lib-storage-for-telegram-desktop
+  (let* ((commit "403df6c4a29562bd417c92d410e49819f5a48cc1")
+         (revision "0")
+         (name "lib-storage-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/lib_storage.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "1zxvzfrxbj4d395fzyb5pm9wn3n8jyimxx88cyqjcdd46sx4h7r5")))))
+
+(define lib-tl-for-telegram-desktop
+  (let* ((commit "45faed44e7f4d11fec79b7a70e4a35dc91ef3fdb")
+         (revision "0")
+         (name "lib-tl-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/lib_tl.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "0h43xvzklda02494d466jp52hl8c1kmav9f12dyld10dpf1w6c7m")))))
+
+(define lib-ui-for-telegram-desktop
+  (let* ((commit "1b590f9e16eb9571a039f072d6fea66c607e419f")
+         (revision "0")
+         (name "lib-ui-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/lib_ui.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "0ighyhfp29h9h8c7vr70pnhcv2xnsr9ln084pssn8hb5z4pmb62f")))))
+
+(define lib-waylandshells-for-telegram-desktop
+  (let* ((commit "59b0ee55a68976d27f1bf7cec0e11d5939e185e7")
+         (revision "0")
+         (name "lib-waylandshells-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/lib_waylandshells.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "0l2xrpc5mvvdlsj333pmkgfvn9wi1ijfdaaz8skfnw9icw52faaf")))))
+
+(define lib-webrtc-for-telegram-desktop
+  (let* ((commit "ef49f953f12b112008a094a719f40939aaf39db4")
+         (revision "0")
+         (name "lib-webrtc-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/lib_webrtc.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "15k4xs3462p3ddp5cn9im3nvdiaijmxir8wxsf5yrj70ghy26ibw")))))
+
+(define lib-webview-for-telegram-desktop
+  (let* ((commit "e06427c624515485774e2e2181d4afeb05ad5a67")
+         (revision "0")
+         (name "lib-webview-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/desktop-app/lib_webview.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "148z7xzfscynwwwqssdsd97npax6yn8zrd64xw8qzbwff2g2r7k4")))))
+
+(define tgcalls-for-telegram-desktop
+  (let* ((commit "81e97fa52e25b7775b62ce07bb653533d81e91b3")
+         (revision "0")
+         (name "tgcalls-for-telegram-desktop")
+         (version (git-version "0" revision commit)))
+    (origin
+      (method git-fetch)
+      (uri (git-reference
+            (url "https://github.com/TelegramMessenger/tgcalls.git")
+            (commit commit)))
+      (file-name (git-file-name name version))
+      (sha256
+       (base32
+        "0fvad87hyxli83xn19mgf8jjrrh6y6iaig14pckpbkg33vf4wqkj")))))
+
 (define-public webrtc-for-telegram-desktop
   (let ((commit "91d836dc84a16584c6ac52b36c04c0de504d9c34")
         (revision "166"))
@@ -286,306 +526,123 @@ (define-public telegram-desktop
                   (ice-9 ftw)
                   (srfi srfi-1)))
        (snippet
-        `(begin
-           (let ((keep
-                  '( ;; Not available in Guix.
-                    "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
-             (with-directory-excursion "Telegram/ThirdParty"
-               (for-each delete-file-recursively
-                         (lset-difference string=?
-                                          (scandir ".")
-                                          (cons* "." ".." keep)))))))))
+        #~(begin
+            (let ((keep
+                   '( ;; Not available in Guix.
+                     "SPMediaKeyTap" "statusnotifieritem" "tgcalls")))
+              (with-directory-excursion "Telegram/ThirdParty"
+                (for-each delete-file-recursively
+                          (lset-difference string=?
+                                           (scandir ".")
+                                           (cons* "." ".." keep)))))))))
     (build-system qt-build-system)
     (arguments
-     `(#:tests? #f                      ; No target
-       #:imported-modules
-       (,@%qt-build-system-modules
-        (guix build glib-or-gtk-build-system))
-       #:modules
-       ((guix build qt-build-system)
-        ((guix build glib-or-gtk-build-system)
-         #:prefix glib-or-gtk:)
-        (guix build utils)
-        (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>.
-        ;; In case, that the credentials below fail to work, contact
-        ;;   Raghav Gururajan <rg@raghavgururajan.name>
-        "-DTDESKTOP_API_ID=2791056"
-        "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
-        ;; Disable WebkitGTK support as it fails to link
-        "-DDESKTOP_APP_DISABLE_WEBKITGTK=ON"
-        ;; Use bundled fonts as fallback.
-        "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'make-writable
-           (lambda _
-             (for-each make-file-writable (find-files "."))))
-         (add-after 'make-writable 'copy-inputs
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (for-each
-              (match-lambda
-                ((dst src)
-                 (copy-recursively src dst)
-                 (for-each make-file-writable (find-files dst))))
-              `(("cmake" ,(assoc-ref inputs "cmake-helpers"))
-                ("Telegram/codegen" ,(assoc-ref inputs "codegen-source"))
-                ("Telegram/lib_base" ,(assoc-ref inputs "lib-base-source"))
-                ("Telegram/lib_crl" ,(assoc-ref inputs "lib-crl-source"))
-                ("Telegram/lib_lottie"
-                 ,(assoc-ref inputs "lib-lottie-source"))
-                ("Telegram/lib_qr" ,(assoc-ref inputs "lib-qr-source"))
-                ("Telegram/lib_rlottie"
-                 ,(assoc-ref inputs "lib-rlottie-source"))
-                ("Telegram/lib_rpl" ,(assoc-ref inputs "lib-rpl-source"))
-                ("Telegram/lib_spellcheck"
-                 ,(assoc-ref inputs "lib-spellcheck-source"))
-                ("Telegram/lib_storage"
-                 ,(assoc-ref inputs "lib-storage-source"))
-                ("Telegram/lib_tl" ,(assoc-ref inputs "lib-tl-source"))
-                ("Telegram/lib_ui" ,(assoc-ref inputs "lib-ui-source"))
-                ("Telegram/lib_waylandshells" ,(assoc-ref inputs "lib-waylandshells-source"))
-                ("Telegram/lib_webrtc" ,(assoc-ref inputs "lib-webrtc-source"))
-                ("Telegram/lib_webview" ,(assoc-ref inputs "lib-webview-source"))
-                ("Telegram/ThirdParty/tgcalls" ,(assoc-ref inputs "tgcalls-source"))))))
-         (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)))))
+     (list #:tests? #f                      ; No target
+           #:imported-modules
+           `(,@%qt-build-system-modules
+             (guix build glib-or-gtk-build-system))
+           #:modules
+           '((guix build qt-build-system)
+             ((guix build glib-or-gtk-build-system)
+              #:prefix glib-or-gtk:)
+             (guix build utils)
+             (ice-9 match))
+           #:configure-flags
+           #~`(;; Client applications must provide their own API-ID and API-HASH,
+               ;; see also <https://core.telegram.org/api/obtaining_api_id>.
+               ;; In case, that the credentials below fail to work, contact
+               ;;   Raghav Gururajan <rg@raghavgururajan.name>
+               "-DTDESKTOP_API_ID=2791056"
+               "-DTDESKTOP_API_HASH=582d6d0b44f7a2de949e99271fd8b3f2"
+               ;; Disable WebkitGTK support as it fails to link
+               "-DDESKTOP_APP_DISABLE_WEBKITGTK=ON"
+               ;; Use bundled fonts as fallback.
+               "-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF")
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'make-writable
+                 (lambda _
+                   (for-each make-file-writable (find-files "."))))
+               (add-after 'make-writable 'copy-inputs
+                 (lambda _
+                   (for-each
+                    (match-lambda
+                      ((dst src)
+                       (copy-recursively src dst)
+                       (for-each make-file-writable (find-files dst))))
+                    '(("cmake" #$cmake-helpers-for-telegram-desktop)
+                      ("Telegram/codegen" #$codegen-for-telegram-desktop)
+                      ("Telegram/lib_base" #$lib-base-for-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/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
-     `(("cmake-helpers"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/cmake_helpers.git")
-             (commit "4d44d822e01b3b5fbec3ce824e01f56aa35d7f72")))
-           (file-name
-            (git-file-name "cmake-helpers-for-telegram-desktop" version))
-           (sha256
-            (base32 "0h6cjiqy014h2mz90h1z5a7plb3ihbnds4bja8994ybr1dy3m7m5"))))
-       ("cmake-shared" ,cmake-shared)
-       ("extra-cmake-modules" ,extra-cmake-modules)
-       ("glib:bin" ,glib "bin")
-       ("gobject-introspection" ,gobject-introspection)
-       ("gtk+:bin" ,gtk+ "bin")
-       ("pkg-config" ,pkg-config)
-       ("python" ,python-wrapper)
-       ("qttools-5" ,qttools-5)))
+     (list cmake-shared
+           extra-cmake-modules
+           `(,glib "bin")
+           `(,gtk+ "bin")
+           pkg-config
+           python-wrapper
+           qttools-5))
     (inputs
-     `(("alsa" ,alsa-lib)
-       ("c++-gsl" ,c++-gsl)
-       ("catch" ,catch2)
-       ("codegen-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/codegen.git")
-             (commit "248614b49cd7d5aff69d75a737f2e35b79fbb119")))
-           (file-name
-            (git-file-name "codegen" version))
-           (sha256
-            (base32 "00f7g2z6xmkbkrmi3q27hscjl44mg66wf9q0mz3rhy3jaa6cfdrk"))))
-       ("expected" ,libexpected)
-       ("fcitx-qt5" ,fcitx-qt5)
-       ("fcitx5-qt" ,fcitx5-qt)
-       ("ffmpeg" ,ffmpeg)
-       ("glib" ,glib)
-       ("glibmm" ,glibmm-2.64)
-       ("gtk+" ,gtk+)
-       ("hime" ,hime)
-       ("hunspell" ,hunspell)
-       ("jemalloc" ,jemalloc)
-       ("kwayland" ,kwayland)
-       ("lib-base-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_base.git")
-             (commit "a23c05c44e4f01dc4428f4d75d4db98c59d313a6")))
-           (file-name
-            (git-file-name "lib-base-for-telegram-desktop" version))
-           (sha256
-            (base32 "0vh5zgxwalmbnvz8lzlnba87ch8vnpmcz6nvf56w09f3nlxvvq78"))))
-       ("lib-crl-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_crl.git")
-             (commit "3ccf2ed5095442e5874bba8852cb7dc4efeae29f")))
-           (file-name
-            (git-file-name "lib-crl-for-telegram-desktop" version))
-           (sha256
-            (base32 "11my7q54m4lvvlgma6pbdyjxi1cv1adk1gph2j50mh18sqlm8myz"))))
-       ("lib-lottie-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_lottie.git")
-             (commit "0770df009db7928df1d0cad0900dc5110106d229")))
-           (file-name
-            (git-file-name "lib-lottie-for-telegram-desktop" version))
-           (sha256
-            (base32 "1gj56ymlbk5dnk82jw674808m511lv9dky8891a5wm4gp3pph5jb"))))
-       ("lib-qr-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_qr.git")
-             (commit "2b08c71c6edcfc3e31f7d7f518cc963493b6e189")))
-           (file-name
-            (git-file-name "lib-qr-for-telegram-desktop" version))
-           (sha256
-            (base32 "05hrkmwgrczyjv87r507i2r7m1zr6k2i43mq3my0s6j4szr1rjq0"))))
-       ("lib-rlottie-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_rlottie.git")
-             (commit "0671bf70547381effcf442ec9618e04502a8adbc")))
-           (file-name
-            (git-file-name "lib-rlottie-for-telegram-desktop" version))
-           (sha256
-            (base32 "05qnza7j15356s8jq16pkbyp4zr586lssmd86lz5jq23lcb3raxv"))))
-       ("lib-rpl-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_rpl.git")
-             (commit "df721be3fa14a27dfc230d2e3c42bb1a7c9d0617")))
-           (file-name
-            (git-file-name "lib-rpl-for-telegram-desktop" version))
-           (sha256
-            (base32 "15fnv3ssn7rn5d0j52gggdvyqc2wm464678dj7v2x9h8lka2jjxn"))))
-       ("lib-spellcheck-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_spellcheck.git")
-             (commit "68c9b788958904aea7de79f986a0f82ec8c5b094")))
-           (file-name
-            (git-file-name "lib-spellcheck-for-telegram-desktop" version))
-           (sha256
-            (base32 "0d8s4wwk6fxf536mhzq2vb9qw3j0m8nqia7ylvvpsbc4kh09dadn"))))
-       ("lib-storage-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_storage.git")
-             (commit "403df6c4a29562bd417c92d410e49819f5a48cc1")))
-           (file-name
-            (git-file-name "lib-storage-for-telegram-desktop" version))
-           (sha256
-            (base32 "1zxvzfrxbj4d395fzyb5pm9wn3n8jyimxx88cyqjcdd46sx4h7r5"))))
-       ("lib-tl-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_tl.git")
-             (commit "45faed44e7f4d11fec79b7a70e4a35dc91ef3fdb")))
-           (file-name
-            (git-file-name "lib-tl-for-telegram-desktop" version))
-           (sha256
-            (base32 "0h43xvzklda02494d466jp52hl8c1kmav9f12dyld10dpf1w6c7m"))))
-       ("lib-ui-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_ui.git")
-             (commit "1b590f9e16eb9571a039f072d6fea66c607e419f")))
-           (file-name
-            (git-file-name "lib-ui-for-telegram-desktop" version))
-           (sha256
-            (base32 "0ighyhfp29h9h8c7vr70pnhcv2xnsr9ln084pssn8hb5z4pmb62f"))))
-       ("lib-waylandshells-source"
-        ,(origin
-           (method git-fetch)
-           (uri
-            (git-reference
-             (url "https://github.com/desktop-app/lib_waylandshells.git")
-             (commit "59b0ee55a68976d27f1bf7cec0e11d5939e185e7")))
-           (file-name
-            (git-file-name "lib-waylandshells-for-telegram-desktop" version))
-           (sha256
-            (base32 "0l2xrpc5mvvdlsj333pmkgfvn9wi1ijfdaaz8skfnw9icw52faaf"))))
-       ("lib-webrtc-source"
-        ,(origin
-           (method git-fetch)