From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8FTpMLX8GWNnnQAAbAwnHQ (envelope-from ) for ; Thu, 08 Sep 2022 16:31:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mMq8MLX8GWOCfQEAauVa8A (envelope-from ) for ; Thu, 08 Sep 2022 16:31:17 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 75A951B219 for ; Thu, 8 Sep 2022 16:31:17 +0200 (CEST) Received: from localhost ([::1]:38302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWIYm-00055z-8t for larch@yhetil.org; Thu, 08 Sep 2022 10:31:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWIYY-00054r-Th for guix-patches@gnu.org; Thu, 08 Sep 2022 10:31:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42877) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWIYY-0006ae-L3 for guix-patches@gnu.org; Thu, 08 Sep 2022 10:31:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oWIYY-0002ef-4i for guix-patches@gnu.org; Thu, 08 Sep 2022 10:31:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57655] [PATCH 2/5] gnu: webrtc-for-telegram-desktop: Update to a5fbc9. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 08 Sep 2022 14:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57655 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Hilton Chain , 57655@debbugs.gnu.org Received: via spool by 57655-submit@debbugs.gnu.org id=B57655.16626474062243 (code B ref 57655); Thu, 08 Sep 2022 14:31:02 +0000 Received: (at 57655) by debbugs.gnu.org; 8 Sep 2022 14:30:06 +0000 Received: from localhost ([127.0.0.1]:59809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWIXc-0000Tq-6G for submit@debbugs.gnu.org; Thu, 08 Sep 2022 10:30:06 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:37388) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWIXX-0000Q1-Ty for 57655@debbugs.gnu.org; Thu, 08 Sep 2022 10:30:02 -0400 Received: by mail-ed1-f65.google.com with SMTP id b16so24678029edd.4 for <57655@debbugs.gnu.org>; Thu, 08 Sep 2022 07:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date; bh=XbTe1zaLSjPvW2mfVmwWYMwcK/qrdRQi/YXtIZdgCdA=; b=CXV5zZEMJ53ZFgfksIdF62lZGeKWzNSKsZ1xOhgr6A3XbXkFL4ofT9q8M3nCH1Pq3i sZj2QmUTTPU6P3QIyTp7Ovm+7L2LOuwMC8ITpWdcU5+MO5fkRV8OlH4CQ7eYRERF8Mt0 LrSplITQgRs4mezc/M0+3HnrpAJFY5RgYDsffIJwce5wSy1tc7PJcMbNxlBGe/unaLq+ LWQRIlFB+dearYr3SAmeC2LdqZKERY//QxZdwKRstJFHx0QdQFupYx76PhfU8qe9x/Ai 6rdmblTbut9NREu/G/5F0jclsiz3nFafOq2x+g8e54/m78Ag83Wx+3nThNZ1GF0JFRVM Ql+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date; bh=XbTe1zaLSjPvW2mfVmwWYMwcK/qrdRQi/YXtIZdgCdA=; b=zR1jaDJrK7CaTE7Cpouu/VUiI/BdkB8ENhGqHPoi+uCOvoCeJ59xoLtjS53wf/fbZE pa0VR3lEiq9Fz+5I7VG2FIAceID+Wf+gGHRa9UeehfsEDGPgph+24Mxguusknqf0X/hd tdtjaDBsp988IhH3dWS51UkQejSZJZrwx1HShNADqvyEoFI6uT//nvlQExDHO1IhkFKG 7LSQluMAA/LiIV9ZN1BlgDhIOjZrgWPS2dsHAGXChbejT4piSsIImNbbiTis8edH5Y+2 drNG7XKB3w2Bj+Dludqci4J+/AR34weAxUZwa9scdKGRChAfaFoEsyJM5lUWb6aBk65w nCDA== X-Gm-Message-State: ACgBeo1Qvz4d9N/X8O7Bz1Jd3iYwJNkMtO/nJLGgt1wxi046SNRtJBEI cn1Q6Txb+WtZ0AgvvxFo3g4= X-Google-Smtp-Source: AA6agR5FFE0nsZcZWwuQmZ6f47y4tJQ0YRLryCK5O/iKgNjAcMlroHkAlbMK4skfNwhH7zIRuL5R0w== X-Received: by 2002:a05:6402:1d55:b0:440:7104:240c with SMTP id dz21-20020a0564021d5500b004407104240cmr7588369edb.207.1662647392818; Thu, 08 Sep 2022 07:29:52 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id r18-20020a170906551200b0073d678f50bfsm1280549ejp.164.2022.09.08.07.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 07:29:52 -0700 (PDT) Message-ID: <2d24006e95d4d71828dfff84a60901f0c37ae0b2.camel@gmail.com> From: Liliana Marie Prikler Date: Thu, 08 Sep 2022 16:29:51 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1662647477; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=XbTe1zaLSjPvW2mfVmwWYMwcK/qrdRQi/YXtIZdgCdA=; b=ZEcIFg9jJ9B4BX8YgkNP30LrQQE4uOSDRwB7hQmtuE07zVT0Uu9ITnMj5Bviytqy/XxCWq s9d0EOjq95CyB94CmPzr6V3B6nFfJ9DGlv5vKmX/15AyFZyhr88qrvnK4RMm2qTgLiHr8l uDN9y2ii5RljSPl0IRIf1RL75J+cxRWWmQJ7PJKjZZ1xj06LIPl5bTOMQ7dr6lIxvB5y2S tqO6c7TFeZvfCZEgaybby9BfQu//gPC1ZOhQjfmUAUwnauHw0plbDI8xYCcUFuT3UKWl+d MDcJm6mr6PrURWMKhXVv8O0UqBz8reEZ6Og10QLt4GzsW/94boXdoYMBKqgaYQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662647477; a=rsa-sha256; cv=none; b=MV0B27OFVEkjoHe5pqQZs6UByOY8Of0CYHpgsTK/479VLFw20+IPvMcmSOIDUrA3NdpHe4 jM/8yp2ElBqZcKEqWGWBtVWpX+o9nkLZLpIXncIb2a8bwdNS8rYmwzJv/9gRVTlCjzIw0P 9V+vcCsiJHVgPvNvc1gAAtMvdHPUE1p6TVSni+bFkGB2MzWjERPPrnvpYrDUwUrp/cyl7/ XYJFJhoerVU1lv9QUWp/zeQF4/zyvqc8zZVpfWqYVYS2twsmapij4LWRKnfICoDEgMCoO1 QXcHqT89IoRmTkqTHNE1iQc0g3jJTNTY9qqR/gPZFWf9wRRet1LUhuRNHTsF/g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=CXV5zZEM; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 6.22 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=CXV5zZEM; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 75A951B219 X-Spam-Score: 6.22 X-Migadu-Scanner: scn1.migadu.com X-TUID: g4w8aYZsC8IO Am Donnerstag, dem 08.09.2022 um 08:57 +0800 schrieb Hilton Chain: > > * gnu/packages/telegram.scm (webrtc-for-telegram-desktop): > Update to a5fbc9123e056e611e69acf0ceb4252ddd838adb. > Use abseil-cpp-for-webrtc-for-telegram-desktop for abseil-cpp. > [patches]: > Add missing header. > Add flag for disabling X11. Mention the patches first in the ChangeLog, then you can just say "Add [patch basename]". > [snippet]: > Don't keep these files: openh264, usrsctp, libvpx. > Remove use of bundled openh264. Can be shortened to "Remove bundled openh264, ..." > [#:configure-flags]: Comment out. > [#:phases]: > Drop bundled libvpx. You might want to do this in the snippet. > Copy crc32c. > Use cmake tool for compilation and installation (and use ninja). You should still be able to produce Unix Makefiles with CMake. If ninja is really required, invoke it as ninja. > [inputs]: > Simplify. > Drop unneeded inputs. > Add external-sources variable for managing recursive checkouts. > Add crc32c. I think it's wiser to declare the external sources as variables, e.g. (define libyuv-for-telegram-desktop (origin ...)) and then just refer to those variables in the post-unpack unpack step via G-Expressions. > [native-inputs]: > Add ninja. > Drop perl. > [propagated-inputs]: Move libraries also needed by telegram-desktop > here from > inputs. > [license]: Update according to source tree updates. > > * 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. > --- Please avoid gratuitous newlines in the ChangeLog. >  gnu/local.mk                                  |   2 + >  ...telegram-desktop-add-missing-cstdint.patch |  21 +++ >  ...telegram-desktop-allow-disabling-X11.patch | 123 +++++++++++++ >  gnu/packages/telegram.scm                     | 171 ++++++++++------ > -- >  4 files changed, 242 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 > > 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 > +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 > + > + 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 25d6a3e226..d339bae017 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) > @@ -83,9 +87,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") > @@ -96,94 +103,110 @@ (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. > +            ;; TODO: There's also a patch for using standalone > crc32c, we can > +            ;; grab that patch once crc32c's been packaged. > +            "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)) Avoid propagating inputs. Instead patch invocations where needed. >         (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.") > @@ -194,13 +217,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 > Cheers