From 99a0241918a237a021c2eb7cac4096c9fae82e75 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Thu, 30 Jan 2025 21:30:21 -0500 Subject: [PATCH] mysql: use `llvm` on Ventura --- Formula/m/mysql.rb | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/Formula/m/mysql.rb b/Formula/m/mysql.rb index db31bc9e9f2c..16150b84832a 100644 --- a/Formula/m/mysql.rb +++ b/Formula/m/mysql.rb @@ -37,7 +37,7 @@ class Mysql < Formula # std::string_view is not fully compatible with the libc++ shipped # with ventura, so we need to use the LLVM libc++ instead. on_ventura :or_older do - depends_on "llvm@18" + depends_on "llvm" fails_with :clang end @@ -73,18 +73,8 @@ def install # Disable ABI checking inreplace "cmake/abi_check.cmake", "RUN_ABI_CHECK 1", "RUN_ABI_CHECK 0" elsif MacOS.version <= :ventura - ENV["CC"] = Formula["llvm@18"].opt_bin/"clang" - ENV["CXX"] = Formula["llvm@18"].opt_bin/"clang++" - - # The dependencies need to be explicitly added to the environment - deps.each do |dep| - next if dep.build? || dep.test? - - ENV.append "CXXFLAGS", "-I#{dep.to_formula.opt_include}" - ENV.append "LDFLAGS", "-L#{dep.to_formula.opt_lib}" - end - - ENV.append "LDFLAGS", "-L#{Formula["llvm@18"].opt_lib}/c++ -L#{Formula["llvm@18"].opt_lib} -lunwind" + ENV.llvm_clang + ENV.append "LDFLAGS", "-L#{Formula["llvm"].opt_lib}/c++ -L#{Formula["llvm"].opt_lib}/unwind -lunwind" end icu4c = deps.find { |dep| dep.name.match?(/^icu4c(@\d+)?$/) } @@ -115,19 +105,6 @@ def install -DWITH_UNIT_TESTS=OFF ] - # Add the dependencies to the CMake args - if OS.mac? && MacOS.version <=(:ventura) - args += %W[ - -DABSL_INCLUDE_DIR=#{Formula["abseil"].opt_include} - -DICU_ROOT=#{Formula["icu4c@76"].opt_prefix} - -DLZ4_INCLUDE_DIR=#{Formula["lz4"].opt_include} - -DOPENSSL_INCLUDE_DIR=#{Formula["openssl@3"].opt_include} - -DPROTOBUF_INCLUDE_DIR=#{Formula["protobuf"].opt_include} - -DZLIB_INCLUDE_DIR=#{Formula["zlib"].opt_include} - -DZSTD_INCLUDE_DIR=#{Formula["zstd"].opt_include} - ] - end - system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args system "cmake", "--build", "build" system "cmake", "--install", "build"