summary refs log tree commit diff
path: root/pkgs/development/libraries/science/math/caffe2/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/science/math/caffe2/default.nix')
-rw-r--r--pkgs/development/libraries/science/math/caffe2/default.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/pkgs/development/libraries/science/math/caffe2/default.nix b/pkgs/development/libraries/science/math/caffe2/default.nix
index b055acba9f1..916bf122b3c 100644
--- a/pkgs/development/libraries/science/math/caffe2/default.nix
+++ b/pkgs/development/libraries/science/math/caffe2/default.nix
@@ -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''
@@ -133,7 +137,7 @@ stdenv.mkDerivation rec {
       algorithms. You can bring your creations to scale using the power of GPUs in the
       cloud or to the masses on mobile with Caffe2's cross-platform libraries.
     '';
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    platforms = with stdenv.lib.platforms; linux;
     license = stdenv.lib.licenses.asl20;
     maintainers = with stdenv.lib.maintainers; [ yuriaisaka ];
   };