🐛 Specify desired LD_RUNPATH_SEARCH_PATHS

This commit is contained in:
Chris Araman 2020-12-29 12:35:44 -08:00
parent 94eb4e5523
commit bcc1c1342f
2 changed files with 2 additions and 38 deletions

View file

@ -1268,7 +1268,7 @@
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INFOPLIST_FILE = "mas/mas-Info.plist";
INSTALL_PATH = /bin;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/. @executable_path/MasKit.framework/Versions/Current/Frameworks /usr/local/Frameworks /usr/local/Frameworks/MasKit.framework/Versions/Current/Frameworks $(inherited)";
LD_RUNPATH_SEARCH_PATHS = "@executable_path/. @executable_path/MasKit.framework/Versions/Current/Frameworks @executable_path/../Frameworks @executable_path/../Frameworks/MasKit.framework/Versions/Current/Frameworks $(inherited)";
MARKETING_VERSION = 1.7.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.mphys.mas-cli";
PRODUCT_NAME = "$(TARGET_NAME)";
@ -1293,7 +1293,7 @@
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
INFOPLIST_FILE = "mas/mas-Info.plist";
INSTALL_PATH = /bin;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/. @executable_path/MasKit.framework/Versions/Current/Frameworks /usr/local/Frameworks /usr/local/Frameworks/MasKit.framework/Versions/Current/Frameworks $(inherited)";
LD_RUNPATH_SEARCH_PATHS = "@executable_path/. @executable_path/MasKit.framework/Versions/Current/Frameworks @executable_path/../Frameworks @executable_path/../Frameworks/MasKit.framework/Versions/Current/Frameworks $(inherited)";
MARKETING_VERSION = 1.7.1;
PRODUCT_BUNDLE_IDENTIFIER = "com.mphys.mas-cli";
PRODUCT_NAME = "$(TARGET_NAME)";

View file

@ -8,7 +8,6 @@
# 1. Invokes the xcodebuild install action.
# 2. Copies the mas binary and MasKit.framework bundle into their correct
# relative positions under PREFIX.
# 3. Linker paths are updated on the mas binary so it can find MasKit under PREFIX.
#
# NOTE: This script is called by the mas Homebrew formula so it has only system
# dependencies aside from xcodebuild.
@ -27,10 +26,6 @@ INSTALL_TEMPORARY_FOLDER=${DSTROOT:-build/distributions}
# Final destination.
PREFIX=/usr/local
# Artifacts to copy.
FRAMEWORK_NAME=MasKit.framework
BINARY_NAME=mas
# Override default prefix path with optional 1st arg
if test -n "$1"; then
PREFIX="$1"
@ -56,34 +51,3 @@ ditto -v \
ditto -v \
"$INSTALL_TEMPORARY_FOLDER/bin" \
"$PREFIX/bin"
# Homebrew wants to fix install linkage...
#
# Error: Failed changing dylib ID of /usr/local/Cellar/mas/1.4.3/Frameworks/MasKit.framework/Versions/A/Frameworks/Result.framework/Versions/A/Result
# from @rpath/Result.framework/Versions/A/Result
# to /usr/local/opt/mas/Frameworks/MasKit.framework/Versions/A/Frameworks/Result.framework/Versions/A/Result
# Error: Failed to fix install linkage
# The formula built, but you may encounter issues using it or linking other
# formula against it.
#
# Setting the rpath to use @executable_path appears to suppress this behavior.
echo "==> 🔗 Update dylib load paths"
# install_name_tool
# -rpath old new
# Changes the rpath path name old to new in the specified Mach-O binary.
# More than one of these options can be specified. If the Mach-O binary does
# not contain the old rpath path name in a specified -rpath it is an error.
install_name_tool \
-rpath \
"/usr/local/Frameworks" \
"@executable_path/../Frameworks" \
"$PREFIX/bin/$BINARY_NAME"
install_name_tool \
-rpath \
"/usr/local/Frameworks/$FRAMEWORK_NAME/Versions/Current/Frameworks" \
"@executable_path/../Frameworks/$FRAMEWORK_NAME/Versions/Current/Frameworks" \
"$PREFIX/bin/$BINARY_NAME"