brave: fix GPU acceleration on Wayland
This commit is contained in:
parent
64db84dbb0
commit
de4a99db5e
@ -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…
Reference in New Issue
Block a user