Mercurial > hg > tony
comparison deploy/osx/paths.sh @ 516:449a0355f864 v2.0_osx_deploy
Deployment fixes. Qt on OSX now seems to depend on QtDBus, so copy that in, and also fail if anything is found to depend on an absent Qt framework.
author | Chris Cannam |
---|---|
date | Fri, 23 Oct 2015 08:50:39 +0100 |
parents | 42e80bb7f1ad |
children |
comparison
equal
deleted
inserted
replaced
515:b575e0890efb | 516:449a0355f864 |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 set -eu | 3 set -e |
4 | 4 |
5 app="$1" | 5 app="$1" |
6 if [ -z "$app" ]; then | 6 if [ -z "$app" ]; then |
7 echo "Usage: $0 <appname>" | 7 echo "Usage: $0 <appname>" |
8 echo "Provide appname without the .app extension, please" | 8 echo "Provide appname without the .app extension, please" |
9 exit 2 | 9 exit 2 |
10 fi | 10 fi |
11 | 11 |
12 frameworks="QtCore QtNetwork QtGui QtXml QtSvg QtWidgets QtPrintSupport" | 12 set -u |
13 | |
14 frameworks="QtCore QtNetwork QtGui QtXml QtSvg QtWidgets QtPrintSupport QtDBus" | |
13 | 15 |
14 echo | 16 echo |
15 echo "I expect you to have already copied these frameworks from the Qt installation to" | 17 echo "I expect you to have already copied these frameworks from the Qt installation to" |
16 echo "$app.app/Contents/Frameworks -- expect errors to follow if they're missing:" | 18 echo "$app.app/Contents/Frameworks -- expect errors to follow if they're missing:" |
17 echo "$frameworks" | 19 echo "$frameworks" |
27 install_name_tool -id "`basename \"$x\"`" "$x" | 29 install_name_tool -id "`basename \"$x\"`" "$x" |
28 done | 30 done |
29 | 31 |
30 for fwk in $frameworks; do | 32 for fwk in $frameworks; do |
31 find "$app.app" -type f -print | while read x; do | 33 find "$app.app" -type f -print | while read x; do |
32 current=$(otool -L "$x" | grep "$fwk" | grep amework | awk '{ print $1; }') | 34 current=$(otool -L "$x" | grep "$fwk" | grep amework | grep -v ':$' | awk '{ print $1; }') |
33 [ -z "$current" ] && continue | 35 [ -z "$current" ] && continue |
34 echo "$x has $current" | 36 echo "$x has $current" |
35 relative=$(echo "$x" | sed -e "s,$app.app/Contents/,," \ | 37 relative=$(echo "$x" | sed -e "s,$app.app/Contents/,," \ |
36 -e 's,[^/]*/,../,g' -e 's,/[^/]*$,/Frameworks/'"$fwk"',' ) | 38 -e 's,[^/]*/,../,g' -e 's,/[^/]*$,/Frameworks/'"$fwk"',' ) |
37 echo "replacing with relative path $relative" | 39 echo "replacing with relative path $relative" |
38 install_name_tool -change "$current" "@loader_path/$relative" "$x" | 40 install_name_tool -change "$current" "@loader_path/$relative" "$x" |
39 done | 41 done |
40 done | 42 done |
41 | 43 |
44 find "$app.app" -type f -print | while read x; do | |
45 qtdep=$(otool -L "$x" | grep Qt | grep amework | grep -v ':$' | grep -v '@loader_path' | awk '{ print $1; }') | |
46 if [ -n "$qtdep" ]; then | |
47 echo | |
48 echo "ERROR: File $x depends on Qt framework(s) not apparently present in the bundle:" | |
49 echo $qtdep | |
50 exit 1 | |
51 fi | |
52 done | |
53 | |
42 echo "Done: be sure to run the app and see that it works!" | 54 echo "Done: be sure to run the app and see that it works!" |
43 | 55 |
44 | 56 |