53 lines
1.7 KiB
Ruby
53 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.8.1.tar.gz"
|
|
sha256 "2e2e263b05e5f551c1a85e6fc5e1f14eab4e742478cd2b0edd57ab17895c2c8c"
|
|
|
|
bottle do
|
|
sha256 "8aa9059964a42f93a5087ef5a32beaeee14dc07dc6ecfc017aa93ab0c0782fa2" => :mojave
|
|
sha256 "21020ab5f4cdf3d8b78c539042526ab221a77021c3f7096383adeffea9f19cb0" => :high_sierra
|
|
sha256 "13a7320ca07c25045255b87f45ce33cfefff185ee3163017907290ad1beb67ac" => :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"
|
|
|
|
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
|