Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gz-launch8: new formula in ionic #2469

Merged
merged 4 commits into from
Oct 24, 2023
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: 0 additions & 1 deletion Aliases/gz-launch8

This file was deleted.

64 changes: 64 additions & 0 deletions Formula/gz-launch8.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
class GzLaunch8 < Formula
desc "Launch libraries for robotics applications"
homepage "https:/gazebosim/gz-launch"
url "https:/gazebosim/gz-launch.git", branch: "main"
version "7.999.999-0-20231016"
license "Apache-2.0"

head "https:/gazebosim/gz-launch.git", branch: "main"

depends_on "cmake" => :build
depends_on "pkg-config" => :build

depends_on "ffmpeg"
depends_on "gz-cmake4"
depends_on "gz-common6"
depends_on "gz-gui9"
depends_on "gz-msgs11"
depends_on "gz-plugin3"
depends_on "gz-sim9"
depends_on "gz-tools2"
depends_on "gz-transport14"
depends_on "protobuf"
depends_on "qt@5"
depends_on "tinyxml2"

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

mkdir "build" do
system "cmake", "..", *cmake_args
system "make", "install"
end
end

test do
# test CLI executable
system lib/"gz/launch8/gz-launch"
# test plugins in subfolders
%w[joytotwist sim-factory sim simgui].each do |plugin|
p = lib/"gz-launch-7/plugins/libgz-launch-#{plugin}.dylib"
# Use gz-plugin --info command to check plugin linking
cmd = Formula["gz-plugin3"].opt_libexec/"gz/plugin3/gz-plugin"
args = ["--info", "--plugin"] << p
# print command and check return code
system cmd, *args
# check that library was loaded properly
_, stderr = system_command(cmd, args: args)
error_string = "Error while loading the library"
assert stderr.exclude?(error_string), error_string
end
ENV["GZ_CONFIG_PATH"] = "#{opt_share}/gz"
system "gz", "launch", "--versions"
# check for Xcode frameworks in bottle
cmd_not_grep_xcode = "! grep -rnI 'Applications[/]Xcode' #{prefix}"
system cmd_not_grep_xcode
end
end