about summary refs log tree commit diff
path: root/pkgs/development/python-modules/python-ethtool/default.nix
blob: d028d1af2429db58d48999d73a1257007b93faaf (plain) (blame)
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
{
  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;
    maintainers = with maintainers; [ elohmeier ];
  };
}