diff --git a/installer/utils/mac_utils.sh b/installer/utils/mac_utils.sh index 5c53b7ae9e..429c4a1e28 100644 --- a/installer/utils/mac_utils.sh +++ b/installer/utils/mac_utils.sh @@ -6,7 +6,7 @@ export BUNDLE_CONTENTS=$PWD/../data/$PRODUCT_DISPLAYED_NAME.app/Contents/ export LIB_PATH=@executable_path/../Lib function fix_dependencies { - set -ueo pipefail + set -ueox pipefail local target="$1" pushd "$(dirname "$target")" local prefix=$(grealpath -e "$2") @@ -25,10 +25,15 @@ function fix_dependencies { continue; fi normalized=$(grealpath -e "$dep") + if [[ "$normalized" == "/usr/local"/* ]] ; then + relative=$(basename "$normalized") + fi + if [[ "$normalized" == "$prefix"/* ]] ; then relative=$(grealpath -e --relative-to "$prefix" "$normalized") - change="$change -change \"$dep\" \"$subst/$relative\"" fi + + change="$change -change \"$dep\" \"$subst/$relative\"" done popd if [[ -n "$change" ]] ; then