From 198dda950be230df9794833a0bc916a48bb13195 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 24 Sep 2015 09:44:10 +0200 Subject: [PATCH] sshuttle: add PyXAPI for tproxy UDP proxy support --- pkgs/tools/security/sshuttle/default.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/security/sshuttle/default.nix b/pkgs/tools/security/sshuttle/default.nix index d392f8a2fb63..e085bfaaa91a 100644 --- a/pkgs/tools/security/sshuttle/default.nix +++ b/pkgs/tools/security/sshuttle/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchFromGitHub, fetchpatch, makeWrapper, pandoc -, coreutils, iptables, nettools, openssh, procps, python }: +, coreutils, iptables, nettools, openssh, procps, pythonPackages }: let version = "0.71"; in stdenv.mkDerivation rec { @@ -28,20 +28,25 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ makeWrapper pandoc ]; - buildInputs = [ coreutils iptables nettools openssh procps python ]; + buildInputs = + [ coreutils iptables nettools openssh procps pythonPackages.python ]; + pythonPaths = with pythonPackages; [ PyXAPI ]; preConfigure = '' cd src ''; - installPhase = '' + installPhase = let + mapPath = f: x: stdenv.lib.concatStringsSep ":" (map f x); + in '' mkdir -p $out/share/sshuttle cp -R sshuttle *.py compat $out/share/sshuttle mkdir -p $out/bin ln -s $out/share/sshuttle/sshuttle $out/bin - wrapProgram $out/bin/sshuttle --prefix PATH : \ - "${stdenv.lib.concatStringsSep ":" (map (x: "${x}/bin") buildInputs)}" + wrapProgram $out/bin/sshuttle \ + --prefix PATH : "${mapPath (x: "${x}/bin") buildInputs}" \ + --prefix PYTHONPATH : "${mapPath (x: "$(toPythonPath ${x})") pythonPaths}" install -Dm644 sshuttle.8 $out/share/man/man8/sshuttle.8 '';