forked from zoff99/zanavi_maptool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
117 lines (103 loc) · 6.63 KB
/
circle.yml
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
machine:
timezone:
Europe/Berlin
environment:
ZANAVI_VERSION_HASH: f5937abeb406d37d3fd6b9f805ae6a448ffe7063
_MT_BUILDDIR: /home/ubuntu/maptool_build
_MT_RUNDIR: /home/ubuntu/maptool_run
_MT_MEM: 3000
###############################
# build type:
#
# 0 -> *not used now*
# 1 -> build
# 3 -> build + run-tests
#
_BUILD_TYPE_: 3
###############################
###############################
# build variant:
#
# 0 -> *not used now*
# 1 -> release
# 2 -> debug
#
_BUILD_VARIANT_: 2
###############################
dependencies:
pre:
### ------- DO NOT EDIT -------
### ------- scripts for _BUILD_TYPE_ type check -------
- echo 'if [ $_BUILD_TYPE_ -lt 1 ]; then echo "=BT=:SKIP [""$_BUILD_TYPE_""]" ; exit 0 ; else echo "=BT=:""$_BUILD_TYPE_" ; fi' > ~/_bt1 ; chmod a+rx ~/_bt1
- echo 'if [ $_BUILD_TYPE_ -lt 2 ]; then echo "=BT=:SKIP [""$_BUILD_TYPE_""]" ; exit 0 ; else echo "=BT=:""$_BUILD_TYPE_" ; fi' > ~/_bt2 ; chmod a+rx ~/_bt2
- echo 'if [ $_BUILD_TYPE_ -lt 3 ]; then echo "=BT=:SKIP [""$_BUILD_TYPE_""]" ; exit 0 ; else echo "=BT=:""$_BUILD_TYPE_" ; fi' > ~/_bt3 ; chmod a+rx ~/_bt3
- echo 'if [ $_BUILD_TYPE_ -gt 1 ]; then echo "=BT=:SKIP [""$_BUILD_TYPE_""]" ; exit 0 ; else echo "=BT=:""$_BUILD_TYPE_" ; fi' > ~/_xbt1 ; chmod a+rx ~/_xbt1
- echo 'if [ $_BUILD_TYPE_ -gt 2 ]; then echo "=BT=:SKIP [""$_BUILD_TYPE_""]" ; exit 0 ; else echo "=BT=:""$_BUILD_TYPE_" ; fi' > ~/_xbt2 ; chmod a+rx ~/_xbt2
- echo 'if [ $_BUILD_TYPE_ -gt 3 ]; then echo "=BT=:SKIP [""$_BUILD_TYPE_""]" ; exit 0 ; else echo "=BT=:""$_BUILD_TYPE_" ; fi' > ~/_xbt3 ; chmod a+rx ~/_xbt3
- wget 'https://raw.githubusercontent.com/zoff99/android_sdk_install_wrapper/master/__sdk_update__.sh' -O ~/__sdk_update__.sh
- chmod a+rx ~/__sdk_update__.sh
- printf '#! /bin/bash\n pgrep -l "$1"\n kill -9 $(pgrep "$1" | grep -v ^$$\$)\n pgrep -l -f "$1"\n' > ~/pkill2.sh
- chmod a+rx ~/pkill2.sh
### ------- scripts for _BUILD_TYPE_ type check -------
### ------- DO NOT EDIT -------
- sudo apt-get update
- sudo apt-get install libpng12-dev
- sudo apt-get install g++
- sudo apt-get install gettext
- sudo apt-get install libsaxonb-java
- sudo apt-get install lib32stdc++6
- sudo apt-get install lib32z1
- sudo apt-get install zip
- sudo apt-get install bc
- sudo apt-get install mtools
- sudo apt-get install libmagickcore5 ; exit 0
- sudo apt-get install perlmagick ; exit 0
- sudo apt-get install liblwp-useragent-determined-perl
- sudo apt-get install autoconf
- sudo apt-get install telnet
- sudo apt-get install qrencode
- sudo apt-get install automake1.11
- git clone https://github.com/jandegr/zanavi
- cd zanavi; git checkout "$ZANAVI_VERSION_HASH"
- cd zanavi; ls -al
- mkdir -p "$_MT_BUILDDIR"
- mkdir -p "$_MT_RUNDIR"
compile:
override:
- cd "$_MT_BUILDDIR" && rm -Rf *
- echo "$_BUILD_VARIANT_"
- if [ "$_BUILD_VARIANT_""x" == "2x" ]; then export CFLAGS=" -finline-limit=1 -fkeep-inline-functions -O0 -DNO_GTYPES_ -DPLUGSSS -g -DONLY_C_BORDER -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -ldl -lpthread "; export CFLAGS=" -DNAVIT_TRANS_LAT_LON_GEO_NOFUNCS -DMAPTOOL ""$CFLAGS" ; echo -n 'export CFLAGS="' > ~/cflags.txt ; echo "$CFLAGS"'"' >> ~/cflags.txt ; else export CFLAGS=" -O2 -DONLY_C_BORDER -D_FILE_OFFSET_BITS=64 -DNO_GTYPES_ -DPLUGSSS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -lpthread -ldl " ; export CFLAGS=" -DNAVIT_TRANS_LAT_LON_GEO_NOFUNCS -DMAPTOOL ""$CFLAGS" ; echo -n 'export CFLAGS="' > ~/cflags.txt ; echo "$CFLAGS"'"' >> ~/cflags.txt ; fi
- cat ~/cflags.txt
- cd "$_MT_BUILDDIR" ; . ~/cflags.txt ; export CC="gcc" ; export CXX="g++" ; ~/zanavi_maptool/zanavi/configure --disable-samplemap --disable-graphics --disable-graphics-gtk-drawing-area --disable-graphics-opengl --disable-svg --disable-svg2png --disable-binding-python --disable-fastmath --disable-gui-gtk --disable-gui-win32 --disable-gui-qml --disable-gui-internal
- echo '' > /home/ubuntu/zanavi_maptool/zanavi/navit/coffeecatch.c
- echo '' > /home/ubuntu/zanavi_maptool/zanavi/navit/coffeejni.c
- sudo ln -sf /usr/include/freetype2 /usr/include/freetype
#- sed -i -e 's#type_ramp#9999999#' /home/ubuntu/zanavi_maptool/zanavi/navit/maptool/ch.c
#- sed -i -e 's#type_ramp#9999999#' /home/ubuntu/zanavi_maptool/zanavi/navit/maptool/misc.c
- cd "$_MT_BUILDDIR" ; . ~/cflags.txt ; export CC="gcc" ; export CXX="g++" ; cd navit && make && make version.h
- cd "$_MT_BUILDDIR" ; . ~/cflags.txt ; export CC="gcc" ; export CXX="g++" ; cd navit/maptool && make
- cd "$_MT_BUILDDIR" ; cd navit/maptool ; ldd maptool
- cd "$_MT_BUILDDIR" ; cd navit/maptool ; ls -al maptool
- cd "$_MT_BUILDDIR" ; cd navit/maptool ; cp -v maptool $CIRCLE_ARTIFACTS/
- cd "$_MT_BUILDDIR" ; cd navit/maptool ; ./maptool ; exit 0
- cd "$_MT_BUILDDIR" ; cd navit/maptool ; gcc --static -static -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -lpthread -Wall -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE -o maptool_linux64_static maptool.o -lglib-2.0 .libs/libmaptool.a -lgthread-2.0 -lgmodule-2.0 -ldl -lrt -lz ../.libs/libnavit.a -pthread -lgthread-2.0 -lrt -lglib-2.0 -pthread -lgmodule-2.0 -lrt -lglib-2.0 -lz p2t/.libs/libp2tc.a refine/.libs/libp2tc-refine.a libcfu-0.03-zanavi/src/libcfu.a -lm -lcrypto -ldl
- cd "$_MT_BUILDDIR" ; cd navit/maptool ; ls -al maptool_linux64_static
- cd "$_MT_BUILDDIR" ; cd navit/maptool ; ldd maptool_linux64_static ; exit 0
- cd "$_MT_BUILDDIR" ; cd navit/maptool ; cp -v maptool_linux64_static $CIRCLE_ARTIFACTS/
- cd "$_MT_BUILDDIR" ; cd navit/maptool ; ./maptool_linux64_static ; exit 0
test:
override:
- . ~/_bt3; wget http://download.geofabrik.de/europe/belgium-latest.osm.bz2 -O ~/testmap.osm.bz2
- . ~/_bt3; cd "$_MT_RUNDIR" ; bzcat ~/testmap.osm.bz2 | "$_MT_BUILDDIR"/navit/maptool/maptool -o runtimes.sqlite -k -n -U -S "$_MT_MEM""000000" testmap.bin
- ls -al "$_MT_RUNDIR"
- ls -alR "$_MT_RUNDIR"
- ls -al "$_MT_RUNDIR"/testmap.bin
- ls -alh "$_MT_RUNDIR"/testmap.bin
- unzip -t "$_MT_RUNDIR"/testmap.bin ; exit 0 # just for a crude basic test, maps are not really zip-files!
- mkdir -p $CIRCLE_ARTIFACTS/maps/
- cp -v "$_MT_RUNDIR"/testmap.bin $CIRCLE_ARTIFACTS/maps/
# ------ cleanup -------------
- mkdir $CIRCLE_ARTIFACTS/job_logs
- mv -v $CIRCLE_ARTIFACTS/stderr_circle_*.txt $CIRCLE_ARTIFACTS/job_logs/ ; exit 0
- mv -v $CIRCLE_ARTIFACTS/stdout_circle_*.txt $CIRCLE_ARTIFACTS/job_logs/ ; exit 0
# ------ cleanup -------------