annotate deploy/osx/paths.sh @ 198:bb391844e2aa

Switching pitch candidate no longer wraps around: you can't go higher than the highest or lower than the lowest (though you can go either "up" or "down" if none of the alternate candidates has been selected yet, regardless of whether the candidates are higher or lower than the actual pitch track)
author Chris Cannam
date Wed, 05 Mar 2014 11:39:28 +0000
parents 092a69229347
children a3e9ddb7bb8b
rev   line source
Chris@62 1 #!/bin/bash
Chris@62 2
Chris@62 3 app="$1"
Chris@62 4 if [ -z "$app" ]; then
Chris@62 5 echo "Usage: $0 <appname>"
Chris@62 6 echo "Provide appname without the .app extension, please"
Chris@62 7 exit 2
Chris@62 8 fi
Chris@62 9
Chris@62 10 echo
Chris@62 11 echo "I expect you to have already copied QtCore, QtNetwork, QtGui, QtXml and QtWidgets to "
Chris@62 12 echo "$app.app/Contents/Frameworks -- expect errors to follow if they're missing"
Chris@62 13 echo
Chris@62 14
Chris@62 15 echo "Fixing up loader paths in binaries..."
Chris@62 16
Chris@62 17 install_name_tool -id QtCore "$app.app/Contents/Frameworks/QtCore"
Chris@62 18 install_name_tool -id QtGui "$app.app/Contents/Frameworks/QtGui"
Chris@62 19 install_name_tool -id QtNetwork "$app.app/Contents/Frameworks/QtNetwork"
Chris@62 20 install_name_tool -id QtXml "$app.app/Contents/Frameworks/QtXml"
Chris@62 21 install_name_tool -id QtWidgets "$app.app/Contents/Frameworks/QtWidgets"
Chris@62 22
Chris@62 23 find "$app.app" -name \*.dylib -print | while read x; do
Chris@62 24 install_name_tool -id "`basename \"$x\"`" "$x"
Chris@62 25 done
Chris@62 26
Chris@62 27 for fwk in QtCore QtGui QtNetwork QtXml QtWidgets; do
Chris@62 28 find "$app.app" -type f -print | while read x; do
Chris@62 29 current=$(otool -L "$x" | grep "$fwk" | grep amework | awk '{ print $1; }')
Chris@62 30 [ -z "$current" ] && continue
Chris@62 31 echo "$x has $current"
Chris@62 32 relative=$(echo "$x" | sed -e "s,$app.app/Contents/,," \
Chris@62 33 -e 's,[^/]*/,../,g' -e 's,/[^/]*$,/Frameworks/'"$fwk"',' )
Chris@62 34 echo "replacing with relative path $relative"
Chris@62 35 install_name_tool -change "$current" "@loader_path/$relative" "$x"
Chris@62 36 done
Chris@62 37 done
Chris@62 38
Chris@62 39 echo "Done: be sure to run the app and see that it works!"
Chris@62 40
Chris@62 41