comparison deploy/osx/paths.sh @ 335:aa852b477e4d

More OS/X deployment: Try to set shared library dependencies separately for each source arch
author Chris Cannam
date Wed, 02 Mar 2011 15:58:34 +0000
parents
children 2d3f1e5d8638
comparison
equal deleted inserted replaced
320:67feb05754ee 335:aa852b477e4d
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 and QtGui to "
12 echo "$app.app/Contents/Frameworks and PyQt4/QtCore.so and PyQt4/QtGui.so to "
13 echo "$app.app/Contents/MacOS -- expect errors to follow if they're missing"
14 echo
15
16 echo "Fixing up loader paths in binaries..."
17
18 install_name_tool -id QtCore "$app.app/Contents/Frameworks/QtCore"
19 install_name_tool -id QtGui "$app.app/Contents/Frameworks/QtGui"
20 install_name_tool -id QtNetwork "$app.app/Contents/Frameworks/QtNetwork"
21
22 for fwk in QtCore QtGui QtNetwork; do
23 find "$app.app" -type f -print | while read x; do
24 current=$(otool -L "$x" | grep "$fwk.framework/" | 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