comparison deploy/osx/deploy.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 806e9cb9ce61
children ce4d06d87a39
comparison
equal deleted inserted replaced
320:67feb05754ee 335:aa852b477e4d
17 echo "(This should be a three-part number: major.minor.point)" 17 echo "(This should be a three-part number: major.minor.point)"
18 18
19 perl -p -e "s/EASYHG_VERSION/$bundleVersion/" deploy/osx/Info.plist \ 19 perl -p -e "s/EASYHG_VERSION/$bundleVersion/" deploy/osx/Info.plist \
20 > "$app".app/Contents/Info.plist 20 > "$app".app/Contents/Info.plist
21 21
22 echo "Done: check $app.app for sanity please" 22 echo "Done: check $app.app/Contents/Info.plist for sanity please"
23 23
24 echo 24 bash deploy/osx/paths.sh "$app"
25 echo "I expect you to have already copied QtCore, QtNetwork and QtGui to "
26 echo "$app.app/Contents/Frameworks and PyQt4/QtCore.so and PyQt4/QtGui.so to "
27 echo "$app.app/Contents/MacOS -- expect errors to follow if they're missing"
28 echo
29
30 echo "Fixing up loader paths in binaries..."
31
32 install_name_tool -id QtCore "$app.app/Contents/Frameworks/QtCore"
33 install_name_tool -id QtGui "$app.app/Contents/Frameworks/QtGui"
34 install_name_tool -id QtNetwork "$app.app/Contents/Frameworks/QtNetwork"
35
36 for fwk in QtCore QtGui QtNetwork; do
37 find "$app.app" -type f -print | while read x; do
38 current=$(otool -L "$x" | grep "$fwk.framework/" | awk '{ print $1; }')
39 [ -z "$current" ] && continue
40 echo "$x has $current"
41 relative=$(echo "$x" | sed -e "s,$app.app/Contents/,," \
42 -e 's,[^/]*/,../,g' -e 's,/[^/]*$,/Frameworks/'"$fwk"',' )
43 echo "replacing with relative path $relative"
44 install_name_tool -change "$current" "@loader_path/$relative" "$x"
45 done
46 done
47
48 echo "Done: be sure to run the app and see that it works!"
49 25
50 echo 26 echo
51 echo "Making dmg..." 27 echo "Making dmg..."
52 28
53 hdiutil create -srcfolder "$app".app "$app"-"$version".dmg -volname "$app"-"$version" 29 mkdir "$app"-"$version" &&
30 ln -s /Applications "$app"-"$version"/Applications &&
31 cp -rp "$app".app "$app"-"$version"/ &&
32 hdiutil create -srcfolder "$app"-"$version" "$app"-"$version".dmg -volname "$app"-"$version" &&
33 rm -r "$app"-"$version"
54 34
55 echo "Done" 35 echo "Done"