Skip to content

Commit

Permalink
remove autobrew path in configure
Browse files Browse the repository at this point in the history
  • Loading branch information
assignUser committed Sep 13, 2023
1 parent 932a32c commit 52eecc2
Showing 1 changed file with 1 addition and 45 deletions.
46 changes: 1 addition & 45 deletions r/configure
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ PKG_TEST_HEADER="<arrow/api.h>"
# Some env vars that control the build (all logical, case insensitive)
# Development mode, also increases verbosity in the bundled build
ARROW_R_DEV=`echo $ARROW_R_DEV | tr '[:upper:]' '[:lower:]'`
# autobrew is how mac binaries are built on CRAN; FORCE ensures we use it here
FORCE_AUTOBREW=`echo $FORCE_AUTOBREW | tr '[:upper:]' '[:lower:]'`
# The bundled build compiles arrow C++ from source; FORCE ensures we don't pick up
# any other packages that may be found on the system
FORCE_BUNDLED_BUILD=`echo $FORCE_BUNDLED_BUILD | tr '[:upper:]' '[:lower:]'`
Expand Down Expand Up @@ -141,19 +139,11 @@ fi
find_or_build_libarrow () {
if [ "$FORCE_BUNDLED_BUILD" = "true" ]; then
do_bundled_build
elif [ "$FORCE_AUTOBREW" = "true" ]; then
do_autobrew
else
find_arrow
if [ "$_LIBARROW_FOUND" = "false" ]; then
# If we haven't found a suitable version of libarrow, build it
if [ "$UNAME" = "Darwin" ] && ! echo $VERSION | grep -q "000"; then
# Only autobrew on release version (for testing, use FORCE_AUTOBREW above)
# (dev versions end in .9000, and nightly gets something like .10000xxx)
do_autobrew
else
do_bundled_build
fi
do_bundled_build
fi
fi
}
Expand All @@ -175,12 +165,6 @@ find_arrow () {
# 2. Use pkg-config to find arrow on the system
_LIBARROW_FOUND="`${PKG_CONFIG} --variable=prefix --silence-errors ${PKG_CONFIG_NAME}`"
echo "*** Trying Arrow C++ found by pkg-config: $_LIBARROW_FOUND"
elif brew --prefix ${PKG_BREW_NAME} > /dev/null 2>&1; then
# 3. On macOS, look for Homebrew apache-arrow
# (note that if you have pkg-config, homebrew arrow may have already been found)
_LIBARROW_FOUND=`brew --prefix ${PKG_BREW_NAME}`
echo "*** Trying Arrow C++ found by Homebrew: ${_LIBARROW_FOUND}"
export PKG_CONFIG_PATH="${_LIBARROW_FOUND}/lib/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
else
_LIBARROW_FOUND="false"
fi
Expand Down Expand Up @@ -247,34 +231,6 @@ do_bundled_build () {
fi
}

do_autobrew () {
echo "*** Downloading ${PKG_BREW_NAME}"

# Setup for local autobrew testing
if [ -f "tools/apache-arrow.rb" ]; then
# If you want to use a local apache-arrow.rb formula, do
# $ cp ../dev/tasks/homebrew-formulae/autobrew/apache-arrow*.rb tools
# before R CMD build or INSTALL (assuming a local checkout of the apache/arrow repository).
# If you have this, you should use the local autobrew script so they match.
cp tools/autobrew .
fi

if [ -f "autobrew" ]; then
echo "**** Using local manifest for ${PKG_BREW_NAME}"
else
if ! curl -sfL "https://autobrew.github.io/scripts/$PKG_BREW_NAME" > autobrew; then
echo "Failed to download manifest for ${PKG_BREW_NAME}"
# Fall back to the local copy
cp tools/autobrew .
fi
fi
if ! . autobrew; then
echo "Failed to retrieve binary for ${PKG_BREW_NAME}"
fi
# autobrew sets `PKG_LIBS`, `PKG_DIRS`, and `PKG_CFLAGS`
# TODO: move PKG_LIBS and PKG_CFLAGS out of autobrew and use set_pkg_vars
}

# Once libarrow is obtained, this function sets `PKG_LIBS`, `PKG_DIRS`, and `PKG_CFLAGS`
# either from pkg-config or by inferring things about the directory in $1
set_pkg_vars () {
Expand Down

0 comments on commit 52eecc2

Please sign in to comment.