-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathgz-msgs9.rb
73 lines (66 loc) · 2.21 KB
/
gz-msgs9.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
class GzMsgs9 < Formula
desc "Middleware protobuf messages for robotics"
homepage "https://gazebosim.org"
url "https://osrf-distributions.s3.amazonaws.com/gz-msgs/releases/gz-msgs-9.5.1.tar.bz2"
sha256 "7b77d92c14e22af29b3244e4ff5dce7ec34d9bfbb7c69719126b16e5405a9c34"
license "Apache-2.0"
head "https://github.com/gazebosim/gz-msgs.git", branch: "gz-msgs9"
bottle do
root_url "https://osrf-distributions.s3.amazonaws.com/bottles-simulation"
sha256 cellar: :any, sonoma: "90b1ec527e09d15deacc2060ae2d2e7733af045a676879c028e750bbe45c8b26"
sha256 cellar: :any, ventura: "2c8a987c7d140488a1fef2c297b0a27cb3ad9eac1a92db8cb0cea6fb45a15232"
end
deprecate! date: "2024-09-30", because: "is past end-of-life date"
depends_on "abseil"
depends_on "cmake"
depends_on "gz-cmake3"
depends_on "gz-math7"
depends_on "gz-tools2"
depends_on "gz-utils2"
depends_on macos: :high_sierra # c++17
depends_on "pkgconf"
depends_on "protobuf"
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
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-msgs9 QUIET REQUIRED)
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake gz-msgs9::gz-msgs9)
EOS
# test building with pkg-config
system "pkg-config", "gz-msgs9"
# cflags = `pkg-config --cflags gz-msgs9`.split
# ldflags = `pkg-config --libs gz-msgs9`.split
# system ENV.cc, "test.cpp",
# *cflags,
# *ldflags,
# "-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