Skip to content

Commit

Permalink
Tweak for R-universe
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation committed Jan 8, 2024
1 parent 5307292 commit 9576797
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ EOF
exit 0
}

args()
tweak_for_aarm64_macos()
{
while [ 0 -lt $# ]; do
OPT="$1"
Expand All @@ -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
;;
Expand All @@ -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")

Expand Down Expand Up @@ -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}|" \
Expand Down

0 comments on commit 9576797

Please sign in to comment.