blob: 488ec0daefca7cb6b76c243bc694a52a4dae0381 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
{
lib,
stdenv,
buildPythonPackage,
fetchPypi,
dbus,
pkgsLibpcap,
pkg-about,
setuptools,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "libpcap";
version = "1.11.0b25";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-GzrTqpkiKJjWBuZ7ez707BGZez9wXB96psygDQykO6c=";
};
build-system = [ setuptools ];
# tox is listed in build requirements but not actually used to build
# keeping it as a requirement breaks the build unnecessarily
postPatch = ''
sed -i "/requires/s/, 'tox>=[^']*'//" pyproject.toml
cat <<EOF >src/libpcap/libpcap.cfg
[libpcap]
LIBPCAP = ${lib.getLib pkgsLibpcap}/lib/libpcap${stdenv.hostPlatform.extensions.sharedLibrary}
EOF
'';
buildInputs = [
dbus.lib
pkgsLibpcap
pkg-about
];
preCheck = ''
pushd tests
'';
postCheck = ''
popd
'';
nativeCheckInputs = [ pytestCheckHook ];
pythonImportsCheck = [ "libpcap" ];
meta = {
description = "Python binding for the libpcap C library";
longDescription = ''
Python libpcap module is a low-level binding for libpcap C library.
It is an effort to allow python programs full access to the API provided by the well known libpcap Unix C library and by its implementations provided under Win32 systems by such packet capture systems as: Npcap, WinPcap
libpcap is a lightweight Python package, based on the ctypes library.
It is fully compliant implementation of the original C libpcap from 1.0.0 up to 1.9.0 API and the WinPcap’s 4.1.3 libpcap (1.0.0rel0b) API by implementing whole its functionality in a clean Python instead of C.
'';
homepage = "https://github.com/karpierz/libpcap/";
changelog = "https://github.com/karpierz/libpcap/blob/${version}/CHANGES.rst";
license = lib.licenses.bsd3;
teams = [ lib.teams.ororatech ];
};
}
|