@@ -1,30 +1,36 @@
1−{ stdenv, buildPythonPackage, fetchFromGitHub, isPy3k, isPyPy
1+{ stdenv, lib, buildPythonPackage, fetchFromGitHub, isPyPy, isPy3k, pythonOlder
22, matplotlib, pycrypto, ecdsa
3−# Python3: pyx
3+, enum34, mock
44}:
55
66buildPythonPackage rec {
77 pname = "scapy";
8− version = "2.3.3";
8+ version = "2.4.0";
99 name = pname + "-" + version;
1010
11− disabled = isPy3k || isPyPy;
11+ disabled = isPyPy;
1212
1313 src = fetchFromGitHub {
1414 owner = "secdev";
1515 repo = "scapy";
1616 rev = "v${version}";
17− sha256 = "1c22407vhksnhc0rwrslnp9zy05qmk2zmdm2imm3iw7g6kx7gak1";
17+ sha256 = "0dw6kl1qi9bf3rbm79gb1h40ms8y0b5dbmpip841p2905d5r2isj";
1818 };
1919
20− # Temporary workaround, only needed for 2.3.3
20+ # TODO: Temporary workaround
2121 patches = [ ./fix-version-1.patch ./fix-version-2.patch ];
2222
23− propagatedBuildInputs = [ matplotlib pycrypto ecdsa ];
23+ propagatedBuildInputs =
24+ [ matplotlib pycrypto ecdsa ]
25+ ++ lib.optional (isPy3k && pythonOlder "3.4") [ enum34 ]
26+ ++ lib.optional doCheck [ mock ];
27+
28+ # Tests fail with Python 3.6 (seems to be an upstream bug, I'll investigate)
29+ doCheck = if isPy3k then false else true;
2430
2531 meta = with stdenv.lib; {
2632 description = "Powerful interactive network packet manipulation program";
27− homepage = http://www.secdev.org/projects/scapy/;
33+ homepage = https://scapy.net/;
2834 license = licenses.gpl2;
2935 platforms = platforms.linux;
3036 maintainers = with maintainers; [ primeos bjornfor ];