blob: 1e0a22e3ea09140d6c583f57827de8e8437d3433 (
plain) (
blame)
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
|
#!/bin/sh
# Shave and a Haircut
# (c) 2019 Epic Games
# US Patent 6720962
process() {
sed -e "s/%%shaveVersion%%/${shaveVersion}/g" \
-e "s/%%shaveMinor%%/${shaveMinor}/g" \
-e "s/%%shaveMajor%%/${shaveMajor}/g" \
-e "s/%%shaveRelease%%/${release}/g" \
-e "s/%%mayaMinor%%/${mayaMinor}/g" \
-e "s/%%mayaMajor%%/${mayaMajor}/g" \
-e "s/%%mayaVersion%%/${mayaVersion}/g" \
-e "s?%%rayrcLocation%%?${rayrcLocation}?g" \
-e "s?%%mayaShared%%?${mayaShared}?g" \
-e "s?%%mayaLocation%%?${mayaLocation}?g" \
-e "s?%%mtoaLocation%%?${mtoaLocation}?g" \
-e "s?%%vendorDir%%?${vendorDir}?g" \
$1 > $2
}
source getosxvars.sh
# The web-site and upload scripts are all expecting the package to end in
# .pkg.zip not .mpkg.zip so let's oblige them.
zipfile=`echo "${pkgName}.zip" | sed 's/\.mpkg\./.pkg./'`
if [ -d osxpkg ]; then
rm -rf osxpkg
fi
if [ -d $pkgName ]; then
rm -rf $pkgName
fi
if [ -e $zipfile ]; then
rm -rf $zipfile
fi
vendorDir="/Users/Shared/Epic Games/shaveHaircut/maya${mayaVersion}"
binType=x86_64
#
# Create directories for the main package.
#
mkdir -p "${pkgName}/Contents/Packages"
mkdir -p "${pkgName}/Contents/Resources"
echo "---------------------------------------------"
echo ${mayaVersion}
#-------------------------------------------
#
# Files which go into Maya's directories.
#
#-------------------------------------------
# Define variables for all the directories we need, so that we only need to change
# them in one place.
#
MacOSDir="osxpkg/mayaFiles/component/Maya.app/Contents/MacOS"
shavePresetsDir="osxpkg/mayaFiles/component/Maya.app/Contents/presets/attrPresets/shaveHair"
cgBinDir="osxpkg/mayaFiles/component/Maya.app/Contents/bin/Cg"
vrayPluginsDir="osxpkg/mayaFiles/component/vray/vrayplugins"
mayaIncludeDir="osxpkg/mayaFiles/component/include/maya"
#
# Create the directories
#
mkdir -p ${MacOSDir}
mkdir -p ${shavePresetsDir}
mkdir -p ${mayaIncludeDir}
mkdir -p ${vrayPluginsDir}
mkdir -p ${cgBinDir}
# Copy the files.
#
cp mayaPlug/libShave.dylib ${MacOSDir}/libShave.dylib
cp mayaPlug/libShaveAPI.dylib ${MacOSDir}/libShaveAPI.dylib
cp presets/*.xpm presets/*.png presets/*.mel ${shavePresetsDir}
# Maya viewport 2.0 shaders
#
cp CgFx/shaveHair.cgfx ${cgBinDir}/shaveHair.cgfx
# V-Ray shaders
#
osTag=`vrayPlug/getMayaConfig.sh ${mayaVersion} osTag`
supportedVersions=`vrayPlug/getMayaConfig.sh ${mayaVersion} versionTags`
for vrayVersion in ${supportedVersions}; do
cp vrayPlug/bin/${osTag}/libvray_Shave${vrayVersion}.so ${vrayPluginsDir}
done
# Shave API headers
#
cp mayaPlug/shaveAPI.h mayaPlug/shaveItHair.h ${mayaIncludeDir}
# Make sure everything's world readable.
#
chmod -R o+r osxpkg/mayaFiles
#
# Set up the Packager configuration files.
#
mkdir -p "osxpkg/mayaFiles/other"
mkdir -p "osxpkg/mayaFiles/Resources"
process install/osx/Info.plist-mayaFiles osxpkg/mayaFiles/other/Info.plist
process install/osx/Description.plist-mayaFiles osxpkg/mayaFiles/other/Description.plist
#
# Create the component package.
#
${pmaker} -build -p ${PWD}/${pkgName}/Contents/Packages/shave_Maya${mayaVersion}-mayaFiles.pkg -f ${PWD}/osxpkg/mayaFiles/component -i ${PWD}/osxpkg/mayaFiles/other/Info.plist -d ${PWD}/osxpkg/mayaFiles/other/Description.plist -r ${PWD}/osxpkg/mayaFiles/Resources
#-------------------------------------------
#
# Files which go into Maya's shared directories
#
#-------------------------------------------
#
# Create the directories
#
mkdir -p "osxpkg/pluginFiles/component/icons"
mkdir -p "osxpkg/pluginFiles/component/scripts"
mkdir -p "osxpkg/pluginFiles/component/plug-ins/prman/shaders/src"
mkdir -p "osxpkg/pluginFiles/component/plug-ins/vray"
for rmsDir in prman/plugins/RMS*; do
mkdir -p "osxpkg/pluginFiles/component/plug-ins/prman/`basename ${rmsDir}`"
done
#
# Copy the files.
#
cp mayaPlug/shaveNode.bundle "osxpkg/pluginFiles/component/plug-ins/shaveNode.bundle"
cp mayaPlug/libShaveVray*Exporter.so "osxpkg/pluginFiles/component/plug-ins/vray"
cp libexe/Shave.slo "osxpkg/pluginFiles/component/plug-ins/prman/shaders/Shave.slo"
cp libexe/Shave.sl "osxpkg/pluginFiles/component/plug-ins/prman/shaders/src/Shave.sl"
for rmsDir in prman/plugins/RMS*; do
cp ${rmsDir}/maya${mayaVersion}/osx/*.so "osxpkg/pluginFiles/component/plug-ins/prman/`basename ${rmsDir}`"
done
cp scripts/*.mel "osxpkg/pluginFiles/component/scripts"
cp libexe/icons/maya/selection/*.xpm "osxpkg/pluginFiles/component/icons"
cp libexe/icons/maya/selectUtils/*.xpm "osxpkg/pluginFiles/component/icons"
cp libexe/icons/maya/tools/*.xpm "osxpkg/pluginFiles/component/icons"
cp libexe/icons/maya/transforms/*.xpm "osxpkg/pluginFiles/component/icons"
cp libexe/icons/maya/utils/*.xpm "osxpkg/pluginFiles/component/icons"
cp mayaPlug/icons/*.xpm "osxpkg/pluginFiles/component/icons"
cp libexe/icons/maya/selection/*.png "osxpkg/pluginFiles/component/icons"
cp libexe/icons/maya/selectUtils/*.png "osxpkg/pluginFiles/component/icons"
cp libexe/icons/maya/tools/*.png "osxpkg/pluginFiles/component/icons"
cp libexe/icons/maya/transforms/*.png "osxpkg/pluginFiles/component/icons"
cp libexe/icons/maya/utils/*.png "osxpkg/pluginFiles/component/icons"
cp mayaPlug/icons/*.png "osxpkg/pluginFiles/component/icons"
#
# Make sure everything's world readable since cvs will have removed that.
#
chmod -R o+r osxpkg/pluginFiles
#
# Set up the Packager configuration files.
#
mkdir -p "osxpkg/pluginFiles/other"
mkdir -p "osxpkg/pluginFiles/Resources"
process install/osx/Info.plist-pluginFiles osxpkg/pluginFiles/other/Info.plist
process install/osx/Description.plist-pluginFiles osxpkg/pluginFiles/other/Description.plist
process install/osx/postflight-pluginFiles osxpkg/pluginFiles/Resources/postflight
chmod +x osxpkg/pluginFiles/Resources/postflight
#
# Create the component package.
#
${pmaker} -build -p ${PWD}/${pkgName}/Contents/Packages/shave_Maya${mayaVersion}-pluginFiles.pkg -f ${PWD}/osxpkg/pluginFiles/component -i ${PWD}/osxpkg/pluginFiles/other/Info.plist -d ${PWD}/osxpkg/pluginFiles/other/Description.plist -r ${PWD}/osxpkg/pluginFiles/Resources
#-------------------------------------------
#
# Files which go into the MtoA directories
#
#-------------------------------------------
# MtoA uses a compact form of the Maya version which drops the period and
# also drops the minor number if it is zero.
#
if [ "${mayaMinor}" = "0" ]; then
mtoaLocation="/Applications/solidangle/mtoa/${mayaMajor}"
else
mtoaLocation="/Applications/solidangle/mtoa/${mayaMajor}${mayaMinor}"
fi
mtoaExtensionsDir="osxpkg/mtoaFiles/component/extensions"
mtoaShadersDir="osxpkg/mtoaFiles/component/shaders"
# Create the directories
#
mkdir -p ${mtoaExtensionsDir}
mkdir -p ${mtoaShadersDir}
# Copy the files.
#
grep "^${mayaVersion}:" arnold/supportedMtoAVersions.txt | while read mayaVer minVer maxVer buildVer garbage; do
mtoaBuild=${buildVer/\/*/}
arnoldBuild=${buildVer/*\//}
safeMtoABuild=${mtoaBuild//./_}
safeArnoldBuild=${arnoldBuild//./_}
cp arnold/Release/${mayaVersion}/${mtoaBuild}/shave.dylib ${mtoaExtensionsDir}/shave-${safeMtoABuild}.dylib
cp arnold/plugin/shave.py ${mtoaExtensionsDir}/shave-${safeMtoABuild}.py
cp arnold/Release/${mayaVersion}/${mtoaBuild}/shave_shaders-${safeArnoldBuild}.dylib ${mtoaShadersDir}
done
# Make sure everything's world readable.
#
chmod -R o+r osxpkg/mtoaFiles
# Set up the Packager configuration files.
#
mkdir -p "osxpkg/mtoaFiles/other"
mkdir -p "osxpkg/mtoaFiles/Resources"
process install/osx/Info.plist-mtoaFiles osxpkg/mtoaFiles/other/Info.plist
process install/osx/Description.plist-mtoaFiles osxpkg/mtoaFiles/other/Description.plist
# Create the component package.
#
${pmaker} -build -p ${PWD}/${pkgName}/Contents/Packages/shave_Maya${mayaVersion}-mtoaFiles.pkg -f ${PWD}/osxpkg/mtoaFiles/component -i ${PWD}/osxpkg/mtoaFiles/other/Info.plist -d ${PWD}/osxpkg/mtoaFiles/other/Description.plist -r ${PWD}/osxpkg/mtoaFiles/Resources
#-------------------------------------------
#
# Files which go into the vendor directories
#
#-------------------------------------------
#
# Create the directories
#
mkdir -p "osxpkg/sampleFiles/component/samples"
#
# Copy the files.
#
cp install/docs/Install.html "osxpkg/sampleFiles/component"
cp arnold/supportedMtoAVersions.txt "osxpkg/sampleFiles/component"
cp prman/supportedRManVersions.txt "osxpkg/sampleFiles/component"
cp vrayPlug/supportedVrayVersions.txt "osxpkg/sampleFiles/component"
cp libexe/shaveEngine.h "osxpkg/sampleFiles/component/samples"
cp libexe/libShaveEngine-${binType}.dylib "osxpkg/sampleFiles/component/samples/libShaveEngine.dylib"
cp libexe/shaveSDKTYPES.h "osxpkg/sampleFiles/component/samples"
cp mayaPlug/shaveAPITestApp.cpp "osxpkg/sampleFiles/component/samples"
cp mayaPlug/shaveAPITestCmd.cpp "osxpkg/sampleFiles/component/samples"
cp mayaPlug/README-samples.osx "osxpkg/sampleFiles/component/samples/README"
#
# Make sure everything is world readable since cvs will have removed that.
#
chmod -R o+r osxpkg/sampleFiles
#
# Set up the Packager configuration files.
#
mkdir -p "osxpkg/sampleFiles/other"
mkdir -p "osxpkg/sampleFiles/Resources"
process install/osx/Info.plist-sampleFiles osxpkg/sampleFiles/other/Info.plist
process install/osx/Description.plist-sampleFiles osxpkg/sampleFiles/other/Description.plist
process install/osx/postflight-sampleFiles osxpkg/sampleFiles/Resources/postflight
chmod +x osxpkg/sampleFiles/Resources/postflight
#
# Create the component package.
#
${pmaker} -build -p ${PWD}/${pkgName}/Contents/Packages/shave_Maya${mayaVersion}-sampleFiles.pkg -f ${PWD}/osxpkg/sampleFiles/component -i ${PWD}/osxpkg/sampleFiles/other/Info.plist -d ${PWD}/osxpkg/sampleFiles/other/Description.plist -r ${PWD}/osxpkg/sampleFiles/Resources
#
# Add the distribution file to the main package.
#
distFile="distribution${mayaMajor}.dist"
if [ -r install/osx/${distFile} ]; then
process install/osx/${distFile} ${pkgName}/Contents/${distFile}
else
echo "Could not find distribution file install/osx/${distFile}"
exit 1
fi
#
# Create a zip file of the main package for uploading.
#
mkdir -p Installers
/usr/bin/zip -ry Installers/${zipfile} ${pkgName}
#
# Clean up.
#
rm -rf osxpkg
|