This repository has been archived by the owner on Jul 16, 2023. It is now read-only.
forked from NHERI-SimCenter/HydroUQ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makeDMG.sh
executable file
·138 lines (110 loc) · 3.89 KB
/
makeDMG.sh
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
# remove & rebuild app and macdeploy it
appName="Hydro-UQ"
appFile="Hydro_UQ.app"
dmgFile="Hydro-UQ_Mac_Download.dmg"
QTDIR="/Users/fmckenna/Qt/5.15.2/clang_64/"
pathToBackendApps="/Users/fmckenna/release/SimCenterBackendApplications"
pathToOpenSees="/Users/fmckenna/bin/OpenSees3.2.2"
pathToDakota="/Users/fmckenna/dakota-6.12.0"
#pathToPython="/Users/fmckenna/PythonEnvR2D"
#
# source userID file containig stuff dor signing, ok if not there
#
source userID.sh
#
# build it
#
./makeEXE.sh
cd build
rm $dmgFile
#
# Check to see if the app built
#
if ! [ -x "$(command -v open $pathApp)" ]; then
echo "$appFile did not build. Exiting."
exit
fi
#
# macdeployqt it
#
macdeployqt ./Hydro_UQ.app
#
# add missing files from macdeployqt (a known bug)
#
mkdir -p ./$appFile/Contents/plugins/renderers/
cp -R $QTDIR/plugins/renderers/libopenglrenderer.dylib ./$appFile/Contents/plugins/renderers/
echo "cp -R $QTDIR/plugins/renderplugins/libscene2d.dylib ./$appFile/Contents/plugins/renderplugins/"
mkdir -p ./$appFile/Contents/plugins/renderplugins/
cp -R $QTDIR/plugins/renderplugins/libscene2d.dylib ./$appFile/Contents/plugins/renderplugins/
# copy applications folderm opensees and dakota
echo "cp -fR $pathToBackendApps/applications ./$appFile/Contents/MacOS"
cp -fR $pathToBackendApps/applications ./$appFile/Contents/MacOS
mkdir ./$appFile/Contents/MacOS/applications/opensees
mkdir ./$appFile/Contents/MacOS/applications/dakota
echo "cp -fr $pathToOpenSees/* $pathApp/Contents/MacOS/applications/opensees"
cp -fr $pathToOpenSees/* ./$appFile/Contents/MacOS/applications/opensees
cp -fr $pathToDakota/* ./$appFile/Contents/MacOS/applications/dakota
# clean up
declare -a notWantedApp=("createBIM"
"performRegionalMapping"
"performRegionalEventSimulation"
"performDL"
"createEDP/standardEarthquakeEDP_R"
"createEDP/standardEarthquake"
"createEDP/userEDP_R"
"createEDP/gmtEDP"
"createEDP/simpleEDP"
"createEDP/standardWindEDP"
"createEVENT/ASCE7_WindSpeed"
"createEVENT/MultiplePEER"
"createEVENT/SiteResponse"
"createEVENT/CFDEvent"
"createEVENT/hazardBasedEvent"
"createEVENT/DEDM_HRP"
"createEVENT/stochasticGroundMotion"
"createEVENT/stochasticWind"
"createEVENT/stochasticWind"
"createEVENT/ASCE7_WindSpeed"
"createEVENT/LLNL_SW4"
"createEVENT/windTunnelExperiment"
"createEVENT/LowRiseTPU"
"createEVENT/pointWindSpeed"
"createSAM/MDOF-LU"
"performSIMULATION/IMasEDP"
"performSIMULATION/extractPGA"
"performSIMULATION/openSees_R"
)
for app in "${notWantedApp[@]}"
do
echo "removing $app"
rm -fr ./$appFile/Contents/MacOS/applications/$app
done
find ./$appFile -name __pycache__ -exec rm -rf {} +;
#
# load my credential file
#
if [ -z "$appleID" ]; then
echo "creating dmg $dmgFile"
rm $dmgFile
hdiutil create $dmgFile -fs HFS+ -srcfolder ./$appFile -format UDZO -volname $appName
echo "No password & credential file to continue with codesig and App store verification"
exit
fi
#codesign
echo "codesign --deep --force --verbose --options=runtime --sign "$appleCredential" $appFile"
codesign --deep --force --verbose --options=runtime --sign "$appleCredential" $appFile
# create dmg
echo "hdiutil create $dmgFile -fs HFS+ -srcfolder ./$appFile -format UDZO -volname $appName"
hdiutil create $dmgFile -fs HFS+ -srcfolder ./$appFile -format UDZO -volname $appName
#codesign dmg
echo "codesign --force --sign "$appleCredential" $dmgFile"
codesign --force --sign "$appleCredential" $dmgFile
echo "Issue the following: "
echo "xcrun altool --notarize-app -u $appleID -p $appleAppPassword -f ./$dmgFile --primary-bundle-id altool --verbose"
echo ""
echo "returns id: ID .. wait for email indicating success"
echo "To check status"
echo "xcrun altool --notarization-info ID -u $appleID -p $appleAppPassword"
echo ""
echo "Finally staple the dmg"
echo "xcrun stapler staple \"$appName\" $dmgFile"