1{ lib
2, buildPythonPackage
3, cython
4, fetchFromGitHub
5, libpcap
6, pkgconfig
7, pytestCheckHook
8, python
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 = pname;
22 rev = version;
23 hash = "sha256-6LA2n7Kv0MiZcqUJpi0lDN4Q+GcOttYw7hJwVqK/DU0=";
24 };
25
26 nativeBuildInputs = [
27 cython
28 pkgconfig
29 ];
30
31 buildInputs = [
32 libpcap
33 ];
34
35 nativeCheckInputs = [
36 pytestCheckHook
37 ];
38
39 preCheck = ''
40 cd tests
41 '';
42
43 pythonImportsCheck = [
44 "pcapy"
45 ];
46
47 doCheck = pythonOlder "3.10";
48
49 pytestFlagsArray = [
50 "pcapytests.py"
51 ];
52
53 meta = with lib; {
54 description = "Module to interface with the libpcap packet capture library";
55 homepage = "https://github.com/stamparm/pcapy-ng/";
56 license = licenses.bsd2;
57 maintainers = with maintainers; [ fab ];
58 };
59}