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