Merge pull request #20549 from proger/ceres-solver-darwin

ceres-solver: glog builds on darwin just fine now
This commit is contained in:
Graham Christensen 2016-11-27 22:09:17 -05:00 committed by GitHub
commit 540670259c

View file

@ -3,7 +3,7 @@
, fetchurl , fetchurl
, cmake , cmake
, google-gflags ? null , google-gflags ? null
, glog ? null , glog
, runTests ? false , runTests ? false
}: }:
@ -12,11 +12,6 @@ assert runTests -> google-gflags != null;
let let
version = "1.10.0"; version = "1.10.0";
# glog currently doesn't build on darwin
# Issue: https://code.google.com/p/google-glog/issues/detail?id=121
useGlog = glog != null && !stdenv.isDarwin;
in in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "ceres-solver-${version}"; name = "ceres-solver-${version}";
@ -26,8 +21,7 @@ stdenv.mkDerivation {
sha256 = "20bb5db05c3e3e14a4062e2cf2b0742d2653359549ecded3e0653104ef3deb17"; sha256 = "20bb5db05c3e3e14a4062e2cf2b0742d2653359549ecded3e0653104ef3deb17";
}; };
buildInputs = [ cmake ] buildInputs = [ cmake glog ]
++ stdenv.lib.optional useGlog glog
++ stdenv.lib.optional (google-gflags != null) google-gflags; ++ stdenv.lib.optional (google-gflags != null) google-gflags;
inherit eigen; inherit eigen;
@ -38,7 +32,6 @@ stdenv.mkDerivation {
cmakeFlags = " cmakeFlags = "
-DEIGEN_INCLUDE_DIR=${eigen}/include/eigen3 -DEIGEN_INCLUDE_DIR=${eigen}/include/eigen3
${if !useGlog then "-DMINIGLOG=ON" else ""}
"; ";
meta = with stdenv.lib; { meta = with stdenv.lib; {