Skip to content

Commit 12ed413

Browse files
authored
gz-common7: Bump gz-cmake and others in jetty (#3031)
Bumping gz-cmake and others except gz-tools. Signed-off-by: Steve Peters <[email protected]>
1 parent a1798b7 commit 12ed413

File tree

2 files changed

+76
-1
lines changed

2 files changed

+76
-1
lines changed

Aliases/gz-common7

-1
This file was deleted.

Formula/gz-common7.rb

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
class GzCommon7 < Formula
2+
desc "Common libraries for robotics applications"
3+
homepage "https://gazebosim.org"
4+
url "https://github.com/gazebosim/gz-common.git", branch: "main"
5+
version "6.999.999-0-20250430"
6+
license "Apache-2.0"
7+
8+
head "https://github.com/gazebosim/gz-common.git", branch: "gz-common7"
9+
10+
depends_on "assimp"
11+
depends_on "cmake"
12+
depends_on "ffmpeg"
13+
depends_on "freeimage"
14+
depends_on "gdal"
15+
depends_on "gz-cmake5"
16+
depends_on "gz-math9"
17+
depends_on "gz-utils4"
18+
depends_on macos: :high_sierra # c++17
19+
depends_on "ossp-uuid"
20+
depends_on "pkgconf"
21+
depends_on "spdlog"
22+
depends_on "tinyxml2"
23+
24+
def install
25+
cmake_args = std_cmake_args
26+
cmake_args << "-DBUILD_TESTING=OFF"
27+
cmake_args << "-DCMAKE_INSTALL_RPATH=#{rpath}"
28+
29+
# Use a build folder
30+
mkdir "build" do
31+
system "cmake", "..", *cmake_args
32+
system "make", "install"
33+
end
34+
end
35+
36+
test do
37+
(testpath/"test.cpp").write <<-EOS
38+
#include <iostream>
39+
#include <gz/common.hh>
40+
int main() {
41+
gzdbg << "debug" << std::endl;
42+
gzwarn << "warn" << std::endl;
43+
gzerr << "error" << std::endl;
44+
return 0;
45+
}
46+
EOS
47+
(testpath/"CMakeLists.txt").write <<-EOS
48+
cmake_minimum_required(VERSION 3.22.1 FATAL_ERROR)
49+
find_package(gz-common QUIET REQUIRED)
50+
add_executable(test_cmake test.cpp)
51+
target_link_libraries(test_cmake gz-common::gz-common)
52+
EOS
53+
system "pkg-config", "gz-common"
54+
# cflags = `pkg-config --cflags gz-common`.split
55+
# ldflags = `pkg-config --libs gz-common`.split
56+
# system ENV.cc, "test.cpp",
57+
# *cflags,
58+
# *ldflags,
59+
# "-lc++",
60+
# "-o", "test"
61+
# system "./test"
62+
# test building with cmake
63+
mkdir "build" do
64+
ENV.append "LIBRARY_PATH", Formula["gettext"].opt_lib
65+
system "cmake", ".."
66+
system "make"
67+
system "./test_cmake"
68+
end
69+
# check for Xcode frameworks in bottle
70+
# ! requires system with single argument, which uses standard shell
71+
# put in variable to avoid audit complaint
72+
# enclose / in [] so the following line won't match itself
73+
cmd_not_grep_xcode = "! grep -rnI 'Applications[/]Xcode' #{prefix}"
74+
system cmd_not_grep_xcode
75+
end
76+
end

0 commit comments

Comments
 (0)