summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/cffi/default.nix
blob: 435ebfd324916feb5c924b99cf2515de690ed1f6 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
  buildPythonPackage,
  fetchFromGitHub,
  lib,
  libffi,
  pkg-config,
  pycparser,
  pytestCheckHook,
  setuptools,
  stdenv,
}:

buildPythonPackage rec {
  pname = "cffi";
  version = "2.1.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "python-cffi";
    repo = "cffi";
    tag = "v${version}";
    hash = "sha256-17OgcPo1pYwsPV/2iHe7iXVusCp5zLTFGcHYUfX1g48=";
  };

  nativeBuildInputs = [ pkg-config ];

  build-system = [ setuptools ];

  buildInputs = [ libffi ];

  # Some dependent packages expect to have pycparser available when using cffi.
  dependencies = [ pycparser ];

  doCheck = !(stdenv.hostPlatform.isMusl || stdenv.hostPlatform.useLLVM or false);

  disabledTests = [
    # parse error
    "test_dont_remove_comment_in_line_directives"
    "test_multiple_line_directives"
    "test_commented_line_directive"
    # exception mismatch
    "test_unknown_name"
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  meta = {
    changelog = "https://github.com/python-cffi/cffi/releases/tag/v${version}";
    description = "Foreign Function Interface for Python calling C code";
    downloadPage = "https://github.com/python-cffi/cffi";
    homepage = "https://cffi.readthedocs.org/";
    license = lib.licenses.mit0;
    teams = [ lib.teams.python ];
  };
}