From d921ee2245b5d39342e932db283bced7462497ce Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 18 Nov 2020 15:53:01 +0100 Subject: [PATCH] ci: check if all plugins are installed with meson Will prevent us to forget adding new plugins to meson. --- .gitlab-ci.yml | 5 +++-- ci/check-plugins-installed.py | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100755 ci/check-plugins-installed.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 36798057..17f95564 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -153,8 +153,9 @@ test nightly: meson shared: extends: .img-stable script: - - meson build --default-library=shared - - ninja -C build + - meson build --default-library=shared --prefix=$(pwd)/install + - ninja -C build install + - ./ci/check-plugins-installed.py install rules: - if: '$UPDATE_IMG == null || $UPDATE_IMG == "stable"' diff --git a/ci/check-plugins-installed.py b/ci/check-plugins-installed.py new file mode 100755 index 00000000..8284ace7 --- /dev/null +++ b/ci/check-plugins-installed.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 +# Check that all available plugins have been build and installed in the prefix +# directory passed in argument. +import sys +import os +import glob + +DIRS = ['audio', 'generic', 'net', 'text', 'utils', 'video'] +OVERRIDE = {'wrap': 'textwrap', 'flavors': 'rsflv'} + +prefix = sys.argv[1] + +plugins = glob.glob(os.path.join( + prefix, '**', 'gstreamer-1.0', '*.so'), recursive=True) +plugins = list(map(os.path.basename, plugins)) +print("Built plugins:", plugins) + +success = True + +for d in DIRS: + for name in os.listdir(d): + name = OVERRIDE.get(name, name) + + plugin = "libgst{}.so".format(name) + # Some plugins are prefixed with 'rs' + rs_plugin = "libgstrs{}.so".format(name) + + if plugin not in plugins and rs_plugin not in plugins: + print(name, "missing in", prefix) + success = False + +if not success: + sys.exit(1)