-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakedist-mac.command
executable file
·239 lines (175 loc) · 6.69 KB
/
makedist-mac.command
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
#! /bin/sh
BASEDIR=$(dirname $0)
# AAX codesigning requires ashelper tool in /usr/local/bin and aax.key/.crt in ./../../../Certificates/
cd $BASEDIR
#---------------------------------------------------------------------------------------------------------
#variables
VERSION=`echo | grep PLUG_VER resource.h`
VERSION=${VERSION//\#define PLUG_VER }
VERSION=${VERSION//\'}
MAJOR_VERSION=$(($VERSION & 0xFFFF0000))
MAJOR_VERSION=$(($MAJOR_VERSION >> 16))
MINOR_VERSION=$(($VERSION & 0x0000FF00))
MINOR_VERSION=$(($MINOR_VERSION >> 8))
BUG_FIX=$(($VERSION & 0x000000FF))
FULL_VERSION=$MAJOR_VERSION"."$MINOR_VERSION"."$BUG_FIX
# work out the paths to the bundles
VST2=`echo | grep VST_FOLDER ../../common.xcconfig`
VST2=${VST2//\VST_FOLDER = }/Synthesis.vst
VST3=`echo | grep VST3_FOLDER ../../common.xcconfig`
VST3=${VST3//\VST3_FOLDER = }/Synthesis.vst3
AU=`echo | grep AU_FOLDER ../../common.xcconfig`
AU=${AU//\AU_FOLDER = }/Synthesis.component
APP=`echo | grep APP_FOLDER ../../common.xcconfig`
APP=${APP//\APP_FOLDER = }/Synthesis.app
# Dev build folder
RTAS=`echo | grep RTAS_FOLDER ../../common.xcconfig`
RTAS=${RTAS//\RTAS_FOLDER = }/Synthesis.dpm
RTAS_FINAL="/Library/Application Support/Digidesign/Plug-Ins/Synthesis.dpm"
# Dev build folder
AAX=`echo | grep AAX_FOLDER ../../common.xcconfig`
AAX=${AAX//\AAX_FOLDER = }/Synthesis.aaxplugin
AAX_FINAL="/Library/Application Support/Avid/Audio/Plug-Ins/Synthesis.aaxplugin"
PKG='installer/build-mac/Synthesis Installer.pkg'
PKG_US='installer/build-mac/Synthesis Installer.unsigned.pkg'
CERT_ID=`echo | grep CERTIFICATE_ID ../../common.xcconfig`
CERT_ID=${CERT_ID//\CERTIFICATE_ID = }
echo "making Synthesis version $FULL_VERSION mac distribution..."
echo ""
#---------------------------------------------------------------------------------------------------------
./update_version.py
#could use touch to force a rebuild
#touch blah.h
#---------------------------------------------------------------------------------------------------------
#remove existing dist folder
#if [ -d installer/dist ]
#then
# rm -R installer/dist
#fi
#mkdir installer/dist
#remove existing binaries
if [ -d $APP ]
then
sudo rm -f -R -f $APP
fi
if [ -d $AU ]
then
sudo rm -f -R $AU
fi
if [ -d $VST2 ]
then
sudo rm -f -R $VST2
fi
if [ -d $VST3 ]
then
sudo rm -f -R $VST3
fi
if [ -d "${RTAS}" ]
then
sudo rm -f -R "${RTAS}"
fi
if [ -d "${RTAS_FINAL}" ]
then
sudo rm -f -R "${RTAS_FINAL}"
fi
if [ -d "${AAX}" ]
then
sudo rm -f -R "${AAX}"
fi
if [ -d "${AAX_FINAL}" ]
then
sudo rm -f -R "${AAX_FINAL}"
fi
#---------------------------------------------------------------------------------------------------------
# build xcode project. Change target to build individual formats
xcodebuild -project Synthesis.xcodeproj -xcconfig Synthesis.xcconfig -target "All" -configuration Release 2> ./build-mac.log
#xcodebuild -project Synthesis-ios.xcodeproj -xcconfig Synthesis.xcconfig -target "IOSAPP" -configuration Release
if [ -s build-mac.log ]
then
echo "build failed due to following errors:"
echo ""
cat build-mac.log
exit 1
else
rm build-mac.log
fi
#---------------------------------------------------------------------------------------------------------
#icon stuff - http://maxao.free.fr/telechargements/setfileicon.gz
echo "setting icons"
echo ""
setfileicon resources/Synthesis.icns $AU
setfileicon resources/Synthesis.icns $VST2
setfileicon resources/Synthesis.icns $VST3
setfileicon resources/Synthesis.icns "${RTAS}"
setfileicon resources/Synthesis.icns "${AAX}"
#---------------------------------------------------------------------------------------------------------
#ProTools stuff
echo "copying RTAS bundle from 3PDev to main RTAS folder"
sudo cp -p -R "${RTAS}" "${RTAS_FINAL}"
echo "copying AAX bundle from 3PDev to main AAX folder"
sudo cp -p -R "${AAX}" "${AAX_FINAL}"
echo "code sign AAX binary"
sudo ashelper -f "${AAX_FINAL}/Contents/MacOS/Synthesis" -l ../../../Certificates/aax.crt -k ../../../Certificates/aax.key -o "${AAX_FINAL}/Contents/MacOS/Synthesis"
#---------------------------------------------------------------------------------------------------------
#appstore stuff
# echo "code signing app for appstore"
# echo ""
# codesign -f -s "3rd Party Mac Developer Application: ""${CERT_ID}" $APP --entitlements resources/Synthesis.entitlements
#
# echo "building pkg for app store"
# productbuild \
# --component $APP /Applications \
# --sign "3rd Party Mac Developer Installer: ""${CERT_ID}" \
# --product "/Applications/Synthesis.app/Contents/Info.plist" installer/Synthesis.pkg
#---------------------------------------------------------------------------------------------------------
#10.8 Gatekeeper/Developer ID stuff
#echo "code sign app for Gatekeeper on 10.8"
#echo ""
#codesign -f -s "Developer ID Application: ""${CERT_ID}" $APP
#---------------------------------------------------------------------------------------------------------
# installer, uses Packages http://s.sudre.free.fr/Software/Packages/about.html
sudo sudo rm -R -f installer/Synthesis-mac.dmg
echo "building installer"
echo ""
packagesbuild installer/Synthesis.pkgproj
#echo "code sign installer for Gatekeeper on 10.8"
#echo ""
#mv "${PKG}" "${PKG_US}"
#productsign --sign "Developer ID Installer: ""${CERT_ID}" "${PKG_US}" "${PKG}"
#rm -R -f "${PKG_US}"
#set installer icon
setfileicon resources/Synthesis.icns "${PKG}"
#---------------------------------------------------------------------------------------------------------
# dmg, can use dmgcanvas http://www.araelium.com/dmgcanvas/ to make a nice dmg
echo "building dmg"
echo ""
if [ -d installer/Synthesis.dmgCanvas ]
then
dmgcanvas installer/Synthesis.dmgCanvas installer/Synthesis-mac.dmg
else
hdiutil create installer/Synthesis.dmg -srcfolder installer/build-mac/ -ov -anyowners -volname Synthesis
if [ -f installer/Synthesis-mac.dmg ]
then
rm -f installer/Synthesis-mac.dmg
fi
hdiutil convert installer/Synthesis.dmg -format UDZO -o installer/Synthesis-mac.dmg
sudo rm -R -f installer/Synthesis.dmg
fi
sudo rm -R -f installer/build-mac/
#---------------------------------------------------------------------------------------------------------
# zip
# echo "copying binaries..."
# echo ""
# cp -R $AU installer/dist/Synthesis.component
# cp -R $VST2 installer/dist/Synthesis.vst
# cp -R $VST3 installer/dist/Synthesis.vst3
# cp -R $RTAS installer/dist/Synthesis.dpm
# cp -R $AAX installer/dist/Synthesis.aaxplugin
# cp -R $APP installer/dist/Synthesis.app
#
# echo "zipping binaries..."
# echo ""
# ditto -c -k installer/dist installer/Synthesis-mac.zip
# rm -R installer/dist
#---------------------------------------------------------------------------------------------------------
echo "done"