diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/arrow/r/tools/autobrew | |
parent | Initial commit. (diff) | |
download | ceph-b26c4052f3542036551aa9dec9caa4226e456195.tar.xz ceph-b26c4052f3542036551aa9dec9caa4226e456195.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/arrow/r/tools/autobrew')
-rw-r--r-- | src/arrow/r/tools/autobrew | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/arrow/r/tools/autobrew b/src/arrow/r/tools/autobrew new file mode 100644 index 000000000..d40729e18 --- /dev/null +++ b/src/arrow/r/tools/autobrew @@ -0,0 +1,66 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# https://github.com/jeroen/autobrew/blob/gh-pages/apache-arrow +export HOMEBREW_NO_ANALYTICS=1 +export HOMEBREW_NO_AUTO_UPDATE=1 + +# Official Homebrew no longer supports El-Capitan +UPSTREAM_ORG="autobrew" + +if [ "$DISABLE_AUTOBREW" ]; then return 0; fi +AUTOBREW=${TMPDIR-/tmp} +export HOMEBREW_TEMP="$AUTOBREW/hbtmp" +BREWDIR="$AUTOBREW/build-$PKG_BREW_NAME" +BREW="$BREWDIR/bin/brew" +rm -Rf $BREWDIR +mkdir -p $BREWDIR +echo "$(date): Auto-brewing $PKG_BREW_NAME in $BREWDIR..." +curl -fsSL https://github.com/$UPSTREAM_ORG/brew/tarball/master | tar xz --strip 1 -C $BREWDIR + +# Install bottle + dependencies +export HOMEBREW_CACHE="$AUTOBREW" +LOCAL_FORMULA="tools/${PKG_BREW_NAME}.rb" +if [ -f "$LOCAL_FORMULA" ]; then + # Use the local brew formula and install --HEAD + $BREW deps -n "$LOCAL_FORMULA" 2>/dev/null + BREW_DEPS=$($BREW deps -n "$LOCAL_FORMULA" 2>/dev/null) + $BREW install --force-bottle $BREW_DEPS 2>&1 | perl -pe 's/Warning/Note/gi' + $BREW install -v --build-from-source --HEAD "$LOCAL_FORMULA" 2>&1 | perl -pe 's/Warning/Note/gi' +else + $BREW install --force-bottle $BREW_DEPS $PKG_BREW_NAME 2>&1 | perl -pe 's/Warning/Note/gi' +fi + +# Hardcode this for my custom autobrew build +rm -f $BREWDIR/lib/*.dylib +AWS_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" +PKG_LIBS="-lparquet -larrow_dataset -larrow -larrow_bundled_dependencies -lthrift -llz4 -lsnappy -lzstd $AWS_LIBS" +PKG_DIRS="-L$BREWDIR/lib" + +# Prevent CRAN builder from linking against old libs in /usr/local/lib +for FILE in $BREWDIR/Cellar/*/*/lib/*.a; do + BASENAME=`basename $FILE` + LIBNAME=`echo "${BASENAME%.*}" | cut -c4-` + cp -f $FILE $BREWDIR/lib/libbrew$LIBNAME.a + echo "created $BREWDIR/lib/libbrew$LIBNAME.a" + PKG_LIBS=`echo $PKG_LIBS | sed "s/-l$LIBNAME/-lbrew$LIBNAME/g"` +done + +PKG_CFLAGS="-I$BREWDIR/opt/$PKG_BREW_NAME/include -DARROW_R_WITH_PARQUET -DARROW_R_WITH_DATASET -DARROW_R_WITH_JSON -DARROW_R_WITH_S3" + +unset HOMEBREW_NO_ANALYTICS +unset HOMEBREW_NO_AUTO_UPDATE |