From ca9744daf3266b182a330b3fcbd4d6d5f85a6e22 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 2 Jan 2023 07:06:47 +0000 Subject: [PATCH] www/*chromium: enable PipeWire for screen sharing on Wayland PR: 268726 Approved by: maintainer timeout (7 months) --- www/chromium/Makefile | 13 +++++++++++-- ...s_desktop__capture_linux_wayland_egl__dmabuf.cc | 14 ++++++++++++++ www/iridium/Makefile | 14 +++++++++++--- ...s_desktop__capture_linux_wayland_egl__dmabuf.cc | 14 ++++++++++++++ www/ungoogled-chromium/Makefile | 13 +++++++++++-- ...s_desktop__capture_linux_wayland_egl__dmabuf.cc | 14 ++++++++++++++ 6 files changed, 75 insertions(+), 7 deletions(-) create mode 100644 www/chromium/files/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc create mode 100644 www/iridium/files/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc create mode 100644 www/ungoogled-chromium/files/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc diff --git a/www/chromium/Makefile b/www/chromium/Makefile index c2c4d7e934e36..ceaa14ce24980 100644 --- a/www/chromium/Makefile +++ b/www/chromium/Makefile @@ -1,5 +1,6 @@ PORTNAME= chromium PORTVERSION= 116.0.5845.96 +PORTREVISION= 1 CATEGORIES= www wayland MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/ \ https://nerd.hu/distfiles/:external @@ -137,8 +138,8 @@ GN_ARGS+= google_api_key="AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8" SUB_FILES= chromium-browser.desktop chrome SUB_LIST+= COMMENT="${COMMENT}" -OPTIONS_DEFINE= CODECS CUPS DEBUG DRIVER KERBEROS LTO TEST -OPTIONS_DEFAULT= CODECS CUPS DRIVER KERBEROS SNDIO +OPTIONS_DEFINE= CODECS CUPS DEBUG DRIVER KERBEROS LTO PIPEWIRE TEST +OPTIONS_DEFAULT= CODECS CUPS DRIVER KERBEROS PIPEWIRE SNDIO OPTIONS_EXCLUDE_aarch64=LTO OPTIONS_GROUP= AUDIO OPTIONS_GROUP_AUDIO= ALSA PULSEAUDIO SNDIO @@ -192,6 +193,14 @@ LTO_VARS= GN_ARGS+=use_thin_lto=true \ LTO_VARS_OFF= GN_ARGS+=use_thin_lto=false MIT_LIB_DEPENDS= libkrb.so.3:security/krb5 + +PIPEWIRE_DESC= Screen capture via PipeWire +PIPEWIRE_LIB_DEPENDS= libpipewire-0.3.so:multimedia/pipewire +PIPEWIRE_VARS= GN_ARGS+=rtc_use_pipewire=true \ + GN_ARGS+=rtc_link_pipewire=true +PIPEWIRE_VARS_OFF= GN_ARGS+=rtc_use_pipewire=false \ + GN_ARGS+=rtc_link_pipewire=false + PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio PULSEAUDIO_VARS= GN_ARGS+=use_pulseaudio=true PULSEAUDIO_VARS_OFF= GN_ARGS+=use_pulseaudio=false diff --git a/www/chromium/files/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc b/www/chromium/files/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc new file mode 100644 index 0000000000000..7f22e012c98a2 --- /dev/null +++ b/www/chromium/files/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc @@ -0,0 +1,14 @@ +--- third_party/webrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc.orig 2022-12-14 00:41:59 UTC ++++ third_party/webrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +@@ -10,11 +10,9 @@ + + #include "modules/desktop_capture/linux/wayland/egl_dmabuf.h" + +-#include + #include + #include + #include +-#include + #include + #include + #include diff --git a/www/iridium/Makefile b/www/iridium/Makefile index c6cf786aeddd2..afe9cde561582 100644 --- a/www/iridium/Makefile +++ b/www/iridium/Makefile @@ -1,6 +1,6 @@ PORTNAME= iridium PORTVERSION= 2023.07.115.1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= www wayland MASTER_SITES= https://downloads.iridiumbrowser.de/source/ PKGNAMESUFFIX= -browser @@ -135,8 +135,8 @@ GN_BOOTSTRAP_FLAGS= --no-clean --no-rebuild --skip-generate-buildfiles SUB_FILES= iridium-browser.desktop iridium SUB_LIST+= COMMENT="${COMMENT}" -OPTIONS_DEFINE= CODECS CUPS DEBUG KERBEROS LTO -OPTIONS_DEFAULT= CODECS CUPS KERBEROS SNDIO +OPTIONS_DEFINE= CODECS CUPS DEBUG KERBEROS LTO PIPEWIRE +OPTIONS_DEFAULT= CODECS CUPS KERBEROS PIPEWIRE SNDIO OPTIONS_EXCLUDE_aarch64=LTO OPTIONS_GROUP= AUDIO OPTIONS_GROUP_AUDIO= ALSA PULSEAUDIO SNDIO @@ -186,6 +186,14 @@ LTO_VARS= GN_ARGS+=use_thin_lto=true \ LTO_VARS_OFF= GN_ARGS+=use_thin_lto=false MIT_LIB_DEPENDS= libkrb.so.3:security/krb5 + +PIPEWIRE_DESC= Screen capture via PipeWire +PIPEWIRE_LIB_DEPENDS= libpipewire-0.3.so:multimedia/pipewire +PIPEWIRE_VARS= GN_ARGS+=rtc_use_pipewire=true \ + GN_ARGS+=rtc_link_pipewire=true +PIPEWIRE_VARS_OFF= GN_ARGS+=rtc_use_pipewire=false \ + GN_ARGS+=rtc_link_pipewire=false + PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio PULSEAUDIO_VARS= GN_ARGS+=use_pulseaudio=true PULSEAUDIO_VARS_OFF= GN_ARGS+=use_pulseaudio=false diff --git a/www/iridium/files/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc b/www/iridium/files/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc new file mode 100644 index 0000000000000..7f22e012c98a2 --- /dev/null +++ b/www/iridium/files/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc @@ -0,0 +1,14 @@ +--- third_party/webrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc.orig 2022-12-14 00:41:59 UTC ++++ third_party/webrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +@@ -10,11 +10,9 @@ + + #include "modules/desktop_capture/linux/wayland/egl_dmabuf.h" + +-#include + #include + #include + #include +-#include + #include + #include + #include diff --git a/www/ungoogled-chromium/Makefile b/www/ungoogled-chromium/Makefile index 9f9c561cf3006..511f244e36ece 100644 --- a/www/ungoogled-chromium/Makefile +++ b/www/ungoogled-chromium/Makefile @@ -1,5 +1,6 @@ PORTNAME= ungoogled-chromium PORTVERSION= 116.0.5845.96 +PORTREVISION= 1 UGVERSION= ${DISTVERSION}-1 CATEGORIES= www wayland MASTER_SITES= https://commondatastorage.googleapis.com/chromium-browser-official/ \ @@ -151,8 +152,8 @@ GN_BOOTSTRAP_FLAGS= --no-clean --no-rebuild --skip-generate-buildfiles SUB_FILES= ungoogled-chromium.desktop ungoogled-chromium SUB_LIST+= COMMENT="${COMMENT}" -OPTIONS_DEFINE= CODECS CUPS DEBUG DRIVER KERBEROS LTO TEST -OPTIONS_DEFAULT= CODECS CUPS DRIVER KERBEROS SNDIO +OPTIONS_DEFINE= CODECS CUPS DEBUG DRIVER KERBEROS LTO PIPEWIRE TEST +OPTIONS_DEFAULT= CODECS CUPS DRIVER KERBEROS PIPEWIRE SNDIO OPTIONS_EXCLUDE_aarch64=LTO OPTIONS_GROUP= AUDIO OPTIONS_GROUP_AUDIO= ALSA PULSEAUDIO SNDIO @@ -206,6 +207,14 @@ LTO_VARS= GN_ARGS+=use_thin_lto=true \ LTO_VARS_OFF= GN_ARGS+=use_thin_lto=false MIT_LIB_DEPENDS= libkrb.so.3:security/krb5 + +PIPEWIRE_DESC= Screen capture via PipeWire +PIPEWIRE_LIB_DEPENDS= libpipewire-0.3.so:multimedia/pipewire +PIPEWIRE_VARS= GN_ARGS+=rtc_use_pipewire=true \ + GN_ARGS+=rtc_link_pipewire=true +PIPEWIRE_VARS_OFF= GN_ARGS+=rtc_use_pipewire=false \ + GN_ARGS+=rtc_link_pipewire=false + PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio PULSEAUDIO_VARS= GN_ARGS+=use_pulseaudio=true PULSEAUDIO_VARS_OFF= GN_ARGS+=use_pulseaudio=false diff --git a/www/ungoogled-chromium/files/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc b/www/ungoogled-chromium/files/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc new file mode 100644 index 0000000000000..7f22e012c98a2 --- /dev/null +++ b/www/ungoogled-chromium/files/patch-third__party_webrtc_modules_desktop__capture_linux_wayland_egl__dmabuf.cc @@ -0,0 +1,14 @@ +--- third_party/webrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc.orig 2022-12-14 00:41:59 UTC ++++ third_party/webrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +@@ -10,11 +10,9 @@ + + #include "modules/desktop_capture/linux/wayland/egl_dmabuf.h" + +-#include + #include + #include + #include +-#include + #include + #include + #include