-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathignition-msgs1.rb
79 lines (72 loc) · 2.58 KB
/
ignition-msgs1.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
74
75
76
77
78
79
class IgnitionMsgs1 < Formula
desc "Middleware protobuf messages for robotics"
homepage "https://github.com/gazebosim/gz-msgs"
url "https://osrf-distributions.s3.amazonaws.com/ign-msgs/releases/ignition-msgs-1.0.0.tar.bz2"
sha256 "fed54d079a58087fa83cc871f01ba2919866292ba949b6b8f37a0cb3d7186b4b"
license "Apache-2.0"
revision 18
version_scheme 1
head "https://github.com/gazebosim/gz-msgs.git", branch: "ign-msgs1"
deprecate! date: "2023-01-25", because: "is past end-of-life date"
disable! date: "2024-08-31", because: "is past end-of-life date"
depends_on "protobuf-c" => :build
depends_on "cmake"
depends_on "ignition-cmake0"
depends_on "ignition-math4"
depends_on "pkgconf"
depends_on "protobuf"
depends_on "ignition-tools" => :recommended
patch do
# Fix compilation: add missing std namespace
# https://github.com/gazebosim/gz-msgs/pull/242
# TODO: remove with next major release
url "https://github.com/gazebosim/gz-msgs/commit/88386e4e7a38d0ccb0a96f9774ba5339bc7e5440.patch?full_index=1"
sha256 "2cc0cb1887a1c9f945f80f7fcee5f4f1719d914e1134b44254b5718383ff6263"
end
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 <ignition/msgs.hh>
int main() {
ignition::msgs::UInt32;
return 0;
}
EOS
(testpath/"CMakeLists.txt").write <<-EOS
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
find_package(ignition-msgs1 QUIET REQUIRED)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IGNITION-MSGS_CXX_FLAGS}")
include_directories(${IGNITION-MSGS_INCLUDE_DIRS})
link_directories(${IGNITION-MSGS_LIBRARY_DIRS})
add_executable(test_cmake test.cpp)
target_link_libraries(test_cmake ignition-msgs1::ignition-msgs1)
EOS
# test building with pkg-config
system "pkg-config", "ignition-msgs1"
cflags = `pkg-config --cflags ignition-msgs1`.split
system ENV.cc, "test.cpp",
*cflags,
"-L#{lib}",
"-lignition-msgs1",
"-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