comparison deploy/osx/paths.sh @ 1082:b2c45b831ea8 3.0-integration

Merge from default branch
author Chris Cannam
date Wed, 18 Nov 2015 12:08:33 +0000
parents 9fbd599b4e3a bd3728701e1e
children 2d48532a074b
comparison
equal deleted inserted replaced
1071:b0f6dce4eab0 1082:b2c45b831ea8
1 #!/bin/bash 1 #!/bin/bash
2
3 set -e
2 4
3 app="$1" 5 app="$1"
4 if [ -z "$app" ]; then 6 if [ -z "$app" ]; then
5 echo "Usage: $0 <appname>" 7 echo "Usage: $0 <appname>"
6 echo "Provide appname without the .app extension, please" 8 echo "Provide appname without the .app extension, please"
7 exit 2 9 exit 2
8 fi 10 fi
9 11
10 frameworks="QtCore QtNetwork QtGui QtXml QtSvg QtWidgets QtPrintSupport" 12 set -u
13
14 frameworks="QtCore QtNetwork QtGui QtXml QtSvg QtWidgets QtPrintSupport QtDBus"
11 15
12 echo 16 echo
13 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"
14 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:"
15 echo "$frameworks" 19 echo "$frameworks"
25 install_name_tool -id "`basename \"$x\"`" "$x" 29 install_name_tool -id "`basename \"$x\"`" "$x"
26 done 30 done
27 31
28 for fwk in $frameworks; do 32 for fwk in $frameworks; do
29 find "$app.app" -type f -print | while read x; do 33 find "$app.app" -type f -print | while read x; do
30 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; }')
31 [ -z "$current" ] && continue 35 [ -z "$current" ] && continue
32 echo "$x has $current" 36 echo "$x has $current"
33 relative=$(echo "$x" | sed -e "s,$app.app/Contents/,," \ 37 relative=$(echo "$x" | sed -e "s,$app.app/Contents/,," \
34 -e 's,[^/]*/,../,g' -e 's,/[^/]*$,/Frameworks/'"$fwk"',' ) 38 -e 's,[^/]*/,../,g' -e 's,/[^/]*$,/Frameworks/'"$fwk"',' )
35 echo "replacing with relative path $relative" 39 echo "replacing with relative path $relative"
36 install_name_tool -change "$current" "@loader_path/$relative" "$x" 40 install_name_tool -change "$current" "@loader_path/$relative" "$x"
37 done 41 done
38 done 42 done
39 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
40 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!"
41 55
42 56