sshuttle: fix build on darwin

This commit is contained in:
Mario Rodas 2020-07-07 19:54:40 -05:00
parent 1ba6cedad1
commit aaf6cf74ce
No known key found for this signature in database
GPG Key ID: 325649BCA6D53027

View File

@ -1,5 +1,12 @@
{ stdenv, python3Packages, fetchurl, makeWrapper { stdenv
, coreutils, iptables, nettools, openssh, procps }: , python3Packages
, makeWrapper
, coreutils
, iptables
, nettools
, openssh
, procps
}:
python3Packages.buildPythonApplication rec { python3Packages.buildPythonApplication rec {
pname = "sshuttle"; pname = "sshuttle";
@ -13,17 +20,14 @@ python3Packages.buildPythonApplication rec {
patches = [ ./sudo.patch ]; patches = [ ./sudo.patch ];
nativeBuildInputs = [ makeWrapper python3Packages.setuptools_scm ]; nativeBuildInputs = [ makeWrapper python3Packages.setuptools_scm ];
buildInputs =
[ coreutils openssh procps nettools ]
++ stdenv.lib.optionals stdenv.isLinux [ iptables ];
checkInputs = with python3Packages; [ mock pytest pytestcov pytestrunner flake8 ]; checkInputs = with python3Packages; [ mock pytest pytestcov pytestrunner flake8 ];
postInstall = let runtimeDeps = [ coreutils openssh procps ] ++ stdenv.lib.optionals stdenv.isLinux [ iptables nettools ];
mapPath = f: x: stdenv.lib.concatStringsSep ":" (map f x);
in '' postInstall = ''
wrapProgram $out/bin/sshuttle \ wrapProgram $out/bin/sshuttle \
--prefix PATH : "${mapPath (x: "${x}/bin") buildInputs}" \ --prefix PATH : "${stdenv.lib.makeBinPath runtimeDeps}" \
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {