Skip to content

Commit

Permalink
Harmonic: fix rpath issues and add tests (#2413)
Browse files Browse the repository at this point in the history
* gz-gui8: revision bump
* gz-launch7: revision bump
* gz-physics7: revision bump
* gz-rendering8: revision bump
* gz-sim8: revision bump
* gz-transport13: revision bump
* update  bottle.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Co-authored-by: OSRF Build Bot <osrfbuild@osrfoundation.org>
  • Loading branch information
scpeters and osrfbuild authored Sep 19, 2023
1 parent 8efd434 commit d83e5da
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 35 deletions.
28 changes: 23 additions & 5 deletions Formula/gz-gui8.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ class GzGui8 < Formula
version "8.0.0~pre1"
sha256 "30af47eb3fb9e83406a5d5dd921c9e6798a1b7abe636ccc364233f68b54187cb"
license "Apache-2.0"
revision 2
revision 3

head "https://github.com/gazebosim/gz-gui.git", branch: "gz-gui8"

bottle do
root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
sha256 ventura: "337c2aa55a231cca0f2aea892283dc0bfd2ce2fdaca7dc85a4728a308a276c79"
sha256 monterey: "059952e15f8b0b6a9eaec93380bfe35852b21328034aa67365fe57dee2024b17"
sha256 big_sur: "db5696cb83a5f41bace4fd7fdd66c3a253736327cd7c0e1bbcc5dfb2ac225c42"
sha256 ventura: "8abb2c13067e7441c7728bdd4247cab91e1afccd14fe7f1b73e4f2400bb77273"
sha256 monterey: "d9cd1ce8437bf04a7f8d55fc46900aba18288f46abea6a95ccad5c956347fc60"
sha256 big_sur: "eb1051d2a68cdafc3443459ef6bf8d718a92a2471fe905dde4e8591858eb786a"
end

depends_on "cmake" => [:build, :test]
Expand All @@ -30,9 +30,13 @@ class GzGui8 < Formula
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=#{rpath}"
cmake_args << "-DCMAKE_INSTALL_RPATH=#{rpaths.join(";")}"

mkdir "build" do
system "cmake", "..", *cmake_args
Expand All @@ -41,6 +45,20 @@ def install
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 <iostream>
Expand Down
30 changes: 25 additions & 5 deletions Formula/gz-launch7.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ class GzLaunch7 < Formula
version "7.0.0~pre1"
sha256 "efe15fd7201079612ce69bd6d7cdc3a5694f302928838b9bb48a40459085e1e0"
license "Apache-2.0"
revision 2
revision 3

head "https://github.com/gazebosim/gz-launch.git", branch: "gz-launch7"

bottle do
root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
sha256 ventura: "1eb930092c0b5fc49a5828fb7d91094ccf6a7d24a18a5fd8698c101d138a11b0"
sha256 monterey: "72cbc00b70c5f119b0284be4d8966c0b61954d37466e95942afcea2bbf567bf6"
sha256 big_sur: "240ec8562fe42f5bca65924a14d085fa44fafcd03e23ba0da16c8c07f3e62942"
sha256 ventura: "2e4b99c7defe1f746409410b0085f496846eff96e0215ceae28c6fd880c24c57"
sha256 monterey: "c97689fef87143e7d5f285f1ce88bedc25be291fcf0df8b01af138ae52fac737"
sha256 big_sur: "0139929ffa75c52a6a2adad81d7517f6417c632f7ec2f902158ac73a2d78bee3"
end

depends_on "cmake" => :build
Expand All @@ -33,9 +33,14 @@ class GzLaunch7 < Formula
depends_on "tinyxml2"

def install
rpaths = [
rpath,
rpath(source: lib/"gz/launch7", 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=#{rpath}"
cmake_args << "-DCMAKE_INSTALL_RPATH=#{rpaths.join(";")}"

mkdir "build" do
system "cmake", "..", *cmake_args
Expand All @@ -44,6 +49,21 @@ def install
end

test do
# test CLI executable
system lib/"gz/launch7/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-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
ENV["GZ_CONFIG_PATH"] = "#{opt_share}/gz"
system "gz", "launch", "--versions"
# check for Xcode frameworks in bottle
Expand Down
36 changes: 29 additions & 7 deletions Formula/gz-physics7.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ class GzPhysics7 < Formula
version "7.0.0~pre2"
sha256 "0b22a00e83959ca63ae4c4321ef5e1a6ca0ca95d9ba099d9623d803ee3afd5b9"
license "Apache-2.0"
revision 1

head "https://github.com/gazebosim/gz-physics.git", branch: "gz-physics7"

bottle do
root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
sha256 ventura: "138a13d619aa00fce5ab113bc85f2ee8c4c48652618645543683e3b8385ad855"
sha256 monterey: "ae9b15422b6f10492c4acdb6b59c74a0b8fae1b5064a45e7f87190160a7f41fe"
sha256 big_sur: "265a4de73a656256c5aecb1a0f63579fa9515d9f260a3688eed22240f1b4fa30"
sha256 ventura: "4a88d0ec69ea228cc49179b13f39139af70315641e22bcccd8ed110bb9869e2e"
sha256 monterey: "28d26ec8411bf1bf3383e6d0a293a8d52a926f47c39dbb61701d3a2a7f879d6a"
sha256 big_sur: "082f8316f3841e299319792929f33dfeeacd14a8e5be92806a1278791b022d5e"
end

depends_on "cmake" => [:build, :test]
Expand All @@ -30,14 +31,35 @@ class GzPhysics7 < Formula
depends_on "sdformat14"

def install
rpaths = [
rpath,
rpath(source: lib/"gz-physics-7/engine-plugins", target: lib),
]
cmake_args = std_cmake_args
cmake_args << "-DBUILD_TESTING=Off"
cmake_args << "-DCMAKE_INSTALL_RPATH=#{rpath}"
system "cmake", ".", *cmake_args
system "make", "install"
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
%w[bullet-featherstone bullet dartsim tpe].each do |engine|
p = lib/"gz-physics-7/engine-plugins/libgz-physics-#{engine}-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 "gz/plugin/Loader.hh"
#include "gz/physics/ConstructEmpty.hh"
Expand Down
35 changes: 30 additions & 5 deletions Formula/gz-rendering8.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ class GzRendering8 < Formula
version "8.0.0~pre2"
sha256 "2e828c5c0754d082d97a01b5ef6f47d3baae2749f7c638b18259c4673c11be7b"
license "Apache-2.0"
revision 1

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

bottle do
root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
sha256 ventura: "81f3c692236e1fc13e4c07879f9b32dd2c0435f098d4113e1a0ffd384bc45dfb"
sha256 monterey: "ccfd3d17b447223460edf896977317745a9a6babd6fcfd167ccb5d3c7dc6e92a"
sha256 big_sur: "c36c019be012b3553226db1f8ba5aae05a35559ad66a0e45cef4c43742ea2f62"
sha256 ventura: "2b29c8efc349b06ebe235a982c44ec4c8ecf5199e6aee6d115635909585bba77"
sha256 monterey: "9bbee41f78364d5e95eb98e762710bf4ae44dc1263f7a82394dd8253bcbe98f3"
sha256 big_sur: "b24c5455c41e0b240fb1674660558b1883ca2790ef10dddd6a6138b5fa89d86c"
end

depends_on "cmake" => [:build, :test]
Expand All @@ -28,10 +29,20 @@ class GzRendering8 < Formula
depends_on "ogre1.9"
depends_on "ogre2.3"

patch do
# use CMAKE_INSTALL_RPATH values in ogre2 library
url "https://github.com/gazebosim/gz-rendering/commit/65ffacb49e5c5477e2ee5241bb45fdfd2273a5ae.patch?full_index=1"
sha256 "ed13b1d5e74d3a4e66c33a52149eb6be581b5f97014e2745d9e18ad216913fd8"
end

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

mkdir "build" do
system "cmake", "..", *cmake_args
Expand All @@ -40,6 +51,20 @@ def install
end

test do
# test plugins in subfolders
["ogre", "ogre2"].each do |engine|
p = lib/"gz-rendering-8/engine-plugins/libgz-rendering-#{engine}.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
github_actions = ENV["HOMEBREW_GITHUB_ACTIONS"].present?
(testpath/"test.cpp").write <<-EOS
#include <gz/rendering/RenderEngine.hh>
Expand Down
39 changes: 32 additions & 7 deletions Formula/gz-sim8.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ class GzSim8 < Formula
version "8.0.0~pre1"
sha256 "acf6d851cb8570bb978b3a56a4c5d0c11f6f75056b163311aa6dfc7fd9833ff4"
license "Apache-2.0"
revision 2
revision 3

head "https://github.com/gazebosim/gz-sim.git", branch: "gz-sim8"

bottle do
root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
sha256 ventura: "51f5725b5c010dac2210fbfc9506d0aaa989b239f7ef2190d8d31d6c18f9b142"
sha256 monterey: "bd93c768dd24d6b41d34a4962ade40ecbbb10d320a2e949b9dbec53e3b9f60a0"
sha256 big_sur: "1e8dba5053ea9174dbf644f718758c2237c7fc10ef8be69f807b1fb554cd750e"
sha256 ventura: "7630d00cd473903e3aaba1ba472aea9d7f6adb49b5deedafd99d09d1058c6aa2"
sha256 monterey: "5d81376fb61007e273b247916b2e2f73ffb9b3ae9121badff2e6bc7822e5cf5d"
sha256 big_sur: "9b6d8b36f6230dbba5eb54f6ef17bbb6b8e0e7c4a0e297c3e1315c845d409ad5"
end

depends_on "cmake" => :build
Expand Down Expand Up @@ -41,9 +41,15 @@ class GzSim8 < Formula
depends_on "sdformat14"

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

mkdir "build" do
system "cmake", "..", *cmake_args
Expand All @@ -52,10 +58,29 @@ def install
end

test do
# test some plugins in subfolders
plugin_info = lambda { |p|
# 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
}
%w[altimeter log physics sensors].each do |system|
plugin_info.call lib/"gz-sim-8/plugins/libgz-sim-#{system}-system.dylib"
end
["libAlignTool", "libEntityContextMenuPlugin", "libGzSceneManager", "GzSim/libEntityContextMenu"].each do |p|
plugin_info.call lib/"gz-sim-8/plugins/gui/#{p}.dylib"
end
# test gz sim CLI tool
ENV["GZ_CONFIG_PATH"] = "#{opt_share}/gz"
system Formula["ruby"].opt_bin/"ruby",
Formula["gz-tools2"].opt_bin/"gz",
system Formula["gz-tools2"].opt_bin/"gz",
"sim", "-s", "--iterations", "5", "-r", "-v", "4"
# build against API
(testpath/"test.cpp").write <<-EOS
#include <cstdint>
#include <gz/sim/Entity.hh>
Expand Down
20 changes: 14 additions & 6 deletions Formula/gz-transport13.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ class GzTransport13 < Formula
version "13.0.0~pre1"
sha256 "1f5785c70d4e0740490c372436fe06a724544e1b323525e39edf981168c89101"
license "Apache-2.0"
revision 4
revision 5

head "https://github.com/gazebosim/gz-transport.git", branch: "gz-transport13"

bottle do
root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
sha256 ventura: "2140df3adaf2cf2ae2caba5c50fb763f4ea4b49f55db1dcd83fa72e9782b33e1"
sha256 monterey: "26b6941c3f5b5551a1e6c16f4555ab25712ceb9d37dd0535bbcbaa24f48a4715"
sha256 big_sur: "a95495c931b87f95e1c516d4680585e0c9177cc5d11d8a09db5cc58ff723aa16"
sha256 ventura: "30c3d713a8724e28b17f8e64a2c565777f1fee3c56df2f87712aaf38f8cf2b38"
sha256 monterey: "104622bf055b0588c5709707fab3b0d193d80fbf7232f3bf3bd5d488b52682bf"
sha256 big_sur: "f77d840bafa9d6ab306f94dc261110a728e3fd3ea433f2ab0a47a9ad94d7467a"
end

depends_on "doxygen" => [:build, :optional]
Expand All @@ -33,9 +33,13 @@ class GzTransport13 < Formula
depends_on "zeromq"

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

# Use build folder
mkdir "build" do
Expand All @@ -48,6 +52,10 @@ def install
end

test do
# test CLI executables
system libexec/"gz/transport13/gz-transport-service"
system libexec/"gz/transport13/gz-transport-topic"
# build against API
(testpath/"test.cpp").write <<-EOS
#include <iostream>
#include <gz/transport.hh>
Expand Down

0 comments on commit d83e5da

Please sign in to comment.