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
|
cannam@567
|
35 echo "Copying in plugins from libpyin.dylib and libchp.dylib."
|
Chris@66
|
36
|
Chris@558
|
37 cp libpyin.dylib "$source/Contents/Resources/pyin.dylib"
|
Chris@558
|
38 cp libchp.dylib "$source/Contents/Resources/chp.dylib"
|
Chris@437
|
39
|
Chris@437
|
40 echo
|
Chris@437
|
41 echo "Copying in frameworks and plugins from Qt installation directory."
|
Chris@437
|
42
|
Chris@437
|
43 deploy/osx/copy-qt.sh "$app" || exit 2
|
Chris@66
|
44
|
Chris@62
|
45 echo
|
Chris@62
|
46 echo "Fixing up paths."
|
Chris@62
|
47
|
Chris@62
|
48 deploy/osx/paths.sh "$app"
|
Chris@62
|
49
|
Chris@62
|
50 echo
|
Chris@503
|
51 echo "Copying in qt.conf to set local-only plugin paths."
|
Chris@503
|
52 echo "Make sure all necessary Qt plugins are in $source/Contents/plugins/*"
|
Chris@503
|
53 echo "You probably want platforms/, accessible/ and imageformats/ subdirectories."
|
Chris@503
|
54 cp deploy/osx/qt.conf "$source"/Contents/Resources/qt.conf
|
Chris@503
|
55
|
Chris@503
|
56 echo
|
Chris@503
|
57 echo "Writing version $bundleVersion in to bundle."
|
Chris@503
|
58 echo "(This should be a three-part number: major.minor.point)"
|
Chris@503
|
59
|
Chris@503
|
60 perl -p -e "s/TONY_VERSION/$bundleVersion/" deploy/osx/Info.plist \
|
Chris@503
|
61 > "$source"/Contents/Info.plist
|
Chris@503
|
62
|
Chris@503
|
63 echo "Done: check $source/Contents/Info.plist for sanity please"
|