diff --git a/Aliases/gz-fuel-tools10 b/Aliases/gz-fuel-tools10 deleted file mode 120000 index 38c9bfeb6..000000000 --- a/Aliases/gz-fuel-tools10 +++ /dev/null @@ -1 +0,0 @@ -../Formula/gz-fuel-tools9.rb \ No newline at end of file diff --git a/Formula/gz-fuel-tools10.rb b/Formula/gz-fuel-tools10.rb new file mode 100644 index 000000000..0bc3e0aad --- /dev/null +++ b/Formula/gz-fuel-tools10.rb @@ -0,0 +1,66 @@ +class GzFuelTools10 < Formula + desc "Tools for using Fuel API to download robot models" + homepage "https://gazebosim.org" + url "https://github.com/gazebosim/gz-fuel-tools.git", branch: "main" + version "9.999.999-0-20231011" + license "Apache-2.0" + + head "https://github.com/gazebosim/gz-fuel-tools.git", branch: "gz-fuel-tools10" + + depends_on "cmake" + depends_on "gz-cmake4" + depends_on "gz-common6" + depends_on "gz-msgs11" + depends_on "jsoncpp" + depends_on "libyaml" + depends_on "libzip" + depends_on macos: :high_sierra # c++17 + depends_on "pkg-config" + depends_on "protobuf" + + def install + cmake_args = std_cmake_args + cmake_args << "-DBUILD_TESTING=Off" + cmake_args << "-DCMAKE_INSTALL_RPATH=#{rpath}" + + mkdir "build" do + system "cmake", "..", *cmake_args + system "make", "install" + end + end + + test do + (testpath/"test.cpp").write <<-EOS + #include + int main() { + gz::fuel_tools::ServerConfig srv; + return 0; + } + EOS + (testpath/"CMakeLists.txt").write <<-EOS + cmake_minimum_required(VERSION 2.8 FATAL_ERROR) + find_package(gz-fuel_tools10 QUIET REQUIRED) + add_executable(test_cmake test.cpp) + target_link_libraries(test_cmake gz-fuel_tools10::gz-fuel_tools10) + EOS + # test building with pkg-config + system "pkg-config", "gz-fuel_tools10" + cflags = `pkg-config --cflags gz-fuel_tools10`.split + system ENV.cc, "test.cpp", + *cflags, + "-L#{lib}", + "-lgz-fuel_tools10", + "-lc++", + "-o", "test" + system "./test" + # test building with cmake + mkdir "build" do + system "cmake", ".." + system "make" + system "./test_cmake" + end + # check for Xcode frameworks in bottle + cmd_not_grep_xcode = "! grep -rnI 'Applications[/]Xcode' #{prefix}" + system cmd_not_grep_xcode + end +end