summary refs log tree commit diff
path: root/pkgs/tools/security/tor/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/security/tor/default.nix')
-rw-r--r--pkgs/tools/security/tor/default.nix25
1 files changed, 18 insertions, 7 deletions
diff --git a/pkgs/tools/security/tor/default.nix b/pkgs/tools/security/tor/default.nix
index 3318d0c1102..1237890f621 100644
--- a/pkgs/tools/security/tor/default.nix
+++ b/pkgs/tools/security/tor/default.nix
@@ -1,16 +1,26 @@
-{ stdenv, fetchurl, libevent, openssl, zlib }:
+{ stdenv, fetchurl, libevent, openssl, zlib, torsocks }:
 
 stdenv.mkDerivation rec {
-  name = "tor-0.2.4.23";
+  name = "tor-0.2.5.12";
 
   src = fetchurl {
     url = "https://archive.torproject.org/tor-package-archive/${name}.tar.gz";
-    sha256 = "0a8l6d82hk4wbn7nlphd3c1maxhgdli8338wbg5r9dk6zcy7k8q5";
+    sha256 = "0j9byw3i2b7ji88vsqwmsxxg2nlxwkk45k5qbc1y7hdlzvzxl3sm";
   };
 
-  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";
+  CFLAGS = stdenv.lib.optionalString (stdenv.cc.cc.isGNU or false) "-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;
 
@@ -31,7 +41,8 @@ stdenv.mkDerivation rec {
 
     license="mBSD";
 
-    maintainers = with stdenv.lib.maintainers; [ phreedom ludo ];
-    platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
+    maintainers = with stdenv.lib.maintainers;
+      [ phreedom doublec thoughtpolice ];
+    platforms = stdenv.lib.platforms.unix;
   };
 }