about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/tsocks/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/tsocks/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/tsocks/default.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/tsocks/default.nix b/nixpkgs/pkgs/development/libraries/tsocks/default.nix
new file mode 100644
index 000000000000..bcc91d058f04
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tsocks/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "tsocks-${version}";
+  version = "1.8beta5";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/tsocks/${name}.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;
+  };
+}