From 66c52804ae9d85fb4ce8fd7d38c600a39ff2a83c Mon Sep 17 00:00:00 2001 From: K900 Date: Sun, 9 Mar 2025 10:44:55 +0300 Subject: [PATCH] chromium: fix build with Pipewire 1.4 --- .../networking/browsers/chromium/common.nix | 3 +++ .../patches/webrtc-pipewire-1.4.patch | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 pkgs/applications/networking/browsers/chromium/patches/webrtc-pipewire-1.4.patch diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index 7c1c6d40b4f5..c61236fd8e25 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -445,6 +445,9 @@ let ./patches/cross-compile.patch # Optional patch to use SOURCE_DATE_EPOCH in compute_build_timestamp.py (should be upstreamed): ./patches/no-build-timestamps.patch + # Fix build with Pipewire 1.4 + # Submitted upstream: https://webrtc-review.googlesource.com/c/src/+/380500 + ./patches/webrtc-pipewire-1.4.patch ] ++ lib.optionals (packageName == "chromium") [ # This patch is limited to chromium and ungoogled-chromium because electron-source sets diff --git a/pkgs/applications/networking/browsers/chromium/patches/webrtc-pipewire-1.4.patch b/pkgs/applications/networking/browsers/chromium/patches/webrtc-pipewire-1.4.patch new file mode 100644 index 000000000000..a614188a9689 --- /dev/null +++ b/pkgs/applications/networking/browsers/chromium/patches/webrtc-pipewire-1.4.patch @@ -0,0 +1,20 @@ +--- a/third_party/webrtc/modules/video_capture/linux/pipewire_session.cc ++++ b/third_party/webrtc/modules/video_capture/linux/pipewire_session.cc +@@ -87,7 +87,7 @@ PipeWireNode::PipeWireNode(PipeWireSession* session, + .param = OnNodeParam, + }; + +- pw_node_add_listener(proxy_, &node_listener_, &node_events, this); ++ pw_node_add_listener(reinterpret_cast(proxy_), &node_listener_, &node_events, this); + } + + // static +@@ -119,7 +119,7 @@ void PipeWireNode::OnNodeInfo(void* data, const pw_node_info* info) { + uint32_t id = info->params[i].id; + if (id == SPA_PARAM_EnumFormat && + info->params[i].flags & SPA_PARAM_INFO_READ) { +- pw_node_enum_params(that->proxy_, 0, id, 0, UINT32_MAX, nullptr); ++ pw_node_enum_params(reinterpret_cast(that->proxy_), 0, id, 0, UINT32_MAX, nullptr); + break; + } + }