annotate deploy/osx/paths.sh @ 496:109016400b9c 2.0-integration

Update analysis stuff when recording starts (and when model is added) rather than when it ends. Not continuing to update during recording though...
author Chris Cannam
date Mon, 12 Oct 2015 17:10:43 +0100
parents 42e80bb7f1ad
children 449a0355f864
rev   line source
Chris@62 1 #!/bin/bash
Chris@62 2
Chris@437 3 set -eu
Chris@437 4
Chris@62 5 app="$1"
Chris@62 6 if [ -z "$app" ]; then
Chris@62 7 echo "Usage: $0 <appname>"
Chris@62 8 echo "Provide appname without the .app extension, please"
Chris@62 9 exit 2
Chris@62 10 fi
Chris@62 11
Chris@483 12 frameworks="QtCore QtNetwork QtGui QtXml QtSvg QtWidgets QtPrintSupport"
Chris@207 13
Chris@62 14 echo
Chris@207 15 echo "I expect you to have already copied these frameworks from the Qt installation to"
Chris@207 16 echo "$app.app/Contents/Frameworks -- expect errors to follow if they're missing:"
Chris@207 17 echo "$frameworks"
Chris@62 18 echo
Chris@62 19
Chris@62 20 echo "Fixing up loader paths in binaries..."
Chris@62 21
Chris@207 22 for fwk in $frameworks; do
Chris@207 23 install_name_tool -id $fwk "$app.app/Contents/Frameworks/$fwk"
Chris@207 24 done
Chris@62 25
Chris@62 26 find "$app.app" -name \*.dylib -print | while read x; do
Chris@62 27 install_name_tool -id "`basename \"$x\"`" "$x"
Chris@62 28 done
Chris@62 29
Chris@207 30 for fwk in $frameworks; do
Chris@62 31 find "$app.app" -type f -print | while read x; do
Chris@62 32 current=$(otool -L "$x" | grep "$fwk" | grep amework | awk '{ print $1; }')
Chris@62 33 [ -z "$current" ] && continue
Chris@62 34 echo "$x has $current"
Chris@62 35 relative=$(echo "$x" | sed -e "s,$app.app/Contents/,," \
Chris@62 36 -e 's,[^/]*/,../,g' -e 's,/[^/]*$,/Frameworks/'"$fwk"',' )
Chris@62 37 echo "replacing with relative path $relative"
Chris@62 38 install_name_tool -change "$current" "@loader_path/$relative" "$x"
Chris@62 39 done
Chris@62 40 done
Chris@62 41
Chris@62 42 echo "Done: be sure to run the app and see that it works!"
Chris@62 43
Chris@62 44