Unverified Commit 039308e9 authored by Felix Schröter's avatar Felix Schröter
Browse files

mullvad-browser: add support for GPU acceleration

Support GPU acceleration for WebRender & VA-API.
parent 4fd012ba
Loading
Loading
Loading
Loading
+26 −9
Original line number Diff line number Diff line
@@ -6,12 +6,9 @@
, makeWrapper
, writeText
, wrapGAppsHook
, autoPatchelfHook
, callPackage

# Common run-time dependencies
, zlib

# libxul run-time dependencies
, atk
, cairo
, dbus
@@ -30,19 +27,30 @@
, mesa
, pango
, pciutils
, zlib

, libnotifySupport ? stdenv.isLinux
, libnotify

, waylandSupport ? stdenv.isLinux
, libxkbcommon
, libdrm

, mediaSupport ? true
, ffmpeg

, audioSupport ? mediaSupport
, pulseaudioSupport ? mediaSupport

, pipewireSupport ? audioSupport
, pipewire

, pulseaudioSupport ? audioSupport
, libpulseaudio
, apulse
, alsa-lib

# Media support (implies audio support)
, mediaSupport ? true
, ffmpeg
, libvaSupport ? mediaSupport
, libva

# Extra preferences
, extraPrefs ? ""
@@ -74,7 +82,10 @@ let
      stdenv.cc.libc
      zlib
    ] ++ lib.optionals libnotifySupport [ libnotify ]
      ++ lib.optionals waylandSupport [ libxkbcommon libdrm ]
      ++ lib.optionals pipewireSupport [ pipewire ]
      ++ lib.optionals pulseaudioSupport [ libpulseaudio ]
      ++ lib.optionals libvaSupport [ libva ]
      ++ lib.optionals mediaSupport [ ffmpeg ]
  );

@@ -113,7 +124,13 @@ stdenv.mkDerivation rec {

  src = sources.${stdenv.hostPlatform.system} or (throw "unsupported system: ${stdenv.hostPlatform.system}");

  nativeBuildInputs = [ copyDesktopItems makeWrapper wrapGAppsHook ];
  nativeBuildInputs = [ copyDesktopItems makeWrapper wrapGAppsHook autoPatchelfHook ];
  buildInputs = [
    gtk3
    alsa-lib
    dbus-glib
    libXtst
  ];

  preferLocalBuild = true;
  allowSubstitutes = false;