pythonPackages.scapy: Add optional dependencies

This commit is contained in:
Michael Weiss 2018-08-07 18:52:47 +02:00
parent 25f4a12bc4
commit f9291887af

View File

@ -1,6 +1,13 @@
{ stdenv, lib, buildPythonPackage, fetchFromGitHub, isPyPy, isPy3k, pythonOlder { buildPythonPackage, fetchFromGitHub, lib, isPyPy, isPy3k, pythonOlder
, matplotlib, pycrypto, ecdsa , pycrypto, ecdsa # TODO
, enum34, mock , enum34, mock
, withOptionalDeps ? true, tcpdump, ipython
, withCryptography ? true, cryptography
, withVoipSupport ? true, sox
, withPlottingSupport ? true, matplotlib
, withGraphicsSupport ? false, pyx, texlive, graphviz, imagemagick
# 2D/3D graphics and graphs TODO: VPython
# TODO: nmap, numpy
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@ -19,15 +26,19 @@ buildPythonPackage rec {
# TODO: Temporary workaround # TODO: Temporary workaround
patches = [ ./fix-version-1.patch ./fix-version-2.patch ]; patches = [ ./fix-version-1.patch ./fix-version-2.patch ];
propagatedBuildInputs = propagatedBuildInputs = [ pycrypto ecdsa ]
[ matplotlib pycrypto ecdsa ] ++ lib.optional withOptionalDeps [ tcpdump ipython ]
++ lib.optional withCryptography [ cryptography ]
++ lib.optional withVoipSupport [ sox ]
++ lib.optional withPlottingSupport [ matplotlib ]
++ lib.optional withGraphicsSupport [ pyx texlive.combined.scheme-minimal graphviz imagemagick ]
++ lib.optional (isPy3k && pythonOlder "3.4") [ enum34 ] ++ lib.optional (isPy3k && pythonOlder "3.4") [ enum34 ]
++ lib.optional doCheck [ mock ]; ++ lib.optional doCheck [ mock ];
# Tests fail with Python 3.6 (seems to be an upstream bug, I'll investigate) # Tests fail with Python 3.6 (seems to be an upstream bug, I'll investigate)
doCheck = if isPy3k then false else true; doCheck = if isPy3k then false else true;
meta = with stdenv.lib; { meta = with lib; {
description = "Powerful interactive network packet manipulation program"; description = "Powerful interactive network packet manipulation program";
homepage = https://scapy.net/; homepage = https://scapy.net/;
license = licenses.gpl2; license = licenses.gpl2;