]> git.proxmox.com Git - ceph.git/blame - ceph/src/arrow/r/tools/autobrew
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / r / tools / autobrew
CommitLineData
1d09f67e
TL
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# https://github.com/jeroen/autobrew/blob/gh-pages/apache-arrow
19export HOMEBREW_NO_ANALYTICS=1
20export HOMEBREW_NO_AUTO_UPDATE=1
21
22# Official Homebrew no longer supports El-Capitan
23UPSTREAM_ORG="autobrew"
24
25if [ "$DISABLE_AUTOBREW" ]; then return 0; fi
26AUTOBREW=${TMPDIR-/tmp}
27export HOMEBREW_TEMP="$AUTOBREW/hbtmp"
28BREWDIR="$AUTOBREW/build-$PKG_BREW_NAME"
29BREW="$BREWDIR/bin/brew"
30rm -Rf $BREWDIR
31mkdir -p $BREWDIR
32echo "$(date): Auto-brewing $PKG_BREW_NAME in $BREWDIR..."
33curl -fsSL https://github.com/$UPSTREAM_ORG/brew/tarball/master | tar xz --strip 1 -C $BREWDIR
34
35# Install bottle + dependencies
36export HOMEBREW_CACHE="$AUTOBREW"
37LOCAL_FORMULA="tools/${PKG_BREW_NAME}.rb"
38if [ -f "$LOCAL_FORMULA" ]; then
39 # Use the local brew formula and install --HEAD
40 $BREW deps -n "$LOCAL_FORMULA" 2>/dev/null
41 BREW_DEPS=$($BREW deps -n "$LOCAL_FORMULA" 2>/dev/null)
42 $BREW install --force-bottle $BREW_DEPS 2>&1 | perl -pe 's/Warning/Note/gi'
43 $BREW install -v --build-from-source --HEAD "$LOCAL_FORMULA" 2>&1 | perl -pe 's/Warning/Note/gi'
44else
45 $BREW install --force-bottle $BREW_DEPS $PKG_BREW_NAME 2>&1 | perl -pe 's/Warning/Note/gi'
46fi
47
48# Hardcode this for my custom autobrew build
49rm -f $BREWDIR/lib/*.dylib
50AWS_LIBS="-laws-cpp-sdk-config -laws-cpp-sdk-transfer -laws-cpp-sdk-identity-management -laws-cpp-sdk-cognito-identity -laws-cpp-sdk-sts -laws-cpp-sdk-s3 -laws-cpp-sdk-core -laws-c-event-stream -laws-checksums -laws-c-common -lpthread -lcurl"
51PKG_LIBS="-lparquet -larrow_dataset -larrow -larrow_bundled_dependencies -lthrift -llz4 -lsnappy -lzstd $AWS_LIBS"
52PKG_DIRS="-L$BREWDIR/lib"
53
54# Prevent CRAN builder from linking against old libs in /usr/local/lib
55for FILE in $BREWDIR/Cellar/*/*/lib/*.a; do
56 BASENAME=`basename $FILE`
57 LIBNAME=`echo "${BASENAME%.*}" | cut -c4-`
58 cp -f $FILE $BREWDIR/lib/libbrew$LIBNAME.a
59 echo "created $BREWDIR/lib/libbrew$LIBNAME.a"
60 PKG_LIBS=`echo $PKG_LIBS | sed "s/-l$LIBNAME/-lbrew$LIBNAME/g"`
61done
62
63PKG_CFLAGS="-I$BREWDIR/opt/$PKG_BREW_NAME/include -DARROW_R_WITH_PARQUET -DARROW_R_WITH_DATASET -DARROW_R_WITH_JSON -DARROW_R_WITH_S3"
64
65unset HOMEBREW_NO_ANALYTICS
66unset HOMEBREW_NO_AUTO_UPDATE