fix compilation on gcc7

This commit is contained in:
Yuri Aisaka
2018-03-09 22:34:25 +09:00
parent 8dcd7f0d85
commit e559fa19f3
2 changed files with 52 additions and 2 deletions
@@ -1,4 +1,4 @@
{ stdenv, lib, config, fetchFromGitHub
{ stdenv, lib, config, fetchFromGitHub, fetchpatch
, cmake
, glog, google-gflags, gtest
, protobuf, snappy
@@ -56,6 +56,8 @@ let
};
dst = "pybind11";
};
ccVersion = (builtins.parseDrvName stdenv.cc.name).version;
in
stdenv.mkDerivation rec {
@@ -84,7 +86,9 @@ stdenv.mkDerivation rec {
;
propagatedBuildInputs = [ numpy future six python-protobuf pydot ];
patches = lib.optional stdenv.cc.isClang [ ./update_clang_cvtsh_bugfix.patch ];
patches = lib.optional (stdenv.cc.isGNU && lib.versionAtLeast ccVersion "7.0.0") [
./fix_compilation_on_gcc7.patch
] ++ lib.optional stdenv.cc.isClang [ ./update_clang_cvtsh_bugfix.patch ];
cmakeFlags = [ ''-DBUILD_TEST=OFF''
''-DBUILD_PYTHON=ON''