summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/cffi/default.nix
blob: 0c837d51ffce8b09a2061132515aa05985651e50 (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
{
  buildPythonPackage,
  fetchFromGitHub,
  lib,
  libffi,
  pkg-config,
  pycparser,
  pytestCheckHook,
  setuptools,
  stdenv,
}:

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

  src = fetchFromGitHub {
    owner = "python-cffi";
    repo = "cffi";
    tag = "v${version}";
    hash = "sha256-7Mzz3KmmmE2xQru1GA4aY0DZqn6vxykWiExQvnA1bjM=";
  };

  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);

  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 ];
  };
}