1{ stdenv, 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 outputs = [ "out" "dev" ];
14
15 propagatedBuildInputs = [ libffi pycparser ];
16 buildInputs = [ pytest ];
17
18 # The tests use -Werror but with python3.6 clang detects some unreachable code.
19 NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.cc.isClang "-Wno-unreachable-code";
20
21 checkPhase = ''
22 py.test
23 '';
24
25 meta = with stdenv.lib; {
26 maintainers = with maintainers; [ domenkozar ];
27 homepage = https://cffi.readthedocs.org/;
28 license = with licenses; [ mit ];
29 description = "Foreign Function Interface for Python calling C code";
30 };
31}