-
Notifications
You must be signed in to change notification settings - Fork 13
/
plinrelease.sh
executable file
·332 lines (285 loc) · 6.58 KB
/
plinrelease.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
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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
#!/bin/sh
#
# This script is intended for making production linux SimpleIDE packages
# and uses an install methodology deemed appropriate by Parallax.
#
# If you want to use the old packaging methodology, run linrelease.sh
#
# This packager does not include any dynamic support libraries as it is
# assumed that linux users will be able to find the necessary pieces.
#
# To use this release script:
#
# 1) QtSDK Desktop qmake must be in your PATH
# 2) workspace must exist in spinside folder ala:
# hg clone https://[email protected]/p/propsideworkspace/ workspace
#
#
NAME=SimpleIDE
PKG=${NAME}.zip
PROPGCC=/opt/parallax
WXLOADER=../proploader-linux-build/bin/proploader
BUILD=build
SETUP="setup.sh"
SIDE="simpleide.sh"
SETUPSH="./release/linux/${SETUP}"
SIDERSH="./release/linux/${SIDE}"
#
# we provide SimpleIDE, PropellerGCC, ctags, qt libs, spin source, and workspace in this packager
#
CTAGS="./ctags-5.8"
LIBAUDIO="/usr/lib/libaudio.so.2"
LIBAUDIO2="/usr/lib/x86_64-linux-gnu/libaudio.so.2"
SPINLIB="./spin"
which qmake
if [ $? -ne 0 ]
then
echo "Qt must be installed. Please install Qt5.4 from here:"
echo "download.qt.io./official_releases/qt/5.4/5.4.2"
exit 1
fi
QMAKE=`which qmake`
QT5QMAKE=`echo ${QMAKE} | grep -i 'Qt5'`
grep -i 'Qt5' ${QMAKE}
if test $? != 0 ; then
echo "The qmake program must be Qt5.4 or higher vintage."
echo "Please adjust PATH to include a Qt5 build if necessary."
echo "Please install Qt5.4 from here if you don't have it already:"
echo "download.qt.io./official_releases/qt/5.4/5.4.2"
exit 1
fi
CLEAN=$1
if [ ! -e ./Workspace ]
then
echo "SimpleIDE Workspace not found. Adding:"
git clone https://github.com/parallaxinc/propsideworkspace/ Workspace
if [ $? -ne 0 ]
then
echo "SimpleIDE Workspace git failed. Add it with this command:"
echo "git clone https://github.com/parallaxinc/propsideworkspace/ Workspace"
exit 1
fi
cd Workspace
git checkout SimpleIDE-WX-Updates
if [ $? -ne 0 ]
then
echo "SimpleIDE Workspace checkout SimpleIDE-WX-Updates failed. Giving up."
exit 1
fi
cd ..
fi
UARCH=`arch`
UNAME=`uname -n`
if [ `uname -s` = "msys" ]; then
JOBS=
else
ISARM=`echo ${UARCH} | grep -i "arm"`
if [ x${ISARM} != "x" ]; then
JOBS=-j2
else
JOBS=-j6
fi
fi
#
# remove package
#
if [ -e ${PKG} ]; then
rm -rf ${PKG}
fi
mkdir -p ${BUILD}
#
# build SimpleIDE for release
#
#cp -r ./propside/* ${BUILD}
DIR=`pwd`
XFILES=`find propside/*`
for XF in $XFILES ; do
BF=`echo $XF | sed 's/propside\//build\//g'`
if [ ! -e $BF ] ; then
echo $DIR/$BF
ln -s $DIR/$XF ${BUILD}
fi
if [ $? -ne 0 ] ; then
exit 1
fi
done
cd ${BUILD}
qmake -config ${BUILD}
if test $? != 0; then
echo "qmake config failed."
exit 1
fi
if [ x$CLEAN != xnoclean ]; then
make clean
fi
make ${JOBS}
if test $? != 0; then
echo "make failed."
exit 1
fi
cd ${DIR}
# extract version from propside.pro
#
SEDCMD=`sed -n 's/VERSION=.*$/&/p' ${BUILD}/propside.pro | cut -d"=" -f3`
VERSION=`echo ${SEDCMD}`
VERSION=`echo ${VERSION} | sed 's/ /-/g'`
VERSION=`echo ${VERSION} | sed 's/\r//g'`
VERSION="${NAME}-${VERSION}"
echo "Creating Version ${VERSION}"
# create package direcotry
#
rm -rf ${VERSION}
mkdir -p ${VERSION}
if test $? != 0; then
echo "mkdir ${VERSION} failed."
exit 1
fi
cp -r ./release/template/* ${VERSION}
cp -r ${BUILD}/${NAME} ${VERSION}/bin
if test $? != 0; then
echo "copy ${NAME} failed."
exit 1
fi
cp ${SETUPSH} ${VERSION}
cp ${SIDERSH} ${VERSION}/bin
chmod u+x ${VERSION}/${SETUP}
chmod 755 ${VERSION}/bin/${SIDE}
ls ${VERSION}
cp -r ${BUILD}/translations ${VERSION}
if test $? != 0; then
echo "copy translations failed."
exit 1
fi
MYLDD=`ldd ${BUILD}/${NAME} | grep libQt | awk '{print $3}'`
LIBS=`echo $MYLDD`
cp -f ${LIBS} ${VERSION}/bin
if test $? != 0; then
echo "copy ${LIBS} failed."
exit 1
fi
MYLDD=`ldd ${BUILD}/${NAME} | grep libQt | awk '{print $3}'`
LIBS=`echo $MYLDD`
cp -f ${LIBS} ${VERSION}/bin
if test $? != 0; then
echo "copy ${LIBS} failed."
exit 1
fi
AULDD=`ldd ${BUILD}/${NAME} | grep libaudio | awk '{print $3}'`
LIBAUDIO=`echo $AULDD`
if [ ${LIBAUDIO}X != X ]; then
cp -f ${LIBAUDIO} ${VERSION}/bin
if test $? != 0; then
if test $? != 0; then
echo "Can't find libaudio...."
fi
fi
fi
#
# Quazip no longer needed
#
#MYLDD=`ldd ${BUILD}/${NAME} | grep quazip | awk '{print $3}'`
#QUAZIP=`echo $MYLDD`
#
#cp ${QUAZIP} ${VERSION}/bin
#if test $? != 0; then
# echo "copy ${QUAZIP} failed."
# exit 1
#fi
export PATH=$PROPGCC/bin:$PATH
if [ ! -e $WXLOADER ] ; then
echo "proploader not found. Adding:"
git clone https://github.com/dbetz/proploader/ ../proploader
pushd `pwd`
cd ../proploader
export OS=linux
make
popd
unset OS
fi
cp ${WXLOADER} ${VERSION}/bin
if [ ! -e $WXLOADER ] ; then
echo "${WXLOADER} is missing. Build it?"
exit 1
fi
if test $? != 0; then
echo "COPY ${WXLOADER} failed."
exit 1
fi
cd ${CTAGS}
./configure > /dev/null
if test $? != 0; then
echo "configure ${CTAGS} failed."
exit 1
fi
echo "Make ${CTAGS}"
make
if test $? != 0; then
echo "make ${CTAGS} failed."
exit 1
fi
cd ..
echo "Copy files ..."
cp -f ${CTAGS}/ctags ${VERSION}/bin
if test $? != 0; then
echo "copy ${CTAGS}/ctags failed."
exit 1
ls -alRF ${VERSION}/bin
fi
rm -rf parallax
cp -r ${PROPGCC} ${VERSION}
if test $? != 0; then
echo "copy ${PROPGCC} failed."
exit 1
fi
cp -rf ${SPINLIB} ${VERSION}/parallax
if test $? != 0; then
echo "copy ${SPINLIB} failed."
exit 1
fi
cp -f ${CTAGS}/ctags ${VERSION}/parallax/bin
if test $? != 0; then
echo "copy ${CTAGS}/ctags failed."
exit 1
ls -alRF ${VERSION}/bin
fi
cp ./SimpleIDE-User-Guide.pdf ${VERSION}/parallax/bin
if test $? != 0; then
echo "copy User Guide failed."
exit 1
fi
cp -r ./propside-demos/ ${VERSION}/demos
if test $? != 0; then
echo "copy propside-demos failed."
exit 1
fi
echo "Git and copy workspace ..."
rm -rf ${VERSION}/parallax/Workspace
cd Workspace
git fetch
if test $? != 0; then
echo "workspace pull failed."
exit 1
fi
git pull
if test $? != 0; then
echo "workspace update failed."
exit 1
fi
cd ..
cp -r ./Workspace/ ${VERSION}/parallax
if test $? != 0; then
echo "copy workspace failed."
exit 1
fi
rm -rf ${VERSION}/parallax/Workspace/.hg
if test $? != 0; then
echo "remove workspace .hg tracking failed."
exit 1
fi
# pack-up a bzip tarball for distribution
if [ x$CLEAN != xnoclean ]; then
echo "Make tarball ..."
tar -cjf ${VERSION}.${UARCH}.${UNAME}-linux.tar.bz2 ${VERSION}
fi
echo "All done."
exit 0