|
1 | 1 | class AvroCpp < Formula |
2 | 2 | desc "Data serialization system" |
3 | 3 | homepage "https://avro.apache.org/" |
4 | | - url "https://www.apache.org/dyn/closer.lua?path=avro/avro-1.12.0/cpp/avro-cpp-1.12.0.tar.gz" |
5 | | - mirror "https://archive.apache.org/dist/avro/avro-1.12.0/cpp/avro-cpp-1.12.0.tar.gz" |
6 | | - sha256 "f2edf77126a75b0ec1ad166772be058351cea3d74448be7e2cef20050c0f98ab" |
| 4 | + url "https://www.apache.org/dyn/closer.lua?path=avro/avro-1.12.1/cpp/avro-cpp-1.12.1.tar.gz" |
| 5 | + mirror "https://archive.apache.org/dist/avro/avro-1.12.1/cpp/avro-cpp-1.12.1.tar.gz" |
| 6 | + sha256 "18a0d155905a4dab0c2bfd66c742358a7d969bcff58cf6f655bcf602879f4fe7" |
7 | 7 | license "Apache-2.0" |
8 | | - revision 1 |
9 | 8 |
|
10 | 9 | bottle do |
11 | | - sha256 cellar: :any, arm64_tahoe: "6704d6e89acb0c747ea276845a9931aba6be8ccb0555ea7333f6fd871d33ef74" |
12 | | - sha256 cellar: :any, arm64_sequoia: "c957d98325e78e380f0350d9c9e96edd4dedf5bc6e066cd3e1cc8149b50c8598" |
13 | | - sha256 cellar: :any, arm64_sonoma: "b099c4cb40748b37a98350b66ecfaeeca27028731698f061a943aa677cea409b" |
14 | | - sha256 cellar: :any, arm64_ventura: "2bd5f3b4db84283a53fd5ad1378e64fe2be612ba26d542eef7678de2c3a9bc39" |
15 | | - sha256 cellar: :any, sonoma: "1f97c3b6d551ac12a5709fc8677c5f9383d82f592a55884009fefd14f1c86829" |
16 | | - sha256 cellar: :any, ventura: "ec11016e755c1c5ccae51e3e6f443a5051ace8c0649129102d047150fada63dc" |
17 | | - sha256 cellar: :any_skip_relocation, arm64_linux: "06cd6e6715712951deb88a37597234c495bf65fe08eb54a8b74310007780ac32" |
18 | | - sha256 cellar: :any_skip_relocation, x86_64_linux: "3ae8f2eb793dc55a6deb6907c02445d54feb481060a4c0fdc8bbbbdd3cfb3737" |
| 10 | + sha256 cellar: :any, arm64_tahoe: "b89b52514a01938e58227cea3df043f72c11d92517e50e612b7b21dc21a2896e" |
| 11 | + sha256 cellar: :any, arm64_sequoia: "87b4bc2edf4027fb23b6377efc812502ee28d5824fcaa985b505cdb74b7affaa" |
| 12 | + sha256 cellar: :any, arm64_sonoma: "3b5fd6eab8771d335bdcd737c3a36829517744a98d628ba4478ae3832f719d8c" |
| 13 | + sha256 cellar: :any, sonoma: "fc835f42954873b7b49d89070ca917f1b441e46fa3ce2ba74a66951aac80f2ad" |
| 14 | + sha256 cellar: :any_skip_relocation, arm64_linux: "07d6dfb9075c7ebfe7b280a386f7ae12e05ad6359426f170de52e2333f1280ce" |
| 15 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "abb4bdc11f71daeb6474d1f46bbac5dd9d8d80bd916e1386aeb457042c37964d" |
19 | 16 | end |
20 | 17 |
|
21 | 18 | depends_on "cmake" => :build |
22 | 19 | depends_on "fmt" => [:build, :test] # needed for headers |
23 | 20 | depends_on "pkgconf" => :build |
24 | 21 | depends_on "boost" |
| 22 | + depends_on "zstd" |
25 | 23 |
|
26 | | - # Fix compatibility with `fmt` 11, https://github.com/apache/avro/pull/3444 |
27 | | - # Fix to use system installed `fmt`, https://github.com/apache/avro/pull/3447 |
28 | | - # Both patches are not applicable to the source splitted tarball |
29 | | - # Also add workaround for Boost 1.89.0 until next release that drops Boost dep |
30 | | - patch :DATA |
| 24 | + uses_from_macos "zlib" |
| 25 | + |
| 26 | + # Add missing cmake file from git |
| 27 | + resource "avro-cpp-config.cmake.in" do |
| 28 | + url "https://github.com/apache/avro/raw/refs/tags/release-1.12.1/lang/c++/cmake/avro-cpp-config.cmake.in" |
| 29 | + sha256 "2f100bed5a5ec300bc16e618ef17c64056c165a3dba8dde590a3ef65352440fa" |
| 30 | + end |
31 | 31 |
|
32 | 32 | def install |
| 33 | + (buildpath/"cmake").install resource("avro-cpp-config.cmake.in") |
| 34 | + |
| 35 | + # Boost 1.89+ no longer requires the 'system' component |
| 36 | + boost_replacements = /Boost\s1.70\sREQUIRED\s(CONFIG\s)?COMPONENTS\s?system/ |
| 37 | + inreplace "CMakeLists.txt" do |s| |
| 38 | + s.gsub! boost_replacements, "Boost REQUIRED" |
| 39 | + s.gsub! "$<INSTALL_INTERFACE:$<TARGET_NAME_IF_EXISTS:Boost::system>>", "" |
| 40 | + s.gsub! "Boost::system ZLIB::ZLIB", "$<TARGET_NAME_IF_EXISTS:Boost::system> ZLIB::ZLIB" |
| 41 | + end |
| 42 | + inreplace "cmake/avro-cpp-config.cmake.in", boost_replacements, "Boost REQUIRED" |
| 43 | + |
33 | 44 | system "cmake", "-S", ".", "-B", "build", *std_cmake_args |
34 | 45 | system "cmake", "--build", "build" |
35 | 46 | system "cmake", "--install", "build" |
@@ -57,71 +68,7 @@ def install |
57 | 68 | CPP |
58 | 69 |
|
59 | 70 | system bin/"avrogencpp", "-i", "cpx.json", "-o", "cpx.hh", "-n", "cpx" |
60 | | - system ENV.cxx, "test.cpp", "-std=c++14", "-o", "test" |
| 71 | + system ENV.cxx, "test.cpp", "-std=c++17", "-o", "test" |
61 | 72 | system "./test" |
62 | 73 | end |
63 | 74 | end |
64 | | - |
65 | | -__END__ |
66 | | -diff --git a/CMakeLists.txt b/CMakeLists.txt |
67 | | -index 19059a4..afdfdf5 100644 |
68 | | ---- a/CMakeLists.txt |
69 | | -+++ b/CMakeLists.txt |
70 | | -@@ -80,17 +80,20 @@ endif () |
71 | | - |
72 | | - |
73 | | - find_package (Boost 1.38 REQUIRED |
74 | | -- COMPONENTS filesystem iostreams program_options regex system) |
75 | | -- |
76 | | --include(FetchContent) |
77 | | --FetchContent_Declare( |
78 | | -- fmt |
79 | | -- GIT_REPOSITORY https://github.com/fmtlib/fmt.git |
80 | | -- GIT_TAG 10.2.1 |
81 | | -- GIT_PROGRESS TRUE |
82 | | -- USES_TERMINAL_DOWNLOAD TRUE |
83 | | --) |
84 | | --FetchContent_MakeAvailable(fmt) |
85 | | -+ COMPONENTS filesystem iostreams program_options regex) |
86 | | -+ |
87 | | -+find_package(fmt) |
88 | | -+if (NOT fmt_FOUND) |
89 | | -+ include(FetchContent) |
90 | | -+ FetchContent_Declare( |
91 | | -+ fmt |
92 | | -+ GIT_REPOSITORY https://github.com/fmtlib/fmt.git |
93 | | -+ GIT_TAG 10.2.1 |
94 | | -+ GIT_PROGRESS TRUE |
95 | | -+ USES_TERMINAL_DOWNLOAD TRUE |
96 | | -+ ) |
97 | | -+ FetchContent_MakeAvailable(fmt) |
98 | | -+endif (NOT fmt_FOUND) |
99 | | - |
100 | | - find_package(Snappy) |
101 | | - if (SNAPPY_FOUND) |
102 | | -diff --git a/include/avro/Node.hh b/include/avro/Node.hh |
103 | | -index f76078b..7226d05 100644 |
104 | | ---- a/include/avro/Node.hh |
105 | | -+++ b/include/avro/Node.hh |
106 | | -@@ -219,7 +219,7 @@ inline std::ostream &operator<<(std::ostream &os, const avro::Node &n) { |
107 | | - template<> |
108 | | - struct fmt::formatter<avro::Name> : fmt::formatter<std::string> { |
109 | | - template<typename FormatContext> |
110 | | -- auto format(const avro::Name &n, FormatContext &ctx) { |
111 | | -+ auto format(const avro::Name &n, FormatContext &ctx) const { |
112 | | - return fmt::formatter<std::string>::format(n.fullname(), ctx); |
113 | | - } |
114 | | - }; |
115 | | -diff --git a/include/avro/Types.hh b/include/avro/Types.hh |
116 | | -index 84a3397..c0533f3 100644 |
117 | | ---- a/include/avro/Types.hh |
118 | | -+++ b/include/avro/Types.hh |
119 | | -@@ -113,7 +113,7 @@ std::ostream &operator<<(std::ostream &os, const Null &null); |
120 | | - template<> |
121 | | - struct fmt::formatter<avro::Type> : fmt::formatter<std::string> { |
122 | | - template<typename FormatContext> |
123 | | -- auto format(avro::Type t, FormatContext &ctx) { |
124 | | -+ auto format(avro::Type t, FormatContext &ctx) const { |
125 | | - return fmt::formatter<std::string>::format(avro::toString(t), ctx); |
126 | | - } |
127 | | - }; |
0 commit comments