comparison deploy/osx/paths.sh @ 699:646e48a0d3a5

Some work on macOS packaging
author Chris Cannam
date Tue, 11 Dec 2018 16:40:57 +0000
parents 8f3075eeaac2
children
comparison
equal deleted inserted replaced
698:52b8a499f379 699:646e48a0d3a5
29 install_name_tool -id "`basename \"$x\"`" "$x" 29 install_name_tool -id "`basename \"$x\"`" "$x"
30 done 30 done
31 31
32 for fwk in $frameworks; do 32 for fwk in $frameworks; do
33 find "$app.app" -type f -print | while read x; do 33 find "$app.app" -type f -print | while read x; do
34 34 if [ -x "$x" ]; then
35 current=$(otool -L "$x" | 35 current=$(otool -L "$x" |
36 grep "$fwk" | grep amework | grep -v ':$' | 36 grep "$fwk" | grep amework | grep -v ':$' |
37 awk '{ print $1; }') 37 awk '{ print $1; }')
38 38
39 [ -z "$current" ] && continue 39 [ -z "$current" ] && continue
40 40
41 echo "$x has $current" 41 echo "$x has $current"
42 42
43 case "$x" in 43 case "$x" in
44 *PyQt4*) 44 # *PyQt*)
45 # These are "special" Qt4 libraries used by 45 # These are "special" Qt libraries used by
46 # the PyQt module. They need to refer to their 46 # the PyQt module. They need to refer to their
47 # own local neighbours. Ugh, but let's handle 47 # own local neighbours. Ugh, but let's handle
48 # those manually here. 48 # those manually here.
49 relative="$fwk.so" 49 # relative="$fwk.so"
50 ;; 50 # ;;
51 *) 51 *)
52 # The normal Qt5 case 52 # The normal Qt case
53 relative=$(echo "$x" | 53 relative=$(echo "$x" |
54 sed -e "s,$app.app/Contents/,," \ 54 sed -e "s,$app.app/Contents/,," \
55 -e 's,[^/]*/,../,g' \ 55 -e 's,[^/]*/,../,g' \
56 -e 's,/[^/]*$,/Frameworks/'"$fwk"',' ) 56 -e 's,/[^/]*$,/Frameworks/'"$fwk"',' )
57 ;; 57 ;;
58 esac 58 esac
59 59
60 echo "replacing with relative path $relative" 60 echo "replacing with relative path $relative"
61 install_name_tool -change \ 61 install_name_tool -change \
62 "$current" "@loader_path/$relative" "$x" 62 "$current" "@loader_path/$relative" "$x"
63 fi
63 done 64 done
64 done 65 done
65 66
66 find "$app.app" -type f -print | while read x; do 67 find "$app.app" -type f -print | while read x; do
67 qtdep=$(otool -L "$x" | grep Qt | grep amework | grep -v ':$' | grep -v '@loader_path' | awk '{ print $1; }') 68 if [ -x "$x" ]; then
68 if [ -n "$qtdep" ]; then 69 qtdep=$(otool -L "$x" | grep Qt | grep amework | grep -v ':$' | grep -v '@loader_path' | awk '{ print $1; }')
69 echo 70 if [ -n "$qtdep" ]; then
70 echo "ERROR: File $x depends on Qt framework(s) not apparently present in the bundle:" 71 echo
71 echo $qtdep 72 echo "ERROR: File $x depends on Qt framework(s) not apparently present in the bundle:"
72 exit 1 73 echo $qtdep
74 exit 1
75 fi
73 fi 76 fi
74 done 77 done
75 78
76 echo "Done: be sure to run the app and see that it works!" 79 echo "Done: be sure to run the app and see that it works!"
77 80