2021-01-15 09:19:50 +00:00
|
|
|
{ lib, stdenv, fetchgit, fetchurl, autoreconfHook, libcap }:
|
2014-12-06 04:32:56 +00:00
|
|
|
|
2010-10-01 02:38:03 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "torsocks";
|
2019-01-09 18:52:35 +00:00
|
|
|
version = "2.3.0";
|
2014-12-06 04:32:56 +00:00
|
|
|
|
2013-10-08 13:57:48 +00:00
|
|
|
src = fetchgit {
|
2022-03-23 21:22:02 +00:00
|
|
|
url = "https://git.torproject.org/torsocks.git";
|
2014-12-06 04:32:56 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2019-01-09 18:52:35 +00:00
|
|
|
sha256 = "0x0wpcigf22sjxg7bm0xzqihmsrz51hl4v8xf91qi4qnmr4ny1hb";
|
2010-10-01 02:38:03 +00:00
|
|
|
};
|
|
|
|
|
2016-12-04 17:23:02 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
2010-10-01 02:38:03 +00:00
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
patches = lib.optional stdenv.isDarwin
|
2020-05-10 21:52:15 +00:00
|
|
|
(fetchurl {
|
|
|
|
url = "https://trac.torproject.org/projects/tor/raw-attachment/ticket/28538/0001-Fix-macros-for-accept4-2.patch";
|
|
|
|
sha256 = "97881f0b59b3512acc4acb58a0d6dfc840d7633ead2f400fad70dda9b2ba30b0";
|
|
|
|
});
|
|
|
|
|
2016-12-04 17:58:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Patch torify_app()
|
|
|
|
sed -i \
|
|
|
|
-e 's,\(local app_path\)=`which $1`,\1=`type -P $1`,' \
|
2020-05-10 21:52:15 +00:00
|
|
|
src/bin/torsocks.in
|
2021-01-15 09:19:50 +00:00
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
2020-05-10 21:52:15 +00:00
|
|
|
sed -i \
|
2016-12-04 17:58:12 +00:00
|
|
|
-e 's,\(local getcap\)=.*,\1=${libcap}/bin/getcap,' \
|
|
|
|
src/bin/torsocks.in
|
2014-12-06 04:32:56 +00:00
|
|
|
'';
|
|
|
|
|
2016-12-04 18:31:27 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckTarget = "check-recursive";
|
|
|
|
|
2010-10-01 02:38:03 +00:00
|
|
|
meta = {
|
2014-12-06 04:32:56 +00:00
|
|
|
description = "Wrapper to safely torify applications";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/dgoulet/torsocks";
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
platforms = lib.platforms.unix;
|
2021-12-18 09:25:46 +00:00
|
|
|
maintainers = with lib.maintainers; [ thoughtpolice ];
|
2010-10-01 02:38:03 +00:00
|
|
|
};
|
|
|
|
}
|