-
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: install arm brew on MacOS Arm to install libsodium
- Loading branch information
Showing
2 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
#! Install arm-brew on x86 MacOS Arm | ||
#! Based on https://github.com/Homebrew/discussions/discussions/2843#discussioncomment-2243610 | ||
|
||
bottle_tag="arm64_big_sur" # Macos 11 is big sure | ||
dependencies="libsodium gnutls" | ||
|
||
mkdir -p ~/arm-target/bin | ||
mkdir -p ~/arm-target/brew-cache | ||
export PATH="$HOME/arm-target/bin:$PATH" | ||
|
||
PREV_PWD="$PWD" | ||
cd ~/arm-target | ||
|
||
mkdir arm-homebrew | ||
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C arm-homebrew | ||
ln -s ~/arm-target/arm-homebrew/bin/brew ~/arm-target/bin/arm-brew | ||
|
||
export HOMEBREW_CACHE=~/arm-target/brew-cache | ||
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 | ||
|
||
arm-brew fetch --deps --bottle-tag=$bottle_tag $dependencies | | ||
grep -E "(Downloaded to:|Already downloaded:)" | | ||
grep -v pkg-config | | ||
awk '{ print $3 }' | | ||
xargs -n 1 arm-brew install --ignore-dependencies --force-bottle | ||
|
||
# Install host version of pkg-config so we can call it in the build system | ||
arm-brew install pkg-config | ||
ln -s ~/arm-target/arm-homebrew/bin/pkg-config ~/arm-target/bin/arm-pkg-config | ||
|
||
cd "$PREV_PWD" |