comparison deploy/osx/paths.sh @ 409:27446c7f3935

Some deployment gubbins (to be refined)
author Chris Cannam
date Fri, 08 Apr 2011 14:33:27 +0100
parents
children 451d3c087112
comparison
equal deleted inserted replaced
408:9d1dd846238b 409:27446c7f3935
1 #!/bin/bash
2
3 app="$1"
4 if [ -z "$app" ]; then
5 echo "Usage: $0 <appname>"
6 echo "Provide appname without the .app extension, please"
7 exit 2
8 fi
9
10 echo
11 echo "I expect you to have already copied QtCore, QtNetwork, QtGui and QtXml to "
12 echo "$app.app/Contents/Frameworks -- expect errors to follow if they're missing"
13 echo
14
15 echo "Fixing up loader paths in binaries..."
16
17 install_name_tool -id QtCore "$app.app/Contents/Frameworks/QtCore"
18 install_name_tool -id QtGui "$app.app/Contents/Frameworks/QtGui"
19 install_name_tool -id QtNetwork "$app.app/Contents/Frameworks/QtNetwork"
20 install_name_tool -id QtXml "$app.app/Contents/Frameworks/QtXml"
21
22 for fwk in QtCore QtGui QtNetwork QtXml; do
23 find "$app.app" -type f -print | while read x; do
24 current=$(otool -L "$x" | grep "$fwk" | grep ramework | awk '{ print $1; }')
25 [ -z "$current" ] && continue
26 echo "$x has $current"
27 relative=$(echo "$x" | sed -e "s,$app.app/Contents/,," \
28 -e 's,[^/]*/,../,g' -e 's,/[^/]*$,/Frameworks/'"$fwk"',' )
29 echo "replacing with relative path $relative"
30 install_name_tool -change "$current" "@loader_path/$relative" "$x"
31 done
32 done
33
34 echo "Done: be sure to run the app and see that it works!"
35
36