1{
2 lib,
3 buildPythonPackage,
4 cython,
5 fetchFromGitHub,
6 libpcap,
7 pkgconfig,
8 pytestCheckHook,
9 python,
10 pythonOlder,
11}:
12
13buildPythonPackage rec {
14 pname = "pcapy-ng";
15 version = "1.0.9";
16 format = "setuptools";
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "stamparm";
22 repo = pname;
23 rev = version;
24 hash = "sha256-6LA2n7Kv0MiZcqUJpi0lDN4Q+GcOttYw7hJwVqK/DU0=";
25 };
26
27 nativeBuildInputs = [
28 cython
29 pkgconfig
30 ];
31
32 buildInputs = [ libpcap ];
33
34 nativeCheckInputs = [ pytestCheckHook ];
35
36 preCheck = ''
37 cd tests
38 '';
39
40 pythonImportsCheck = [ "pcapy" ];
41
42 doCheck = pythonOlder "3.10";
43
44 pytestFlagsArray = [ "pcapytests.py" ];
45
46 meta = with lib; {
47 description = "Module to interface with the libpcap packet capture library";
48 homepage = "https://github.com/stamparm/pcapy-ng/";
49 license = licenses.bsd2;
50 maintainers = with maintainers; [ fab ];
51 };
52}