From 71701fffbede27c10e10b37288fad1f021ffaa27 Mon Sep 17 00:00:00 2001 From: Renan Castro Date: Tue, 19 Oct 2021 19:49:15 -0300 Subject: [PATCH] Support arm64 on darwin when building the dev bundle --- scripts/build-dev-bundle-common.sh | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/scripts/build-dev-bundle-common.sh b/scripts/build-dev-bundle-common.sh index 2b5afedb79..754c8a8f6a 100644 --- a/scripts/build-dev-bundle-common.sh +++ b/scripts/build-dev-bundle-common.sh @@ -26,18 +26,20 @@ if [ "$UNAME" == "Linux" ] ; then strip --remove-section=.comment --remove-section=.note $1 } elif [ "$UNAME" == "Darwin" ] ; then - SYSCTL_64BIT=$(sysctl -n hw.cpu64bit_capable 2>/dev/null || echo 0) - if [ "$ARCH" == "i386" -a "1" != "$SYSCTL_64BIT" ] ; then - # some older macos returns i386 but can run 64 bit binaries. - # Probably should distribute binaries built on these machines, - # but it should be OK for users to run. - ARCH="x86_64" - fi + if [ "$ARCH" != "arm64" ] ; then + SYSCTL_64BIT=$(sysctl -n hw.cpu64bit_capable 2>/dev/null || echo 0) + if [ "$ARCH" == "i386" -a "1" != "$SYSCTL_64BIT" ] ; then + # some older macos returns i386 but can run 64 bit binaries. + # Probably should distribute binaries built on these machines, + # but it should be OK for users to run. + ARCH="x86_64" + fi - if [ "$ARCH" != "x86_64" ] ; then - echo "Unsupported architecture: $ARCH" - echo "Meteor only supports x86_64 for now." - exit 1 + if [ "$ARCH" != "x86_64" ] ; then + echo "Unsupported architecture: $ARCH" + echo "Meteor only supports x86_64 for now." + exit 1 + fi fi OS="macos" @@ -69,7 +71,9 @@ then fi elif [ "$UNAME" == "Darwin" ] then - NODE_TGZ="node-v${NODE_VERSION}-darwin-x64.tar.gz" + if [ "$ARCH" != "arm64" ] ; then + NODE_TGZ="node-v${NODE_VERSION}-darwin-x64.tar.gz" + fi else echo "Unknown architecture: $UNAME $ARCH" exit 1