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

Bumps in ionic : ci_matching_branch/bump_ionic_gz-sensors9 #2472

Merged
merged 5 commits into from
Oct 17, 2023
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
1 change: 0 additions & 1 deletion Aliases/gz-sensors9

This file was deleted.

70 changes: 70 additions & 0 deletions Formula/gz-sensors9.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
class GzSensors9 < Formula
desc "Sensors library for robotics applications"
homepage "https://github.com/gazebosim/gz-sensors"
url "https://github.com/gazebosim/gz-sensors.git", branch: "main"
version "8.999.999-0-20231016"
license "Apache-2.0"

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

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

depends_on "gz-cmake4"
depends_on "gz-common6"
depends_on "gz-math8"
depends_on "gz-msgs11"
depends_on "gz-rendering9"
depends_on "gz-transport14"
depends_on "protobuf"
depends_on "sdformat15"

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
end

test do
(testpath/"test.cpp").write <<-EOS
#include <gz/sensors/Noise.hh>

int main()
{
gz::sensors::Noise noise(gz::sensors::NoiseType::NONE);

return 0;
}
EOS
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
find_package(gz-sensors9 QUIET REQUIRED)
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake gz-sensors9::gz-sensors9)
EOS
# test building with pkg-config
system "pkg-config", "gz-sensors9"
cflags = `pkg-config --cflags gz-sensors9`.split
ldflags = `pkg-config --libs gz-sensors9`.split
system ENV.cc, "test.cpp",
*cflags,
*ldflags,
"-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
end
end