Skip to content

Commit

Permalink
Fortress: fix rpath part 2 (#2415)
Browse files Browse the repository at this point in the history
* Fix rpath for binaries in gz-gui6, gz-sim6, gz-launch5.
* gz-launch5: patch to fix compilation
* ignition-gui6: revision bump
* ignition-gazebo6: revision bump
* ignition-launch5: revision bump
* update  bottle.

Signed-off-by: Steve Peters <[email protected]>
Co-authored-by: OSRF Build Bot <[email protected]>
  • Loading branch information
scpeters and osrfbuild authored Sep 21, 2023
1 parent 0188f0c commit 1797790
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 18 deletions.
39 changes: 32 additions & 7 deletions Formula/ignition-gazebo6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ class IgnitionGazebo6 < Formula
url "https://osrf-distributions.s3.amazonaws.com/ign-gazebo/releases/ignition-gazebo6-6.15.0.tar.bz2"
sha256 "897c8823054d504272dd8312509fb09baa6f042a131d348de2020ebd80bbf780"
license "Apache-2.0"
revision 4
revision 5

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

bottle do
root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
sha256 ventura: "002c11ac8c1f52766fa803f25a0feb7a37a6ae9789a87015e6ce9617b6cfa81d"
sha256 monterey: "f474d4ef4f3881b114f78084f36e78352246212febfce504060ce1b950bd8363"
sha256 big_sur: "609a698024fc6ef4533f04b3ecec1d3bf873adf6d3a1202b51ab866eb885c38d"
sha256 ventura: "aefc939b2c4ddf44afaf12a50fd6919f5183afadba5ff7bddda1092fbacc7ff0"
sha256 monterey: "13b4c04462fed433a8801bc43c450dbb54e2ee1791ac166711e6b5a677facdd2"
sha256 big_sur: "d05e40ef1e23e5903fc7be9f6587fb5aae9be91ad4f63803743bd3779cb21d11"
end

depends_on "cmake" => :build
depends_on "pybind11" => :build
depends_on "gz-plugin2" => :test
depends_on "ffmpeg"
depends_on "gflags"
depends_on "google-benchmark"
Expand All @@ -41,9 +42,15 @@ class IgnitionGazebo6 < Formula
depends_on "sdformat12"

def install
rpaths = [
rpath,
rpath(source: lib/"ign-gazebo-6/plugins", target: lib),
rpath(source: lib/"ign-gazebo-6/plugins/gui", target: lib),
rpath(source: lib/"ign-gazebo-6/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 +59,28 @@ 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/"ign-gazebo-6/plugins/libignition-gazebo-#{system}-system.dylib"
end
["libAlignTool", "libEntityContextMenuPlugin", "libGzSceneManager", "IgnGazebo/libEntityContextMenu"].each do |p|
plugin_info.call lib/"ign-gazebo-6/plugins/gui/#{p}.dylib"
end
ENV["IGN_CONFIG_PATH"] = "#{opt_share}/ignition"
system Formula["ruby"].opt_bin/"ruby",
Formula["ignition-tools"].opt_bin/"ign",
system Formula["ignition-tools"].opt_bin/"ign",
"gazebo", "-s", "--iterations", "5", "-r", "-v", "4"
# build against API
(testpath/"test.cpp").write <<-EOS
#include <cstdint>
#include <ignition/gazebo/Entity.hh>
Expand Down
33 changes: 27 additions & 6 deletions Formula/ignition-gui6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ class IgnitionGui6 < Formula
url "https://osrf-distributions.s3.amazonaws.com/ign-gui/releases/ignition-gui6-6.8.0.tar.bz2"
sha256 "dd4f26100f4d1343f068ba36f2b8394a0cddb337efde7b4a21c1b0f66ce496c9"
license "Apache-2.0"
revision 11
revision 12

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

bottle do
root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
sha256 ventura: "12ad1a1ea711a87226d9ff85a8c93a8331e7168cbf638fdd05eca528bf3ac49a"
sha256 monterey: "20443a073acc7141680e277f1e0ace5fbcb507be782f53161c6aa5f1415d0e67"
sha256 big_sur: "9b36c3972a32ef7eaca19ef7106283f8cc39ca33f67a59b9d649e3ad4ef7a8d2"
sha256 ventura: "4577cc5c96570b80db04beefe8484c4a446fe653162a3c48bb3c8c0331d9bc67"
sha256 monterey: "ee75c69ff8022215f596b03ec29927e7d53f4f9b954fff5592c3a55733c51e5e"
sha256 big_sur: "afa9ddf3774cece1b00c3777d2728d3ca2e50182012107dc08a1910118813508"
end

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

depends_on "gz-plugin2" => :test

depends_on "ignition-cmake2"
depends_on "ignition-common4"
depends_on "ignition-msgs8"
Expand All @@ -35,9 +38,13 @@ class IgnitionGui6 < Formula
end

def install
rpaths = [
rpath,
rpath(source: lib/"ign-gui-6/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 @@ -46,6 +53,20 @@ def install
end

test do
# test some plugins in subfolders
%w[CameraFps Publisher TopicViewer WorldStats].each do |plugin|
p = lib/"ign-gui-6/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
38 changes: 33 additions & 5 deletions Formula/ignition-launch5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ class IgnitionLaunch5 < Formula
url "https://osrf-distributions.s3.amazonaws.com/ign-launch/releases/ignition-launch5-5.3.0.tar.bz2"
sha256 "84d356b9c85609da1bb7feda2f90ae6d1a1fd2d6713b284799d5605de42e2613"
license "Apache-2.0"
revision 8
revision 9

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

bottle do
root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
sha256 ventura: "03009f4bbecb8ca07df777c329fa4f1fad915ec27f28df82698941641d4a81ad"
sha256 monterey: "3579468be3c929957bd0b250a490e5eaebb9780ada8d20e90943c29759d1caa7"
sha256 big_sur: "6b72248e6f4e0d8a7400a7455d16a09bf9eb3a8b9d38f0a2a32f0a4f40df9313"
sha256 ventura: "35834d227840da92b6c84ebb125a5b8c73743c6ad629db99e32e45e1d147451e"
sha256 monterey: "b7996798a122b9431d6689ed3e4c6ecf8d56d11f136ab007598625e304725d3b"
sha256 big_sur: "6e918d27795a6b33ba9b5035bf1c5393b722c7606820774ed4f0e8b7f6de1069"
end

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

depends_on "gz-plugin2" => :test

depends_on "ffmpeg"
depends_on "ignition-cmake2"
depends_on "ignition-common4"
Expand All @@ -31,10 +33,21 @@ class IgnitionLaunch5 < Formula
depends_on "qt@5"
depends_on "tinyxml2"

patch do
# Fix for m1 processor
url "https://github.com/gazebosim/gz-launch/commit/ae261dc1d8f8c1a1f868b21054ccda659df68a01.patch?full_index=1"
sha256 "eeb5a263154c9a946c9021eb847e0a01f9788daf3c1c31522c5115973c46710f"
end

def install
rpaths = [
rpath,
rpath(source: lib/"ignition/launch5", target: lib),
rpath(source: lib/"ign-launch-5/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 @@ -43,6 +56,21 @@ def install
end

test do
# test CLI executable
system lib/"ignition/launch5/ign-launch"
# test plugins in subfolders
%w[joytotwist gazebo-factory gazebo gazebogui].each do |plugin|
p = lib/"ign-launch-5/plugins/libignition-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["IGN_CONFIG_PATH"] = "#{opt_share}/ignition"
system "ign", "launch", "--versions"
# check for Xcode frameworks in bottle
Expand Down

0 comments on commit 1797790

Please sign in to comment.