Merge pull request #171568 from jaen/fix-brave-gpu-acceleration-wayland

brave: fix GPU acceleration on Wayland
main
Artturi 2 years ago committed by GitHub
commit 530845b05c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      pkgs/applications/networking/browsers/brave/default.nix

@ -49,6 +49,9 @@
, pulseSupport ? stdenv.isLinux
, libpulseaudio
# For GPU acceleration support on Wayland (without the lib it doesn't seem to work)
, libGL
# For video acceleration via VA-API (--enable-features=VaapiVideoDecoder,VaapiVideoEncoder)
, libvaSupport ? stdenv.isLinux
, libva
@ -66,7 +69,7 @@ let
deps = [
alsa-lib at-spi2-atk at-spi2-core atk cairo cups dbus expat
fontconfig freetype gdk-pixbuf glib gtk3 libdrm libX11
fontconfig freetype gdk-pixbuf glib gtk3 libdrm libX11 libGL
libxkbcommon libXScrnSaver libXcomposite libXcursor libXdamage
libXext libXfixes libXi libXrandr libXrender libxshmfence
libXtst libuuid mesa nspr nss pango pipewire udev wayland
@ -128,9 +131,9 @@ stdenv.mkDerivation rec {
ln -sf $BINARYWRAPPER $out/bin/brave
for exe in $out/opt/brave.com/brave/{brave,chrome_crashpad_handler}; do
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${rpath}" $exe
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${rpath}" $exe
done
# Fix paths
@ -170,10 +173,10 @@ stdenv.mkDerivation rec {
${optionalString (disableFeatures != []) ''
--add-flags "--disable-features=${strings.concatStringsSep "," disableFeatures}"
''}
--add-flags ${escapeShellArg commandLineArgs}
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland}}"
${optionalString vulkanSupport ''
--prefix XDG_DATA_DIRS : "${addOpenGLRunpath.driverLink}/share"
--add-flags ${escapeShellArg commandLineArgs}
''}
)
'';

Loading…
Cancel
Save