From 188cc3a6f01060665f9b84480fe974f5b547352e Mon Sep 17 00:00:00 2001 From: Bartel Eerdekens Date: Mon, 5 Dec 2022 11:13:23 +0100 Subject: [PATCH 1/2] fix: make macos-arm-deps.sh executable + fix paths + fix re-running --- .github/workflows/CI.yml | 1 - script/macos-arm-deps.sh | 15 ++++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) mode change 100644 => 100755 script/macos-arm-deps.sh diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 094a26e4..ffb5d8de 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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 diff --git a/script/macos-arm-deps.sh b/script/macos-arm-deps.sh old mode 100644 new mode 100755 index a196c987..fed373d8 --- a/script/macos-arm-deps.sh +++ b/script/macos-arm-deps.sh @@ -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 @@ -28,18 +28,19 @@ 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 reinstall --force-bottle # Install host version of pkg-config so we can call it in the build system -arm-brew install pkg-config +arm-brew reinstall 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" +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" From af8f5c424d6d8169d098daca74f5437174ed9f46 Mon Sep 17 00:00:00 2001 From: Bartel Eerdekens Date: Mon, 5 Dec 2022 13:26:12 +0100 Subject: [PATCH 2/2] fix: faster re-install, ignore warning when already installed + fix pnpm install for arm64 --- script/macos-arm-deps.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/script/macos-arm-deps.sh b/script/macos-arm-deps.sh index fed373d8..a62758e5 100755 --- a/script/macos-arm-deps.sh +++ b/script/macos-arm-deps.sh @@ -31,10 +31,10 @@ arm-brew fetch --deps --bottle-tag=$bottle_tag $dependencies | grep -E ".tar.gz" | grep -v pkg-config | awk '{ print $3 }' | - xargs -n 1 arm-brew reinstall --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 reinstall pkg-config +arm-brew install pkg-config || true # Add the installed binaries/libraries to the path export PATH="$HOME/arm-target/bin/:$PATH" @@ -44,3 +44,4 @@ export PATH="$HOME/arm-target/lib/:$PATH" 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