summary refs log tree commit diff
path: root/pkgs/development/python-modules/cffi/default.nix
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-10-29 01:47:46 +0200
committerDaiderd Jordan <daiderd@gmail.com>2017-10-29 10:51:19 +0100
commit3f3eb6ca64534c1bfcafe23a78e6cc7a711e7137 (patch)
tree39ea56f249b290ea61e0309c6b5f866c4dd62275 /pkgs/development/python-modules/cffi/default.nix
parent0767d2984bcfd61e49af8d849e022c33cfb6aad8 (diff)
downloadnixlib-3f3eb6ca64534c1bfcafe23a78e6cc7a711e7137.tar
nixlib-3f3eb6ca64534c1bfcafe23a78e6cc7a711e7137.tar.gz
nixlib-3f3eb6ca64534c1bfcafe23a78e6cc7a711e7137.tar.bz2
nixlib-3f3eb6ca64534c1bfcafe23a78e6cc7a711e7137.tar.lz
nixlib-3f3eb6ca64534c1bfcafe23a78e6cc7a711e7137.tar.xz
nixlib-3f3eb6ca64534c1bfcafe23a78e6cc7a711e7137.tar.zst
nixlib-3f3eb6ca64534c1bfcafe23a78e6cc7a711e7137.zip
python-cffi: fix clang build
Diffstat (limited to 'pkgs/development/python-modules/cffi/default.nix')
-rw-r--r--pkgs/development/python-modules/cffi/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/development/python-modules/cffi/default.nix b/pkgs/development/python-modules/cffi/default.nix
index 5c99e77af56b..b0524b4121ad 100644
--- a/pkgs/development/python-modules/cffi/default.nix
+++ b/pkgs/development/python-modules/cffi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildPythonPackage, isPyPy, fetchPypi, libffi, pycparser, pytest }:
+{ stdenv, buildPythonPackage, isPy27, isPyPy, fetchPypi, libffi, pycparser, pytest }:
 
 if isPyPy then null else buildPythonPackage rec {
   pname = "cffi";
@@ -10,13 +10,15 @@ if isPyPy then null else buildPythonPackage rec {
     sha256 = "ab87dd91c0c4073758d07334c1e5f712ce8fe48f007b86f8238773963ee700a6";
   };
 
+  patches = stdenv.lib.optional (isPy27 && stdenv.cc.isClang) ./clang.patch;
+
   outputs = [ "out" "dev" ];
 
   propagatedBuildInputs = [ libffi pycparser ];
   buildInputs = [ pytest ];
 
   # 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";
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.cc.isClang [ "-Wno-unused-command-line-argument" "-Wno-unreachable-code" ];
 
   checkPhase = ''
     py.test