annotate deploy/osx/deploy.sh @ 1055:40ff7c801fc2 3.0-integration

Check for audioIO as well as play target; + deployment bits
author Chris Cannam
date Thu, 20 Aug 2015 16:41:51 +0100
parents d18c89386a71
children b2c45b831ea8
rev   line source
Chris@409 1 #!/bin/bash
Chris@409 2
Chris@1055 3 set -e
Chris@1055 4
Chris@409 5 # Execute this from the top-level directory of the project (the one
Chris@409 6 # that contains the .app bundle). Supply the name of the .app bundle
Chris@409 7 # as argument (the target will use $app.app regardless, but we need
Chris@409 8 # to know the source)
Chris@409 9
Chris@409 10 source="$1"
Chris@409 11 dmg="$2"
Chris@409 12 if [ -z "$source" ] || [ ! -d "$source" ] || [ -z "$dmg" ]; then
Chris@409 13 echo "Usage: $0 <source.app> <target-dmg-basename>"
Chris@463 14 echo " e.g. $0 MyApplication.app MyApplication"
Chris@463 15 echo " Version number and .dmg will be appended automatically,"
Chris@463 16 echo " but the .app name must include .app"
Chris@409 17 exit 2
Chris@409 18 fi
Chris@409 19 app=`basename "$source" .app`
Chris@409 20
Chris@1055 21 set -u
Chris@1055 22
Chris@409 23 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h`
Chris@1055 24 stem=${version%%-*}
Chris@1055 25 case "$stem" in
Chris@409 26 [0-9].[0-9]) bundleVersion="$version".0 ;;
Chris@409 27 [0-9].[0-9].[0-9]) bundleVersion="$version" ;;
Chris@1055 28 *) echo "Error: Version stem $stem (of version $version) is neither two- nor three-part number" ;;
Chris@409 29 esac
Chris@409 30
Chris@409 31 echo
Chris@745 32 echo "Copying in frameworks and plugins from Qt installation directory."
Chris@745 33
Chris@745 34 deploy/osx/copy-qt.sh "$app" || exit 2
Chris@745 35
Chris@745 36 echo
Chris@514 37 echo "Fixing up paths."
Chris@514 38
Chris@514 39 deploy/osx/paths.sh "$app"
Chris@514 40
Chris@514 41 echo
Chris@409 42 echo "Making target tree."
Chris@409 43
Chris@409 44 volume="$app"-"$version"
Chris@409 45 target="$volume"/"$app".app
Chris@409 46 dmg="$dmg"-"$version".dmg
Chris@409 47
Chris@409 48 mkdir "$volume" || exit 1
Chris@409 49
Chris@409 50 ln -s /Applications "$volume"/Applications
Chris@412 51 cp README README.OSC COPYING CHANGELOG "$volume/"
Chris@409 52 cp -rp "$source" "$target"
Chris@409 53
Chris@409 54 echo "Done"
Chris@409 55
Chris@742 56 echo
Chris@742 57 echo "Copying in qt.conf to set local-only plugin paths."
Chris@742 58 echo "Make sure all necessary Qt plugins are in $target/Contents/plugins/*"
Chris@742 59 echo "You probably want platforms/, accessible/ and imageformats/ subdirectories."
Chris@742 60 cp deploy/osx/qt.conf "$target"/Contents/Resources/qt.conf
Chris@742 61
Chris@742 62 echo
Chris@409 63 echo "Writing version $bundleVersion in to bundle."
Chris@409 64 echo "(This should be a three-part number: major.minor.point)"
Chris@409 65
Chris@409 66 perl -p -e "s/SV_VERSION/$bundleVersion/" deploy/osx/Info.plist \
Chris@409 67 > "$target"/Contents/Info.plist
Chris@409 68
Chris@409 69 echo "Done: check $target/Contents/Info.plist for sanity please"
Chris@409 70
Chris@510 71 deploy/osx/sign.sh "$volume" || exit 1
Chris@510 72
Chris@409 73 echo
Chris@409 74 echo "Making dmg..."
Chris@409 75
Chris@409 76 hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" &&
Chris@409 77 rm -r "$volume"
Chris@409 78
Chris@409 79 echo "Done"