Merge pull request #4305 from matthewbauer/rosetta2-check

Check for rosetta 2 support before installing x86_64-darwin Nix
This commit is contained in:
Eelco Dolstra 2020-12-07 15:59:56 +01:00 committed by GitHub
commit 97dc44f3d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

9
scripts/install.in Normal file → Executable file
View file

@ -45,10 +45,15 @@ case "$(uname -s).$(uname -m)" in
path=@tarballPath_x86_64-darwin@ path=@tarballPath_x86_64-darwin@
system=x86_64-darwin system=x86_64-darwin
;; ;;
Darwin.arm64) Darwin.arm64|Darwin.aarch64)
# check for Rosetta 2 support
if ! [ -f /Library/Apple/System/Library/LaunchDaemons/com.apple.oahd.plist ]; then
oops "Rosetta 2 is not installed on this ARM64 macOS machine. Run softwareupdate --install-rosetta then restart installation"
fi
hash=@binaryTarball_x86_64-darwin@ hash=@binaryTarball_x86_64-darwin@
path=@tarballPath_x86_64-darwin@ path=@tarballPath_x86_64-darwin@
# eventually maybe: arm64-darwin # eventually maybe: aarch64-darwin
system=x86_64-darwin system=x86_64-darwin
;; ;;
*) oops "sorry, there is no binary distribution of Nix for your platform";; *) oops "sorry, there is no binary distribution of Nix for your platform";;