Skip to content

Commit

Permalink
fix #152151 fix Mac deployment for all libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioBL committed Jan 26, 2017
1 parent c1a143f commit 2f98dae
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions build/package_mac
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,21 @@ done

# Workaround:
# fix Homebrew libraries with hard coded absolute path, see QTBUG-56814
BIN_FILE=${VOLUME}/${APPNAME}.app/Contents/MacOS/mscore
for P in `otool -L $BIN_FILE | awk '{print $1}'`
FOLDER_NAME=${VOLUME}/${APPNAME}.app/Contents/Frameworks
for P in `ls -d $FOLDER_NAME/*.* | awk '{print $1}'`
do
FNAME=$(echo $P | sed "s,@executable_path/../Frameworks,${VOLUME}/${APPNAME}.app/Contents/Frameworks,g")
for P1 in `otool -L $FNAME | awk '{print $1}'`
do
if [[ "$P1" == /usr/local/Cellar*.dylib ]]
then
PATHNAME=$(dirname $P1)
PSLASH1=$(echo $P1 | sed "s,$PATHNAME,@executable_path/../Frameworks,g")
install_name_tool -change $P1 $PSLASH1 $FNAME
fi
done
if [[ "$P" == *.dylib ]]
then
for P1 in `otool -L $P | awk '{print $1}'`
do
if [[ "$P1" == /usr/local/Cellar*.dylib ]]
then
PATHNAME=$(dirname $P1)
PSLASH1=$(echo $P1 | sed "s,$PATHNAME,@executable_path/../Frameworks,g")
install_name_tool -change $P1 $PSLASH1 $P
fi
done
fi
done

for f in $(find "${VOLUME}/${APPNAME}.app/Contents" -iname "*");
Expand Down

0 comments on commit 2f98dae

Please sign in to comment.