-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildmain.sh
executable file
·659 lines (622 loc) · 17.5 KB
/
buildmain.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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
#!/bin/bash
# build script for kurento for windows
#set -e #stop on error
#set -x #print all executed command
#MINGW=mingw32
MINGW=mingw64
BUILDTYPE=RELEASE
#BUILDTYPE=DEBUG
DOINSTALL=TRUE
DOBUILD=TRUE
if [ $MINGW = mingw32 ]; then
MINGWPATH=i686-w64-mingw32
MINGWX=x86
MINGWP1=mingw
else
MINGWPATH=x86_64-w64-mingw32
MINGWX=x64
MINGWP1=mingw64
fi
if [ $BUILDTYPE = RELEASE ]; then
BUILD_TYPE=Release
CONFIGUREPARAMDEBUG=--disable-debug
DEBUGSUFFIX=
DEBUGOPENSSL=
DEBUGLIBVPX=
DEBUGLIBSRTP=
else
BUILD_TYPE=Debug
CONFIGUREPARAMDEBUG=--enable-debug
DEBUGSUFFIX=d
DEBUGOPENSSL=--debug
DEBUGLIBVPX="--enable-debug --enable-debug-libs"
DEBUGLIBSRTP=--enable-debug-logging
fi
function pause() {
echo -e "\e[30m\e[45m\e[5mPress ENTER to continue...\e[97m\e[49m"
# read
}
function getcmakemodules() {
pushd "kms-cmake-utils-build"
cmakemodules=`cmake -L | awk -f ../gawk-find-cmake`
echo "cmake module path: " $cmakemodules
popd
}
build_kms-cmake-utils()
{
echo "--- 01 --- kms-cmake-utils ---"
mkdir -p "kms-cmake-utils-build"
pushd "kms-cmake-utils-build"
if [ $DOBUILD = TRUE ]; then
$MINGW-cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ../kms-cmake-utils/
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_glib()
{
echo "--- 02 --- glib ---"
pushd "glib"
if [ $DOBUILD = TRUE ]; then
./autogen.sh || true
$MINGW-configure \
--disable-directsound --disable-direct3d $CONFIGUREPARAMDEBUG \
--disable-examples --disable-gtk-doc --disable-winscreencap \
--disable-winks --disable-wasapi --disable-opencv
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_kurento-module-creator()
{
echo "--- 03 --- kurento-module-creator ---"
mkdir -p "kurento-module-creator"
pushd "kurento-module-creator"
if [ $DOBUILD = TRUE ]; then
make
fi
if [ $DOINSTALL = TRUE ]; then
sudo make install
fi
popd
}
build_gstreamer()
{
echo "--- 04 --- gstreamer ---"
pushd "gstreamer"
if [ $DOBUILD = TRUE ]; then
./autogen.sh || true ## Ignore configuration errors
$MINGW-configure --disable-tools --disable-tests --disable-benchmarks --disable-examples \
$CONFIGUREPARAMDEBUG --libexec=/usr/$MINGWPATH/sys-root/mingw/libexec
make
fi
if [ $DOINSTALL = TRUE ]; then
sudo make install
fi
popd
}
build_gst-plugins-base()
{
echo "--- 05 --- gst-plugins-base-1.5 ---"
pushd "gst-plugins-base"
if [ $DOBUILD = TRUE ]; then
./autogen.sh || true ## Ignore configuration errors
$MINGW-configure $CONFIGUREPARAMDEBUG
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_jsoncpp()
{
echo "--- 06 --- jsoncpp ---"
mkdir -p "jsoncpp-build"
pushd "jsoncpp-build"
if [ $DOBUILD = TRUE ]; then
$MINGW-cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ../jsoncpp
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_kms-jsonrpc()
{
echo "--- 07 --- kms-jsonrpc ---"
mkdir -p "kms-jsonrpc-build"
pushd "kms-jsonrpc-build"
if [ $DOBUILD = TRUE ]; then
$MINGW-cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_MODULE_PATH=$cmakemodules \
../kms-jsonrpc
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_libvpx()
{
echo "--- 08 --- libvpx ---"
pushd "libvpx"
if [ $MINGW = mingw32 ]; then
eval `rpm --eval %{mingw32_env}`
else
eval `rpm --eval %{mingw64_env}`
fi
if [ $DOBUILD = TRUE ]; then
export AS=yasm
if [ $MINGW = mingw32 ]; then
#libvpx bug https://bugzilla.gnome.org/show_bug.cgi?id=763663 -mstackrealign
./configure --target=x86-win32-gcc --prefix=/usr/$MINGWPATH/sys-root/mingw/ $DEBUGLIBVPX --extra-cflags=-mstackrealign
else
./configure --target=x86_64-win64-gcc --prefix=/usr/$MINGWPATH/sys-root/mingw/ $DEBUGLIBVPX
fi
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_kms-core()
{
echo "--- 09 --- kms-core ---"
if [[ $EUID == 0 ]]; then
echo "Build this step as root will lead to troubles later! (e.g. kurentocreator will not be found) Stop here now."
exit
fi
mkdir -p "kms-core-build"
pushd "kms-core-build"
if [ $DOBUILD = TRUE ]; then
$MINGW-cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_MODULE_PATH=$cmakemodules \
-DCMAKE_INSTALL_PREFIX=/usr/$MINGWPATH/sys-root/mingw \
-DKURENTO_MODULES_DIR=/usr/$MINGWPATH/sys-root/mingw/share/kurento/modules/ \
../kms-core
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_libevent()
{
echo "--- 10 --- libevent ---"
pushd "libevent"
if [ $DOBUILD = TRUE ]; then
./autogen.sh || true ## However, you should not build using configured Makefile
$MINGW-configure $CONFIGUREPARAMDEBUG
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_kurento-media-server()
{
echo "--- 11 --- kurento-media-server ---"
mkdir -p "kurento-media-server-build"
pushd "kurento-media-server-build"
if [ $DOBUILD = TRUE ]; then
#problem mit mingw -> too many sections (40348)... Fatal error: can't write 97 bytes to section .text of CMakeFiles/websocketTransport.dir/WebSocketTransport.cpp.obj because: 'File too big'
#nur bei 64 bit -> 32 bit ok
if [ $MINGW = mingw64 ]; then
$MINGW-cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_MODULE_PATH=$cmakemodules \
../kurento-media-server
else
$MINGW-cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_MODULE_PATH=$cmakemodules \
../kurento-media-server
fi
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_usrsctp()
{
echo "--- 12 --- usersctp ---"
pushd "usrsctp"
./bootstrap
if [ $DOBUILD = TRUE ]; then
$MINGW-configure $CONFIGUREPARAMDEBUG
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_openwebrtc-gst-plugins()
{
echo "--- 13 --- openwebrtc-gst-plugins ---"
pushd "openwebrtc-gst-plugins"
if [ $DOBUILD = TRUE ]; then
./autogen.sh || true ## Ignore configuration errors
$MINGW-configure $CONFIGUREPARAMDEBUG
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
sudo rm /usr/$MINGWPATH/sys-root/mingw/bin/libgstsctp-1.5.dll
sudo ln -s -f /usr/$MINGWPATH/sys-root/mingw/lib/libgstsctp-1.5.dll \
/usr/$MINGWPATH/sys-root/mingw/bin/libgstsctp-1.5.dll
fi
popd
}
build_libnice()
{
echo "--- 14 --- libnice ---"
pushd "libnice"
if [ $DOBUILD = TRUE ]; then
./autogen.sh || true ## Ignore configuration errors
$MINGW-configure $CONFIGUREPARAMDEBUG
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_kms-elements()
{
echo "--- 15 --- kms-elements ---"
mkdir -p "kms-elements-build"
pushd "kms-elements-build"
if [ $DOBUILD = TRUE ]; then
$MINGW-cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_MODULE_PATH=$cmakemodules \
-DCMAKE_INSTALL_PREFIX=/usr/$MINGWPATH/sys-root/mingw \
-DKURENTO_MODULES_DIR=/usr/$MINGWPATH/sys-root/mingw/share/kurento/modules/ \
../kms-elements
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_opencv()
{
echo "--- 16 --- opencv ---"
mkdir -p "opencv-build"
pushd "opencv-build"
if [ $DOBUILD = TRUE ]; then
$MINGW-cmake \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DBUILD_PERF_TESTS=false \
-DBUILD_TESTS=false \
-DWITH_DSHOW=false \
-DWITH_WIN32UI=false \
-DWITH_OPENCL=false \
-DWITH_VFW=false \
-DBUILD_ZLIB=false \
-DBUILD_TIFF=false \
-DBUILD_JASPER=false \
-DBUILD_JPEG=false \
-DBUILD_PNG=false \
-DBUILD_OPENEXR=false \
-DWITH_FFMPEG=false \
-DBUILD_opencv_flann=OFF \
-DBUILD_opencv_photo=OFF \
-DBUILD_opencv_video=OFF \
-DBUILD_opencv_ml=OFF \
../opencv
sed -i 's/-isystem\ \/usr\/'$MINGWPATH'\/sys-root\/mingw\/include/ /g' \
modules/core/CMakeFiles/opencv_core.dir/includes_CXX.rsp
sed -i 's/-isystem\ \/usr\/'$MINGWPATH'\/sys-root\/mingw\/include\ / /g' \
modules/highgui/CMakeFiles/opencv_highgui.dir/includes_CXX.rsp
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
sudo cp unix-install/opencv.pc /usr/$MINGWPATH/sys-root/mingw/lib/pkgconfig/
sudo rm /usr/$MINGWPATH/sys-root/mingw/lib/libopencv_core.a
sudo ln -s -f /usr/$MINGWPATH/sys-root/mingw/$MINGWX/mingw/lib/libopencv_core2413$DEBUGSUFFIX.dll.a \
/usr/$MINGWPATH/sys-root/mingw/lib/libopencv_core.a
sudo rm /usr/$MINGWPATH/sys-root/mingw/lib/libopencv_highgui.a
sudo ln -s -f /usr/$MINGWPATH/sys-root/mingw/$MINGWX/mingw/lib/libopencv_highgui2413$DEBUGSUFFIX.dll.a \
/usr/$MINGWPATH/sys-root/mingw/lib/libopencv_highgui.a
sudo rm /usr/$MINGWPATH/sys-root/mingw/lib/libopencv_imgproc.a
sudo ln -s -f /usr/$MINGWPATH/sys-root/mingw/$MINGWX/mingw/lib/libopencv_imgproc2413$DEBUGSUFFIX.dll.a \
/usr/$MINGWPATH/sys-root/mingw/lib/libopencv_imgproc.a
sudo rm /usr/$MINGWPATH/sys-root/mingw/lib/libopencv_objdetect.a
sudo ln -s -f /usr/$MINGWPATH/sys-root/mingw/$MINGWX/mingw/lib/libopencv_objdetect2413$DEBUGSUFFIX.dll.a \
/usr/$MINGWPATH/sys-root/mingw/lib/libopencv_objdetect.a
sudo rm /usr/$MINGWPATH/sys-root/mingw/bin/libopencv_core2413.dll
sudo rm /usr/$MINGWPATH/sys-root/mingw/bin/libopencv_highgui2413.dll
sudo rm /usr/$MINGWPATH/sys-root/mingw/bin/libopencv_imgproc2413.dll
sudo rm /usr/$MINGWPATH/sys-root/mingw/bin/libopencv_objdetect2413.dll
sudo ln -s -f /usr/$MINGWPATH/sys-root/mingw/$MINGWX/mingw/bin/libopencv_core2413$DEBUGSUFFIX.dll \
/usr/$MINGWPATH/sys-root/mingw/bin/libopencv_core2413.dll
sudo ln -s -f /usr/$MINGWPATH/sys-root/mingw/$MINGWX/mingw/bin/libopencv_highgui2413$DEBUGSUFFIX.dll \
/usr/$MINGWPATH/sys-root/mingw/bin/libopencv_highgui2413.dll
sudo ln -s -f /usr/$MINGWPATH/sys-root/mingw/$MINGWX/mingw/bin/libopencv_imgproc2413$DEBUGSUFFIX.dll \
/usr/$MINGWPATH/sys-root/mingw/bin/libopencv_imgproc2413.dll
sudo ln -s -f /usr/$MINGWPATH/sys-root/mingw/$MINGWX/mingw/bin/libopencv_objdetect2413$DEBUGSUFFIX.dll \
/usr/$MINGWPATH/sys-root/mingw/bin/libopencv_objdetect2413.dll
fi
popd
}
build_kms-filters()
{
echo "--- 17 --- kms-filters ---"
mkdir -p "kms-filters-build"
pushd "kms-filters-build"
if [ $DOBUILD = TRUE ]; then
$MINGW-cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_MODULE_PATH=$cmakemodules \
-DCMAKE_INSTALL_PREFIX=/usr/$MINGWPATH/sys-root/mingw \
-DKURENTO_MODULES_DIR=/usr/$MINGWPATH/sys-root/mingw/share/kurento/modules/ \
-DCMAKE_C_FLAGS="-Wno-error=deprecated-declarations" \
../kms-filters
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_gst-plugins-good()
{
echo "--- 18 --- gst-plugins-good ---"
pushd "gst-plugins-good"
if [ $DOBUILD = TRUE ]; then
./autogen.sh || true ## Ignore configuration errors
$MINGW-configure \
--disable-wavpack --disable-valgrind --disable-directsound \
--disable-libcaca --disable-waveform \
--libexec=/usr/$MINGWPATH/sys-root/mingw/libexec \
$CONFIGUREPARAMDEBUG --disable-gtk-doc --disable-examples
printf "all:\ninstall:\nclean:\nuninstall:\n" > tests/Makefile
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_libsrtp()
{
echo "--- 19 --- libsrtp ---"
pushd "libsrtp"
if [ $DOBUILD = TRUE ]; then
$MINGW-configure $DEBUGLIBSRTP
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_gst-plugins-bad()
{
echo "--- 20 --- gst-plugins-bad ---"
pushd "gst-plugins-bad"
if [ $DOBUILD = TRUE ]; then
./autogen.sh || true ## Ignore configuration errors
$MINGW-configure \
--disable-directsound --disable-direct3d $CONFIGUREPARAMDEBUG \
--disable-examples --disable-gtk-doc --disable-winscreencap \
--disable-winks --disable-wasapi --disable-opencv
sed -i 's/\buint\b/unsigned/g' ext/opencv/gstmotioncells.cpp ## We may need this later
printf "all:\ninstall:\nclean:\nuninstall:\n" > tests/Makefile
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_gst-libav()
{
echo "--- 21 --- gst-libav ---"
pushd "gst-libav"
if [ $DOBUILD = TRUE ]; then
./autogen.sh || true ## Ignore configuration errors
$MINGW-configure $CONFIGUREPARAMDEBUG
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_gst-plugins-ugly()
{
echo "--- 22 --- gst-plugins-ugly ---"
pushd "gst-plugins-ugly"
if [ $DOBUILD = TRUE ]; then
./autogen.sh || true ## Ignore configuration errors
$MINGW-configure \
--libexec=/usr/$MINGWPATH/sys-root/mingw/libexec \
$CONFIGUREPARAMDEBUG --disable-gtk-doc --disable-examples
$MINGW-make
fi
if [ $DOINSTALL = TRUE ]; then
sudo $MINGW-make install
fi
popd
}
build_openssl()
{
echo "--- 23 --- openssl ---"
pushd "openssl"
unset CC
if [ $DOBUILD = TRUE ]; then
#./Configure shared --cross-compile-prefix=$MINGWPATH- $DEBUGOPENSSL $MINGWP1
./Configure shared no-sse2 --cross-compile-prefix=$MINGWPATH- $DEBUGOPENSSL $MINGWP1
#./Configure shared 386 --cross-compile-prefix=$MINGWPATH- $DEBUGOPENSSL $MINGWP1
$MINGW-make depend
$MINGW-make
if [ $MINGW = mingw64 ]; then
cp libeay32.dll libcrypto-10-no-sse.dll
#cp libcrypto-3-x64.dll libcrypto-10.dll
#cp libssl-3-x64.dll libssl-10.dll
else
cp libeay32.dll libcrypto-10-no-sse.dll
#cp ssleay32.dll libssl-10.dll
fi
fi
#if [ $DOINSTALL = TRUE ]; then
#sudo $MINGW-make install
#fi
popd
}
# array of repo URL's and related tags
repos ()
{
cat <<EOF
https://github.com/ESTOS/kms-cmake-utils.git d408e638eaabffdb09c508813706abcd52c88cbf
https://github.com/ESTOS/kurento-module-creator.git 422d3f3f91cd875af93713c1f71037cb6e9e0d85
https://github.com/ESTOS/gstreamer.git 28c20b94242ddc014d098fd2124c7fd71f0ae1fd
https://github.com/ESTOS/gst-plugins-base.git 0a2d80755aef80670b9ab8fc66b3dd7ae1e68597
https://github.com/ESTOS/jsoncpp.git 79efbfde69a285caca20b494a0f94b0528847088
https://github.com/ESTOS/kms-jsonrpc.git ae5ae3184a41a293eb91e8c8a329dbc12b980411
https://github.com/ESTOS/libvpx.git a90944ce794986d8c0daab1449903909ba1956a7
https://github.com/ESTOS/kms-core.git e637da1144500061d27bbfaea2806def6aea266d
https://github.com/ESTOS/libevent.git ba78ba9e8ba4c964dd5d14a281d7421c95d37937
https://github.com/ESTOS/kurento-media-server.git d9e73c6f5b940dc10c9f99202fc666fe8fd05256
https://github.com/ESTOS/usrsctp.git ee2c72bc0cd58de72f662902826e7661794f5e6e
https://github.com/ESTOS/openwebrtc-gst-plugins.git 079ccd07956a33c8c5bcca1c1a39cc19b8167370
https://github.com/ESTOS/libnice.git 84ace21d75c4e3a6165a6aa71763588ca6e2b4a7
https://github.com/ESTOS/kms-elements.git ca6e135096e98ec1ccf9ecfecef29af7dbd9737e
https://github.com/ESTOS/opencv.git d68e3502278d6fc5a1de0ce8f7951d9961b20913
https://github.com/ESTOS/kms-filters.git 9a593d16e0899708101e8e8c1c66df2d7fe1a1cb
https://github.com/ESTOS/gst-plugins-good.git da48327c8d6b77bbdc8fd897de9289cbb17da7c0
https://github.com/ESTOS/libsrtp.git 5ec1baa78cd35b88bfbb2b0600a0f8262f3cf20b
https://github.com/ESTOS/gst-plugins-bad.git ce2dcb310f2fb80fabf0024052f3a56c9ac42f53
https://github.com/ESTOS/glib.git b92bcfb3685a9999a8fad4cd7a2d6c10a133d859
https://github.com/ESTOS/gst-libav.git 493eee49c7171e7fc0bf0110e30d445ba573dc5e
https://github.com/ESTOS/gst-plugins-ugly.git 2685b0f252bf0ed6aa27a5c69e82e05289346ff1
https://github.com/ESTOS/openssl.git 12ad22dd16ffe47f8cde3cddb84a160e8cdb3e30
EOF
}
setup_workspace()
{
set +e #dont stop on error
set -x #print all executed command
local url tag rname ldir
# split url, local dir, and tag
repos | while read url tag; do
#url=${i%\!*}
#tag=${i#*\!}
rname=${url##*/}
ldir=${rname%.git}
# checkout/update workspace
mkdir -p "$ldir"
pushd "$ldir"
if [ -d .git ]; then
if [ "$url" == "$(git remote get-url origin)" ]; then
# workspace exists -> fetching latest data
git fetch --all
else
# unknown/wrong workspace -> cleanup
echo "wrong repository"
#rm -rf ./.git ./*
exit
fi
fi
if [ ! -d .git ]; then
git clone "$url" .
fi
git checkout "$tag"
popd
done
}
build()
{
set -e #stop on error
set -x #print all executed command
build_kms-cmake-utils
getcmakemodules
build_glib
build_kurento-module-creator
build_gstreamer
build_gst-plugins-base
build_jsoncpp
build_kms-jsonrpc
build_libvpx
build_kms-core
build_libevent
build_kurento-media-server
build_usrsctp
build_openwebrtc-gst-plugins
build_libnice
build_kms-elements
build_opencv
build_kms-filters
build_gst-plugins-good
build_libsrtp
build_gst-plugins-bad
#build_gst-libav
#build_gst-plugins-ugly
build_openssl
}
case "$1" in
setup)
setup_workspace
;;
buildonlyinstall)
DOINSTALL=TRUE
DOBUILD=FALSE
build
;;
buildnoinstall)
DOINSTALL=FALSE
DOBUILD=TRUE
build
;;
build)
build
;;
buildlog)
build > logbuildmain.txt 2>&1
;;
buildalllog)
setup_workspace > logbuildmain.txt 2>&1
build >> logbuildmain.txt 2>&1
;;
build_*)
build_kms-cmake-utils
getcmakemodules
set -x #print all executed command
$1
;;
all)
build
;;
*)
build_kms-cmake-utils > /dev/null 2>&1
getcmakemodules > /dev/null 2>&1
echo ""
echo "Usage:"
echo " setup -> clones all components"
echo " buildonlyinstall -> install without build"
echo " buildnoinstall -> build without install"
echo " build -> build"
echo " buildlog -> build + log to logbuildmain.txt"
echo " buildalllog -> setup + build + log to logbuildmain.txt"
echo " build_* -> build selected component"
echo " all -> build"
echo "Environment:"
echo " CMAKEPATH $cmakemodules"
echo ""
;;
esac