|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +# Cloned from https://github.com/autobrew/homebrew-core/blob/high-sierra/Formula/apache-arrow.rb |
| 19 | +# Upstream any relevant changes (dependencies, build args ...) |
| 20 | + |
| 21 | +class ApacheArrowStatic < Formula |
| 22 | + desc "Columnar in-memory analytics layer designed to accelerate big data" |
| 23 | + homepage "https://arrow.apache.org/" |
| 24 | + url "https://www.apache.org/dyn/closer.lua?path=arrow/arrow-8.0.0.9000/apache-arrow-8.0.0.9000.tar.gz" |
| 25 | + # Uncomment and update to test on a release candidate |
| 26 | + # mirror "https://dist.apache.org/repos/dist/dev/arrow/apache-arrow-8.0.0-rc1/apache-arrow-8.0.0.tar.gz" |
| 27 | + sha256 "9948ddb6d4798b51552d0dca3252dd6e3a7d0f9702714fc6f5a1b59397ce1d28" |
| 28 | + head "https://github.com/apache/arrow.git" |
| 29 | + |
| 30 | + bottle do |
| 31 | + sha256 cellar: :any, arm64_big_sur: "ef89d21a110b89840cc6148add685d407e75bd633bc8f79625eb33d00e3694b4" |
| 32 | + sha256 cellar: :any, big_sur: "6fcb9f55d44eb61d295a8020e039a0622bdc044b220cfffef855f3e3ab8057a1" |
| 33 | + sha256 cellar: :any, catalina: "bf71b17766688077fb9b4e679f309742c16524015287dd3633758c679752c977" |
| 34 | + end |
| 35 | + |
| 36 | + depends_on "boost" => :build |
| 37 | + depends_on "cmake" => :build |
| 38 | + depends_on "aws-sdk-cpp-static" |
| 39 | + depends_on "brotli" |
| 40 | + depends_on "lz4" |
| 41 | + depends_on "snappy" |
| 42 | + depends_on "thrift" |
| 43 | + depends_on "zstd" |
| 44 | + |
| 45 | + conflicts_with "apache-arrow", because: "both install Arrow" |
| 46 | + |
| 47 | + def install |
| 48 | + ENV.cxx11 |
| 49 | + # https://github.com/Homebrew/homebrew-core/issues/94724 |
| 50 | + # https://issues.apache.org/jira/browse/ARROW-15664 |
| 51 | + ENV["HOMEBREW_OPTIMIZATION_LEVEL"] = "O2" |
| 52 | + |
| 53 | + args = %W[ |
| 54 | + -DARROW_BUILD_SHARED=OFF |
| 55 | + -DARROW_BUILD_UTILITIES=ON |
| 56 | + -DARROW_COMPUTE=ON |
| 57 | + -DARROW_CSV=ON |
| 58 | + -DARROW_DATASET=ON |
| 59 | + -DARROW_FILESYSTEM=ON |
| 60 | + -DARROW_GCS=ON |
| 61 | + -DARROW_JEMALLOC=ON |
| 62 | + -DARROW_JSON=ON |
| 63 | + -DARROW_MIMALLOC=ON |
| 64 | + -DARROW_PARQUET=ON |
| 65 | + -DARROW_S3=ON |
| 66 | + -DARROW_VERBOSE_THIRDPARTY_BUILD=ON |
| 67 | + -DARROW_WITH_BROTLI=ON |
| 68 | + -DARROW_WITH_BZ2=ON |
| 69 | + -DARROW_WITH_LZ4=ON |
| 70 | + -DARROW_WITH_SNAPPY=ON |
| 71 | + -DARROW_WITH_ZLIB=ON |
| 72 | + -DARROW_WITH_ZSTD=ON |
| 73 | + -DLZ4_HOME=#{Formula["lz4"].prefix} |
| 74 | + -DPARQUET_BUILD_EXECUTABLES=ON |
| 75 | + -DTHRIFT_HOME=#{Formula["thrift"].prefix} |
| 76 | + ] |
| 77 | + |
| 78 | + mkdir "build" |
| 79 | + cd "build" do |
| 80 | + system "cmake", "../cpp", *std_cmake_args, *args |
| 81 | + system "make" |
| 82 | + system "make", "install" |
| 83 | + end |
| 84 | + end |
| 85 | + |
| 86 | + test do |
| 87 | + (testpath/"test.cpp").write <<~EOS |
| 88 | + #include "arrow/api.h" |
| 89 | + int main(void) { |
| 90 | + arrow::int64(); |
| 91 | + return 0; |
| 92 | + } |
| 93 | + EOS |
| 94 | + system ENV.cxx, "test.cpp", "-std=c++11", "-I#{include}", "-L#{lib}", \ |
| 95 | + "-larrow", "-larrow_bundled_dependencies", "-o", "test" |
| 96 | + system "./test" |
| 97 | + end |
| 98 | +end |
0 commit comments