12 , enableStatic ? stdenv.hostPlatform.isStatic
16 # gflags is required to run tests
17 assert runTests -> gflags != null;
19 stdenv.mkDerivation rec {
20 pname = "ceres-solver";
24 url = "http://ceres-solver.org/ceres-solver-${version}.tar.gz";
25 sha256 = "00vng9vnmdb1qga01m0why90m0041w7bn6kxa2h4m26aflfqla8h";
28 outputs = [ "out" "dev" ];
31 # Enable GNUInstallDirs, see: https://github.com/ceres-solver/ceres-solver/pull/706
33 url = "https://github.com/ceres-solver/ceres-solver/commit/4998c549396d36a491f1c0638fe57824a40bcb0d.patch";
34 sha256 = "sha256-mF6Zh2fDVzg2kD4nI2dd9rp4NpvPErmwfdYo5JaBmCA=";
38 nativeBuildInputs = [ cmake ];
39 buildInputs = lib.optional runTests gflags;
40 propagatedBuildInputs = [ eigen glog ]
41 ++ lib.optionals withBlas [ blas suitesparse ];
44 "-DBUILD_SHARED_LIBS=${if enableStatic then "OFF" else "ON"}"
47 # The Basel BUILD file conflicts with the cmake build directory on
48 # case-insensitive filesystems, eg. darwin.
58 description = "C++ library for modeling and solving large, complicated optimization problems";
59 license = licenses.bsd3;
60 homepage = "http://ceres-solver.org";
61 maintainers = with maintainers; [ giogadi ];
62 platforms = platforms.unix;