11class ClickhouseCpp < Formula
22 desc "C++ client library for ClickHouse"
33 homepage "https://github.com/ClickHouse/clickhouse-cpp"
4- url "https://github.com/ClickHouse/clickhouse-cpp/archive/refs/tags/v2.5.1 .tar.gz"
5- sha256 "8942fc702eca1f656e59c680c7e464205bffea038b62c1a0ad1f794ee01e7266 "
4+ url "https://github.com/ClickHouse/clickhouse-cpp/archive/refs/tags/v2.6.0 .tar.gz"
5+ sha256 "f694395ab49e7c2380297710761a40718278cefd86f4f692d3f8ce4293e1335f "
66 license "Apache-2.0"
7+ head "https://github.com/ClickHouse/clickhouse-cpp.git" , branch : "master"
78
89 bottle do
910 rebuild 1
@@ -17,15 +18,11 @@ class ClickhouseCpp < Formula
1718 sha256 cellar : :any_skip_relocation , x86_64_linux : "632c681d02c3b5261da20562567ec7e0bfcce88e6abde92d13b24fad35662498"
1819 end
1920
20- head do
21- url "https://github.com/ClickHouse/clickhouse-cpp.git" , branch : "master"
22- depends_on "zstd"
23- end
24-
2521 depends_on "cmake" => :build
2622 depends_on "abseil"
2723 depends_on "lz4"
2824 depends_on "openssl@3"
25+ depends_on "zstd"
2926
3027 def install
3128 # We use the vendored version (1.0.2) of `cityhash` because newer versions
@@ -37,21 +34,13 @@ def install
3734 -DOPENSSL_ROOT_DIR=#{ Formula [ "openssl@3" ] . opt_prefix }
3835 -DWITH_SYSTEM_ABSEIL=ON
3936 -DWITH_SYSTEM_CITYHASH=OFF
40- -DWITH_SYSTEM_LZ4=ON
37+ -DWITH_SYSTEM_LZ4=O
38+ -DWITH_SYSTEM_ZSTD=ON
4139 ]
4240 # Upstream only allows building static libs on macOS
4341 # See: https://github.com/ClickHouse/clickhouse-cpp/pull/219#issuecomment-1362928064
4442 args << "-DBUILD_SHARED_LIBS=ON" unless OS . mac?
4543
46- if build . stable?
47- # Workaround for CMake 4 until next release with:
48- # https://github.com/ClickHouse/clickhouse-cpp/commit/56155829273bf428aebd9c501c2ff898058fafea
49- odie "Remove CMake 4 workaround!" if version > "2.5.1"
50- ENV [ "CMAKE_POLICY_VERSION_MINIMUM" ] = "3.5.2"
51- else
52- args << "-DWITH_SYSTEM_ZSTD=ON"
53- end
54-
5544 system "cmake" , "-S" , "." , "-B" , "build" , *args , *std_cmake_args
5645 system "cmake" , "--build" , "build"
5746 system "cmake" , "--install" , "build"
@@ -101,14 +90,10 @@ def install
10190 CPP
10291
10392 args = %W[
104- -std=c++17
105- -I#{ include }
106- -L#{ lib }
107- -lclickhouse-cpp-lib
108- -L#{ Formula [ "openssl@3" ] . opt_lib }
109- -lcrypto -lssl
110- -L#{ Formula [ "lz4" ] . opt_lib }
111- -llz4
93+ -std=c++17 -I#{ include } -L#{ lib } -lclickhouse-cpp-lib
94+ -L#{ Formula [ "openssl@3" ] . opt_lib } -lcrypto -lssl
95+ -L#{ Formula [ "lz4" ] . opt_lib } -llz4
96+ -L#{ Formula [ "zstd" ] . opt_lib } -lzstd
11297 ]
11398 args += %W[ -L#{ libexec } /lib -lcityhash ] if OS . mac?
11499 system ENV . cxx , "main.cpp" , *args , "-o" , "test-client"
0 commit comments