comparison deploy/osx/deploy.sh @ 699:646e48a0d3a5

Some work on macOS packaging
author Chris Cannam
date Tue, 11 Dec 2018 16:40:57 +0000
parents 8121a6f9abca
children 5afb26b7575a
comparison
equal deleted inserted replaced
698:52b8a499f379 699:646e48a0d3a5
14 echo " e.g. $0 MyApplication.app MyApplication" 14 echo " e.g. $0 MyApplication.app MyApplication"
15 echo " Version number and .dmg will be appended automatically," 15 echo " Version number and .dmg will be appended automatically,"
16 echo " but the .app name must include .app" 16 echo " but the .app name must include .app"
17 exit 2 17 exit 2
18 fi 18 fi
19 app=EasyMercurial 19 app=`basename "$source" .app`
20 20
21 set -u 21 set -u
22 22
23 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' src/version.h` 23 version=`perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' src/version.h`
24 case "$version" in 24 stem=${version%%-*}
25 [0-9].[0-9]) bundleVersion="$version".0 ;; 25 stem=${stem%%pre*}
26 [0-9].[0-9].[0-9]) bundleVersion="$version" ;; 26 case "$stem" in
27 *) echo "Error: Version $version is neither two- nor three-part number" ;; 27 [0-9].[0-9]) bundleVersion="$stem".0 ;;
28 [0-9].[0-9].[0-9]) bundleVersion="$stem" ;;
29 *) echo "Error: Version stem $stem (of version $version) is neither two- nor three-part number" ;;
28 esac 30 esac
29 31
30 echo 32 echo
31 echo "Copying in frameworks and plugins from Qt installation directory." 33 echo "Copying in frameworks and plugins from Qt installation directory."
32 34
68 70
69 ln -s /Applications "$volume"/Applications 71 ln -s /Applications "$volume"/Applications
70 cp COPYING "$volume/COPYING.txt" 72 cp COPYING "$volume/COPYING.txt"
71 cp -rp "$source" "$target" 73 cp -rp "$source" "$target"
72 74
75 # update file timestamps so as to make the build date apparent
76 find "$volume" -exec touch \{\} \;
77
73 echo "Done" 78 echo "Done"
74 79
80 echo
81 echo "Code-signing volume..."
82
75 deploy/osx/sign.sh "$volume" || exit 1 83 deploy/osx/sign.sh "$volume" || exit 1
84
85 echo "Done"
76 86
77 echo 87 echo
78 echo "Making dmg..." 88 echo "Making dmg..."
79 89
80 hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" && 90 hdiutil create -srcfolder "$volume" "$dmg" -volname "$volume" -fs HFS+ &&
81 rm -r "$volume" 91 rm -r "$volume"
82 92
93 echo
94 echo "Signing dmg..."
95
96 codesign -s "Developer ID Application: Chris Cannam" -fv "$dmg"
97
83 echo "Done" 98 echo "Done"