summary refs log tree commit diff
path: root/pkgs/development/libraries/tsocks/default.nix
blob: d5af39d3f2a1e4e00d1ab3238159c8115bc2c12d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  pname = "tsocks";
  version = "1.8beta5";

  src = fetchurl {
    url = "mirror://sourceforge/tsocks/${pname}-${version}.tar.gz";
    sha256 = "0ixkymiph771dcdzvssi9dr2pk1bzaw9zv85riv3xl40mzspx7c4";
  };

  patches = [ ./poll.patch ];

  preConfigure = ''
    sed -i -e "s,\\\/usr,"$(echo $out|sed -e "s,\\/,\\\\\\\/,g")",g" tsocks
    substituteInPlace tsocks --replace /usr $out
    export configureFlags="$configureFlags --libdir=$out/lib"
  '';

  preBuild = ''
    # We don't need the saveme binary, it is in fact never stored and we're
    # never injecting stuff into ld.so.preload anyway
    sed -i \
      -e "s,TARGETS=\(.*\)..SAVE.\(.*\),TARGETS=\1\2," \
      -e "/SAVE/d" Makefile
  '';

  meta = with stdenv.lib; {
    description = "Transparent SOCKS v4 proxying library";
    homepage = http://tsocks.sourceforge.net/;
    license = stdenv.lib.licenses.gpl2;
    maintainers = with maintainers; [ edwtjo phreedom ];
    platforms = platforms.unix;
    broken = stdenv.hostPlatform.isDarwin;
  };
}