homebrew-core/Formula/apache-arrow.rb

96 lines
3.2 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-8.0.1/apache-arrow-8.0.1.tar.gz"
mirror "https://archive.apache.org/dist/arrow/arrow-8.0.1/apache-arrow-8.0.1.tar.gz"
sha256 "82d46929f7574715551da21700f100b39f99c3c4d6790f26cac86d869d64e94e"
license "Apache-2.0"
head "https://github.com/apache/arrow.git", branch: "master"
bottle do
sha256 cellar: :any, arm64_monterey: "236f3e3d792c5450549703d4baaffb4c272c10495ab5e28e00745e33dd5c8b9f"
sha256 cellar: :any, arm64_big_sur: "4f410eb8437deb23972cc7c1afee02f589debed45c0e2cd70b5f30735a45a94a"
sha256 cellar: :any, monterey: "b523d867a39dcd7bb1e6184bf542a7dbe2dcecdf4ce987413e0a4beaa86dcd67"
sha256 cellar: :any, big_sur: "6c94f65c8985387ff46b26b2d0e6a2a3cf6ce2c34d264d2353580ba73c0fdc7e"
sha256 cellar: :any, catalina: "1bb210d9cb9bbd851c1d0d51ad88ffc2516f35d87f4b3771b4d4313e65576a68"
sha256 cellar: :any_skip_relocation, x86_64_linux: "34c6809c6ecf836b59924fc4ea0f5677bdf17b0fd3cecbeba2cbd8e4f599fbbb"
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.10"
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=#{which("python3")}
]
args << "-DARROW_MIMALLOC=ON" unless Hardware::CPU.arm?
system "cmake", "-S", "cpp", "-B", "build", *std_cmake_args, *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