From patchwork Sun Sep 11 10:12:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hilton Chain X-Patchwork-Id: 42468 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9441C27BBEA; Sun, 11 Sep 2022 11:14:01 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 769D427BBE9 for ; Sun, 11 Sep 2022 11:14:00 +0100 (BST) Received: from localhost ([::1]:52886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXJyR-0006cb-LZ for patchwork@mira.cbaines.net; Sun, 11 Sep 2022 06:13:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXJxW-0006EG-Ss for guix-patches@gnu.org; Sun, 11 Sep 2022 06:13:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXJxW-0007hx-KE for guix-patches@gnu.org; Sun, 11 Sep 2022 06:13:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oXJxW-0007Ta-FR for guix-patches@gnu.org; Sun, 11 Sep 2022 06:13:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57675] [PATCH v3 4/7] gnu: webrtc-for-telegram-desktop: Update to a5fbc9. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Sep 2022 10:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57675 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57675@debbugs.gnu.org Cc: Liliana Marie Prikler Received: via spool by 57675-submit@debbugs.gnu.org id=B57675.166289116028679 (code B ref 57675); Sun, 11 Sep 2022 10:13:02 +0000 Received: (at 57675) by debbugs.gnu.org; 11 Sep 2022 10:12:40 +0000 Received: from localhost ([127.0.0.1]:40786 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXJx9-0007SU-4M for submit@debbugs.gnu.org; Sun, 11 Sep 2022 06:12:40 -0400 Received: from mail.boiledscript.com ([144.168.59.46]:60052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXJx6-0007SH-Ql for 57675@debbugs.gnu.org; Sun, 11 Sep 2022 06:12:37 -0400 Date: Sun, 11 Sep 2022 18:12:15 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1662891151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fvTNFxU5DBh4FoktqWmF7yuTEnp8/KQxk91xEhQsI58=; b=gh9OovzURDjlH8yp0WVG8q0xUQkdaC7IOrBGyl/MrM/MUFxsD5jqUm+orFvu4wVevhQ5Qx ElRvBvbIqliKzNfIKkdH5XXsmnAG+F0d8Mkpqr7U6vuYk8swpJ4DnK7vaXY9UncFf5syaJ p3poh0q3tZ9nlTpiPvo92AaaIWePdHAbEEAm4gERUFLDafAa9HHNAz/pi/2Y1dyW58DeZQ Vy2gsrdrG8Un6s2Zlj8XW3d3ywTr6WkmphZ/klg2z64KwFlvc2c9MdOEN3QhE/+uMjNh37 FwYCJ/Az4nT21SFuplfJgmYEQ+hMSTOHXbnHgF2M/WCubh9EKozF4Rg/0fN+MQ== Message-ID: In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: mail.boiledscript.com; auth=pass smtp.mailfrom=hako@ultrarare.space X-Spamd-Bar: / 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches X-Patchwork-Original-From: Hilton Chain via Guix-patches via From: Hilton Chain X-getmail-retrieved-from-mailbox: Patches * 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 -- 2.37.3 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 +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 +Date: Fri Sep 9 22:13:15 2022 +0800 + + Adapt the patch with cmake_dependent_option. + +commit f6631bb43f353c9eafe1b1aba093e116518aa12a +Author: Esteve Varela Colominas +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 +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/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