git.iko.soy/typeable/nixpkgs
on master help sign in
Revert "nixpkgs: remove tsocks"

torsocks and tsocks are not equivalent. torsocks needs a tor proxy for DNS, tsocks do not. This reverts commit 1ef6470f15fa16c8f72467d54605096806476859. tsocks: adding myself as maintainer

commit7102ef5d49171bf1d42461df828773a41f78037d authorEdward Tjörnhammar <ed@cflags.cc> dateMon 8 Dec 2014, 11:45 (12 years ago) parent6a69a25
3 files changed+54
pkgs/development/libraries/tsocks/default.nix+26 pkgs/development/libraries/tsocks/poll.patch+26 pkgs/top-level/all-packages.nix+2
pkgs/development/libraries/tsocks/default.nixnew file+26
@@ -0,0 +1,26 @@
1+{ stdenv, fetchurl }:
2+stdenv.mkDerivation rec {
3+ name = "tsocks-${version}";
4+ version = "1.8beta5";
5+
6+ src = fetchurl {
7+ url = "mirror://sourceforge/tsocks/${name}.tar.gz";
8+ sha256 = "0ixkymiph771dcdzvssi9dr2pk1bzaw9zv85riv3xl40mzspx7c4";
9+ };
10+
11+ patches = [ ./poll.patch ];
12+
13+ preConfigure = ''
14+ sed -i -e "s,\\\/usr,"$(echo $out|sed -e "s,\\/,\\\\\\\/,g")",g" tsocks
15+ substituteInPlace tsocks --replace /usr $out
16+ export configureFlags="$configureFlags --libdir=$out/lib"
17+ '';
18+
19+ meta = with stdenv.lib; {
20+ description = "Transparent SOCKS v4 proxying library";
21+ homepage = http://tsocks.sourceforge.net/;
22+ license = stdenv.lib.licenses.gpl2;
23+ maintainers = with maintainers; [ edwtjo phreedom ];
24+ platforms = platforms.linux;
25+ };
26+}
pkgs/development/libraries/tsocks/poll.patchnew file+26
@@ -0,0 +1,26 @@
1+From Ingo Hadan <ingo.hadan@sdm.de> Fri, 02 Apr 2010 21:08:50 +0200
2+From: Julien Moutinho <julm+tsocks@autogeree.net>
3+Date: Fri, 26 Apr 2013 01:57:26 +0200
4+Subject: tsocks fails if socksified application uses poll(2) (e.g. subversion-1.5)
5+
6+---
7+diff --git a/tsocks.c b/tsocks.c
8+index 9cfdfff..470babd 100644
9+--- a/tsocks.c
10++++ b/tsocks.c
11+@@ -657,10 +657,11 @@ int poll(POLL_SIGNATURE) {
12+ * be ready for writing), otherwise we'll just let the select loop
13+ * come around again (since we can't flag it for read, we don't know
14+ * if there is any data to be read and can't be bothered checking) */
15+- if (conn->selectevents & WRITE) {
16+- setevents |= POLLOUT;
17++ if (conn->selectevents & POLLOUT) {
18++ ufds[i].revents |= POLLOUT;
19+ nevents++;
20+ }
21++ ufds[i].events = conn->selectevents;
22+ }
23+ }
24+ } while (nevents == 0);
25+
26+
pkgs/top-level/all-packages.nix+2
@@ -7004,6 +7004,8 @@ let
70047004
70057005 unicap = callPackage ../development/libraries/unicap {};
70067006
7007+ tsocks = callPackage ../development/libraries/tsocks { };
7008+
70077009 unixODBC = callPackage ../development/libraries/unixODBC { };
70087010
70097011 unixODBCDrivers = recurseIntoAttrs (import ../development/libraries/unixODBCDrivers {