From 50d83ba2277527de4c2060f68e2c8ae42f3e3b4b Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Thu, 12 Oct 2023 18:48:41 +0000 Subject: [PATCH 1/3] Bumps in ionic : ci_matching_branch/bump_ionic_gz-gui9 Signed-off-by: Ian Chen --- Aliases/gz-gui9 | 1 - Formula/gz-gui9.rb | 119 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 1 deletion(-) delete mode 120000 Aliases/gz-gui9 create mode 100644 Formula/gz-gui9.rb diff --git a/Aliases/gz-gui9 b/Aliases/gz-gui9 deleted file mode 120000 index 26841f5e0..000000000 --- a/Aliases/gz-gui9 +++ /dev/null @@ -1 +0,0 @@ -../Formula/gz-gui8.rb \ No newline at end of file diff --git a/Formula/gz-gui9.rb b/Formula/gz-gui9.rb new file mode 100644 index 000000000..a7694e541 --- /dev/null +++ b/Formula/gz-gui9.rb @@ -0,0 +1,119 @@ +class GzGui9 < Formula + desc "Common libraries for robotics applications. GUI Library" + homepage "https://github.com/gazebosim/gz-gui" + url "https://github.com/gazebosim/gz-gui.git", branch: "main" + version "8.999.999-0-20231012" + license "Apache-2.0" + + head "https://github.com/gazebosim/gz-gui.git", branch: "main" + + depends_on "cmake" => [:build, :test] + depends_on "pkg-config" => [:build, :test] + depends_on "gz-cmake3" + depends_on "gz-common5" + depends_on "gz-msgs10" + depends_on "gz-plugin2" + depends_on "gz-rendering8" + depends_on "gz-transport13" + depends_on macos: :mojave # c++17 + depends_on "protobuf" + depends_on "qt@5" + depends_on "tinyxml2" + + def install + rpaths = [ + rpath, + rpath(source: lib/"gz-gui-8/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 some plugins in subfolders + %w[CameraFps Publisher TopicViewer WorldStats].each do |plugin| + p = lib/"gz-gui-8/plugins/lib#{plugin}.dylib" + # Use gz-plugin --info command to check plugin linking + cmd = Formula["gz-plugin2"].opt_libexec/"gz/plugin2/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 + # build against API + (testpath/"test.cpp").write <<-EOS + #include + + #ifndef Q_MOC_RUN + #include + #include + #include + #endif + + ////////////////////////////////////////////////// + int main(int _argc, char **_argv) + { + std::cout << "Hello, GUI!" << std::endl; + + // Increase verboosity so we see all messages + gz::common::Console::SetVerbosity(4); + + // Create app + gz::gui::Application app(_argc, _argv); + + // Load plugins / config + if (!app.LoadPlugin("Publisher")) + { + return 1; + } + + // Customize main window + auto win = app.findChild()->QuickWindow(); + win->setProperty("title", "Hello Window!"); + + // Run window + // app.exec(); + + std::cout << "After run" << std::endl; + + return 0; + } + EOS + (testpath/"CMakeLists.txt").write <<-EOS + cmake_minimum_required(VERSION 3.5 FATAL_ERROR) + find_package(gz-gui9 QUIET REQUIRED) + add_executable(test_cmake test.cpp) + target_link_libraries(test_cmake gz-gui9::gz-gui9) + EOS + ENV.append_path "PKG_CONFIG_PATH", Formula["qt@5"].opt_lib/"pkgconfig" + system "pkg-config", "gz-gui9" + cflags = `pkg-config --cflags gz-gui9`.split + ldflags = `pkg-config --libs gz-gui9`.split + system ENV.cc, "test.cpp", + *cflags, + *ldflags, + "-lc++", + "-o", "test" + ENV["GZ_PARTITION"] = rand((1 << 32) - 1).to_s + system "./test" + # test building with cmake + ENV.append_path "CMAKE_PREFIX_PATH", Formula["qt@5"].opt_prefix + 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 From 94e5e0ea1000e2e263b546136768bd14e6a2d69b Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Mon, 16 Oct 2023 17:22:12 -0500 Subject: [PATCH 2/3] Bumps in ionic : ci_matching_branch/bump_ionic_gz-gui9 Signed-off-by: Addisu Z. Taddese --- Formula/gz-gui9.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Formula/gz-gui9.rb b/Formula/gz-gui9.rb index a7694e541..59d4d3e9a 100644 --- a/Formula/gz-gui9.rb +++ b/Formula/gz-gui9.rb @@ -2,19 +2,19 @@ class GzGui9 < Formula desc "Common libraries for robotics applications. GUI Library" homepage "https://github.com/gazebosim/gz-gui" url "https://github.com/gazebosim/gz-gui.git", branch: "main" - version "8.999.999-0-20231012" + version "8.999.999-0-20231016" license "Apache-2.0" head "https://github.com/gazebosim/gz-gui.git", branch: "main" depends_on "cmake" => [:build, :test] depends_on "pkg-config" => [:build, :test] - depends_on "gz-cmake3" - depends_on "gz-common5" - depends_on "gz-msgs10" + depends_on "gz-cmake4" + depends_on "gz-common6" + depends_on "gz-msgs11" depends_on "gz-plugin2" - depends_on "gz-rendering8" - depends_on "gz-transport13" + depends_on "gz-rendering9" + depends_on "gz-transport14" depends_on macos: :mojave # c++17 depends_on "protobuf" depends_on "qt@5" From b519c7eca39bba0e1f650b16ea071f16d5ea8abc Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Mon, 16 Oct 2023 18:09:05 -0500 Subject: [PATCH 3/3] Bumps in ionic : ci_matching_branch/bump_ionic_gz-gui9 Signed-off-by: Addisu Z. Taddese --- Formula/gz-gui9.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Formula/gz-gui9.rb b/Formula/gz-gui9.rb index 59d4d3e9a..df36a1187 100644 --- a/Formula/gz-gui9.rb +++ b/Formula/gz-gui9.rb @@ -12,7 +12,7 @@ class GzGui9 < Formula depends_on "gz-cmake4" depends_on "gz-common6" depends_on "gz-msgs11" - depends_on "gz-plugin2" + depends_on "gz-plugin3" depends_on "gz-rendering9" depends_on "gz-transport14" depends_on macos: :mojave # c++17 @@ -40,7 +40,7 @@ def install %w[CameraFps Publisher TopicViewer WorldStats].each do |plugin| p = lib/"gz-gui-8/plugins/lib#{plugin}.dylib" # Use gz-plugin --info command to check plugin linking - cmd = Formula["gz-plugin2"].opt_libexec/"gz/plugin2/gz-plugin" + cmd = Formula["gz-plugin3"].opt_libexec/"gz/plugin3/gz-plugin" args = ["--info", "--plugin"] << p # print command and check return code system cmd, *args