2017-09-16 16:27:33 +02:00
|
|
|
{ stdenv, buildPythonPackage, isPyPy, fetchPypi, libffi, pycparser, pytest }:
|
2017-05-01 17:50:55 +02:00
|
|
|
|
|
|
|
if isPyPy then null else buildPythonPackage rec {
|
|
|
|
pname = "cffi";
|
|
|
|
version = "1.10.0";
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "1mffyilq4qycm8gs4wkgb18rnqil8a9blqq77chdlshzxc8jkc5k";
|
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ libffi pycparser ];
|
|
|
|
buildInputs = [ pytest ];
|
|
|
|
|
2017-09-16 16:27:33 +02:00
|
|
|
# The tests use -Werror but with python3.6 clang detects some unreachable code.
|
|
|
|
NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.cc.isClang "-Wno-unreachable-code";
|
2017-05-01 17:50:55 +02:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
py.test
|
|
|
|
'';
|
|
|
|
|
2017-09-16 16:27:33 +02:00
|
|
|
meta = with stdenv.lib; {
|
2017-05-01 17:50:55 +02:00
|
|
|
maintainers = with maintainers; [ domenkozar ];
|
|
|
|
homepage = https://cffi.readthedocs.org/;
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
description = "Foreign Function Interface for Python calling C code";
|
|
|
|
};
|
|
|
|
}
|