about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/nftables/python.nix
blob: 7980b8ff6de68424dfd7de0f5c6d444d74161b08 (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
{ lib
, buildPythonPackage
, setuptools
, nftables
}:

buildPythonPackage {
  pname = "nftables";
  inherit (nftables) version src;
  pyproject = true;

  postPatch = ''
    substituteInPlace "src/nftables.py" \
      --replace-fail "libnftables.so.1" "${nftables}/lib/libnftables.so.1"
  '';

  setSourceRoot = "sourceRoot=$(echo */py)";

  build-system = [ setuptools ];

  pythonImportsCheck = [ "nftables" ];

  meta = {
    inherit (nftables.meta) description homepage license platforms maintainers;
  };
}