From 95608c3e8d222e19f57b1ec7924476529ff0ee2c Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Sun, 4 Dec 2016 18:58:12 +0100 Subject: [PATCH] torsocks: redo patching, ensure getcap is available --- pkgs/tools/security/tor/torsocks.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/security/tor/torsocks.nix b/pkgs/tools/security/tor/torsocks.nix index 01d426b2702..a28d477d3f8 100644 --- a/pkgs/tools/security/tor/torsocks.nix +++ b/pkgs/tools/security/tor/torsocks.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, autoreconfHook, which }: +{ stdenv, fetchgit, autoreconfHook, libcap }: stdenv.mkDerivation rec { name = "torsocks-${version}"; @@ -12,9 +12,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; - patchPhase = '' - substituteInPlace src/bin/torsocks.in \ - --replace which ${which}/bin/which + postPatch = '' + # Patch torify_app() + sed -i \ + -e 's,\(local app_path\)=`which $1`,\1=`type -P $1`,' \ + -e 's,\(local getcap\)=.*,\1=${libcap}/bin/getcap,' \ + src/bin/torsocks.in ''; meta = {