summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/seccomp/default.nix
blob: 951e4b31722abf3308fa12e454f55d4479e7343c (plain)
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
{
  buildPythonPackage,
  lib,
  cython,
  libseccomp,
}:

buildPythonPackage rec {
  pname = "libseccomp";
  version = libseccomp.version;
  format = "setuptools";
  src = libseccomp.pythonsrc;

  VERSION_RELEASE = version; # used by build system

  nativeBuildInputs = [ cython ];
  buildInputs = [ libseccomp ];

  unpackCmd = "tar xf $curSrc";
  doInstallCheck = true;

  postPatch = ''
    substituteInPlace ./setup.py \
      --replace 'extra_objects=["../.libs/libseccomp.a"]' \
                'libraries=["seccomp"]'
  '';

  pythonImportsCheck = [ "seccomp" ];

  meta = {
    description = "Python bindings for libseccomp";
    license = with lib.licenses; [ lgpl21 ];
    maintainers = with lib.maintainers; [ thoughtpolice ];
  };
}