Skip to content

Commit 6cccfcb

Browse files
committed
fix: use arm-pkg-config to get the path to libsodium
1 parent 4eadc18 commit 6cccfcb

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

script/macos-arm-deps.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,21 @@ mkdir -p ~/arm-target/bin
1111
mkdir -p ~/arm-target/brew-cache
1212
export PATH="$HOME/arm-target/bin:$PATH"
1313

14+
# Download Homebrew under ~/arm-target
1415
PREV_PWD="$PWD"
1516
cd ~/arm-target
16-
1717
mkdir arm-homebrew
1818
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C arm-homebrew
19+
cd "$PREV_PWD"
20+
21+
# Add arm-brew binary
1922
ln -s ~/arm-target/arm-homebrew/bin/brew ~/arm-target/bin/arm-brew
2023

24+
# Homebrew env variables
2125
export HOMEBREW_CACHE=~/arm-target/brew-cache
2226
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
2327

28+
# Install the given dependencies for the given bottle_tag
2429
arm-brew fetch --deps --bottle-tag=$bottle_tag $dependencies |
2530
grep -E "(Downloaded to:|Already downloaded:)" |
2631
grep -v pkg-config |
@@ -29,13 +34,12 @@ arm-brew fetch --deps --bottle-tag=$bottle_tag $dependencies |
2934

3035
# Install host version of pkg-config so we can call it in the build system
3136
arm-brew install pkg-config
32-
ln -s ~/arm-target/arm-homebrew/bin/pkg-config ~/arm-target/bin/arm-pkg-config
3337

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

37-
cd "$PREV_PWD"
38-
3942
# libsodium
40-
export PATH="$HOME/arm-target/Cellar/libsodium/1.0.18_1/lib:$PATH"
41-
export PKG_CONFIG_PATH="$HOME/arm-target/Cellar/libsodium/1.0.18_1/lib:$PKG_CONFIG_PATH"
43+
SODIUM_PATH=$(~/arm-target/arm-homebrew/bin/pkg-config libsodium --libs)
44+
export PATH="$SODIUM_PATH:$PATH"
45+
export PKG_CONFIG_PATH="$SODIUM_PATH:$PKG_CONFIG_PATH"

0 commit comments

Comments
 (0)