# HG changeset patch # User Chris Cannam # Date 1302269607 -3600 # Node ID 27446c7f393544b3d573d8aba5c1425289ec48be # Parent 9d1dd846238b4a0a954adc1e82598ae84e191df6 Some deployment gubbins (to be refined) diff -r 9d1dd846238b -r 27446c7f3935 deploy/osx/Info.plist --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy/osx/Info.plist Fri Apr 08 14:33:27 2011 +0100 @@ -0,0 +1,18 @@ + + + + + CFBundlePackageType + APPL + CFBundleName + SonicVisualiser + CFBundleExecutable + Sonic Visualiser + CFBundleIconFile + sv-macicon.icns + CFBundleIdentifier + org.sonicvisualiser.SonicVisualiser + CFBundleShortVersionString + SV_VERSION + + diff -r 9d1dd846238b -r 27446c7f3935 deploy/osx/Info.plist.2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy/osx/Info.plist.2 Fri Apr 08 14:33:27 2011 +0100 @@ -0,0 +1,141 @@ + + + + + CFBundleIconFile + sv-macicon.icns + CFBundlePackageType + APPL + CFBundleGetInfoString + Created by Qt/QMake + CFBundleSignature + SNCV + CFBundleExecutable + Sonic Visualiser + CFBundleIdentifier + org.isophonics.SonicVisualiser + CFBundleDocumentTypes + + + + CFBundleTypeExtensions + + sv + + + CFBundleTypeMIMETypes + + application/x-sonic-visualiser-project + + CFBundleTypeName + Sonic Visualiser Project + CFBundleTypeOSTypes + + **** + + CFBundleTypeRole + Editor + LSHandlerRank + Owner + LSIsAppleDefaultForType + + + + + + CFBundleTypeExtensions + + mp3 + + CFBundleTypeMIMETypes + + audio/mpeg + + CFBundleTypeName + MP3 Audio + CFBundleTypeRole + Viewer + LSIsAppleDefaultForType + + LSHandlerRank + Alternate + + + CFBundleTypeExtensions + + ogg + oga + + CFBundleTypeMIMETypes + + audio/ogg + + CFBundleTypeName + Ogg Vorbis Audio + CFBundleTypeRole + Viewer + LSIsAppleDefaultForType + + LSHandlerRank + Alternate + + + CFBundleTypeExtensions + + wav + + CFBundleTypeMIMETypes + + audio/x-wav + + CFBundleTypeName + Wave Audio + CFBundleTypeRole + Viewer + LSIsAppleDefaultForType + + LSHandlerRank + Alternate + + + CFBundleTypeExtensions + + aif + aiff + + CFBundleTypeMIMETypes + + audio/x-aiff + + CFBundleTypeName + AIFF Audio + CFBundleTypeRole + Viewer + LSIsAppleDefaultForType + + LSHandlerRank + Alternate + + + CFBundleTypeExtensions + + flac + + CFBundleTypeMIMETypes + + audio/flac + + CFBundleTypeName + FLAC Audio + CFBundleTypeRole + Viewer + LSIsAppleDefaultForType + + LSHandlerRank + Alternate + + + + diff -r 9d1dd846238b -r 27446c7f3935 deploy/osx/deploy.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy/osx/deploy.sh Fri Apr 08 14:33:27 2011 +0100 @@ -0,0 +1,51 @@ +#!/bin/bash + +# Execute this from the top-level directory of the project (the one +# that contains the .app bundle). Supply the name of the .app bundle +# as argument (the target will use $app.app regardless, but we need +# to know the source) + +source="$1" +dmg="$2" +if [ -z "$source" ] || [ ! -d "$source" ] || [ -z "$dmg" ]; then + echo "Usage: $0 " + exit 2 +fi +app=`basename "$source" .app` + +version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h` +case "$version" in + [0-9].[0-9]) bundleVersion="$version".0 ;; + [0-9].[0-9].[0-9]) bundleVersion="$version" ;; + *) echo "Error: Version $version is neither two- nor three-part number" ;; +esac + +echo +echo "Making target tree." + +volume="$app"-"$version" +target="$volume"/"$app".app +dmg="$dmg"-"$version".dmg + +mkdir "$volume" || exit 1 + +ln -s /Applications "$volume"/Applications +cp -rp "$source" "$target" + +echo "Done" + +echo "Writing version $bundleVersion in to bundle." +echo "(This should be a three-part number: major.minor.point)" + +perl -p -e "s/SV_VERSION/$bundleVersion/" deploy/osx/Info.plist \ + > "$target"/Contents/Info.plist + +echo "Done: check $target/Contents/Info.plist for sanity please" + +echo +echo "Making dmg..." + +hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" && + rm -r "$volume" + +echo "Done" diff -r 9d1dd846238b -r 27446c7f3935 deploy/osx/paths.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy/osx/paths.sh Fri Apr 08 14:33:27 2011 +0100 @@ -0,0 +1,36 @@ +#!/bin/bash + +app="$1" +if [ -z "$app" ]; then + echo "Usage: $0 " + echo "Provide appname without the .app extension, please" + exit 2 +fi + +echo +echo "I expect you to have already copied QtCore, QtNetwork, QtGui and QtXml to " +echo "$app.app/Contents/Frameworks -- expect errors to follow if they're missing" +echo + +echo "Fixing up loader paths in binaries..." + +install_name_tool -id QtCore "$app.app/Contents/Frameworks/QtCore" +install_name_tool -id QtGui "$app.app/Contents/Frameworks/QtGui" +install_name_tool -id QtNetwork "$app.app/Contents/Frameworks/QtNetwork" +install_name_tool -id QtXml "$app.app/Contents/Frameworks/QtXml" + +for fwk in QtCore QtGui QtNetwork QtXml; do + find "$app.app" -type f -print | while read x; do + current=$(otool -L "$x" | grep "$fwk" | grep ramework | awk '{ print $1; }') + [ -z "$current" ] && continue + echo "$x has $current" + relative=$(echo "$x" | sed -e "s,$app.app/Contents/,," \ + -e 's,[^/]*/,../,g' -e 's,/[^/]*$,/Frameworks/'"$fwk"',' ) + echo "replacing with relative path $relative" + install_name_tool -change "$current" "@loader_path/$relative" "$x" + done +done + +echo "Done: be sure to run the app and see that it works!" + +