From 8f542eae1ae3d8c0c248aefbf646ce1a8a7de0bc Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Mon, 8 Mar 2021 19:46:30 +0530 Subject: [PATCH] Fix linking old_libraries in macOS --- src/scripts/darwin.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index ea9d67d7..a1a1801d 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -235,7 +235,11 @@ link_libraries() { formula=$1 formula_prefix="$(brew --prefix "$formula")" sudo mkdir -p "$formula_prefix"/lib - sudo cp -a "$formula_prefix"/lib/*.dylib "$brew_prefix/lib" 2>/dev/null || true + for lib in "$formula_prefix"/lib/*.dylib; do + lib_name=$(basename "$lib") + sudo cp -a "$lib" "$brew_prefix/lib/old_$lib_name" 2>/dev/null || true + sudo ln -sf "$brew_prefix/lib/old_$lib_name" "$brew_prefix/lib/$lib_name" + done } # Function to update dependencies @@ -244,7 +248,7 @@ update_dependencies() { while read -r formula; do ( curl -o "$tap_dir/homebrew/homebrew-core/Formula/$formula.rb" "${curl_opts[@]}" "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/$formula.rb" - link_libraries $formula + link_libraries "$formula" ) & to_wait+=( $! ) done < "$tap_dir/shivammathur/homebrew-php/.github/deps/${ImageOS:?}_${ImageVersion:?}"