homebrew-core/Formula/apache-arrow.rb

93 lines
3.1 KiB
Ruby

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-9.0.0/apache-arrow-9.0.0.tar.gz"
mirror "https://archive.apache.org/dist/arrow/arrow-9.0.0/apache-arrow-9.0.0.tar.gz"
sha256 "a9a033f0a3490289998f458680d19579cf07911717ba65afde6cb80070f7a9b5"
license "Apache-2.0"
revision 3
head "https://github.com/apache/arrow.git", branch: "master"
bottle do
sha256 cellar: :any, arm64_monterey: "55f87d0d14a6accb8b6b43b62af381384f661e85d8dcbed817a054e2f1cae745"
sha256 cellar: :any, arm64_big_sur: "e177b4c390ff3fad54ba19db43fc3ef09bd0796ea85a68f66905ec1bbddb0597"
sha256 cellar: :any, monterey: "bac71c2e4f60323a51e4eb273c9b74b2acdddbc8908900dd2e428d742a8b2b3b"
sha256 cellar: :any, big_sur: "8fff61ec841ce7171b2f7827f0019cff0c3772337b4580489c0959e0ac86fa00"
sha256 cellar: :any, catalina: "4d08c17ce81908ec8c923ab5729fd5fedc6d116306a71ffe854b332afaaf3f74"
sha256 cellar: :any_skip_relocation, x86_64_linux: "6146db2be35f971fdbc579a2f3a853b4c4de85f2abf9f86ca018866a8e4030fe"
end
depends_on "boost" => :build
depends_on "cmake" => :build
depends_on "llvm@14" => :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.10"
depends_on "rapidjson"
depends_on "re2"
depends_on "snappy"
depends_on "thrift"
depends_on "utf8proc"
depends_on "zstd"
fails_with gcc: "5"
def install
python = "python3.10"
# 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"
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=#{which(python)}
]
args << "-DARROW_MIMALLOC=ON" unless Hardware::CPU.arm?
system "cmake", "-S", "cpp", "-B", "build", *args, *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
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