annotate deploy/osx/paths.sh @ 461:61b8c366f1f3
v1.0
Another exclusion from src
author |
Chris Cannam |
date |
Wed, 01 Apr 2015 13:11:10 +0100 |
parents |
af696edbd644 |
children |
42e80bb7f1ad |
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@207
|
12 frameworks="QtCore QtNetwork QtGui QtXml 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
|