diff --git a/pkgs/tools/security/tor/default.nix b/pkgs/tools/security/tor/default.nix index 8eddc992f9ff..3b9dd0fa4381 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 = {