homebrew-core/Formula/dartsim.rb

59 lines
1.8 KiB
Ruby

class Dartsim < Formula
desc "Dynamic Animation and Robotics Toolkit"
homepage "https://dartsim.github.io/"
url "https://github.com/dartsim/dart/archive/v6.9.4.tar.gz"
sha256 "aefa13b9cb1c968373faa976288f29fde4d94110125ab14b4707c2e0c7280443"
license "BSD-2-Clause"
bottle do
sha256 "bad657c56bb6d83b782b7a25e97e3bb60a042984255d05b85d1d50e9c50f830e" => :catalina
sha256 "a9c7a4c1aaf357f88bc389ced38816c4d5857cc44c2876933e8c12be3f5e4450" => :mojave
sha256 "9ff5943e7d6d6d055091e9e9318d230051379dd09dae3ec48a063a5a477ec78b" => :high_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 "ipopt"
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"
# Clean up the build file garbage that has been installed.
rm_r Dir["#{share}/doc/dart/**/CMakeFiles/"]
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++14", "-o", "test"
system "./test"
end
end