Skip to content

Instantly share code, notes, and snippets.

@lasconic
Last active July 30, 2022 06:10
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lasconic/5965542 to your computer and use it in GitHub Desktop.
Save lasconic/5965542 to your computer and use it in GitHub Desktop.
replace double slashes by simple slash in library paths before running macdeployqt
BIN_FILE=YOURBINARY
for P in `otool -L $BIN_FILE | awk '{print $1}'`
do
if [[ "$P" == *//* ]]
then
PSLASH=$(echo $P | sed 's,//,/,g')
install_name_tool -change $P $PSLASH $BIN_FILE
fi
done
QTDIR=$1
for F in `find $QTDIR/lib $QTDIR/plugins $QTDIR/qml -perm 755 -type f`
do
for P in `otool -L $F | awk '{print $1}'`
do
if [[ "$P" == *//* ]]
then
PSLASH=$(echo $P | sed 's,//,/,g')
install_name_tool -change $P $PSLASH $F
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment