class ApacheArrow < Formula desc "Columnar in-memory analytics layer designed to accelerate big data" homepage "https://arrow.apache.org/" url "https://www.apache.org/dyn/closer.lua?path=arrow/arrow-8.0.0/apache-arrow-8.0.0.tar.gz" mirror "https://archive.apache.org/dist/arrow/arrow-8.0.0/apache-arrow-8.0.0.tar.gz" sha256 "ad9a05705117c989c116bae9ac70492fe015050e1b80fb0e38fde4b5d863aaa3" license "Apache-2.0" revision 1 head "https://github.com/apache/arrow.git", branch: "master" bottle do sha256 cellar: :any, arm64_monterey: "3319b8ee2eb5046def32b4e52896b1f876495d9d7bda6f2fd06b7101893b4a97" sha256 cellar: :any, arm64_big_sur: "ff7d1efad9d635fc2b58e8b00da49f8f151117be023b3e3f700d8e072bb0e786" sha256 cellar: :any, monterey: "68d8d93c2d8c5b268217fe5987a91dc7877a64c529654bcabf5889b1b9bfe0e3" sha256 cellar: :any, big_sur: "0efbc480db467c0491e63b1d1ef80af7362f0203153846c3edadb8557ebdd138" sha256 cellar: :any, catalina: "d96cb2577f76adc8685297f06136d94ee6759491a0517208f66b37a74bc9f052" sha256 cellar: :any_skip_relocation, x86_64_linux: "9dd3aa5bdc76774d783d11f5126c3595fa52d1d9b0e4e47aab1e283180f06048" end depends_on "boost" => :build depends_on "cmake" => :build depends_on "llvm" => :build depends_on "aws-sdk-cpp" depends_on "brotli" depends_on "glog" depends_on "grpc" depends_on "lz4" depends_on "numpy" depends_on "openssl@1.1" depends_on "protobuf" depends_on "python@3.9" depends_on "rapidjson" depends_on "re2" depends_on "snappy" depends_on "thrift" depends_on "utf8proc" depends_on "zstd" on_linux do depends_on "gcc" end fails_with gcc: "5" def install # https://github.com/Homebrew/homebrew-core/issues/76537 ENV.runtime_cpu_detection if Hardware::CPU.intel? # https://github.com/Homebrew/homebrew-core/issues/94724 # https://issues.apache.org/jira/browse/ARROW-15664 ENV["HOMEBREW_OPTIMIZATION_LEVEL"] = "O2" # link against system libc++ instead of llvm provided libc++ ENV.remove "HOMEBREW_LIBRARY_PATHS", Formula["llvm"].opt_lib args = %W[ -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE -DCMAKE_INSTALL_RPATH=#{rpath} -DARROW_FLIGHT=ON -DARROW_GANDIVA=ON -DARROW_JEMALLOC=ON -DARROW_ORC=ON -DARROW_PARQUET=ON -DARROW_PLASMA=ON -DARROW_PROTOBUF_USE_SHARED=ON -DARROW_PYTHON=ON -DARROW_S3=ON -DARROW_WITH_BZ2=ON -DARROW_WITH_ZLIB=ON -DARROW_WITH_ZSTD=ON -DARROW_WITH_LZ4=ON -DARROW_WITH_SNAPPY=ON -DARROW_WITH_BROTLI=ON -DARROW_WITH_UTF8PROC=ON -DARROW_INSTALL_NAME_RPATH=OFF -DPython3_EXECUTABLE=#{Formula["python@3.9"].bin/"python3"} ] args << "-DARROW_MIMALLOC=ON" unless Hardware::CPU.arm? mkdir "build" do system "cmake", "../cpp", *std_cmake_args, *args system "make" system "make", "install" end end test do (testpath/"test.cpp").write <<~EOS #include "arrow/api.h" int main(void) { arrow::int64(); return 0; } EOS system ENV.cxx, "test.cpp", "-std=c++11", "-I#{include}", "-L#{lib}", "-larrow", "-o", "test" system "./test" end end