1{ lib, buildPythonPackage, isPyPy, fetchPypi, libffi, pycparser, pytest }:
2
3if isPyPy then null else buildPythonPackage rec {
4 pname = "cffi";
5 version = "1.10.0";
6 name = "${pname}-${version}";
7
8 src = fetchPypi {
9 inherit pname version;
10 sha256 = "1mffyilq4qycm8gs4wkgb18rnqil8a9blqq77chdlshzxc8jkc5k";
11 };
12
13 propagatedBuildInputs = [ libffi pycparser ];
14 buildInputs = [ pytest ];
15
16 patchPhase = ''
17 substituteInPlace testing/cffi0/test_ownlib.py --replace "gcc" "cc"
18 '';
19
20 checkPhase = ''
21 py.test
22 '';
23
24 meta = with lib; {
25 maintainers = with maintainers; [ domenkozar ];
26 homepage = https://cffi.readthedocs.org/;
27 license = with licenses; [ mit ];
28 description = "Foreign Function Interface for Python calling C code";
29 };
30}