From fae468b3ce1a758da727796db18dbaca417d1a50 Mon Sep 17 00:00:00 2001 From: James Ravn Date: Fri, 5 Jun 2020 20:52:41 +0100 Subject: [PATCH 1/2] chromium: add rtc_use_pipewire This provides the browser flag #enable-webrtc-pipewire-capturer, which adds support for screensharing on Wayland via xdg-desktop-portal. The browser flag is disabled by default until a user enables it. At least one other major distribution (Arch) enables this compile time option, and so I believe it should be safe to enable by default. This is also needed to support xdg-desktop-portal-wlr which was added in https://github.com/NixOS/nixpkgs/pull/83485. --- pkgs/applications/networking/browsers/chromium/common.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index 8ce7c89bf780..33f859976f20 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -17,6 +17,7 @@ , protobuf, speechd, libXdamage, cups , ffmpeg, libxslt, libxml2, at-spi2-core , jre +, pipewire_0_2 # optional dependencies , libgcrypt ? null # gnomeSupport || cupsSupport @@ -132,6 +133,7 @@ let libXScrnSaver libXcursor libXtst libGLU libGL pciutils protobuf speechd libXdamage at-spi2-core jre + pipewire_0_2 ] ++ optional useVaapi libva ++ optional gnomeKeyringSupport libgnome-keyring3 ++ optionals gnomeSupport [ gnome.GConf libgcrypt ] @@ -243,6 +245,8 @@ let # added later in the wrapped -wv build or downloaded from Google. enable_widevine = true; use_cups = cupsSupport; + # Provides the enable-webrtc-pipewire-capturer flag to support Wayland screen capture. + rtc_use_pipewire = true; treat_warnings_as_errors = false; is_clang = stdenv.cc.isClang; From 1535270d91e82af7927c0f121f3f5605a0a7b248 Mon Sep 17 00:00:00 2001 From: James Ravn Date: Sat, 6 Jun 2020 17:08:39 +0100 Subject: [PATCH 2/2] Add pipewire to runtime path --- pkgs/applications/networking/browsers/chromium/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix index df1dcb413e15..6f1380a42a05 100644 --- a/pkgs/applications/networking/browsers/chromium/default.nix +++ b/pkgs/applications/networking/browsers/chromium/default.nix @@ -2,6 +2,7 @@ , makeWrapper, ed , glib, gtk3, gnome3, gsettings-desktop-schemas, gn, fetchgit , libva ? null +, pipewire_0_2 , gcc, nspr, nss, patchelfUnstable, runCommand , lib @@ -152,7 +153,7 @@ in stdenv.mkDerivation { buildCommand = let browserBinary = "${chromiumWV}/libexec/chromium/chromium"; getWrapperFlags = plugin: "$(< \"${plugin}/nix-support/wrapper-flags\")"; - libPath = stdenv.lib.makeLibraryPath [ libva ]; + libPath = stdenv.lib.makeLibraryPath [ libva pipewire_0_2 ]; in with stdenv.lib; '' mkdir -p "$out/bin"