Mercurial > hg > easyhg
comparison deploy/osx/deploy.sh @ 667:0f3e086066fc qt5
Start reworking deployment scripts
author | Chris Cannam |
---|---|
date | Fri, 27 May 2016 09:56:22 +0100 |
parents | 5ac4e821ee7b |
children | 8f3075eeaac2 |
comparison
equal
deleted
inserted
replaced
666:98a7fbbe9d88 | 667:0f3e086066fc |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 | |
3 set -e | |
2 | 4 |
3 # Execute this from the top-level directory of the project (the one | 5 # Execute this from the top-level directory of the project (the one |
4 # that contains the .app bundle). Supply the name of the .app bundle | 6 # that contains the .app bundle). Supply the name of the .app bundle |
5 # as argument (the target will use $app.app regardless, but we need | 7 # as argument (the target will use $app.app regardless, but we need |
6 # to know the source) | 8 # to know the source) |
11 echo "Usage: $0 <source.app> <target-dmg-basename>" | 13 echo "Usage: $0 <source.app> <target-dmg-basename>" |
12 exit 2 | 14 exit 2 |
13 fi | 15 fi |
14 app=EasyMercurial | 16 app=EasyMercurial |
15 | 17 |
18 set -u | |
19 | |
16 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' src/version.h` | 20 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' src/version.h` |
17 case "$version" in | 21 case "$version" in |
18 [0-9].[0-9]) bundleVersion="$version".0 ;; | 22 [0-9].[0-9]) bundleVersion="$version".0 ;; |
19 [0-9].[0-9].[0-9]) bundleVersion="$version" ;; | 23 [0-9].[0-9].[0-9]) bundleVersion="$version" ;; |
20 *) echo "Error: Version $version is neither two- nor three-part number" ;; | 24 *) echo "Error: Version $version is neither two- nor three-part number" ;; |
21 esac | 25 esac |
26 | |
27 echo | |
28 echo "Copying in frameworks and plugins from Qt installation directory." | |
29 | |
30 deploy/osx/copy-qt.sh "$app" || exit 2 | |
31 | |
32 echo | |
33 echo "Fixing up paths." | |
34 | |
35 deploy/osx/paths.sh "$app" | |
36 | |
37 echo | |
38 echo "Copying in qt.conf to set local-only plugin paths." | |
39 echo "Make sure all necessary Qt plugins are in $source/Contents/plugins/*" | |
40 echo "You probably want platforms/, accessible/ and imageformats/ subdirectories." | |
41 cp deploy/osx/qt.conf "$source"/Contents/Resources/qt.conf | |
42 | |
43 echo "Writing version $bundleVersion in to bundle." | |
44 echo "(This should be a three-part number: major.minor.point)" | |
45 | |
46 perl -p -e "s/EASYHG_VERSION/$bundleVersion/" deploy/osx/Info.plist \ | |
47 > "$source"/Contents/Info.plist | |
48 | |
49 echo "Done: check $source/Contents/Info.plist for sanity please" | |
22 | 50 |
23 echo | 51 echo |
24 echo "Making target tree." | 52 echo "Making target tree." |
25 | 53 |
26 volume="$app"-"$version" | 54 volume="$app"-"$version" |
29 | 57 |
30 mkdir "$volume" || exit 1 | 58 mkdir "$volume" || exit 1 |
31 | 59 |
32 ln -s /Applications "$volume"/Applications | 60 ln -s /Applications "$volume"/Applications |
33 cp COPYING "$volume/COPYING.txt" | 61 cp COPYING "$volume/COPYING.txt" |
34 cp -RPp "$source" "$target" | 62 cp -rp "$source" "$target" |
35 | 63 |
36 echo "Done" | 64 echo "Done" |
37 | 65 |
38 echo "Writing version $bundleVersion in to bundle." | 66 deploy/osx/sign.sh "$volume" || exit 1 |
39 echo "(This should be a three-part number: major.minor.point)" | |
40 | |
41 perl -p -e "s/EASYHG_VERSION/$bundleVersion/" deploy/osx/Info.plist \ | |
42 > "$target"/Contents/Info.plist | |
43 | |
44 echo "Done: check $target/Contents/Info.plist for sanity please" | |
45 | 67 |
46 echo | 68 echo |
47 echo "Making dmg..." | 69 echo "Making dmg..." |
48 | 70 |
49 hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" && | 71 hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" && |