Skip to content

Commit

Permalink
python-cffi: fix test failures when using clang
Browse files Browse the repository at this point in the history
(cherry picked from commit 3564975)
  • Loading branch information
LnL7 committed Sep 16, 2017
1 parent a4bf452 commit 2ad8055
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkgs/development/python-modules/cffi/default.nix
@@ -1,4 +1,4 @@
{ lib, buildPythonPackage, isPyPy, fetchPypi, libffi, pycparser, pytest }:
{ stdenv, buildPythonPackage, isPyPy, fetchPypi, libffi, pycparser, pytest }:

if isPyPy then null else buildPythonPackage rec {
pname = "cffi";
Expand All @@ -13,15 +13,14 @@ if isPyPy then null else buildPythonPackage rec {
propagatedBuildInputs = [ libffi pycparser ];
buildInputs = [ pytest ];

patchPhase = ''
substituteInPlace testing/cffi0/test_ownlib.py --replace "gcc" "cc"
'';
# 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";

checkPhase = ''
py.test
'';

meta = with lib; {
meta = with stdenv.lib; {
maintainers = with maintainers; [ domenkozar ];
homepage = https://cffi.readthedocs.org/;
license = with licenses; [ mit ];
Expand Down

0 comments on commit 2ad8055

Please sign in to comment.