Skip to content

Commit

Permalink
Merge branch 'master' into ci_matching_branch/bump_ionic_gz-physics8
Browse files Browse the repository at this point in the history
  • Loading branch information
azeey authored Oct 17, 2023
2 parents 7289bb2 + 71fe2dd commit 359640d
Show file tree
Hide file tree
Showing 7 changed files with 240 additions and 7 deletions.
1 change: 0 additions & 1 deletion Aliases/gz-common6

This file was deleted.

1 change: 0 additions & 1 deletion Aliases/gz-msgs11

This file was deleted.

1 change: 0 additions & 1 deletion Aliases/gz-rendering9

This file was deleted.

76 changes: 76 additions & 0 deletions Formula/gz-common6.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
class GzCommon6 < Formula
desc "Common libraries for robotics applications"
homepage "https://gazebosim.org"
url "https://github.com/gazebosim/gz-common.git", branch: "main"
version "5.999.999-0-20231009"
license "Apache-2.0"

head "https://github.com/gazebosim/gz-common.git", branch: "gz-common6"

depends_on "assimp"
depends_on "cmake"
depends_on "ffmpeg"
depends_on "freeimage"
depends_on "gdal"
depends_on "gts"
depends_on "gz-cmake4"
depends_on "gz-math8"
depends_on "gz-utils3"
depends_on macos: :high_sierra # c++17
depends_on "ossp-uuid"
depends_on "pkg-config"
depends_on "tinyxml2"

def install
cmake_args = std_cmake_args
cmake_args << "-DBUILD_TESTING=OFF"
cmake_args << "-DCMAKE_INSTALL_RPATH=#{rpath}"

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

test do
(testpath/"test.cpp").write <<-EOS
#include <iostream>
#include <gz/common.hh>
int main() {
gzdbg << "debug" << std::endl;
gzwarn << "warn" << std::endl;
gzerr << "error" << std::endl;
return 0;
}
EOS
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
find_package(gz-common6 QUIET REQUIRED)
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake gz-common6::gz-common6)
EOS
system "pkg-config", "gz-common6"
cflags = `pkg-config --cflags gz-common6`.split
system ENV.cc, "test.cpp",
*cflags,
"-L#{lib}",
"-lgz-common6",
"-lc++",
"-o", "test"
system "./test"
# test building with cmake
mkdir "build" do
ENV.append "LIBRARY_PATH", Formula["gettext"].opt_lib
system "cmake", ".."
system "make"
system "./test_cmake"
end
# check for Xcode frameworks in bottle
# ! requires system with single argument, which uses standard shell
# put in variable to avoid audit complaint
# enclose / in [] so the following line won't match itself
cmd_not_grep_xcode = "! grep -rnI 'Applications[/]Xcode' #{prefix}"
system cmd_not_grep_xcode
end
end
70 changes: 70 additions & 0 deletions Formula/gz-msgs11.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
class GzMsgs11 < Formula
desc "Middleware protobuf messages for robotics"
homepage "https://gazebosim.org"
url "https://github.com/gazebosim/gz-msgs.git", branch: "main"
version "10.999.999-0-20231013"
license "Apache-2.0"

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

depends_on "cmake"
depends_on "gz-cmake4"
depends_on "gz-math8"
depends_on "gz-tools2"
depends_on macos: :high_sierra # c++17
depends_on "pkg-config"
depends_on "protobuf"
depends_on "python@3.11"
depends_on "tinyxml2"

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

(lib/"python3.11/site-packages").install Dir[lib/"python/*"]
rmdir prefix/"lib/python"
end

test do
(testpath/"test.cpp").write <<-EOS
#include <gz/msgs.hh>
int main() {
gz::msgs::UInt32;
return 0;
}
EOS
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
find_package(gz-msgs11 QUIET REQUIRED)
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake gz-msgs11::gz-msgs11)
EOS
# test building with pkg-config
system "pkg-config", "gz-msgs11"
cflags = `pkg-config --cflags gz-msgs11`.split
system ENV.cc, "test.cpp",
*cflags,
"-L#{lib}",
"-lgz-msgs11",
"-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
# check python import
system Formula["python@3.11"].opt_bin/"python3.11", "-c", "import gz.msgs11"
end
end
90 changes: 90 additions & 0 deletions Formula/gz-rendering9.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
class GzRendering9 < Formula
desc "Rendering library for robotics applications"
homepage "https://gazebosim.org"
url "https://github.com/gazebosim/gz-rendering.git", branch: "main"
version "8.999.999-0-20231016"
license "Apache-2.0"

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

depends_on "cmake" => [:build, :test]
depends_on "pkg-config" => [:build, :test]

depends_on "freeimage"
depends_on "gz-cmake4"
depends_on "gz-common6"
depends_on "gz-math8"
depends_on "gz-plugin3"
depends_on "gz-utils3"
depends_on macos: :mojave # c++17
depends_on "ogre1.9"
depends_on "ogre2.3"

def install
rpaths = [
rpath,
rpath(source: lib/"gz-rendering-9/engine-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 plugins in subfolders
["ogre", "ogre2"].each do |engine|
p = lib/"gz-rendering-9/engine-plugins/libgz-rendering-#{engine}.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
# build against API
github_actions = ENV["HOMEBREW_GITHUB_ACTIONS"].present?
(testpath/"test.cpp").write <<-EOS
#include <gz/rendering/RenderEngine.hh>
#include <gz/rendering/RenderingIface.hh>
int main(int _argc, char** _argv)
{
gz::rendering::RenderEngine *engine =
gz::rendering::engine("ogre");
return engine == nullptr;
}
EOS
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
find_package(gz-rendering9 REQUIRED COMPONENTS ogre ogre2)
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake gz-rendering9::gz-rendering9)
EOS
# test building with pkg-config
system "pkg-config", "gz-rendering9"
cflags = `pkg-config --cflags gz-rendering9`.split
ldflags = `pkg-config --libs gz-rendering9`.split
system ENV.cc, "test.cpp",
*cflags,
*ldflags,
"-lc++",
"-o", "test"
system "./test" unless github_actions
# test building with cmake
mkdir "build" do
system "cmake", ".."
system "make"
system "./test_cmake" unless github_actions
end
# check for Xcode frameworks in bottle
cmd_not_grep_xcode = "! grep -rnI 'Applications[/]Xcode' #{prefix}"
system cmd_not_grep_xcode
end
end
8 changes: 4 additions & 4 deletions Formula/sdformat15.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Sdformat15 < Formula
desc "Simulation Description Format"
homepage "http://sdformat.org"
url "https://github.com/gazebosim/sdformat.git", branch: "main"
version "14.999.999-0-20231011"
version "14.999.999-0-20231016"
license "Apache-2.0"

head "https://github.com/gazebosim/sdformat.git", branch: "main"
Expand All @@ -12,10 +12,10 @@ class Sdformat15 < Formula
depends_on "pybind11" => :build

depends_on "doxygen"
depends_on "gz-cmake3"
depends_on "gz-math7"
depends_on "gz-cmake4"
depends_on "gz-math8"
depends_on "gz-tools2"
depends_on "gz-utils2"
depends_on "gz-utils3"
depends_on macos: :mojave # c++17
depends_on "python@3.11"
depends_on "tinyxml2"
Expand Down

0 comments on commit 359640d

Please sign in to comment.