Unverified Commit ed5534ce authored by Martin Weinelt's avatar Martin Weinelt Committed by GitHub
Browse files

Merge pull request #267085 from felschr/tor-browser-gpu-acceleration

{tor,mullvad}-browser: add support for GPU acceleration
parents 7de34968 039308e9
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;
+59 −32
Original line number Diff line number Diff line
@@ -2,12 +2,9 @@
, fetchurl
, makeDesktopItem
, writeText
, autoPatchelfHook
, callPackage

# Common run-time dependencies
, zlib

# libxul run-time dependencies
, atk
, cairo
, dbus
@@ -22,14 +19,32 @@
, libXext
, libXrender
, libXt
, libXtst
, mesa
, pango
, pciutils
, zlib

, libnotifySupport ? stdenv.isLinux
, libnotify

, waylandSupport ? stdenv.isLinux
, libxkbcommon
, libdrm

, audioSupport ? mediaSupport
, pulseaudioSupport ? mediaSupport

, pipewireSupport ? audioSupport
, pipewire

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

, libvaSupport ? mediaSupport
, libva

# Media support (implies audio support)
, mediaSupport ? true
, ffmpeg
@@ -58,9 +73,8 @@ lib.warnIf (useHardenedMalloc != null)
  "tor-browser: useHardenedMalloc is deprecated and enabling it can cause issues"

(let
  libPath = lib.makeLibraryPath libPkgs;

  libPkgs = [
  libPath = lib.makeLibraryPath (
    [
      alsa-lib
      atk
      cairo
@@ -76,15 +90,20 @@ lib.warnIf (useHardenedMalloc != null)
      libXext
      libXrender
      libXt
      libXtst
      mesa # for libgbm
      pango
      pciutils
      stdenv.cc.cc
      stdenv.cc.libc
      zlib
  ]
    ] ++ lib.optionals libnotifySupport [ libnotify ]
      ++ lib.optionals waylandSupport [ libxkbcommon libdrm ]
      ++ lib.optionals pipewireSupport [ pipewire ]
      ++ lib.optionals pulseaudioSupport [ libpulseaudio ]
  ++ lib.optionals mediaSupport [
    ffmpeg
  ];
      ++ lib.optionals libvaSupport [ libva ]
      ++ lib.optionals mediaSupport [ ffmpeg ]
  );

  version = "13.0.1";

@@ -129,6 +148,14 @@ stdenv.mkDerivation rec {

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

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

  preferLocalBuild = true;
  allowSubstitutes = false;