Skip to content

Commit 06b7494

Browse files
sobucherhankur
authored andcommitted
.gitlab: install libjim for build jobs
1 parent 4e90511 commit 06b7494

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

.gitlab/ci/build.yml

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,18 @@
8080
make install
8181
popd
8282

83+
.buildx_jimtcl: &buildx_jimtcl |
84+
export JIMTCL_VER=jimtcl-0.83
85+
wget https://dl.espressif.com/dl/$JIMTCL_VER.tar.gz -O $JIMTCL_VER.tar.gz
86+
tar xzf $JIMTCL_VER.tar.gz && rm $JIMTCL_VER.tar.gz
87+
pushd $JIMTCL_VER
88+
./configure --prefix="$PWD/dist" --host=${CONF_HOST} --disable-shared CC=${HOST_CC}
89+
make
90+
# Running "make" does not create this file for static builds on Windows but "make install" still expects it
91+
touch build-jim-ext
92+
make install
93+
popd
94+
8395
.buildx_openocd: &buildx_openocd |
8496
./bootstrap
8597
mkdir _build && pushd _build/
@@ -102,7 +114,9 @@
102114
- job: style_check
103115
script:
104116
- *get_release_name
105-
- !reference [.submodules_mirror_update, script]
117+
- export HOST_CC=${CONF_HOST}-gcc
118+
- *buildx_jimtcl
119+
- export PKG_CONFIG_PATH=$PWD/$JIMTCL_VER/dist/lib/pkgconfig
106120
- ./bootstrap
107121
- mkdir _build && pushd _build/
108122
- ../configure CFLAGS="${TEST_CFLAGS}" --prefix=$PWD/../$DIST_INSTALLED_DIR --host=${CONF_HOST} $OPENOCD_CONFIGURE_OPTS $GCOV_BUILD_OPTS
@@ -130,12 +144,12 @@
130144
- job: style_check
131145
script:
132146
- *get_release_name
133-
- !reference [.submodules_mirror_update, script]
134147
- *buildx_libusb
135148
- export OSXCROSS_PKG_CONFIG_PATH=$PWD/$LIBUSB_VER/dist/lib/pkgconfig
136149
- *buildx_hidapi
137150
- *buildx_libjaylink
138-
- export OSXCROSS_PKG_CONFIG_PATH=$PWD/hidapi-$HIDAPI_VER/dist/lib/pkgconfig/:$PWD/$LIBJAYLINK_VER/dist/lib/pkgconfig:$OSXCROSS_PKG_CONFIG_PATH
151+
- *buildx_jimtcl
152+
- export OSXCROSS_PKG_CONFIG_PATH=$PWD/hidapi-$HIDAPI_VER/dist/lib/pkgconfig/:$PWD/$LIBJAYLINK_VER/dist/lib/pkgconfig:$PWD/$JIMTCL_VER/dist/lib/pkgconfig:$OSXCROSS_PKG_CONFIG_PATH
139153
- export LDFLAGS="-Wl,-framework,CoreFoundation -Wl,-framework,IOKit -Wl,-framework,Security"
140154
- *buildx_openocd
141155
- *dist_archive
@@ -157,12 +171,12 @@ build_linux:
157171
- job: style_check
158172
script:
159173
- *get_release_name
160-
- !reference [.submodules_mirror_update, script]
161174
- apt-get update || true
162175
- apt-get install systemd libudev-dev --force-yes -y # needed for hidapi build
163176
- *buildx_hidapi
164177
- *buildx_libjaylink
165-
- export PKG_CONFIG_PATH=$PWD/hidapi-$HIDAPI_VER/dist/lib/pkgconfig/:$PWD/$LIBJAYLINK_VER/dist/lib/pkgconfig
178+
- *buildx_jimtcl
179+
- export PKG_CONFIG_PATH=$PWD/hidapi-$HIDAPI_VER/dist/lib/pkgconfig/:$PWD/$LIBJAYLINK_VER/dist/lib/pkgconfig:$PWD/$JIMTCL_VER/dist/lib/pkgconfig
166180
- ./bootstrap
167181
- mkdir _build
168182
- pushd _build/
@@ -181,8 +195,12 @@ build_linux_gcc_latest:
181195
allow_failure: true
182196
needs:
183197
- job: style_check
198+
variables:
199+
CONF_HOST: ""
200+
HOST_CC: "gcc"
184201
script:
185-
- !reference [.submodules_mirror_update, script]
202+
- *buildx_jimtcl
203+
- export PKG_CONFIG_PATH=$PWD/$JIMTCL_VER/dist/lib/pkgconfig
186204
- ./bootstrap
187205
- ./configure ${OPENOCD_CONFIGURE_OPTS}
188206
- make -j`nproc`
@@ -252,13 +270,13 @@ build_linux_arm64_test:
252270
- job: style_check
253271
script:
254272
- *get_release_name
255-
- !reference [.submodules_mirror_update, script]
256273
- *buildx_libusb
257274
- export PKG_CONFIG_PATH=$PWD/$LIBUSB_VER/dist/lib/pkgconfig
258275
- *buildx_hidapi
259276
- *buildx_libjaylink
277+
- *buildx_jimtcl
260278
- *buildx_zlib
261-
- export PKG_CONFIG_PATH=$PWD/hidapi-$HIDAPI_VER/dist/lib/pkgconfig/:$PWD/$LIBJAYLINK_VER/dist/lib/pkgconfig:$PKG_CONFIG_PATH
279+
- export PKG_CONFIG_PATH=$PWD/hidapi-$HIDAPI_VER/dist/lib/pkgconfig/:$PWD/$LIBJAYLINK_VER/dist/lib/pkgconfig:$PWD/$JIMTCL_VER/dist/lib/pkgconfig:$PKG_CONFIG_PATH
262280
- export LDFLAGS=$ZLIB_LDFLAGS
263281
- *buildx_openocd
264282
- cp $PWD/${ZLIB_VER}/dist/bin/zlib1.dll $DIST_INSTALLED_DIR/bin/
@@ -297,6 +315,8 @@ scan-build:
297315
allow_failure: true
298316
variables:
299317
SCAN_BUILD_OUTPUT: "report"
318+
CONF_HOST: ""
319+
HOST_CC: "gcc"
300320
artifacts:
301321
reports:
302322
codequality:
@@ -305,12 +325,13 @@ scan-build:
305325
- ${SCAN_BUILD_OUTPUT}
306326
when: always
307327
script:
308-
- !reference [.submodules_mirror_update, script]
328+
- *buildx_jimtcl
329+
- export PKG_CONFIG_PATH=$PWD/$JIMTCL_VER/dist/lib/pkgconfig
309330
- ./bootstrap
310331
- mkdir build-scanbuild
311332
- pushd build-scanbuild
312333
- scan-build ../configure
313-
- scan-build -o out make -j`nproc` CFLAGS="-std=gnu99 -I. -I../../jimtcl"
334+
- scan-build -o out make -j`nproc` CFLAGS="-std=gnu99 -I. -I../../${JIMTCL_VER}"
314335
- popd
315336
- ${ARCHIVE_TOOL} scan_build.${ARCHIVE_EXT} build-scanbuild/out
316337
- mkdir -p ${SCAN_BUILD_OUTPUT}
@@ -325,6 +346,8 @@ sparse:
325346
variables:
326347
SPARSE_BUILD_OUTDIR: "sparse"
327348
SPARSE_BUILD_OUTFILE: "warnings.log"
349+
CONF_HOST: ""
350+
HOST_CC: "gcc"
328351
artifacts:
329352
reports:
330353
codequality:
@@ -333,7 +356,8 @@ sparse:
333356
- ${SPARSE_BUILD_OUTDIR}
334357
when: always
335358
script:
336-
- !reference [.submodules_mirror_update, script]
359+
- *buildx_jimtcl
360+
- export PKG_CONFIG_PATH=$PWD/$JIMTCL_VER/dist/lib/pkgconfig
337361
- ./bootstrap
338362
- mkdir build-sparse && pushd build-sparse
339363
- ../configure CC=cgcc CFLAGS="-Wsparse-all -Wno-declaration-after-statement -Wno-unknown-attribute -Wno-transparent-union -Wno-tautological-compare -Wno-vla -Wno-flexible-array-array -D__FLT_EVAL_METHOD__=0"
@@ -357,7 +381,7 @@ build_linux_cmake:
357381
script:
358382
- !reference [.submodules_mirror_update, script]
359383
- mkdir build && cd build
360-
- cmake .. -G Ninja
384+
- cmake .. -D use_internal_jimtcl=ON -G Ninja
361385
- ninja
362386

363387
# TODO: enable after updating CMake version in the docker image

0 commit comments

Comments
 (0)