Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Aliases/gz-plugin5
1 change: 1 addition & 0 deletions Aliases/gz-tools3
2 changes: 2 additions & 0 deletions Formula/gz-plugin4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class GzPlugin4 < Formula
depends_on "gz-utils4"
depends_on "pkgconf"

conflicts_with "gz-rotary-plugin", because: "both install gz-plugin"

def install
rpaths = [
rpath,
Expand Down
74 changes: 74 additions & 0 deletions Formula/gz-rotary-plugin.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
class GzRotaryPlugin < Formula
desc "Plugin libraries for robotics applications"
homepage "https://github.com/gazebosim/gz-plugin"
license "Apache-2.0"

head "https://github.com/gazebosim/gz-plugin.git", branch: "main"

depends_on "cmake"
depends_on "gz-rotary-cmake"
depends_on "gz-rotary-tools"
depends_on "gz-rotary-utils"
depends_on "pkgconf"

conflicts_with "gz-jetty-plugin", because: "both install gz-plugin"

def install
rpaths = [
rpath,
rpath(source: libexec/"gz/plugin", target: lib),
]
cmake_args = std_cmake_args
cmake_args << "-DBUILD_TESTING=OFF"
cmake_args << "-DCMAKE_INSTALL_RPATH=#{rpaths.join(";")}"

# Use a build folder
mkdir "build" do
system "cmake", "..", *cmake_args
system "make", "install"
end
end

def caveats
<<~EOS
This is an unstable, development version of Gazebo built from source.
EOS
end

test do
# test CLI executable
system libexec/"gz/plugin/gz-plugin"
# build against API
(testpath/"test.cpp").write <<-EOS
#include <gz/plugin/Loader.hh>
int main() {
gz::plugin::Loader loader;
return loader.InterfacesImplemented().size();
}
EOS
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
find_package(gz-plugin QUIET REQUIRED COMPONENTS loader)
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake gz-plugin::loader)
EOS
system "pkg-config", "gz-plugin-loader"
cflags = `pkg-config --cflags gz-plugin-loader`.split
system ENV.cc, "test.cpp",
*cflags,
"-L#{lib}",
"-lgz-plugin-loader",
"-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
17 changes: 10 additions & 7 deletions Formula/gz-tools3.rb → Formula/gz-rotary-tools.rb
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
class GzTools3 < Formula
class GzRotaryTools < Formula
desc "Entry point for Gazebo command-line tools"
homepage "https://gazebosim.org"
url "https://github.com/gazebosim/gz-tools.git", branch: "main"
version "2.999.999-0-20250530"
license "Apache-2.0"

head "https://github.com/gazebosim/gz-tools.git", branch: "gz-tools3"
head "https://github.com/gazebosim/gz-tools.git", branch: "main"

depends_on "cmake" => :build
depends_on "libyaml" => :test
depends_on "ruby" => :test
depends_on "gz-cmake5"
depends_on "gz-rotary-cmake"

conflicts_with "gazebo11", because: "both install bin/gz"
conflicts_with "gz-tools2", because: "both install bin/gz"
conflicts_with "gz-jetty-tools", because: "both install bin/gz"

def install
inreplace "src/gz.in" do |s|
s.gsub! "@CMAKE_INSTALL_PREFIX@", HOMEBREW_PREFIX
end

# Use a build folder
mkdir "build" do
system "cmake", "..", *std_cmake_args
system "make", "install"
end
end

def caveats
<<~EOS
This is an unstable, development version of Gazebo built from source.
EOS
end

test do
mkdir testpath/"config"
(testpath/"config/test.yaml").write <<~EOS
Expand Down
2 changes: 1 addition & 1 deletion Formula/gz-tools2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class GzTools2 < Formula
depends_on "gz-cmake3"

conflicts_with "gazebo11", because: "both install bin/gz"
conflicts_with "gz-tools3", because: "both install bin/gz"
conflicts_with "gz-rotary-tools", because: "both install bin/gz"

def install
inreplace "src/gz.in" do |s|
Expand Down