diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-07-14 14:47:25 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-07-16 12:25:39 +0100 |
commit | fc394fca876e5e3ebf6fc4f5d4432927f80745eb (patch) | |
tree | ac63beee5f64234f1209b8f79c00bef45273bb51 | |
parent | 60796ee4c7bcf45e1da341e85266b99871da5350 (diff) |
ci: Add simple-cam build test
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rwxr-xr-x | 60-simple-cam.sh | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/60-simple-cam.sh b/60-simple-cam.sh new file mode 100755 index 0000000..2dab9cf --- /dev/null +++ b/60-simple-cam.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +# SPDX-License-Identifier: GPL-2.0-or-later +# +# Compile test builder. +# +# Call a meson/ninja build with all combinations of gcc/clang identifyied in +# the path using compgen. Builds are left in tree, allowing incremental builds +# on each call. + +source ./common.sh + +# Simple Cam builds against a libcamera BUILD directory... +LIBCAMERA_BUILD=${1:-"$(builddir coverity)"} +LIBCAMERA=$LIBCAMERA_BUILD/source/ + +ID=simple-cam +SIMPLECAM=$(srcdir simple-cam) +SIMPLECAM_REPO=https://git.libcamera.org/libcamera/simple-cam.git + +check_version $LIBCAMERA $ID + +echo "Build latest simple-cam for libcamera at version : " $(libcamera_version "$LIBCAMERA") + +#### Building and compiling + +function update_sources() { + if [ ! -d $SIMPLECAM ]; then + git clone https://git.libcamera.org/libcamera/simple-cam.git $SIMPLECAM + fi + + echo Using: $LIBCAMERA_BUILD + + git -C $SIMPLECAM pull --ff-only +} + +function build() { + LIBCAMERA_BUILD=$(realpath -L $LIBCAMERA_BUILD/meson-uninstalled/) + + # Always build apps from clean + BUILDDIR="$(builddir $ID)" + rm -fr "$BUILDDIR" + + PKG_CONFIG_PATH=$LIBCAMERA_BUILD \ + meson "$BUILDDIR" "$SIMPLECAM" + + ninja -C "$BUILDDIR" + ret=$? + + return $ret +} + +logfile=$(log_filename $ID) + +update_sources > $logfile +build >> $logfile +pass_fail $? "simple-cam:" + +completed $ID + |