55 lines
1.7 KiB
Ruby
55 lines
1.7 KiB
Ruby
class Dartsim < Formula
|
|
desc "Dynamic Animation and Robotics Toolkit"
|
|
homepage "https://dartsim.github.io/"
|
|
url "https://github.com/dartsim/dart/archive/v6.7.1.tar.gz"
|
|
sha256 "5cd41a2b1aa942dc2ce1ab20b16acaf8c267760a8b839f6aada53030485c9f4f"
|
|
|
|
bottle do
|
|
sha256 "43441501d60ad6a87e35ba3430901e47f46642c89d62b3592bb4dd50e2cbc84d" => :mojave
|
|
sha256 "b747352e0fafaeb7895be52fa2cfafd07c0f97869413172a5ebe276b5085d74e" => :high_sierra
|
|
sha256 "83be38ed2917c7df23ce4596e703c28aad841c9d12bcd84594f9df12f1dc56b2" => :sierra
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "assimp"
|
|
depends_on "boost"
|
|
depends_on "bullet"
|
|
depends_on "eigen"
|
|
depends_on "fcl"
|
|
depends_on "flann"
|
|
depends_on "libccd"
|
|
depends_on "nlopt"
|
|
depends_on "ode"
|
|
depends_on "open-scene-graph"
|
|
depends_on "tinyxml2"
|
|
depends_on "urdfdom"
|
|
|
|
needs :cxx11
|
|
|
|
def install
|
|
ENV.cxx11
|
|
|
|
# Force to link to system GLUT (see: https://cmake.org/Bug/view.php?id=16045)
|
|
system "cmake", ".", "-DGLUT_glut_LIBRARY=/System/Library/Frameworks/GLUT.framework",
|
|
*std_cmake_args
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.cpp").write <<~EOS
|
|
#include <dart/dart.hpp>
|
|
int main() {
|
|
auto world = std::make_shared<dart::simulation::World>();
|
|
assert(world != nullptr);
|
|
return 0;
|
|
}
|
|
EOS
|
|
system ENV.cxx, "test.cpp", "-I#{Formula["eigen"].include}/eigen3",
|
|
"-I#{include}", "-L#{lib}", "-ldart",
|
|
"-L#{Formula["assimp"].opt_lib}", "-lassimp",
|
|
"-L#{Formula["boost"].opt_lib}", "-lboost_system",
|
|
"-std=c++11", "-o", "test"
|
|
system "./test"
|
|
end
|
|
end
|