2018-03-27 16:26:03 +00:00
|
|
|
{ stdenv, lib, buildPythonPackage, fetchFromGitHub, isPyPy, isPy3k, pythonOlder
|
2018-02-15 21:40:01 +00:00
|
|
|
, matplotlib, pycrypto, ecdsa
|
2018-03-27 16:26:03 +00:00
|
|
|
, enum34, mock
|
2018-02-15 21:40:01 +00:00
|
|
|
}:
|
2017-10-29 14:47:17 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2017-11-09 11:26:09 +00:00
|
|
|
pname = "scapy";
|
2018-03-27 16:26:03 +00:00
|
|
|
version = "2.4.0";
|
2017-11-09 11:26:09 +00:00
|
|
|
name = pname + "-" + version;
|
2017-10-29 14:47:17 +00:00
|
|
|
|
2018-03-27 16:26:03 +00:00
|
|
|
disabled = isPyPy;
|
2017-10-29 14:47:17 +00:00
|
|
|
|
2018-02-15 21:40:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "secdev";
|
|
|
|
repo = "scapy";
|
|
|
|
rev = "v${version}";
|
2018-03-27 16:26:03 +00:00
|
|
|
sha256 = "0dw6kl1qi9bf3rbm79gb1h40ms8y0b5dbmpip841p2905d5r2isj";
|
2017-10-29 14:47:17 +00:00
|
|
|
};
|
|
|
|
|
2018-03-27 16:26:03 +00:00
|
|
|
# TODO: Temporary workaround
|
2018-02-15 21:40:01 +00:00
|
|
|
patches = [ ./fix-version-1.patch ./fix-version-2.patch ];
|
|
|
|
|
2018-03-27 16:26:03 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
[ matplotlib pycrypto ecdsa ]
|
|
|
|
++ lib.optional (isPy3k && pythonOlder "3.4") [ enum34 ]
|
|
|
|
++ lib.optional doCheck [ mock ];
|
|
|
|
|
|
|
|
# Tests fail with Python 3.6 (seems to be an upstream bug, I'll investigate)
|
|
|
|
doCheck = if isPy3k then false else true;
|
2018-02-15 21:40:01 +00:00
|
|
|
|
2017-10-29 14:47:17 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Powerful interactive network packet manipulation program";
|
2018-03-27 16:26:03 +00:00
|
|
|
homepage = https://scapy.net/;
|
2017-10-29 14:47:17 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
2018-02-15 21:40:01 +00:00
|
|
|
maintainers = with maintainers; [ primeos bjornfor ];
|
2017-10-29 14:47:17 +00:00
|
|
|
};
|
|
|
|
}
|