tor-browser: add support for GPU acceleration

Support GPU acceleration for WebRender & VA-API.

+59 -32
+59 -32
pkgs/applications/networking/browsers/tor-browser/default.nix
··· 2 2 , fetchurl 3 3 , makeDesktopItem 4 4 , writeText 5 + , autoPatchelfHook 5 6 , callPackage 6 7 7 - # Common run-time dependencies 8 - , zlib 9 - 10 - # libxul run-time dependencies 11 8 , atk 12 9 , cairo 13 10 , dbus ··· 22 19 , libXext 23 20 , libXrender 24 21 , libXt 22 + , libXtst 23 + , mesa 25 24 , pango 25 + , pciutils 26 + , zlib 27 + 28 + , libnotifySupport ? stdenv.isLinux 29 + , libnotify 30 + 31 + , waylandSupport ? stdenv.isLinux 32 + , libxkbcommon 33 + , libdrm 26 34 27 35 , audioSupport ? mediaSupport 28 - , pulseaudioSupport ? mediaSupport 36 + 37 + , pipewireSupport ? audioSupport 38 + , pipewire 39 + 40 + , pulseaudioSupport ? audioSupport 29 41 , libpulseaudio 30 42 , apulse 31 43 , alsa-lib 32 44 45 + , libvaSupport ? mediaSupport 46 + , libva 47 + 33 48 # Media support (implies audio support) 34 49 , mediaSupport ? true 35 50 , ffmpeg ··· 58 73 "tor-browser: useHardenedMalloc is deprecated and enabling it can cause issues" 59 74 60 75 (let 61 - libPath = lib.makeLibraryPath libPkgs; 62 - 63 - libPkgs = [ 64 - alsa-lib 65 - atk 66 - cairo 67 - dbus 68 - dbus-glib 69 - fontconfig 70 - freetype 71 - gdk-pixbuf 72 - glib 73 - gtk3 74 - libxcb 75 - libX11 76 - libXext 77 - libXrender 78 - libXt 79 - pango 80 - stdenv.cc.cc 81 - stdenv.cc.libc 82 - zlib 83 - ] 84 - ++ lib.optionals pulseaudioSupport [ libpulseaudio ] 85 - ++ lib.optionals mediaSupport [ 86 - ffmpeg 87 - ]; 76 + libPath = lib.makeLibraryPath ( 77 + [ 78 + alsa-lib 79 + atk 80 + cairo 81 + dbus 82 + dbus-glib 83 + fontconfig 84 + freetype 85 + gdk-pixbuf 86 + glib 87 + gtk3 88 + libxcb 89 + libX11 90 + libXext 91 + libXrender 92 + libXt 93 + libXtst 94 + mesa # for libgbm 95 + pango 96 + pciutils 97 + stdenv.cc.cc 98 + stdenv.cc.libc 99 + zlib 100 + ] ++ lib.optionals libnotifySupport [ libnotify ] 101 + ++ lib.optionals waylandSupport [ libxkbcommon libdrm ] 102 + ++ lib.optionals pipewireSupport [ pipewire ] 103 + ++ lib.optionals pulseaudioSupport [ libpulseaudio ] 104 + ++ lib.optionals libvaSupport [ libva ] 105 + ++ lib.optionals mediaSupport [ ffmpeg ] 106 + ); 88 107 89 108 version = "13.0.1"; 90 109 ··· 128 147 inherit version; 129 148 130 149 src = sources.${stdenv.hostPlatform.system} or (throw "unsupported system: ${stdenv.hostPlatform.system}"); 150 + 151 + nativeBuildInputs = [ autoPatchelfHook ]; 152 + buildInputs = [ 153 + gtk3 154 + alsa-lib 155 + dbus-glib 156 + libXtst 157 + ]; 131 158 132 159 preferLocalBuild = true; 133 160 allowSubstitutes = false;