Merge pull request #20902 from joachifm/torsocks

torsocks update & improvements
This commit is contained in:
Joachim F 2016-12-05 15:33:45 +01:00 committed by GitHub
commit 4277c8da7b

View File

@ -1,24 +1,27 @@
{ stdenv, fetchgit, autoreconfHook, which }: { stdenv, fetchgit, autoreconfHook, libcap }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "torsocks-${version}"; name = "torsocks-${version}";
version = "2.1.0"; version = "2.2.0";
src = fetchgit { src = fetchgit {
url = meta.repositories.git; url = meta.repositories.git;
rev = "refs/tags/v${version}"; rev = "refs/tags/v${version}";
sha256 = "1l890pg0h2hqpkabsnwc6pq2qi8mfv58qzaaicc9y62rq5nmrrws"; sha256 = "1xwkmfaxhhnbmvp37agnby1n53hznwhvx0dg1hj35467qfx985zc";
}; };
buildInputs = [ autoreconfHook ]; nativeBuildInputs = [ autoreconfHook ];
preConfigure = ''
export configureFlags="$configureFlags --libdir=$out/lib" 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
''; '';
patchPhase = '' doInstallCheck = true;
substituteInPlace src/bin/torsocks.in \ installCheckTarget = "check-recursive";
--replace which ${which}/bin/which
'';
meta = { meta = {
description = "Wrapper to safely torify applications"; description = "Wrapper to safely torify applications";