1{ stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 name = "tsocks-${version}";
5 version = "1.8beta5";
6
7 src = fetchurl {
8 url = "mirror://sourceforge/tsocks/${name}.tar.gz";
9 sha256 = "0ixkymiph771dcdzvssi9dr2pk1bzaw9zv85riv3xl40mzspx7c4";
10 };
11
12 patches = [ ./poll.patch ];
13
14 preConfigure = ''
15 sed -i -e "s,\\\/usr,"$(echo $out|sed -e "s,\\/,\\\\\\\/,g")",g" tsocks
16 substituteInPlace tsocks --replace /usr $out
17 export configureFlags="$configureFlags --libdir=$out/lib"
18 '';
19
20 preBuild = ''
21 # We don't need the saveme binary, it is in fact never stored and we're
22 # never injecting stuff into ld.so.preload anyway
23 sed -i \
24 -e "s,TARGETS=\(.*\)..SAVE.\(.*\),TARGETS=\1\2," \
25 -e "/SAVE/d" Makefile
26 '';
27
28 meta = with stdenv.lib; {
29 description = "Transparent SOCKS v4 proxying library";
30 homepage = http://tsocks.sourceforge.net/;
31 license = stdenv.lib.licenses.gpl2;
32 maintainers = with maintainers; [ edwtjo phreedom ];
33 platforms = platforms.unix;
34 };
35}