summary refs log tree commit diff
path: root/pkgs/tools/security/tor
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2020-05-10 14:52:15 -0700
committerJohn Wiegley <johnw@newartisans.com>2020-08-06 15:52:54 -0700
commitef3cb36ba4c237842f74039cb105afe4d291fb93 (patch)
treeb771b9db0b4b8c997589a32f51e2228ef4db4935 /pkgs/tools/security/tor
parent7cd05de015b6b125c249f5012881249f5645a4d2 (diff)
downloadnixpkgs-ef3cb36ba4c237842f74039cb105afe4d291fb93.tar
nixpkgs-ef3cb36ba4c237842f74039cb105afe4d291fb93.tar.gz
nixpkgs-ef3cb36ba4c237842f74039cb105afe4d291fb93.tar.bz2
nixpkgs-ef3cb36ba4c237842f74039cb105afe4d291fb93.tar.lz
nixpkgs-ef3cb36ba4c237842f74039cb105afe4d291fb93.tar.xz
nixpkgs-ef3cb36ba4c237842f74039cb105afe4d291fb93.tar.zst
nixpkgs-ef3cb36ba4c237842f74039cb105afe4d291fb93.zip
torsocks: Fix the Darwin build
Diffstat (limited to 'pkgs/tools/security/tor')
-rw-r--r--pkgs/tools/security/tor/torsocks.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/tools/security/tor/torsocks.nix b/pkgs/tools/security/tor/torsocks.nix
index 2ce4c9806eb..381377032d6 100644
--- a/pkgs/tools/security/tor/torsocks.nix
+++ b/pkgs/tools/security/tor/torsocks.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, autoreconfHook, libcap }:
+{ stdenv, fetchgit, fetchurl, autoreconfHook, libcap }:
 
 stdenv.mkDerivation rec {
   pname = "torsocks";
@@ -12,10 +12,19 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
 
+  patches = stdenv.lib.optional stdenv.isDarwin
+    (fetchurl {
+       url = "https://trac.torproject.org/projects/tor/raw-attachment/ticket/28538/0001-Fix-macros-for-accept4-2.patch";
+       sha256 = "97881f0b59b3512acc4acb58a0d6dfc840d7633ead2f400fad70dda9b2ba30b0";
+     });
+
   postPatch = ''
     # Patch torify_app()
     sed -i \
       -e 's,\(local app_path\)=`which $1`,\1=`type -P $1`,' \
+      src/bin/torsocks.in
+  '' + stdenv.lib.optionalString stdenv.isLinux ''
+    sed -i \
       -e 's,\(local getcap\)=.*,\1=${libcap}/bin/getcap,' \
       src/bin/torsocks.in
   '';