|
| 1 | +class BehaviortreeCpp < Formula |
| 2 | + desc "Behavior Trees Library in C++" |
| 3 | + homepage "https://www.behaviortree.dev/" |
| 4 | + url "https://github.com/BehaviorTree/BehaviorTree.CPP/archive/refs/tags/4.6.2.tar.gz" |
| 5 | + sha256 "b0e7e53b27feae894e2df3f3faadfdd49f2108ebccfb1bd7cc0d405ffc56cecd" |
| 6 | + license "MIT" |
| 7 | + |
| 8 | + bottle do |
| 9 | + sha256 cellar: :any, arm64_sequoia: "76735a4aaa8407db888e5dcda8cdd615c867d60d22e7571a09815189c6638529" |
| 10 | + sha256 cellar: :any, arm64_sonoma: "1d302e8019808583145e3cd797615fa030821e6019530c4438cf88f6d622172a" |
| 11 | + sha256 cellar: :any, arm64_ventura: "d66a7461ae47f2c5bf0e8fec136178870098cb66ea06a4f2ce271da3317fbb6b" |
| 12 | + sha256 cellar: :any, sonoma: "2305e0df7acf9f12494b0f8df56f993cb571256c039217dff05fca9d1f672225" |
| 13 | + sha256 cellar: :any, ventura: "a43a30fc1138ca2e6553c1d29ebf7936bd1f61569595b4dd1a58f1e21499c0fd" |
| 14 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "6ca79c98d692d391afd368f2da3fb03e561686afe91312f664aa94ebdabb2e1a" |
| 15 | + end |
| 16 | + |
| 17 | + depends_on "cmake" => :build |
| 18 | + depends_on "cppzmq" |
| 19 | + depends_on "zeromq" |
| 20 | + |
| 21 | + uses_from_macos "sqlite" |
| 22 | + |
| 23 | + def install |
| 24 | + system "cmake", "-S", ".", "-B", "build", |
| 25 | + "-DCMAKE_INSTALL_RPATH=#{rpath}", |
| 26 | + "-DBTCPP_UNIT_TESTS=OFF", |
| 27 | + "-DBTCPP_EXAMPLES=OFF", |
| 28 | + *std_cmake_args |
| 29 | + system "cmake", "--build", "build" |
| 30 | + system "cmake", "--install", "build" |
| 31 | + pkgshare.install "examples" |
| 32 | + end |
| 33 | + |
| 34 | + test do |
| 35 | + cp pkgshare/"examples/t03_generic_ports.cpp", testpath/"test.cpp" |
| 36 | + system ENV.cxx, "-std=c++17", "test.cpp", "-L#{lib}", "-lbehaviortree_cpp", "-o", "test" |
| 37 | + assert_match "Target positions: [ -1.0, 3.0 ]", shell_output("./test") |
| 38 | + end |
| 39 | +end |
0 commit comments