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

tarantool: revision bump to migrate to icu4c@76 #196228

Merged
merged 2 commits into from
Oct 31, 2024
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
65 changes: 27 additions & 38 deletions Formula/t/tarantool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Tarantool < Formula
url "https://download.tarantool.org/tarantool/src/tarantool-3.2.0.tar.gz"
sha256 "16a6d54a67f5f954cf784175dfcdb2b549c04ed1414e76256743e1fd4a560289"
license "BSD-2-Clause"
revision 1
revision 2
version_scheme 1
head "https://github.com/tarantool/tarantool.git", branch: "master"

Expand All @@ -23,7 +23,7 @@ class Tarantool < Formula

depends_on "cmake" => :build
depends_on "curl" # curl 8.4.0+
depends_on "icu4c@75"
depends_on "icu4c@76"
depends_on "libyaml"
depends_on "openssl@3"
depends_on "readline"
Expand All @@ -36,44 +36,33 @@ class Tarantool < Formula
end

def install
# Avoid keeping references to Homebrew's clang/clang++ shims
inreplace "src/trivia/config.h.cmake",
"#define COMPILER_INFO \"@CMAKE_C_COMPILER_ID@-@CMAKE_C_COMPILER_VERSION@\"",
"#define COMPILER_INFO \"/usr/bin/clang /usr/bin/clang++\""
# Workaround for clang >= 16 until upstream fix is available[^1].
# Also, trying to apply LuaJIT commit[^2] worked on Xcode 16 but caused issue on Xcode 15.
#
# [^1]: https://github.com/tarantool/tarantool/issues/10566
# [^2]: https://github.com/LuaJIT/LuaJIT/commit/2240d84464cc3dcb22fd976f1db162b36b5b52d5
ENV.append "LDFLAGS", "-Wl,-no_deduplicate" if DevelopmentTools.clang_build_version >= 1600

args = std_cmake_args
args << "-DCMAKE_INSTALL_MANDIR=#{doc}"
args << "-DCMAKE_INSTALL_SYSCONFDIR=#{etc}"
args << "-DCMAKE_INSTALL_LOCALSTATEDIR=#{var}"
args << "-DENABLE_DIST=ON"
args << "-DOPENSSL_ROOT_DIR=#{Formula["openssl@3"].opt_prefix}"
args << "-DREADLINE_ROOT=#{Formula["readline"].opt_prefix}"
args << "-DENABLE_BUNDLED_LIBCURL=OFF"
args << "-DENABLE_BUNDLED_LIBYAML=OFF"
args << "-DENABLE_BUNDLED_ZSTD=OFF"
icu4c = deps.find { |dep| dep.name.match?(/^icu4c(@\d+)?$/) }
.to_formula
args = %W[
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DCMAKE_INSTALL_LOCALSTATEDIR=#{var}
-DENABLE_DIST=ON
-DCURL_ROOT=#{Formula["curl"].opt_prefix}
-DCURL_ROOT_DIR=#{Formula["curl"].opt_prefix}
-DICU_ROOT=#{icu4c.opt_prefix}
-DOPENSSL_ROOT_DIR=#{Formula["openssl@3"].opt_prefix}
-DREADLINE_ROOT=#{Formula["readline"].opt_prefix}
-DENABLE_BUNDLED_LIBCURL=OFF
-DENABLE_BUNDLED_LIBUNWIND=OFF
-DENABLE_BUNDLED_LIBYAML=OFF
-DENABLE_BUNDLED_ZSTD=OFF
]

if OS.mac?
if MacOS.version >= :big_sur
sdk = MacOS.sdk_path_if_needed
lib_suffix = "tbd"
else
sdk = ""
lib_suffix = "dylib"
end

args << "-DCURL_ROOT=#{Formula["curl"].opt_prefix}"
args << "-DCURSES_NEED_NCURSES=ON"
args << "-DCURSES_NCURSES_INCLUDE_PATH=#{sdk}/usr/include"
args << "-DCURSES_NCURSES_LIBRARY=#{sdk}/usr/lib/libncurses.#{lib_suffix}"
args << "-DICONV_INCLUDE_DIR=#{sdk}/usr/include"
else
args << "-DENABLE_BUNDLED_LIBUNWIND=OFF"
args << "-DCURL_ROOT=#{Formula["curl"].opt_prefix}"
end

system "cmake", ".", *args
system "make"
system "make", "install"
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end

def post_install
Expand Down
Loading