summary refs log tree commit diff
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2014-12-05 22:37:47 -0600
committerAustin Seipp <aseipp@pobox.com>2014-12-06 05:00:27 -0600
commitc206c728a898886cdb6970ad801478da854c2a44 (patch)
tree7a278b9800203b0dbc21fdc23621bd079191648b
parentd92d0eca9230b5154bc690a90c1ddc7508fb0ee7 (diff)
downloadnixpkgs-c206c728a898886cdb6970ad801478da854c2a44.tar
nixpkgs-c206c728a898886cdb6970ad801478da854c2a44.tar.gz
nixpkgs-c206c728a898886cdb6970ad801478da854c2a44.tar.bz2
nixpkgs-c206c728a898886cdb6970ad801478da854c2a44.tar.lz
nixpkgs-c206c728a898886cdb6970ad801478da854c2a44.tar.xz
nixpkgs-c206c728a898886cdb6970ad801478da854c2a44.tar.zst
nixpkgs-c206c728a898886cdb6970ad801478da854c2a44.zip
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 <aseipp@pobox.com>
-rw-r--r--pkgs/tools/security/tor/default.nix14
1 files 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 = {