forked from omega-gg/MotionBox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
285 lines (181 loc) · 9.19 KB
/
deploy.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
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
#!/bin/sh
set -e
#--------------------------------------------------------------------------------------------------
# Settings
#--------------------------------------------------------------------------------------------------
Sky="../Sky"
backend="../backend"
#--------------------------------------------------------------------------------------------------
# Syntax
#--------------------------------------------------------------------------------------------------
if [ $# != 2 ] || [ $1 != "qt4" -a $1 != "qt5" -a $1 != "clean" ] \
|| \
[ $2 != "win32" -a $2 != "win64" -a $2 != "win32-msvc" -a $2 != "win64-msvc" -a \
$2 != "macOS" -a $2 != "linux" -a $2 != "android" ]; then
echo "Usage: deploy <qt4 | qt5 | clean>"
echo " <win32 | win64 | win32-msvc | win64-msvc | macOS | linux | android>"
exit 1
fi
#--------------------------------------------------------------------------------------------------
# Configuration
#--------------------------------------------------------------------------------------------------
if [ $2 = "win32" -o $2 = "win64" -o $2 = "win32-msvc" -o $2 = "win64-msvc" ]; then
os="windows"
else
os="default"
fi
#--------------------------------------------------------------------------------------------------
# Clean
#--------------------------------------------------------------------------------------------------
echo "CLEANING"
rm -rf deploy/*
touch deploy/.gitignore
if [ $1 = "clean" ]; then
exit 0
fi
echo ""
#--------------------------------------------------------------------------------------------------
# Bundle
#--------------------------------------------------------------------------------------------------
if [ $2 = "macOS" ]; then
cp -r bin/MotionBox.app deploy
deploy="deploy/MotionBox.app/Contents/MacOS"
rm -rf $deploy/plugins
rm $deploy/*.dylib
else
deploy="deploy"
fi
#--------------------------------------------------------------------------------------------------
# Sky
#--------------------------------------------------------------------------------------------------
echo "DEPLOYING Sky"
echo "-------------"
cd "$Sky"
sh deploy.sh $1 $2 tools
cd -
path="$Sky/deploy"
cp -r "$path"/imageformats $deploy
if [ $1 = "qt5" ]; then
cp -r "$path"/platforms $deploy
cp -r "$path"/QtQuick.2 $deploy
if [ $2 = "linux" ]; then
cp -r "$path"/xcbglintegrations $deploy
fi
fi
if [ $os = "windows" ]; then
cp -r "$path"/plugins $deploy
cp "$path"/*.dll $deploy
rm -f $deploy/Sk*.dll
elif [ $2 = "macOS" ]; then
# FIXME Qt 5.14 macOS: We have to copy qt.conf to avoid a segfault.
cp "$path"/qt.conf $deploy/../Resources
cp -r "$path"/plugins $deploy
cp "$path"/*.dylib $deploy
rm -f $deploy/Sk*.dylib
elif [ $2 = "linux" ]; then
cp -r "$path"/vlc $deploy
cp "$path"/*.so* $deploy
rm -f $deploy/Sk*.so*
fi
echo "-------------"
echo ""
#--------------------------------------------------------------------------------------------------
# MotionBox
#--------------------------------------------------------------------------------------------------
echo "COPYING MotionBox"
if [ $os = "windows" ]; then
cp bin/MotionBox.exe deploy
elif [ $2 = "macOS" ]; then
cd $deploy
#----------------------------------------------------------------------------------------------
# Qt
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore \
@loader_path/QtCore.dylib MotionBox
install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui \
@loader_path/QtGui.dylib MotionBox
install_name_tool -change @rpath/QtNetwork.framework/Versions/5/QtNetwork \
@loader_path/QtNetwork.dylib MotionBox
install_name_tool -change @rpath/QtOpenGL.framework/Versions/5/QtOpenGL \
@loader_path/QtOpenGL.dylib MotionBox
install_name_tool -change @rpath/QtQml.framework/Versions/5/QtQml \
@loader_path/QtQml.dylib MotionBox
if [ -f QtQmlModels.dylib ]; then
install_name_tool -change @rpath/QtQmlModels.framework/Versions/5/QtQmlModels \
@loader_path/QtQmlModels.dylib MotionBox
fi
install_name_tool -change @rpath/QtQuick.framework/Versions/5/QtQuick \
@loader_path/QtQuick.dylib MotionBox
install_name_tool -change @rpath/QtSvg.framework/Versions/5/QtSvg \
@loader_path/QtSvg.dylib MotionBox
install_name_tool -change @rpath/QtWidgets.framework/Versions/5/QtWidgets \
@loader_path/QtWidgets.dylib MotionBox
install_name_tool -change @rpath/QtXml.framework/Versions/5/QtXml \
@loader_path/QtXml.dylib MotionBox
install_name_tool -change @rpath/QtXmlPatterns.framework/Versions/5/QtXmlPatterns \
@loader_path/QtXmlPatterns.dylib MotionBox
#----------------------------------------------------------------------------------------------
# platforms
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore \
@loader_path/../QtCore.dylib platforms/libqcocoa.dylib
install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui \
@loader_path/../QtGui.dylib platforms/libqcocoa.dylib
install_name_tool -change @rpath/QtWidgets.framework/Versions/5/QtWidgets \
@loader_path/../QtWidgets.dylib platforms/libqcocoa.dylib
install_name_tool -change @rpath/QtDBus.framework/Versions/5/QtDBus \
@loader_path/../QtDBus.dylib platforms/libqcocoa.dylib
install_name_tool -change @rpath/QtPrintSupport.framework/Versions/5/QtPrintSupport \
@loader_path/../QtPrintSupport.dylib platforms/libqcocoa.dylib
#----------------------------------------------------------------------------------------------
# imageformats
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore \
@loader_path/../QtCore.dylib imageformats/libqjpeg.dylib
install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui \
@loader_path/../QtGui.dylib imageformats/libqjpeg.dylib
#----------------------------------------------------------------------------------------------
install_name_tool -change @rpath/QtCore.framework/Versions/5/QtCore \
@loader_path/../QtCore.dylib imageformats/libqsvg.dylib
install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui \
@loader_path/../QtGui.dylib imageformats/libqsvg.dylib
install_name_tool -change @rpath/QtWidgets.framework/Versions/5/QtWidgets \
@loader_path/../QtWidgets.dylib imageformats/libqsvg.dylib
install_name_tool -change @rpath/QtSvg.framework/Versions/5/QtSvg \
@loader_path/../QtSvg.dylib imageformats/libqsvg.dylib
#----------------------------------------------------------------------------------------------
# QtQuick.2
install_name_tool -change @rpath/QtGui.framework/Versions/5/QtGui \
@loader_path/../QtGui.dylib QtQuick.2/libqtquick2plugin.dylib
install_name_tool -change @rpath/QtQml.framework/Versions/5/QtQml \
@loader_path/../QtQml.dylib QtQuick.2/libqtquick2plugin.dylib
install_name_tool -change @rpath/QtQuick.framework/Versions/5/QtQuick \
@loader_path/../QtQuick.dylib QtQuick.2/libqtquick2plugin.dylib
if [ -f QtQmlModels.dylib ]; then
install_name_tool -change @rpath/QtQmlModels.framework/Versions/5/QtQmlModels \
@loader_path/../QtQmlModels.dylib \
QtQuick.2/libqtquick2plugin.dylib
install_name_tool -change @rpath/QtQmlWorkerScript.framework/Versions/5/QtQmlWorkerScript \
@loader_path/../QtQmlWorkerScript.dylib \
QtQuick.2/libqtquick2plugin.dylib
fi
#----------------------------------------------------------------------------------------------
# VLC
install_name_tool -change @rpath/libvlccore.dylib \
@loader_path/libvlccore.dylib libvlc.dylib
#----------------------------------------------------------------------------------------------
# libtorrent
install_name_tool -change libboost_system.dylib \
@loader_path/libboost_system.dylib libtorrent.dylib
cd -
elif [ $2 = "linux" ]; then
cp bin/MotionBox $deploy
cp dist/script/start.sh $deploy
chmod 755 $deploy/start.sh
elif [ $2 = "android" ]; then
cp bin/libMotionBox* $deploy
fi
#--------------------------------------------------------------------------------------------------
# backend
#--------------------------------------------------------------------------------------------------
echo "COPYING backend"
mkdir -p $deploy/backend/cover
cp "$backend"/cover/* $deploy/backend/cover
cp "$backend"/*.vbml $deploy/backend