Skip to content

Commit

Permalink
tarantool: revision bump to migrate to icu4c@76
Browse files Browse the repository at this point in the history
* Migrate to `icu4c@76`
* Fix Xcode 16 build
* Remove unnecessary workarounds and CMake args
* Install man pages in correct directory
* Set `CURL_ROOT_DIR` to avoid `CURL_ROOT` being overridden
* Use modern CMake commands
  • Loading branch information
cho-m committed Oct 31, 2024
1 parent 5f89ae5 commit df11d52
Showing 1 changed file with 29 additions and 39 deletions.
68 changes: 29 additions & 39 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 @@ -35,45 +35,35 @@ class Tarantool < Formula
depends_on "libunwind"
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++\""

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"

if OS.mac?
if MacOS.version >= :big_sur
sdk = MacOS.sdk_path_if_needed
lib_suffix = "tbd"
else
sdk = ""
lib_suffix = "dylib"
end
# Apply LuaJIT fix until upstream syncs their copy
# Issue ref: https://github.com/tarantool/tarantool/issues/10566
patch do
url "https://github.com/LuaJIT/LuaJIT/commit/2240d84464cc3dcb22fd976f1db162b36b5b52d5.patch?full_index=1"
sha256 "7b428c7f0d9c36cee04c2f0f9978a2656c29aa1034974f656b12627e1730b07d"
directory "third_party/luajit"
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
def install
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
]

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

0 comments on commit df11d52

Please sign in to comment.