Revert to old brew linking behaviour

This commit is contained in:
Shivam Mathur
2026-03-08 16:40:59 +05:30
parent 650d05dc41
commit a1e0f566a8
3 changed files with 16 additions and 5 deletions

View File

@@ -36,7 +36,10 @@ get_openssl_suffix() {
change_library_paths() {
if [ "$os" = "Darwin" ]; then
otool -L "${ext_dir:?}"/relay.so | grep -q 'ssl.1' && openssl_version='1.1' || openssl_version='3'
[ -e "${brew_prefix:?}"/opt/openssl@"$openssl_version" ] || safe_brew install openssl@"$openssl_version"
[ -e "${brew_prefix:?}"/opt/openssl@"$openssl_version" ] || {
safe_brew install --skip-link openssl@"$openssl_version" &&
brew link --overwrite --force openssl@"$openssl_version"
}
dylibs="$(otool -L "${ext_dir:?}"/relay.so | grep -Eo '.*\.dylib' | cut -f1 -d ' ')"
install_name_tool -change "$(echo "${dylibs}" | grep -E "libzstd.*dylib" | xargs)" "$brew_prefix"/opt/zstd/lib/libzstd.dylib "$ext_dir"/relay.so
install_name_tool -change "$(echo "${dylibs}" | grep -E "liblz4.*dylib" | xargs)" "$brew_prefix"/opt/lz4/lib/liblz4.dylib "$ext_dir"/relay.so

View File

@@ -60,9 +60,11 @@ add_linux_libs() {
add_darwin_libs() {
local lib=$1
if ! check_lib "$lib"; then
safe_brew install "$lib" >/dev/null 2>&1 || true
if [[ "$lib" = *@* ]]; then
safe_brew install --skip-link "$lib" >/dev/null 2>&1 || true
brew link --overwrite --force "$lib" >/dev/null 2>&1 || true
else
safe_brew install "$lib" >/dev/null 2>&1 || true
fi
fi
add_lib_log "$lib"