torbrowser: make additional media playback support optional

This feature might not be appropriate for all users, leave it off by
default.

See 96be6a11a8
This commit is contained in:
Joachim Fasting 2017-01-26 14:23:27 +01:00
parent fa18c37c71
commit b18ff7ab82
No known key found for this signature in database
GPG Key ID: 7544761007FE4E08

View File

@ -3,16 +3,19 @@
, atk, pango, freetype, fontconfig, gdk_pixbuf, cairo, zlib
, gstreamer, gst_plugins_base, gst_plugins_good, gst_ffmpeg, gmp, ffmpeg
, libpulseaudio
, mediaSupport ? false
}:
let
libPath = stdenv.lib.makeLibraryPath [
libPath = stdenv.lib.makeLibraryPath ([
stdenv.cc.cc zlib glib alsaLib dbus dbus_glib gtk2 atk pango freetype
fontconfig gdk_pixbuf cairo libXrender libX11 libXext libXt
] ++ stdenv.lib.optionals mediaSupport [
gstreamer gst_plugins_base gmp ffmpeg
libpulseaudio
] ;
]);
# Ignored if !mediaSupport
gstPlugins = [ gstreamer gst_plugins_base gst_plugins_good gst_ffmpeg ];
gstPluginsPath = stdenv.lib.concatMapStringsSep ":" (x:
@ -77,7 +80,9 @@ stdenv.mkDerivation rec {
fi
export FONTCONFIG_PATH=\$HOME/Data/fontconfig
export LD_LIBRARY_PATH=${libPath}:$out/share/tor-browser/Browser/TorBrowser/Tor
export GST_PLUGIN_SYSTEM_PATH=${gstPluginsPath}
${stdenv.lib.optionalString mediaSupport ''
export GST_PLUGIN_SYSTEM_PATH=${gstPluginsPath}
''}
exec $out/share/tor-browser/Browser/firefox --class "Tor Browser" -no-remote -profile ~/Data/Browser/profile.default "\$@"
EOF
chmod +x $out/bin/tor-browser