about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/nftables/python.nix
blob: 5c5770ebed4a5a0edab536afb710df186c4f7726 (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 "py/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;
  };
}