Skip to content

Commit

Permalink
Add macOS/AArch64 to get-stack.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
mpilgrem committed Sep 25, 2023
1 parent c375c68 commit 850ebfa
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions etc/scripts/get-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ post_install_separator() {
info ""
}

# determines the CPU's instruction set
# determines the CPU's instruction set architecture (ISA)
get_isa() {
if uname -m | grep -Eq 'armv[78]l?' ; then
echo arm
elif uname -m | grep -q aarch64 ; then
echo aarch64
# uname -m returns arm64 on macOS/AArch64
elif uname -m | grep -q arm64 ; then
echo aarch64
elif uname -m | grep -q x86 ; then
echo x86
else
Expand Down Expand Up @@ -289,16 +292,22 @@ do_windows_install() {
}

# Attempts to install on macOS.
# If 'brew' exists, installs using Homebrew. Otherwise, installs
# the generic bindist.
do_osx_install() {
info "Using generic bindist..."
info ""
install_64bit_osx_binary
info "NOTE: You may need to run 'xcode-select --install' and/or"
info " 'open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg'"
info " to set up the Xcode command-line tools, which Stack uses."
info ""
if is_x86_64 ; then
install_x86_64_osx_binary
info "NOTE: You may need to run 'xcode-select --install' and/or"
info " 'open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg'"
info " to set up the Xcode command-line tools, which Stack uses."
info ""
elif is_aarch64 ; then
install_aarch64_osx_binary
info "NOTE: You may need to run 'xcode-select --install' and/or"
info " 'open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg'"
info " to set up the Xcode command-line tools, which Stack uses."
info ""
else
die "Sorry, currently only 64-bit (x86_64 or aarch64) macOS binary is available."
fi
}

# # Attempts to install on FreeBSD. Installs dependencies with
Expand Down Expand Up @@ -581,7 +590,11 @@ install_aarch64_linux_binary() {
install_from_bindist "linux-aarch64.tar.gz"
}

install_64bit_osx_binary() {
install_aarch64_osx_binary() {
install_from_bindist "osx-aarch64.tar.gz"
}

install_x86_64_osx_binary() {
install_from_bindist "osx-x86_64.tar.gz"
}

Expand Down

0 comments on commit 850ebfa

Please sign in to comment.