changeset 409:27446c7f3935

Some deployment gubbins (to be refined)
author Chris Cannam
date Fri, 08 Apr 2011 14:33:27 +0100
parents 9d1dd846238b
children 663bfebdef4e
files deploy/osx/Info.plist deploy/osx/Info.plist.2 deploy/osx/deploy.sh deploy/osx/paths.sh
diffstat 4 files changed, 246 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleName</key>
+	<string>SonicVisualiser</string>
+	<key>CFBundleExecutable</key>
+	<string>Sonic Visualiser</string>
+	<key>CFBundleIconFile</key>
+	<string>sv-macicon.icns</string>
+	<key>CFBundleIdentifier</key>
+	<string>org.sonicvisualiser.SonicVisualiser</string>
+	<key>CFBundleShortVersionString</key>
+	<string>SV_VERSION</string>
+</dict>
+</plist>
--- /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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+	<key>CFBundleIconFile</key>
+	<string>sv-macicon.icns</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+    <key>CFBundleGetInfoString</key>
+	<string>Created by Qt/QMake</string>
+	<key>CFBundleSignature</key>
+	<string>SNCV</string>
+	<key>CFBundleExecutable</key>
+	<string>Sonic Visualiser</string>
+	<key>CFBundleIdentifier</key>
+	<string>org.isophonics.SonicVisualiser</string>
+	<key>CFBundleDocumentTypes</key>
+	<array>
+		<!-- we are an 'editor' of SV files -->
+		<dict>
+			<key>CFBundleTypeExtensions</key>
+			<array>
+				<string>sv</string>
+			</array>
+			<!-- TODO
+			<key>CFBundleTypeIconFile</key>
+			<string>SVProject.icns</string> -->
+			<key>CFBundleTypeMIMETypes</key>
+			<array>
+				<string>application/x-sonic-visualiser-project</string>
+			</array>
+			<key>CFBundleTypeName</key>
+			<string>Sonic Visualiser Project</string>
+			<key>CFBundleTypeOSTypes</key>
+			<array>
+				<string>****</string>
+			</array>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>LSHandlerRank</key>
+			<string>Owner</string>
+			<key>LSIsAppleDefaultForType</key>
+			<true/>
+		</dict>
+		
+		<!-- we are a 'viewer' of general audio files -->
+		<dict>
+			<key>CFBundleTypeExtensions</key>
+			<array>
+				<string>mp3</string>
+			</array>
+			<key>CFBundleTypeMIMETypes</key>
+			<array>
+				<string>audio/mpeg</string>
+			</array>
+			<key>CFBundleTypeName</key>
+			<string>MP3 Audio</string>
+			<key>CFBundleTypeRole</key>
+			<string>Viewer</string>
+			<key>LSIsAppleDefaultForType</key>
+			<false/>
+			<key>LSHandlerRank</key>
+			<string>Alternate</string>
+		</dict>
+		<dict>
+			<key>CFBundleTypeExtensions</key>
+			<array>
+				<string>ogg</string>
+				<string>oga</string>
+			</array>
+			<key>CFBundleTypeMIMETypes</key>
+			<array>
+				<string>audio/ogg</string>
+			</array>
+			<key>CFBundleTypeName</key>
+			<string>Ogg Vorbis Audio</string>
+			<key>CFBundleTypeRole</key>
+			<string>Viewer</string>
+			<key>LSIsAppleDefaultForType</key>
+			<false/>
+			<key>LSHandlerRank</key>
+			<string>Alternate</string>
+		</dict>
+		<dict>
+			<key>CFBundleTypeExtensions</key>
+			<array>
+				<string>wav</string>
+			</array>
+			<key>CFBundleTypeMIMETypes</key>
+			<array>
+				<string>audio/x-wav</string>
+			</array>
+			<key>CFBundleTypeName</key>
+			<string>Wave Audio</string>
+			<key>CFBundleTypeRole</key>
+			<string>Viewer</string>
+			<key>LSIsAppleDefaultForType</key>
+			<false/>
+			<key>LSHandlerRank</key>
+			<string>Alternate</string>
+		</dict>
+		<dict>
+			<key>CFBundleTypeExtensions</key>
+			<array>
+				<string>aif</string>
+				<string>aiff</string>
+			</array>
+			<key>CFBundleTypeMIMETypes</key>
+			<array>
+				<string>audio/x-aiff</string>
+			</array>
+			<key>CFBundleTypeName</key>
+			<string>AIFF Audio</string>
+			<key>CFBundleTypeRole</key>
+			<string>Viewer</string>
+			<key>LSIsAppleDefaultForType</key>
+			<false/>
+			<key>LSHandlerRank</key>
+			<string>Alternate</string>
+		</dict>
+		<dict>
+			<key>CFBundleTypeExtensions</key>
+			<array>
+				<string>flac</string>
+			</array>
+			<key>CFBundleTypeMIMETypes</key>
+			<array>
+				<string>audio/flac</string>
+			</array>
+			<key>CFBundleTypeName</key>
+			<string>FLAC Audio</string>
+			<key>CFBundleTypeRole</key>
+			<string>Viewer</string>
+			<key>LSIsAppleDefaultForType</key>
+			<false/>
+			<key>LSHandlerRank</key>
+			<string>Alternate</string>
+		</dict>
+	</array>
+  </dict>
+</plist>
--- /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 <source.app> <target-dmg-basename>"
+	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"
--- /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 <appname>"
+	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!"
+
+