Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clickhouse-cpp: use vendored cityhash #129222

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions Formula/clickhouse-cpp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,29 @@ class ClickhouseCpp < Formula

depends_on "cmake" => :build
depends_on "abseil"
depends_on "cityhash"
depends_on "lz4"
depends_on "openssl@3"

fails_with gcc: "5"
fails_with gcc: "6"

def install
# `cityhash` does not provide a pkg-config or CMake config file.
# Help CMake find it.
# Remove when merged: https://github.com/ClickHouse/clickhouse-cpp/pull/301
inreplace "CMakeLists.txt", "FIND_PACKAGE(cityhash REQUIRED)",
"FIND_LIBRARY(CITYHASH NAMES cityhash REQUIRED)"
inreplace "clickhouse/CMakeLists.txt", "cityhash::cityhash", "cityhash"

# We use the vendored version (1.0.2) of `cityhash` because newer versions
# break hash compatibility. See:
# https://github.com/ClickHouse/clickhouse-cpp/pull/301#issuecomment-1520592157
args = %W[
-DWITH_OPENSSL=ON
-DOPENSSL_ROOT_DIR=#{Formula["openssl@3"].opt_prefix}
-DWITH_SYSTEM_ABSEIL=ON
-DWITH_SYSTEM_CITYHASH=ON
-DWITH_SYSTEM_CITYHASH=OFF
-DWITH_SYSTEM_LZ4=ON
]
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"

# Install vendored `cityhash`.
(libexec/"lib").install "build/contrib/cityhash/cityhash/libcityhash.a"
end

test do
Expand Down Expand Up @@ -90,10 +88,10 @@ def install
-I#{include}
-L#{lib}
-lclickhouse-cpp-lib
-L#{libexec}/lib
-lcityhash
-L#{Formula["openssl@3"].opt_lib}
-lcrypto -lssl
-L#{Formula["cityhash"].opt_lib}
-lcityhash
-L#{Formula["lz4"].opt_lib}
-llz4
]
Expand Down