-
Notifications
You must be signed in to change notification settings - Fork 23
/
makeDMG_Adam.sh
115 lines (86 loc) · 3.04 KB
/
makeDMG_Adam.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
# remove & rebuild app and macdeploy it
appName="PBE"
appFile="PBE.app"
dmgFile="PBE_Mac_Download.dmg"
QTDIR="/Users/adamzs/Qt/5.15.2/clang_64/"
pathToQuaZip="/Users/adamzs/Repos/PBE/quazip/install/lib/"
pathToBackendApps="/Users/adamzs/SimCenter"
pathToOpenSees="/Users/adamzs/SimCenter/applications/OpenSees/OpenSees3.3.0/bin"
pathToDakota="/Users/adamzs/SimCenter/applications/Dakota/bin"
pathToS3hark="/Users/adamzs/Repos/PBE/s3hark"
#pathToPython="/Users/adamzs/PythonEnvR2D"
#
# source userID file containig stuff dor signing, ok if not there
#
# source userID.sh
#
# create build dir if does not exist, cd to build, conan install and then qmake
#
rm -fr ./build/PBE.app
rm -fr ./build/*.dmg
./makeEXE.sh
cd build
cp -fr $pathToS3hark/resources ./PBE.app/Contents/MacOS
echo $PWD
#
# 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 ./PBE.app
#-qmldir=$pathToShark
#
# 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 quazip libraries
cp $pathToQuaZip/libquazip1-qt5.1.4.0.dylib ./$appFile/Contents/Frameworks/
cp $pathToQuaZip/libquazip1-qt5.1.4.dylib ./$appFile/Contents/Frameworks/
cp $pathToQuaZip/libquazip1-qt5.dylib ./$appFile/Contents/Frameworks/
# 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"
"createEDP/standardEarthquakeEDP_R"
"createEDP/userEDP_R"
"createEDP/simpleEDP"
"createEDP/standardWindEDP"
"createEVENT/ASCE7_WindSpeed"
"createEVENT/CFDEvent"
"createEVENT/hazardBasedEvent"
"createEVENT/DEDM_HRP"
"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 {} +;