comparison deploy/osx/paths.sh @ 742:5462ac97d28f

OS/X build/deploy fixes
author Chris Cannam
date Fri, 04 Jul 2014 11:03:33 +0100
parents 4481a2ca375d
children 9fbd599b4e3a bd3728701e1e
comparison
equal deleted inserted replaced
741:2d5c6920e814 742:5462ac97d28f
5 echo "Usage: $0 <appname>" 5 echo "Usage: $0 <appname>"
6 echo "Provide appname without the .app extension, please" 6 echo "Provide appname without the .app extension, please"
7 exit 2 7 exit 2
8 fi 8 fi
9 9
10 frameworks="QtCore QtNetwork QtGui QtXml QtWidgets QtPrintSupport"
11
10 echo 12 echo
11 echo "I expect you to have already copied QtCore, QtNetwork, QtGui, QtXml and QtWidgets to " 13 echo "I expect you to have already copied these frameworks from the Qt installation to"
12 echo "$app.app/Contents/Frameworks -- expect errors to follow if they're missing" 14 echo "$app.app/Contents/Frameworks -- expect errors to follow if they're missing:"
15 echo "$frameworks"
13 echo 16 echo
14 17
15 echo "Fixing up loader paths in binaries..." 18 echo "Fixing up loader paths in binaries..."
16 19
17 install_name_tool -id QtCore "$app.app/Contents/Frameworks/QtCore" 20 for fwk in $frameworks; do
18 install_name_tool -id QtGui "$app.app/Contents/Frameworks/QtGui" 21 install_name_tool -id $fwk "$app.app/Contents/Frameworks/$fwk"
19 install_name_tool -id QtNetwork "$app.app/Contents/Frameworks/QtNetwork" 22 done
20 install_name_tool -id QtXml "$app.app/Contents/Frameworks/QtXml"
21 install_name_tool -id QtWidgets "$app.app/Contents/Frameworks/QtWidgets"
22 23
23 find "$app.app" -name \*.dylib -print | while read x; do 24 find "$app.app" -name \*.dylib -print | while read x; do
24 install_name_tool -id "`basename \"$x\"`" "$x" 25 install_name_tool -id "`basename \"$x\"`" "$x"
25 done 26 done
26 27
27 for fwk in QtCore QtGui QtNetwork QtXml QtWidgets; do 28 for fwk in $frameworks; do
28 find "$app.app" -type f -print | while read x; do 29 find "$app.app" -type f -print | while read x; do
29 current=$(otool -L "$x" | grep "$fwk" | grep amework | awk '{ print $1; }') 30 current=$(otool -L "$x" | grep "$fwk" | grep amework | awk '{ print $1; }')
30 [ -z "$current" ] && continue 31 [ -z "$current" ] && continue
31 echo "$x has $current" 32 echo "$x has $current"
32 relative=$(echo "$x" | sed -e "s,$app.app/Contents/,," \ 33 relative=$(echo "$x" | sed -e "s,$app.app/Contents/,," \