@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, libevent, openssl, zlib }:
1+{ stdenv, fetchurl, libevent, openssl, zlib, torsocks }:
22
33stdenv.mkDerivation rec {
44 name = "tor-0.2.5.10";
@@ -8,10 +8,20 @@ stdenv.mkDerivation rec {
88 sha256 = "0fx8qnwh2f8ykfx0np4hyznjfi4xfy96z59pk96y3zyjvjjh5pdk";
99 };
1010
11− buildInputs = [ libevent openssl zlib ];
11+ # Note: torsocks is specified as a dependency, as the distributed
12+ # 'torify' wrapper attempts to use it; although there is no
13+ # ./configure time check for any of this.
14+ buildInputs = [ libevent openssl zlib torsocks ];
1215
1316 CFLAGS = "-lgcc_s";
1417
18+ # Patch 'torify' to point directly to torsocks.
19+ patchPhase = ''
20+ substituteInPlace contrib/client-tools/torify \
21+ --replace 'pathfind torsocks' true \
22+ --replace 'exec torsocks' 'exec ${torsocks}/bin/torsocks'
23+ '';
24+
1525 doCheck = true;
1626
1727 meta = {