forked from caqtdm/caqtdm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcaQtDM_BuildMacBundle
executable file
·231 lines (167 loc) · 13.6 KB
/
caQtDM_BuildMacBundle
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
#!/bin/bash
source caQtDM_Env
export PATH=$PATH:${QTHOME}/bin
pwd
echo
echo ========== Collect Files for Mac Bundle ============
echo
chmod -R 777 ./caQtDM_Binaries/caQtDM.app
echo
echo ========== add plugin dirs ============
echo
mkdir ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/platforms/
mkdir ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/imageformats/
mkdir ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/printsupport/
echo
echo ========== add libcoca ============
echo
cp ${QTHOME}/plugins/imageformats/*.dylib ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/imageformats/
rm ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/imageformats/*_debug.dylib
cp ${QTHOME}/plugins/platforms/libqcocoa.dylib ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/platforms/
echo
echo ========== macdeployqt caQtDM ============
echo
macdeployqt ./caQtDM_Binaries/caQtDM.app -executable=./caQtDM_Binaries/caQtDM.app/Contents/MacOS/caQtDM -libpath=./caQtDM_Binaries -libpath=/Users/brands/Documents/Entwicklung/epics/base-7.0.7/lib/darwin-aarch64 -libpath=/Users/brands/Documents/Entwicklung/qt/qwt-6.2.0/lib -libpath=/Users/brands/Documents/Entwicklung/qt/zmqbuild/lib
echo
echo ========== change plugin libs =============
echo
echo ++++++++++ libepics3_plugin controls lib ++++++++
install_name_tool -change libcaQtDM_Lib.dylib @rpath/libcaQtDM_Lib.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libepics3_plugin.dylib
install_name_tool -change @loader_path/../../Frameworks/libca.4.14.2.dylib @rpath/libca.4.14.2.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libepics3_plugin.dylib
install_name_tool -change @loader_path/../../Frameworks/libCom.3.22.0.dylib @rpath/libCom.3.22.0.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libepics3_plugin.dylib
echo ++++++++++ libepics4_plugin controls lib ++++++++
install_name_tool -change libcaQtDM_Lib.dylib @rpath/libcaQtDM_Lib.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libepics4_plugin.dylib
echo ++++++++++ libbsread_plugin controls lib ++++++++
install_name_tool -change libcaQtDM_Lib.dylib @rpath/libcaQtDM_Lib.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libbsread_plugin.dylib
echo ++++++++++ libarchiveSF_plugin controls lib ++++++++
install_name_tool -change libcaQtDM_Lib.dylib @rpath/libcaQtDM_Lib.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libarchiveSF_plugin.dylib
install_name_tool -change libqtcontrols.dylib @rpath/libqtcontrols.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libarchiveSF_plugin.dylib
echo ++++++++++ libarchiveHTTP_plugin controls lib ++++++++
install_name_tool -change libcaQtDM_Lib.dylib @rpath/libcaQtDM_Lib.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libarchiveHTTP_plugin.dylib
install_name_tool -change libqtcontrols.dylib @rpath/libqtcontrols.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libarchiveHTTP_plugin.dylib
echo ++++++++++ libdemo_plugin controls lib ++++++++
install_name_tool -change libcaQtDM_Lib.dylib @rpath/libcaQtDM_Lib.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libdemo_plugin.dylib
echo ++++++++++ libmodbus_plugin lib ++++++++
install_name_tool -change libcaQtDM_Lib.dylib @rpath/libcaQtDM_Lib.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libmodbus_plugin.dylib
install_name_tool -change libqtcontrols.dylib @rpath/libqtcontrols.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libmodbus_plugin.dylib
echo ++++++++++ libenvironment_plugin lib ++++++++
install_name_tool -change libcaQtDM_Lib.dylib @rpath/libcaQtDM_Lib.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libenvironment_plugin.dylib
install_name_tool -change libqtcontrols.dylib @rpath/libqtcontrols.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libenvironment_plugin.dylib
echo ++++++++++ libgps_plugin lib ++++++++
install_name_tool -change libcaQtDM_Lib.dylib @rpath/libcaQtDM_Lib.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libgps_plugin.dylib
install_name_tool -change libqtcontrols.dylib @rpath/libqtcontrols.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Plugins/controlsystems/libgps_plugin.dylib
echo ++++++++++ libcaQtDM_Lib.dylib controls lib ++++++++
install_name_tool -change qwt.framework/Versions/6/qwt @rpath/qwt.framework/Versions/6/qwt ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/libcaQtDM_Lib.dylib
install_name_tool -change libqtcontrols.dylib @rpath/libqtcontrols.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/libcaQtDM_Lib.dylib
install_name_tool -change @loader_path/ibCom.3.22.0.dylib @rpath/ibCom.3.22.0.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/libcaQtDM_Lib.dylib
echo ++++++++++ libqtcontrols.dylib controls lib ++++++++
install_name_tool -change qwt.framework/Versions/6/qwt @rpath/qwt.framework/Versions/6/qwt ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/libqtcontrols.dylib
install_name_tool -change libadlParser.dylib @rpath/libadlParser.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/libqtcontrols.dylib
install_name_tool -change libedlParser.dylib @rpath/libedlParser.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/libqtcontrols.dylib
echo ++++++++++ libca.3.14.12.dylib controls lib ++++++++
install_name_tool -change @loader_path/libCom.3.22.0.dylib @rpath/ibCom.3.22.0.dylib ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/libCom.3.22.0.dylib
echo ++++++++++ libqtcontrols_controllers_plugin.dylib ++++++++
install_name_tool -change qwt.framework/Versions/6/qwt @rpath/qwt.framework/Versions/6/qwt ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/designer/libqtcontrols_controllers_plugin.dylib
install_name_tool -change libqtcontrols.dylib @rpath/libqtcontrols.dylib ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/designer/libqtcontrols_controllers_plugin.dylib
echo ++++++++++ libqtcontrols_graphics_plugin.dylib ++++++++
install_name_tool -change qwt.framework/Versions/6/qwt @rpath/qwt.framework/Versions/6/qwt ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/designer/libqtcontrols_graphics_plugin.dylib
install_name_tool -change libqtcontrols.dylib @rpath/libqtcontrols.dylib ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/designer/libqtcontrols_graphics_plugin.dylib
echo ++++++++++ libqtcontrols_monitors_plugin.dylib ++++++++
install_name_tool -change qwt.framework/Versions/6/qwt @rpath/qwt.framework/Versions/6/qwt ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/designer/libqtcontrols_monitors_plugin.dylib
install_name_tool -change libqtcontrols.dylib @rpath/libqtcontrols.dylib ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/designer/libqtcontrols_monitors_plugin.dylib
echo ++++++++++ libqtcontrols_utilities_plugin.dylib ++++++++
install_name_tool -change qwt.framework/Versions/6/qwt @rpath/qwt.framework/Versions/6/qwt ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/designer/libqtcontrols_utilities_plugin.dylib
install_name_tool -change libqtcontrols.dylib @rpath/libqtcontrols.dylib ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/designer/libqtcontrols_utilities_plugin.dylib
echo
echo ========== fix for codesigning ============
echo
rm -rf ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/QtOpenGl.framework/Headers
rm -rf ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/QtOpenGl.framework/QtOpenGL_debug
rm -f ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/QtOpenGl.framework/*.prl
echo
echo ========== change case sensitive OpenGl =============
echo
echo ++++++++++ caQtDM ++++++++
#install_name_tool -change @rpath/QtOpenGL.framework/Versions/5/QtOpenGL @rpath/QtOpenGl.framework/Versions/5/QtOpenGL ./caQtDM_Binaries/caQtDM.app/Contents/MacOS/caQtDM
echo ++++++++++ libcaQtDM_Lib.dylib ++++++++
#install_name_tool -change @rpath/QtOpenGL.framework/Versions/5/QtOpenGL @rpath/QtOpenGl.framework/Versions/5/QtOpenGL ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/libcaQtDM_Lib.dylib
echo ++++++++++ libqtcontrols.dylib ++++++++
#install_name_tool -change @rpath/QtOpenGL.framework/Versions/5/QtOpenGL @rpath/QtOpenGl.framework/Versions/5/QtOpenGL ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/libqtcontrols.dylib
echo ++++++++++ caQtDM ++++++++
install_name_tool -change libcaQtDM_Lib.dylib @loader_path/../Frameworks/libcaQtDM_Lib.dylib ./caQtDM_Binaries/caQtDM.app/Contents/MacOS/caQtDM
install_name_tool -change libqtcontrols.dylib @loader_path/../Frameworks/libqtcontrols.dylib ./caQtDM_Binaries/caQtDM.app/Contents/MacOS/caQtDM
install_name_tool -change libadlParser.dylib @loader_path/../Frameworks/libadlParser.dylib ./caQtDM_Binaries/caQtDM.app/Contents/MacOS/caQtDM
install_name_tool -change libedlParser.dylib @loader_path/../Frameworks/libedlParser.dylib ./caQtDM_Binaries/caQtDM.app/Contents/MacOS/caQtDM
echo
echo ========== add designer.app ============
echo
cp -R ${QTHOME}/bin/Designer.app ./caQtDM_Binaries/
chmod -R 777 ./caQtDM_Binaries/Designer.app
mkdir ./caQtDM_Binaries/Designer.app/Contents/Frameworks/
mkdir ./caQtDM_Binaries/Designer.app/Contents/PlugIns/
mkdir ./caQtDM_Binaries/Designer.app/Contents/PlugIns/platforms/
cp ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/libqtcontrols.dylib ./caQtDM_Binaries/Designer.app/Contents/Frameworks/
cp -R ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/* ./caQtDM_Binaries/Designer.app/Contents/Frameworks/
cp -R $QTHOME/lib/QtDesignerComponents.framework ./caQtDM_Binaries/Designer.app/Contents/Frameworks/
cp ./caQtDM_Binaries/caQtDM.app/Contents/Resources/qt.conf ./caQtDM_Binaries/Designer.app/Contents/Resources/
cp $QTHOME/plugins/platforms/libqcocoa.dylib ./caQtDM_Binaries/Designer.app/Contents/PlugIns/platforms
install_name_tool -rpath @loader_path/../../../../lib @loader_path/../Frameworks ./caQtDM_Binaries/Designer.app/Contents/MacOS/Designer
mkdir ./caQtDM_Binaries/Designer.app/Contents/PlugIns
mkdir ./caQtDM_Binaries/Designer.app/Contents/PlugIns/designer
mkdir ./caQtDM_Binaries/Designer.app/Contents/PlugIns/imageformats
cp ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/designer/*.dylib ./caQtDM_Binaries/Designer.app/Contents/PlugIns/designer/
cp ./caQtDM_Binaries/caQtDM.app/Contents/PlugIns/imageformats/*.dylib ./caQtDM_Binaries/Designer.app/Contents/PlugIns/imageformats/
echo
echo ========== add adl2ui.app ============
echo
#cp -R ./caQtDM_Binaries/adl2ui.app ./caQtDM_Binaries/caQtDM.app/Contents/Applications/
macdeployqt ./caQtDM_Binaries/adl2ui.app
echo
echo ========== codesigning ============
echo
echo Identity = ${CAQTDM_MAC_CODESIGN}
codesign --verbose=2 --force -s "${CAQTDM_MAC_CODESIGN}" -vvvv ./caQtDM_Binaries/caQtDM.app/Contents/MacOS/caQtDM
codesign --verbose=2 --force -s "${CAQTDM_MAC_CODESIGN}" -vvvv ./caQtDM_Binaries/caQtDM.app/Contents/Frameworks/*
codesign --verbose=2 --force -s "${CAQTDM_MAC_CODESIGN}" -vvvv ./caQtDM_Binaries/caQtDM.app
echo
echo ========== check codesigning ============
echo
codesign -dvvv ./caQtDM_Binaries/caQtDM.app
echo
echo ========== modifiy dmg image ============
echo
hdiutil create -megabytes 280 -format UDRW ./caQtDM_Binaries/caqtdm.dmg -srcfolder ./caQtDM_Binaries/caQtDM.app
hdiutil attach -mountpoint /Volumes/caQtDM -readwrite ./caQtDM_Binaries/caQtDM.dmg
ln -s /Applications /Volumes/caQtDM/Applications
cp -R ./caQtDM_Binaries/Designer.app /Volumes/caQtDM/
#cp -R ./caQtDM_Binaries/adl2ui.app /Volumes/caQtDM/
hdiutil detach /Volumes/caQtDM/
rm ./caQtDM_Binaries/caqtdm_package.dmg
hdiutil convert ./caQtDM_Binaries/caqtdm.dmg -format UDZO -o ./caQtDM_Binaries/caqtdm_package.dmg
rm ./caQtDM_Binaries/caqtdm.dmg
echo
echo ========== generate Mac Pkg for MacAppStore ============
echo
mkdir ./caQtDM_Binaries/caQtDM.app/Contents/Applications
cp -R ./caQtDM_Binaries/Designer.app ./caQtDM_Binaries/caQtDM.app/Contents/Applications
echo ========== codesigning ============
echo
echo Identity = ${CAQTDM_MAC_CODESIGN}
#codesign --verbose=2 --deep --force --entitlements ./caQtDM_Viewer/src/Mac/Entitlements.plist -s "${CAQTDM_MAC_CODESIGN}" -vvvv ./caQtDM_Binaries/caQtDM.app
pkgbuild --install-location /Applications --component ./caQtDM_Binaries/caQtDM.app ./caQtDM_Binaries/caQtDMApp.pkg
#pkgbuild --install-location /Applications --component ./caQtDM_Binaries/Designer.app ./caQtDM_Binaries/DesignerApp.pkg
#--package ./caQtDM_Binaries/DesignerApp.pkg
productbuild --synthesize --package ./caQtDM_Binaries/caQtDMApp.pkg ./caQtDM_Binaries/Distribution.xml
productbuild --identifier ch.psi.caqtdm.osx --distribution ./caQtDM_Binaries/Distribution.xml --sign "${CAQTDM_MAC_INSTALLSIGN}" --resources ./caQtDM_Viewer/src --package-path ./caQtDM_Binaries/ './caQtDM_Binaries/caqtdm.pkg'
#mkdir ./caQtDM_Binaries/pkg
#cp -R ./caQtDM_Binaries/caQtDM.app ./caQtDM_Binaries/pkg
#cp -R ./caQtDM_Binaries/Designer.app ./caQtDM_Binaries/pkg
#productbuild --component ./caQtDM_Binaries/caQtDM.app /Applications ./caQtDM_Binaries/caQtDMApp.pkg
#productbuild --component ./caQtDM_Binaries/Designer.app /Applications ./caQtDM_Binaries/DesignerApp.pkg
#pkgbuild --analyze --root ./caQtDM_Binaries/pkg ./caQtDM_Binaries/caQtDM.plist
#pkgbuild --root './caQtDM_Binaries' --identifier ch.psi.caqtdm.osx --component-plist './caQtDM_Binaries/caQtDM.plist' './caQtDM_Binaries/caQtDM.pkg' --install-location /Applications
#productbuild --synthesize --package ./caQtDM_Binaries/caQtDM.pkg --package ./caQtDM_Binaries/Designer.pkg ./caQtDM_Binaries/Distribution.xml
#pkgbuild --root './caQtDM_Binaries' --component-plist './caQtDM_Binaries/caQtDM.plist' './caQtDM_Binaries/caQtDM.pkg'
#pkgbuild --root './caQtDM_Binaries' --component-plist './caQtDM_Binaries/Designer.plist' './caQtDM_Binaries/Designer.pkg'
#productbuild --distribution ./caQtDM_Binaries/Distribution.xml --sign "${CAQTDM_MAC_INSTALLSIGN}" --resources ./caQtDM_Viewer/src --package-path ./caQtDM_Binaries/ './caQtDM_Binaries/caqtdmdist.pkg'
cd ..