annotate deploy/osx/deploy.sh @ 256:f649f6066e4d

* OS/X deployment fixes
author Chris Cannam
date Wed, 12 Jan 2011 15:02:11 +0000
parents 41ae9544a255
children 7057a4dcac3e
rev   line source
Chris@232 1 #!/bin/bash
Chris@232 2
Chris@232 3 # Execute this from the top-level directory of the project (the one
Chris@232 4 # that contains the .app bundle).
Chris@232 5
Chris@232 6 app=EasyMercurial
Chris@232 7
Chris@232 8 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h`
Chris@232 9 bundleVersion="$version".0
Chris@232 10
Chris@232 11 echo
Chris@232 12 echo "Writing version $bundleVersion in to bundle."
Chris@232 13 echo "(This should be a three-part number: major.minor.point)"
Chris@232 14
Chris@232 15 perl -p -e "s/EASYHG_VERSION/$bundleVersion/" deploy/osx/Info.plist \
Chris@232 16 > "$app".app/Contents/Info.plist
Chris@232 17
Chris@232 18 echo "Done: check $app.app for sanity please"
Chris@232 19
Chris@232 20 echo
Chris@256 21 echo "I expect you to have already copied QtCore, QtNetwork and QtGui to "
Chris@256 22 echo "$app.app/Contents/Frameworks and PyQt4/QtCore.so and PyQt4/QtGui.so to "
Chris@256 23 echo "$app.app/Contents/MacOS -- expect errors to follow if they're missing"
Chris@256 24 echo
Chris@256 25
Chris@256 26 echo "Fixing up loader paths in binaries..."
Chris@256 27
Chris@256 28 install_name_tool -id QtCore "$app.app/Contents/Frameworks/QtCore"
Chris@256 29 install_name_tool -id QtGui "$app.app/Contents/Frameworks/QtGui"
Chris@256 30 install_name_tool -id QtNetwork "$app.app/Contents/Frameworks/QtNetwork"
Chris@256 31
Chris@256 32 install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore "$app.app/Contents/MacOS/$app"
Chris@256 33 install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui "$app.app/Contents/MacOS/$app"
Chris@256 34 install_name_tool -change QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork "$app.app/Contents/MacOS/$app"
Chris@256 35
Chris@256 36 install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/QtCore "$app.app/Contents/Frameworks/QtGui"
Chris@256 37 install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/QtCore "$app.app/Contents/Frameworks/QtNetwork"
Chris@256 38
Chris@256 39 install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/../../Frameworks/QtCore "$app.app/Contents/MacOS/PyQt4/QtCore.so"
Chris@256 40 install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/../../Frameworks/QtCore "$app.app/Contents/MacOS/PyQt4/QtGui.so"
Chris@256 41 install_name_tool -change QtCore.framework/Versions/4/QtCore @loader_path/../../Frameworks/QtGui "$app.app/Contents/MacOS/PyQt4/QtGui.so"
Chris@256 42
Chris@256 43 echo "Done: be sure to run the app and see that it works!"
Chris@256 44
Chris@256 45 echo
Chris@232 46 echo "Making dmg..."
Chris@232 47
Chris@232 48 hdiutil create -srcfolder "$app".app "$app"-"$version".dmg -volname "$app"-"$version"
Chris@232 49
Chris@232 50 echo "Done"