From 95767979f2187f9623b1e5c6b1fc3c6b481b1601 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Mon, 8 Jan 2024 12:41:34 +0900 Subject: [PATCH] Tweak for R-universe --- configure | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/configure b/configure index b1b0ffd..49cc4ca 100755 --- a/configure +++ b/configure @@ -10,7 +10,7 @@ EOF exit 0 } -args() +tweak_for_aarm64_macos() { while [ 0 -lt $# ]; do OPT="$1" @@ -24,6 +24,12 @@ args() aarch64-apple-darwin*) TARGET="aarch64-apple-darwin" TARGET_ARG="--target ${TARGET}" + # TODO: ugly hack to install aarch64-apple-darwin target on R-universe + # c.f. https://github.com/r-universe-org/build-and-check/blob/261f7fc891adc7d4475501506821dc76275eaed9/macos-cross/action.yml#L26 + if [ -n "${ARROW_R_DEV}" ]; then + echo "[DEBUG] Installing aarch64-apple-darwin target" + BEFORE_CARGO_BUILD="${BEFORE_CARGO_BUILD}"' rustup target add aarch64-apple-darwin \&\&' + fi ;; esac ;; @@ -32,10 +38,6 @@ args() done } -# define $TARGET and $TARGET_ARG if provided via --build arg -# c.f. https://www.gnu.org/prep/standards/html_node/Configuration.html -args $* - # The envvar used in libR-sys crate LIBRSYS_R_VERSION=$("${R_HOME}/bin/Rscript" "./tools/print_r_version.R") @@ -72,6 +74,10 @@ else echo "*** Detected NOT_CRAN=true, do not override CARGO_HOME" fi +# define $TARGET and $TARGET_ARG if provided via --build arg +# c.f. https://www.gnu.org/prep/standards/html_node/Configuration.html +tweak_for_aarm64_macos $* + sed \ -e "s|@BEFORE_CARGO_BUILD@|${BEFORE_CARGO_BUILD}|" \ -e "s|@AFTER_CARGO_BUILD@|${AFTER_CARGO_BUILD}|" \