python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / security / tor / torsocks.nix
blob16eeca0ffad74f8bb6733dbd7206833e142272c1
1 { lib, stdenv, fetchgit, fetchurl, autoreconfHook, libcap }:
3 stdenv.mkDerivation rec {
4   pname = "torsocks";
5   version = "2.3.0";
7   src = fetchgit {
8     url    = "https://git.torproject.org/torsocks.git";
9     rev    = "refs/tags/v${version}";
10     sha256 = "0x0wpcigf22sjxg7bm0xzqihmsrz51hl4v8xf91qi4qnmr4ny1hb";
11   };
13   nativeBuildInputs = [ autoreconfHook ];
15   patches = lib.optional stdenv.isDarwin
16     (fetchurl {
17        url = "https://trac.torproject.org/projects/tor/raw-attachment/ticket/28538/0001-Fix-macros-for-accept4-2.patch";
18        sha256 = "97881f0b59b3512acc4acb58a0d6dfc840d7633ead2f400fad70dda9b2ba30b0";
19      });
21   postPatch = ''
22     # Patch torify_app()
23     sed -i \
24       -e 's,\(local app_path\)=`which $1`,\1=`type -P $1`,' \
25       src/bin/torsocks.in
26   '' + lib.optionalString stdenv.isLinux ''
27     sed -i \
28       -e 's,\(local getcap\)=.*,\1=${libcap}/bin/getcap,' \
29       src/bin/torsocks.in
30   '';
32   doInstallCheck = true;
33   installCheckTarget = "check-recursive";
35   meta = {
36     description      = "Wrapper to safely torify applications";
37     homepage         = "https://github.com/dgoulet/torsocks";
38     license          = lib.licenses.gpl2;
39     platforms        = lib.platforms.unix;
40     maintainers      = with lib.maintainers; [ thoughtpolice ];
41   };