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

Migrate remaining Garden formulae to gz #1946

Merged
merged 4 commits into from
Jun 24, 2022
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
24 changes: 11 additions & 13 deletions Formula/ignition-fuel-tools8.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
class IgnitionFuelTools8 < Formula
desc "Tools for using Fuel API to download robot models"
homepage "https://ignitionrobotics.org"
homepage "https://gazebosim.org"
url "https://github.com/gazebosim/gz-fuel-tools.git", branch: "main"
version "7.999.999~0~20220414"
license "Apache-2.0"

depends_on "cmake"
depends_on "ignition-cmake3"
depends_on "ignition-common5"
depends_on "ignition-msgs9"
depends_on "gz-cmake3"
depends_on "gz-common5"
depends_on "gz-msgs9"
depends_on "jsoncpp"
depends_on "libyaml"
depends_on "libzip"
Expand All @@ -28,27 +28,25 @@ def install

test do
(testpath/"test.cpp").write <<-EOS
#include <ignition/fuel_tools.hh>
#include <gz/fuel_tools.hh>
int main() {
ignition::fuel_tools::ServerConfig srv;
gz::fuel_tools::ServerConfig srv;
return 0;
}
EOS
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
find_package(ignition-fuel_tools8 QUIET REQUIRED)
include_directories(${IGNITION-FUEL_TOOLS_INCLUDE_DIRS})
link_directories(${IGNITION-FUEL_TOOLS_LIBRARY_DIRS})
find_package(gz-fuel_tools8 QUIET REQUIRED)
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake ignition-fuel_tools8::ignition-fuel_tools8)
target_link_libraries(test_cmake gz-fuel_tools8::gz-fuel_tools8)
EOS
# test building with pkg-config
system "pkg-config", "ignition-fuel_tools8"
cflags = `pkg-config --cflags ignition-fuel_tools8`.split
system "pkg-config", "gz-fuel_tools8"
cflags = `pkg-config --cflags gz-fuel_tools8`.split
system ENV.cc, "test.cpp",
*cflags,
"-L#{lib}",
"-lignition-fuel_tools8",
"-lgz-fuel_tools8",
"-lc++",
"-o", "test"
system "./test"
Expand Down
32 changes: 16 additions & 16 deletions Formula/ignition-garden.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ class IgnitionGarden < Formula
head "https://github.com/gazebosim/gz-garden.git", branch: "main"

depends_on "cmake" => :build
depends_on "ignition-cmake3"
depends_on "ignition-common5"
depends_on "ignition-fuel-tools8"
depends_on "ignition-gazebo7"
depends_on "ignition-gui7"
depends_on "ignition-launch6"
depends_on "ignition-math7"
depends_on "ignition-msgs9"
depends_on "ignition-physics6"
depends_on "ignition-plugin2"
depends_on "ignition-rendering7"
depends_on "ignition-sensors7"
depends_on "ignition-tools2"
depends_on "ignition-transport12"
depends_on "ignition-utils2"
depends_on "gz-cmake3"
depends_on "gz-common5"
depends_on "gz-fuel-tools8"
depends_on "gz-gui7"
depends_on "gz-launch6"
depends_on "gz-math7"
depends_on "gz-msgs9"
depends_on "gz-physics6"
depends_on "gz-plugin2"
depends_on "gz-rendering7"
depends_on "gz-sensors7"
depends_on "gz-sim7"
depends_on "gz-tools2"
depends_on "gz-transport12"
depends_on "gz-utils2"
depends_on macos: :mojave # c++17
depends_on "pkg-config"
depends_on "sdformat13"
Expand All @@ -47,7 +47,7 @@ def install
end

test do
yaml_file = share/"ignition/ignition-garden/gazebodistro/collection-garden.yaml"
yaml_file = share/"gz/gz-garden/gazebodistro/collection-garden.yaml"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these install paths are not updated yet

vcs validate: error: argument --input: can't open
 '/usr/local/Cellar/ignition-garden/0.999.999~0~20220414/share/gz/gz-garden/gazebodistro/collection-garden.yaml':
 [Errno 2] No such file or directory:
 '/usr/local/Cellar/ignition-garden/0.999.999~0~20220414/share/gz/gz-garden/gazebodistro/collection-garden.yaml'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we haven't migrated IGN_DATA_INSTALL_DIR yet. This was future-proofing. I understood no bottles were being built yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the garden formula is a special case; we have a nightly job to build that formula and run its test. I had forgotten about this when saying that tests were only used when building bottles. I'll submit a small PR to fix this formula only

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

system libexec/"bin/vcs", "validate", "--input", yaml_file
end
end
56 changes: 28 additions & 28 deletions Formula/ignition-gazebo7.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class IgnitionGazebo7 < Formula
desc "Ignition Gazebo robot simulator"
desc "Gazebo Sim robot simulator"
homepage "https://github.com/gazebosim/gz-sim"
url "https://github.com/gazebosim/gz-sim.git", branch: "main"
version "6.999.999~0~20220412"
Expand All @@ -10,19 +10,19 @@ class IgnitionGazebo7 < Formula
depends_on "ffmpeg"
depends_on "gflags"
depends_on "google-benchmark"
depends_on "ignition-cmake3"
depends_on "ignition-common5"
depends_on "ignition-fuel-tools8"
depends_on "ignition-gui7"
depends_on "ignition-math7"
depends_on "ignition-msgs9"
depends_on "ignition-physics6"
depends_on "ignition-plugin2"
depends_on "ignition-rendering7"
depends_on "ignition-sensors7"
depends_on "ignition-tools2"
depends_on "ignition-transport12"
depends_on "ignition-utils2"
depends_on "gz-cmake3"
depends_on "gz-common5"
depends_on "gz-fuel-tools8"
depends_on "gz-gui7"
depends_on "gz-math7"
depends_on "gz-msgs9"
depends_on "gz-physics6"
depends_on "gz-plugin2"
depends_on "gz-rendering7"
depends_on "gz-sensors7"
depends_on "gz-tools2"
depends_on "gz-transport12"
depends_on "gz-utils2"
depends_on macos: :mojave # c++17
depends_on "pkg-config"
depends_on "ruby"
Expand All @@ -40,19 +40,19 @@ def install
end

test do
ENV["IGN_CONFIG_PATH"] = "#{opt_share}/ignition"
ENV["IGN_CONFIG_PATH"] = "#{opt_share}/gz"
system Formula["ruby"].opt_bin/"ruby",
Formula["ignition-tools2"].opt_bin/"ign",
"gazebo", "-s", "--iterations", "5", "-r", "-v", "4"
Formula["gz-tools2"].opt_bin/"gz",
"sim", "-s", "--iterations", "5", "-r", "-v", "4"
(testpath/"test.cpp").write <<-EOS
#include <cstdint>
#include <ignition/gazebo/Entity.hh>
#include <ignition/gazebo/EntityComponentManager.hh>
#include <ignition/gazebo/components/World.hh>
#include <ignition/gazebo/components/Name.hh>
#include <gz/sim/Entity.hh>
#include <gz/sim/EntityComponentManager.hh>
#include <gz/sim/components/World.hh>
#include <gz/sim/components/Name.hh>

using namespace ignition;
using namespace gazebo;
using namespace gz;
using namespace sim;

//////////////////////////////////////////////////
int main(int argc, char **argv)
Expand Down Expand Up @@ -80,14 +80,14 @@ def install
EOS
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
find_package(ignition-gazebo7 QUIET REQUIRED)
find_package(gz-sim7 QUIET REQUIRED)
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake ignition-gazebo7::core)
target_link_libraries(test_cmake gz-sim7::core)
EOS
# ENV.append_path "PKG_CONFIG_PATH", Formula["qt@5"].opt_lib/"pkgconfig"
# system "pkg-config", "--cflags", "ignition-gazebo7"
# cflags = `pkg-config --cflags ignition-gazebo7`.split
# ldflags = `pkg-config --libs ignition-gazebo7`.split
# system "pkg-config", "--cflags", "gz-sim7"
# cflags = `pkg-config --cflags gz-sim7`.split
# ldflags = `pkg-config --libs gz-sim7`.split
# system ENV.cc, "test.cpp",
# *cflags,
# *ldflags,
Expand Down
36 changes: 18 additions & 18 deletions Formula/ignition-gui7.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ class IgnitionGui7 < Formula

depends_on "cmake" => [:build, :test]
depends_on "pkg-config" => [:build, :test]
depends_on "ignition-cmake3"
depends_on "ignition-common5"
depends_on "ignition-msgs9"
depends_on "ignition-plugin2"
depends_on "ignition-rendering7"
depends_on "ignition-transport12"
depends_on "gz-cmake3"
depends_on "gz-common5"
depends_on "gz-msgs9"
depends_on "gz-plugin2"
depends_on "gz-rendering7"
depends_on "gz-transport12"
depends_on macos: :mojave # c++17
depends_on "qt@5"
depends_on "tinyxml2"
Expand All @@ -33,9 +33,9 @@ def install
#include <iostream>

#ifndef Q_MOC_RUN
#include <ignition/gui/qt.h>
#include <ignition/gui/Application.hh>
#include <ignition/gui/MainWindow.hh>
#include <gz/gui/qt.h>
#include <gz/gui/Application.hh>
#include <gz/gui/MainWindow.hh>
#endif

//////////////////////////////////////////////////
Expand All @@ -44,10 +44,10 @@ def install
std::cout << "Hello, GUI!" << std::endl;

// Increase verboosity so we see all messages
ignition::common::Console::SetVerbosity(4);
gz::common::Console::SetVerbosity(4);

// Create app
ignition::gui::Application app(_argc, _argv);
gz::gui::Application app(_argc, _argv);

// Load plugins / config
if (!app.LoadPlugin("Publisher"))
Expand All @@ -56,7 +56,7 @@ def install
}

// Customize main window
auto win = app.findChild<ignition::gui::MainWindow *>()->QuickWindow();
auto win = app.findChild<gz::gui::MainWindow *>()->QuickWindow();
win->setProperty("title", "Hello Window!");

// Run window
Expand All @@ -69,20 +69,20 @@ def install
EOS
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
find_package(ignition-gui7 QUIET REQUIRED)
find_package(gz-gui7 QUIET REQUIRED)
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake ignition-gui7::ignition-gui7)
target_link_libraries(test_cmake gz-gui7::gz-gui7)
EOS
ENV.append_path "PKG_CONFIG_PATH", Formula["qt@5"].opt_lib/"pkgconfig"
system "pkg-config", "ignition-gui7"
cflags = `pkg-config --cflags ignition-gui7`.split
ldflags = `pkg-config --libs ignition-gui7`.split
system "pkg-config", "gz-gui7"
cflags = `pkg-config --cflags gz-gui7`.split
ldflags = `pkg-config --libs gz-gui7`.split
system ENV.cc, "test.cpp",
*cflags,
*ldflags,
"-lc++",
"-o", "test"
ENV["IGN_PARTITION"] = rand((1 << 32) - 1).to_s
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
Expand Down
20 changes: 10 additions & 10 deletions Formula/ignition-launch6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class IgnitionLaunch6 < Formula
depends_on "pkg-config" => :build

depends_on "ffmpeg"
depends_on "ignition-cmake3"
depends_on "ignition-common5"
depends_on "ignition-gazebo7"
depends_on "ignition-gui7"
depends_on "ignition-msgs9"
depends_on "ignition-plugin2"
depends_on "ignition-tools2"
depends_on "ignition-transport12"
depends_on "gz-cmake3"
depends_on "gz-common5"
depends_on "gz-gui7"
depends_on "gz-msgs9"
depends_on "gz-plugin2"
depends_on "gz-sim7"
depends_on "gz-tools2"
depends_on "gz-transport12"
depends_on "qt@5"
depends_on "tinyxml2"

Expand All @@ -32,8 +32,8 @@ def install
end

test do
ENV["IGN_CONFIG_PATH"] = "#{opt_share}/ignition"
system "ign", "launch", "--versions"
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
Expand Down
42 changes: 21 additions & 21 deletions Formula/ignition-physics6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class IgnitionPhysics6 < Formula
depends_on "bullet"
depends_on "dartsim"
depends_on "google-benchmark"
depends_on "ignition-cmake3"
depends_on "ignition-common5"
depends_on "ignition-math7"
depends_on "ignition-plugin2"
depends_on "ignition-utils2"
depends_on "gz-cmake3"
depends_on "gz-common5"
depends_on "gz-math7"
depends_on "gz-plugin2"
depends_on "gz-utils2"
depends_on macos: :mojave # c++17
depends_on "pkg-config"
depends_on "sdformat13"
Expand All @@ -29,28 +29,28 @@ def install

test do
(testpath/"test.cpp").write <<-EOS
#include "ignition/plugin/Loader.hh"
#include "ignition/physics/ConstructEmpty.hh"
#include "ignition/physics/RequestEngine.hh"
#include "gz/plugin/Loader.hh"
#include "gz/physics/ConstructEmpty.hh"
#include "gz/physics/RequestEngine.hh"
int main()
{
ignition::plugin::Loader loader;
loader.LoadLib("#{opt_lib}/libignition-physics6-dartsim-plugin.dylib");
ignition::plugin::PluginPtr dartsim =
loader.Instantiate("ignition::physics::dartsim::Plugin");
using featureList = ignition::physics::FeatureList<
ignition::physics::ConstructEmptyWorldFeature>;
gz::plugin::Loader loader;
loader.LoadLib("#{opt_lib}/libgz-physics6-dartsim-plugin.dylib");
gz::plugin::PluginPtr dartsim =
loader.Instantiate("gz::physics::dartsim::Plugin");
using featureList = gz::physics::FeatureList<
gz::physics::ConstructEmptyWorldFeature>;
auto engine =
ignition::physics::RequestEngine3d<featureList>::From(dartsim);
gz::physics::RequestEngine3d<featureList>::From(dartsim);
return engine == nullptr;
}
EOS
system "pkg-config", "ignition-physics6"
cflags = `pkg-config --cflags ignition-physics6`.split
ldflags = `pkg-config --libs ignition-physics6`.split
system "pkg-config", "ignition-plugin2-loader"
loader_cflags = `pkg-config --cflags ignition-plugin2-loader`.split
loader_ldflags = `pkg-config --libs ignition-plugin2-loader`.split
system "pkg-config", "gz-physics6"
cflags = `pkg-config --cflags gz-physics6`.split
ldflags = `pkg-config --libs gz-physics6`.split
system "pkg-config", "gz-plugin2-loader"
loader_cflags = `pkg-config --cflags gz-plugin2-loader`.split
loader_ldflags = `pkg-config --libs gz-plugin2-loader`.split
system ENV.cc, "test.cpp",
*cflags,
*ldflags,
Expand Down
Loading