diff --git a/pkgs/development/python-modules/scapy/default.nix b/pkgs/development/python-modules/scapy/default.nix index 6670394ac0bb..1f4a34d18a38 100644 --- a/pkgs/development/python-modules/scapy/default.nix +++ b/pkgs/development/python-modules/scapy/default.nix @@ -1,22 +1,32 @@ -{ stdenv, fetchurl, buildPythonPackage, isPy3k, isPyPy }: +{ stdenv, buildPythonPackage, fetchFromGitHub, isPy3k, isPyPy +, matplotlib, pycrypto, ecdsa +# Python3: pyx +}: buildPythonPackage rec { pname = "scapy"; - version = "2.2.0"; + version = "2.3.3"; name = pname + "-" + version; disabled = isPy3k || isPyPy; - src = fetchurl { - url = "http://www.secdev.org/projects/scapy/files/${name}.tar.gz"; - sha256 = "1bqmp0xglkndrqgmybpwmzkv462mir8qlkfwsxwbvvzh9li3ndn5"; + src = fetchFromGitHub { + owner = "secdev"; + repo = "scapy"; + rev = "v${version}"; + sha256 = "1c22407vhksnhc0rwrslnp9zy05qmk2zmdm2imm3iw7g6kx7gak1"; }; + # Temporary workaround, only needed for 2.3.3 + patches = [ ./fix-version-1.patch ./fix-version-2.patch ]; + + propagatedBuildInputs = [ matplotlib pycrypto ecdsa ]; + meta = with stdenv.lib; { description = "Powerful interactive network packet manipulation program"; homepage = http://www.secdev.org/projects/scapy/; license = licenses.gpl2; platforms = platforms.linux; - maintainers = with maintainers; [ bjornfor ]; + maintainers = with maintainers; [ primeos bjornfor ]; }; } diff --git a/pkgs/development/python-modules/scapy/fix-version-1.patch b/pkgs/development/python-modules/scapy/fix-version-1.patch new file mode 100644 index 000000000000..3864a41964e2 --- /dev/null +++ b/pkgs/development/python-modules/scapy/fix-version-1.patch @@ -0,0 +1,11 @@ +--- a/setup.py 2018-02-15 22:14:08.531591678 +0100 ++++ b/setup.py 2018-02-15 22:14:57.947703737 +0100 +@@ -47,7 +47,7 @@ + + setup( + name='scapy', +- version=__import__('scapy').VERSION, ++ version='2.3.3', + packages=[ + 'scapy', + 'scapy/arch', diff --git a/pkgs/development/python-modules/scapy/fix-version-2.patch b/pkgs/development/python-modules/scapy/fix-version-2.patch new file mode 100644 index 000000000000..62d43b51fbb9 --- /dev/null +++ b/pkgs/development/python-modules/scapy/fix-version-2.patch @@ -0,0 +1,11 @@ +--- a/scapy/__init__.py 2017-12-29 18:57:35.315472160 +0100 ++++ b/scapy/__init__.py 2018-02-15 22:36:43.102132489 +0100 +@@ -73,7 +73,7 @@ + tag = f.read() + return tag + except: +- return 'unknown.version' ++ return '2.3.3' + + VERSION = _version() +