From 053d5aba1dc69c29f00c1109080ce7265ad9907c Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 4 Dec 2022 18:41:45 -0800 Subject: [PATCH] fix: use arm-pkg-config to get the path to libsodium --- script/macos-arm-deps.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/script/macos-arm-deps.sh b/script/macos-arm-deps.sh index 3b0e38fa..c28e1c64 100644 --- a/script/macos-arm-deps.sh +++ b/script/macos-arm-deps.sh @@ -11,16 +11,21 @@ mkdir -p ~/arm-target/bin mkdir -p ~/arm-target/brew-cache export PATH="$HOME/arm-target/bin:$PATH" +# Download Homebrew under ~/arm-target 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 +cd "$PREV_PWD" + +# Add arm-brew binary ln -s ~/arm-target/arm-homebrew/bin/brew ~/arm-target/bin/arm-brew +# Homebrew env variables export HOMEBREW_CACHE=~/arm-target/brew-cache 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 -v pkg-config | @@ -31,11 +36,11 @@ arm-brew fetch --deps --bottle-tag=$bottle_tag $dependencies | arm-brew install pkg-config ln -s ~/arm-target/arm-homebrew/bin/pkg-config ~/arm-target/bin/arm-pkg-config +# 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" -cd "$PREV_PWD" - # libsodium -export PATH="$HOME/arm-target/Cellar/libsodium/1.0.18_1/lib:$PATH" -export PKG_CONFIG_PATH="$HOME/arm-target/Cellar/libsodium/1.0.18_1/lib:$PKG_CONFIG_PATH" +SODIUM_PATH=$(arm-pkg-config libsodium --libs) +export PATH="$SODIUM_PATH:$PATH" +export PKG_CONFIG_PATH="$SODIUM_PATH:$PKG_CONFIG_PATH"