1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pkg-config
5, libnl
6, nettools
7}:
8
9buildPythonPackage rec {
10 pname = "python-ethtool";
11 version = "0.15";
12
13 src = fetchFromGitHub {
14 owner = "fedora-python";
15 repo = pname;
16 rev = "v${version}";
17 sha256 = "0arkcfq64a4fl88vjjsx4gd3mhcpa7mpq6sblpkgs4k4m9mccz6i";
18 };
19
20 postPatch = ''
21 substituteInPlace tests/parse_ifconfig.py --replace "Popen('ifconfig'," "Popen('${nettools}/bin/ifconfig',"
22 '';
23
24 buildInputs = [ libnl ];
25 nativeBuildInputs = [ pkg-config ];
26 pythonImportsCheck = [ "ethtool" ];
27
28 meta = with lib; {
29 description = "Python bindings for the ethtool kernel interface";
30 homepage = "https://github.com/fedora-python/python-ethtool";
31 license = licenses.gpl2Plus;
32 maintainers = with maintainers; [ elohmeier ];
33 };
34}