From c206c728a898886cdb6970ad801478da854c2a44 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Fri, 5 Dec 2014 22:37:47 -0600 Subject: [PATCH] nixpkgs: tor depends on torsocks This may seem strange, but tor distributes its 'torify' wrapper which in turn attempts to use torsocks to bridge a connection, meaning 'tor' users out the box may want it to work. Signed-off-by: Austin Seipp --- pkgs/tools/security/tor/default.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/security/tor/default.nix b/pkgs/tools/security/tor/default.nix index 8eddc992f9f..3b9dd0fa438 100644 --- a/pkgs/tools/security/tor/default.nix +++ b/pkgs/tools/security/tor/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, libevent, openssl, zlib }: +{ stdenv, fetchurl, libevent, openssl, zlib, torsocks }: stdenv.mkDerivation rec { name = "tor-0.2.5.10"; @@ -8,10 +8,20 @@ stdenv.mkDerivation rec { sha256 = "0fx8qnwh2f8ykfx0np4hyznjfi4xfy96z59pk96y3zyjvjjh5pdk"; }; - buildInputs = [ libevent openssl zlib ]; + # Note: torsocks is specified as a dependency, as the distributed + # 'torify' wrapper attempts to use it; although there is no + # ./configure time check for any of this. + buildInputs = [ libevent openssl zlib torsocks ]; CFLAGS = "-lgcc_s"; + # Patch 'torify' to point directly to torsocks. + patchPhase = '' + substituteInPlace contrib/client-tools/torify \ + --replace 'pathfind torsocks' true \ + --replace 'exec torsocks' 'exec ${torsocks}/bin/torsocks' + ''; + doCheck = true; meta = {