Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions pkgs/development/python-modules/libpcap/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{ lib
Comment thread
kip93 marked this conversation as resolved.
Outdated
, stdenv
, buildPythonPackage
, fetchPypi
, pythonOlder
, dbus
, pkgsLibpcap
, pkg-about
, setuptools
, tox
}:

buildPythonPackage rec {
pname = "libpcap";
version = "1.11.0b7";
format = "pyproject";

disabled = pythonOlder "3.7";

src = fetchPypi {
inherit pname version;
extension = "zip";
hash = "sha256-gEWFqmeOJTVHdjcSOxfVLZtrNSO3CTY1L2VcXOu7q7k=";
};

nativeBuildInputs = [
setuptools
tox
];

postPatch = ''
cat <<EOF >src/libpcap/libpcap.cfg
[libpcap]
LIBPCAP = ${pkgsLibpcap}/lib/libpcap${stdenv.hostPlatform.extensions.sharedLibrary}
EOF
'';

propagatedBuildInputs = [
dbus.lib
pkgsLibpcap
pkg-about
];

# Project has tests, but I can't get them to run even outside of nix
doCheck = false;

pythonImportsCheck = [
"libpcap"
];

meta = with lib; {
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/";
license = licenses.bsd3;
maintainers = [ teams.ororatech ];
};
Comment thread
kip93 marked this conversation as resolved.
Outdated
}
20 changes: 16 additions & 4 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5989,6 +5989,10 @@ self: super: with self; {
inherit (pkgs) libsodium;
};

libpcap = callPackage ../development/python-modules/libpcap {
pkgsLibpcap = pkgs.libpcap; # Needs the C library
};

libpurecool = callPackage ../development/python-modules/libpurecool { };

libpyfoscam = callPackage ../development/python-modules/libpyfoscam { };
Expand Down Expand Up @@ -7860,7 +7864,9 @@ self: super: with self; {

pc-ble-driver-py = toPythonModule (callPackage ../development/python-modules/pc-ble-driver-py { });

pcapy-ng = callPackage ../development/python-modules/pcapy-ng { };
pcapy-ng = callPackage ../development/python-modules/pcapy-ng {
inherit (pkgs) libpcap; # Avoid confusion with python package of the same name
};

pcodedmp = callPackage ../development/python-modules/pcodedmp { };

Expand Down Expand Up @@ -8962,7 +8968,9 @@ self: super: with self; {

pydes = callPackage ../development/python-modules/pydes { };

py-desmume = callPackage ../development/python-modules/py-desmume { };
py-desmume = callPackage ../development/python-modules/py-desmume {
inherit (pkgs) libpcap; # Avoid confusion with python package of the same name
};

pydevccu = callPackage ../development/python-modules/pydevccu { };

Expand Down Expand Up @@ -9613,7 +9621,9 @@ self: super: with self; {

pypca = callPackage ../development/python-modules/pypca { };

pypcap = callPackage ../development/python-modules/pypcap { };
pypcap = callPackage ../development/python-modules/pypcap {
inherit (pkgs) libpcap; # Avoid confusion with python package of the same name
};

pypck = callPackage ../development/python-modules/pypck { };

Expand Down Expand Up @@ -11484,7 +11494,9 @@ self: super: with self; {

scancode-toolkit = callPackage ../development/python-modules/scancode-toolkit { };

scapy = callPackage ../development/python-modules/scapy { };
scapy = callPackage ../development/python-modules/scapy {
inherit (pkgs) libpcap; # Avoid confusion with python package of the same name
};

schedule = callPackage ../development/python-modules/schedule { };

Expand Down