depot/third_party/nixpkgs/pkgs/development/python-modules/python-ethtool/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

35 lines
798 B
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pkg-config,
libnl,
nettools,
}:
buildPythonPackage rec {
pname = "python-ethtool";
version = "0.15";
format = "setuptools";
src = fetchFromGitHub {
owner = "fedora-python";
repo = pname;
rev = "v${version}";
sha256 = "0arkcfq64a4fl88vjjsx4gd3mhcpa7mpq6sblpkgs4k4m9mccz6i";
};
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;
};
}