Chris@62
|
1 #!/bin/bash
|
Chris@62
|
2
|
Chris@439
|
3 set -e
|
Chris@437
|
4
|
Chris@62
|
5 # Execute this from the top-level directory of the project (the one
|
Chris@619
|
6 # that contains the .app bundle). Supply the name of the application
|
Chris@619
|
7 # as argument.
|
Chris@619
|
8 #
|
Chris@619
|
9 # This now performs *only* the app deployment step - copying in
|
Chris@619
|
10 # libraries and setting up paths etc. It does not create a
|
Chris@619
|
11 # package. Use deploy-and-package.sh for that.
|
Chris@62
|
12
|
Chris@619
|
13 app="$1"
|
Chris@619
|
14 source="$app.app"
|
Chris@619
|
15
|
Chris@619
|
16 if [ -z "$app" ] || [ ! -d "$source" ] || [ -n "$2" ]; then
|
Chris@619
|
17 echo "Usage: $0 <app>"
|
Chris@619
|
18 echo " e.g. $0 MyApplication"
|
Chris@619
|
19 echo " The app bundle must exist in ./<app>.app."
|
Chris@619
|
20 echo " Version number will be extracted from version.h."
|
Chris@62
|
21 exit 2
|
Chris@62
|
22 fi
|
Chris@62
|
23
|
Chris@439
|
24 set -u
|
Chris@439
|
25
|
Chris@62
|
26 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h`
|
Chris@437
|
27 stem=${version%%-*}
|
Chris@437
|
28 case "$stem" in
|
Chris@437
|
29 [0-9].[0-9]) bundleVersion="$stem".0 ;;
|
Chris@437
|
30 [0-9].[0-9].[0-9]) bundleVersion="$stem" ;;
|
Chris@437
|
31 *) echo "Error: Version stem $stem (of version $version) is neither two- nor three-part number"; exit 1 ;;
|
Chris@62
|
32 esac
|
Chris@62
|
33
|
Chris@66
|
34 echo
|
Chris@624
|
35 echo "Copying in Vamp plugins."
|
Chris@66
|
36
|
Chris@624
|
37 for plugin in chp pyin ; do
|
Chris@624
|
38 cp "$plugin.dylib" "$source/Contents/Resources/"
|
Chris@624
|
39 done
|
Chris@437
|
40
|
Chris@437
|
41 echo
|
Chris@437
|
42 echo "Copying in frameworks and plugins from Qt installation directory."
|
Chris@437
|
43
|
Chris@437
|
44 deploy/osx/copy-qt.sh "$app" || exit 2
|
Chris@66
|
45
|
Chris@62
|
46 echo
|
Chris@62
|
47 echo "Fixing up paths."
|
Chris@62
|
48
|
Chris@62
|
49 deploy/osx/paths.sh "$app"
|
Chris@62
|
50
|
Chris@62
|
51 echo
|
Chris@503
|
52 echo "Copying in qt.conf to set local-only plugin paths."
|
Chris@503
|
53 echo "Make sure all necessary Qt plugins are in $source/Contents/plugins/*"
|
Chris@503
|
54 echo "You probably want platforms/, accessible/ and imageformats/ subdirectories."
|
Chris@503
|
55 cp deploy/osx/qt.conf "$source"/Contents/Resources/qt.conf
|
Chris@503
|
56
|
Chris@503
|
57 echo
|
Chris@503
|
58 echo "Writing version $bundleVersion in to bundle."
|
Chris@503
|
59 echo "(This should be a three-part number: major.minor.point)"
|
Chris@503
|
60
|
Chris@503
|
61 perl -p -e "s/TONY_VERSION/$bundleVersion/" deploy/osx/Info.plist \
|
Chris@503
|
62 > "$source"/Contents/Info.plist
|
Chris@503
|
63
|
Chris@503
|
64 echo "Done: check $source/Contents/Info.plist for sanity please"
|