@@ -69,12 +69,15 @@ post_install_separator() {
6969 info " "
7070}
7171
72- # determines the CPU's instruction set
72+ # determines the CPU's instruction set architecture (ISA)
7373get_isa () {
7474 if uname -m | grep -Eq ' armv[78]l?' ; then
7575 echo arm
7676 elif uname -m | grep -q aarch64 ; then
7777 echo aarch64
78+ # uname -m returns arm64 on macOS/AArch64
79+ elif uname -m | grep -q arm64 ; then
80+ echo aarch64
7881 elif uname -m | grep -q x86 ; then
7982 echo x86
8083 else
@@ -289,16 +292,22 @@ do_windows_install() {
289292}
290293
291294# Attempts to install on macOS.
292- # If 'brew' exists, installs using Homebrew. Otherwise, installs
293- # the generic bindist.
294295do_osx_install () {
295- info " Using generic bindist..."
296- info " "
297- install_64bit_osx_binary
298- info " NOTE: You may need to run 'xcode-select --install' and/or"
299- info " 'open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg'"
300- info " to set up the Xcode command-line tools, which Stack uses."
301- info " "
296+ if is_x86_64 ; then
297+ install_x86_64_osx_binary
298+ info " NOTE: You may need to run 'xcode-select --install' and/or"
299+ info " 'open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg'"
300+ info " to set up the Xcode command-line tools, which Stack uses."
301+ info " "
302+ elif is_aarch64 ; then
303+ install_aarch64_osx_binary
304+ info " NOTE: You may need to run 'xcode-select --install' and/or"
305+ info " 'open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg'"
306+ info " to set up the Xcode command-line tools, which Stack uses."
307+ info " "
308+ else
309+ die " Sorry, currently only 64-bit (x86_64 or aarch64) macOS binary is available."
310+ fi
302311}
303312
304313# # Attempts to install on FreeBSD. Installs dependencies with
@@ -581,7 +590,11 @@ install_aarch64_linux_binary() {
581590 install_from_bindist " linux-aarch64.tar.gz"
582591}
583592
584- install_64bit_osx_binary () {
593+ install_aarch64_osx_binary () {
594+ install_from_bindist " osx-aarch64.tar.gz"
595+ }
596+
597+ install_x86_64_osx_binary () {
585598 install_from_bindist " osx-x86_64.tar.gz"
586599}
587600
0 commit comments