61 lines
1.9 KiB
Ruby
61 lines
1.9 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.5.tar.gz"
|
|
sha256 "624c00b65e3a753cba50de038620860c86e2ac47b1793ae51f9427a4bcb14c32"
|
|
license "BSD-2-Clause"
|
|
revision 1
|
|
|
|
bottle do
|
|
sha256 "0272c14be39d1dc6e68ee7f527f7b5412809c7e687086bb922045050f943a4cf" => :big_sur
|
|
sha256 "6bc3941b914e7052855cc887a33794efd910e5e97716ef8ab60662d9fc80e3bb" => :catalina
|
|
sha256 "f9b521725e18122b4174f4a97919248362df4b04892b91e9229f218343814741" => :mojave
|
|
sha256 "10b1a4aa99a6a8e399439137ad871ef5d0b780c5dca96db0843bf26ee7983042" => :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
|