Skip to content

Commit

Permalink
Merge pull request #543 from Bartel-C8/macos-arm [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya authored Dec 5, 2022
2 parents 6cccfcb + af8f5c4 commit 3b6667e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ jobs:
if: ${{ contains(matrix.os, 'macos') && matrix.ARCH == 'arm64' }}
run: |
brew uninstall libsodium --force --ignore-dependencies
chmod +x ./script/macos-arm-deps.sh
source ./script/macos-arm-deps.sh
- name: Install Dependencies and Build
Expand Down
16 changes: 9 additions & 7 deletions script/macos-arm-deps.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ export PATH="$HOME/arm-target/bin:$PATH"
# Download Homebrew under ~/arm-target
PREV_PWD="$PWD"
cd ~/arm-target
mkdir arm-homebrew
mkdir -p arm-homebrew
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C arm-homebrew
cd "$PREV_PWD"

# Add arm-brew binary
ln -s ~/arm-target/arm-homebrew/bin/brew ~/arm-target/bin/arm-brew
ln -sf ~/arm-target/arm-homebrew/bin/brew ~/arm-target/bin/arm-brew

# Homebrew env variables
export HOMEBREW_CACHE=~/arm-target/brew-cache
Expand All @@ -28,18 +28,20 @@ export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
# Install the given dependencies for the given bottle_tag
arm-brew fetch --deps --bottle-tag=$bottle_tag $dependencies |
grep -E "(Downloaded to:|Already downloaded:)" |
grep -E ".tar.gz" |
grep -v pkg-config |
awk '{ print $3 }' |
xargs -n 1 arm-brew install --force-bottle
xargs -n 1 arm-brew install --force-bottle || true

# Install host version of pkg-config so we can call it in the build system
arm-brew install pkg-config
arm-brew install pkg-config || true

# Add the installed binaries/libraries to the path
export PATH="$HOME/arm-target/arm-homebrew/bin/:$PATH"
export PATH="$HOME/arm-target/arm-homebrew/lib/:$PATH"
export PATH="$HOME/arm-target/bin/:$PATH"
export PATH="$HOME/arm-target/lib/:$PATH"

# libsodium
SODIUM_PATH=$(~/arm-target/arm-homebrew/bin/pkg-config libsodium --libs)
SODIUM_PATH=$(~/arm-target/bin/pkg-config libsodium --libs-only-L | sed -e 's/-L//g') # print only -L and replace "-L" itself
export PATH="$SODIUM_PATH:$PATH"
export PKG_CONFIG_PATH="$SODIUM_PATH:$PKG_CONFIG_PATH"
export npm_config_target_arch=arm64

0 comments on commit 3b6667e

Please sign in to comment.