3
0
Fork 0
forked from mirrors/nixpkgs

torbrowser: use makeLibraryPath instead of buildEnv

Also remove redundant buildInputs
This commit is contained in:
Joachim Fasting 2016-04-28 23:29:29 +02:00
parent 638e16e623
commit 85aece2f8e
No known key found for this signature in database
GPG key ID: 4330820E1E04DCF4
2 changed files with 17 additions and 24 deletions

View file

@ -1,21 +1,16 @@
{ stdenv, fetchurl, buildEnv, makeDesktopItem
, xorg, alsaLib, dbus, dbus_glib, glib, gtk, atk, pango, freetype, fontconfig
, gdk_pixbuf, cairo, zlib}:
{ stdenv, fetchurl, makeDesktopItem
, libXrender, libX11, libXext, libXt, alsaLib, dbus, dbus_glib, glib, gtk
, atk, pango, freetype, fontconfig, gdk_pixbuf, cairo, zlib
}:
let
# isolated tor environment
torEnv = buildEnv {
name = "tor-env";
paths = [
libPath = stdenv.lib.makeLibraryPath [
stdenv.cc.cc zlib glib alsaLib dbus dbus_glib gtk atk pango freetype
fontconfig gdk_pixbuf cairo xorg.libXrender xorg.libX11 xorg.libXext
xorg.libXt
fontconfig gdk_pixbuf cairo libXrender libX11 libXext libXt
];
extraOutputsToInstall = [ "lib" "out" ];
};
in
ldLibraryPath = ''${torEnv}/lib${stdenv.lib.optionalString stdenv.is64bit ":${torEnv}/lib64"}'';
in stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
name = "tor-browser-${version}";
version = "5.5.5";
@ -43,12 +38,10 @@ in stdenv.mkDerivation rec {
doCheck = true;
checkPhase = ''
# Just do a simple test if all libraries get loaded by running help on
# firefox and tor
echo "Checking firefox..."
LD_LIBRARY_PATH=${ldLibraryPath} Browser/firefox --help 1> /dev/null
LD_LIBRARY_PATH=${libPath} Browser/firefox --help 1> /dev/null
echo "Checking tor..."
LD_LIBRARY_PATH=${torEnv}/lib:Browser/TorBrowser/Tor Browser/TorBrowser/Tor/tor --help 1> /dev/null
LD_LIBRARY_PATH=${libPath}:Browser/TorBrowser/Tor Browser/TorBrowser/Tor/tor --help 1> /dev/null
'';
installPhase = ''
@ -64,7 +57,7 @@ in stdenv.mkDerivation rec {
echo "pref(\"extensions.torlauncher.tordatadir_path\", \"\$HOME/Data/Tor/\");" >> \
~/Data/Browser/profile.default/preferences/extension-overrides.js
fi
export LD_LIBRARY_PATH=${ldLibraryPath}:$out/share/tor-browser/Browser/TorBrowser/Tor
export LD_LIBRARY_PATH=${libPath}:$out/share/tor-browser/Browser/TorBrowser/Tor
$out/share/tor-browser/Browser/firefox -no-remote -profile ~/Data/Browser/profile.default "\$@"
EOF
chmod +x $out/bin/tor-browser
@ -76,8 +69,6 @@ in stdenv.mkDerivation rec {
cp Browser/browser/icons/mozicon128.png $out/share/pixmaps/torbrowser.png
'';
buildInputs = [ stdenv ];
meta = with stdenv.lib; {
description = "Tor Browser Bundle";
homepage = https://www.torproject.org/;

View file

@ -3462,7 +3462,9 @@ in
torbutton = callPackage ../tools/security/torbutton { };
torbrowser = callPackage ../tools/security/tor/torbrowser.nix { };
torbrowser = callPackage ../tools/security/tor/torbrowser.nix {
inherit (xorg) libXrender libX11 libXext libXt;
};
touchegg = callPackage ../tools/inputmethods/touchegg { };