stripe-cli: 1.23.3 -> 1.23.5 (#375724)
[NixPkgs.git] / pkgs / development / python-modules / ethtool / default.nix
blobe7f87548ea058dbfb6bcf854ea25da9eab2d1c5e
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   fetchpatch2,
6   setuptools,
7   pkg-config,
8   libnl,
9   nettools,
10   pytestCheckHook,
13 buildPythonPackage rec {
14   pname = "ethtool";
15   version = "0.15";
16   pyproject = true;
18   src = fetchFromGitHub {
19     owner = "fedora-python";
20     repo = "python-ethtool";
21     tag = "v${version}";
22     hash = "sha256-0XzGaqpkEv3mpUsbfOtRl8E62iNdS7kRoo4oYrBjMys=";
23   };
25   patches = [
26     # https://github.com/fedora-python/python-ethtool/pull/60
27     (fetchpatch2 {
28       url = "https://github.com/fedora-python/python-ethtool/commit/f82dd763bd50affda993b9afe3b141069a1a7466.patch";
29       hash = "sha256-mtI7XsoyM43s2DFQdsBNpB8jJff7ZyO2J6SHodBrdrI=";
30     })
31   ];
33   postPatch = ''
34     substituteInPlace tests/parse_ifconfig.py \
35       --replace-fail "Popen('ifconfig'," "Popen('${lib.getExe' nettools "ifconfig"}',"
36   '';
38   build-system = [ setuptools ];
40   nativeBuildInputs = [ pkg-config ];
42   buildInputs = [ libnl ];
44   pythonImportsCheck = [ "ethtool" ];
46   nativeCheckInputs = [
47     nettools
48     pytestCheckHook
49   ];
51   meta = with lib; {
52     changelog = "https://github.com/fedora-python/python-ethtool/blob/${src.rev}/CHANGES.rst";
53     description = "Python bindings for the ethtool kernel interface";
54     homepage = "https://github.com/fedora-python/python-ethtool";
55     license = licenses.gpl2Plus;
56   };