2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pkg-config,
|
|
|
|
libnl,
|
|
|
|
nettools,
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-ethtool";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "0.15";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fedora-python";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "0arkcfq64a4fl88vjjsx4gd3mhcpa7mpq6sblpkgs4k4m9mccz6i";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tests/parse_ifconfig.py --replace "Popen('ifconfig'," "Popen('${nettools}/bin/ifconfig',"
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ libnl ];
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
pythonImportsCheck = [ "ethtool" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python bindings for the ethtool kernel interface";
|
|
|
|
homepage = "https://github.com/fedora-python/python-ethtool";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
};
|
|
|
|
}
|