diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1d17dae --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.venv diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..dffeeba --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: + - repo: local + hooks: + - id: compatible-machine-check + name: Ensure COMPATIBLE_MACHINE in .bb files + entry: hooks/pre-commit.d/10-compatible-machine.sh + language: system + pass_filenames: false + stages: [pre-commit] + files: \.bb$ diff --git a/README.md b/README.md index 58ad779..c9706ec 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,19 @@ If you maintain `bblayers.conf` manually, append: BBLAYERS += "${TOPDIR}/../meta-ridgerun" ``` +Git Hooks +--------- +This layer uses the `pre-commit` framework. Current checks: +- `10-compatible-machine.sh`: verifies each staged `.bb` file defines `COMPATIBLE_MACHINE`. + +Install `pre-commit` and enable hooks from the `meta-ridgerun` repository root: +``` +pip install pre-commit +pre-commit install --hook-type pre-commit --install-hooks +``` + +To add new validations, add a new executable script under `hooks/pre-commit.d/` and register it in `.pre-commit-config.yaml`. + Customer repositories --------------------- Proprietary plugins in this layer fetch from private RidgeRun GitLab paths under `git@gitlab.ridgerun.com/ridgerun/orders/${RR_CUSTOMER_GITLAB_ORDER_DIR}`. Set the directory you were given in one of these ways (prefer `conf/local.conf`): diff --git a/hooks/pre-commit.d/10-compatible-machine.sh b/hooks/pre-commit.d/10-compatible-machine.sh new file mode 100755 index 0000000..5401fb1 --- /dev/null +++ b/hooks/pre-commit.d/10-compatible-machine.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash + +## meta-ridgerun pre-commit hook: COMPATIBLE_MACHINE check +## Copyright 2026 RidgeRun, LLC (http://www.ridgerun.com) +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions are +## met: +## +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## +## 3. Neither the name of the copyright holder nor the names of its +## contributors may be used to endorse or promote products derived from +## this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +## HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +set -euo pipefail + +bb_files="$(git diff --cached --name-only --diff-filter=ACMR | grep -E '\.bb$' || true)" + +[ -z "${bb_files}" ] && exit 0 + +missing=() +while IFS= read -r file; do + [ -z "${file}" ] && continue + if ! git show ":${file}" | grep -Eq '^[[:space:]]*COMPATIBLE_MACHINE([[:alnum:]_:-]*)?[[:space:]]*([?+]?=)'; then + missing+=("${file}") + fi +done <<< "${bb_files}" + +if [ ${#missing[@]} -gt 0 ]; then + echo "ERROR: COMPATIBLE_MACHINE is missing in the following staged .bb files:" + for file in "${missing[@]}"; do + echo " - ${file}" + done + echo "Add COMPATIBLE_MACHINE before committing." + exit 1 +fi + +exit 0 diff --git a/recipes-multimedia/gstreamer/gst-emboverlay.bb b/recipes-multimedia/gstreamer/gst-emboverlay.bb index af1ae46..ef9c508 100644 --- a/recipes-multimedia/gstreamer/gst-emboverlay.bb +++ b/recipes-multimedia/gstreamer/gst-emboverlay.bb @@ -5,6 +5,7 @@ SECTION = "multimedia" LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://COPYING;md5=1887e8dfc90a84423fd31d1d45ee6718" +COMPATIBLE_MACHINE = ".*" DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base cairo" diff --git a/recipes-multimedia/gstreamer/gst-interpipes.bb b/recipes-multimedia/gstreamer/gst-interpipes.bb index 98cd5f8..2eff42e 100644 --- a/recipes-multimedia/gstreamer/gst-interpipes.bb +++ b/recipes-multimedia/gstreamer/gst-interpipes.bb @@ -4,6 +4,7 @@ HOMEPAGE = "https://developer.ridgerun.com/wiki/index.php?title=GstInterpipe" SECTION = "multimedia" LICENSE = "LGPL2.1" LIC_FILES_CHKSUM = "file://COPYING;md5=3191ae9476980e87e3494d2d8ebe4584" +COMPATIBLE_MACHINE = ".*" # Base dependencies DEPENDS = " \ diff --git a/recipes-multimedia/gstreamer/gst-isp.bb b/recipes-multimedia/gstreamer/gst-isp.bb index 6ea79d6..d8e20c2 100644 --- a/recipes-multimedia/gstreamer/gst-isp.bb +++ b/recipes-multimedia/gstreamer/gst-isp.bb @@ -4,6 +4,7 @@ HOMEPAGE = "https://www.ridgerun.com/gstisp" SECTION = "multimedia" LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://COPYING;md5=46819161aba98ab8c502e93a15713e58" +COMPATIBLE_MACHINE = "(imx-nxp-bsp)" DEPENDS = " \ gstreamer1.0 \ diff --git a/recipes-multimedia/gstreamer/gst-motion-detect.bb b/recipes-multimedia/gstreamer/gst-motion-detect.bb index 9559965..2562d2d 100644 --- a/recipes-multimedia/gstreamer/gst-motion-detect.bb +++ b/recipes-multimedia/gstreamer/gst-motion-detect.bb @@ -4,7 +4,8 @@ HOMEPAGE = "https://developer.ridgerun.com/wiki/index.php?title=Camera_Based_Mot SECTION = "multimedia" LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://COPYING;md5=46819161aba98ab8c502e93a15713e58" +LIC_FILES_CHKSUM = "file://COPYING;md5=152bda62bf553a99a8aff727654bb4c7" +COMPATIBLE_MACHINE = ".*" DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base glib-2.0 glibc" diff --git a/recipes-multimedia/gstreamer/gst-opencl.bb b/recipes-multimedia/gstreamer/gst-opencl.bb index 594b5a9..f3c5ba6 100644 --- a/recipes-multimedia/gstreamer/gst-opencl.bb +++ b/recipes-multimedia/gstreamer/gst-opencl.bb @@ -4,6 +4,7 @@ HOMEPAGE = "https://www.ridgerun.com/post/gstreamer-opencl-accelerated-isp" SECTION = "multimedia" LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://COPYING;md5=46819161aba98ab8c502e93a15713e58" +COMPATIBLE_MACHINE = "(imx-nxp-bsp)" DEPENDS = " \ gstreamer1.0 \ diff --git a/recipes-multimedia/gstreamer/gst-perf.bb b/recipes-multimedia/gstreamer/gst-perf.bb index d7f8bee..3d6f7a5 100644 --- a/recipes-multimedia/gstreamer/gst-perf.bb +++ b/recipes-multimedia/gstreamer/gst-perf.bb @@ -4,6 +4,7 @@ HOMEPAGE = "https://github.com/RidgeRun/gst-perf-autotools" SECTION = "multimedia" LICENSE = "LGPLv2" LIC_FILES_CHKSUM="file://LICENSE;md5=5f30f0716dfdd0d91eb439ebec522ec2" +COMPATIBLE_MACHINE = ".*" DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad" diff --git a/recipes-multimedia/gstreamer/gst-prerecord.bb b/recipes-multimedia/gstreamer/gst-prerecord.bb index 51a85f5..9183420 100644 --- a/recipes-multimedia/gstreamer/gst-prerecord.bb +++ b/recipes-multimedia/gstreamer/gst-prerecord.bb @@ -5,6 +5,7 @@ SECTION = "multimedia" LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://COPYING;md5=1887e8dfc90a84423fd31d1d45ee6718" +COMPATIBLE_MACHINE = ".*" DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base libffi" diff --git a/recipes-multimedia/gstreamer/gst-qt-overlay.bb b/recipes-multimedia/gstreamer/gst-qt-overlay.bb index c77a62f..7cb3006 100644 --- a/recipes-multimedia/gstreamer/gst-qt-overlay.bb +++ b/recipes-multimedia/gstreamer/gst-qt-overlay.bb @@ -3,6 +3,7 @@ DESCRIPTION = "GStreamer element used to overlay QML files over video streams" SECTION = "multimedia" LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://COPYING;md5=2282fc857e14ce7b17c1c9d810504ac5" +COMPATIBLE_MACHINE = ".*" DEPENDS = " \ gstreamer1.0 \ diff --git a/recipes-multimedia/gstreamer/gst-rtsp-sink.bb b/recipes-multimedia/gstreamer/gst-rtsp-sink.bb index ac0be07..9b31255 100644 --- a/recipes-multimedia/gstreamer/gst-rtsp-sink.bb +++ b/recipes-multimedia/gstreamer/gst-rtsp-sink.bb @@ -4,6 +4,7 @@ HOMEPAGE = "https://developer.ridgerun.com/wiki/index.php?title=GstRtspSink" SECTION = "multimedia" LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://COPYING;md5=1887e8dfc90a84423fd31d1d45ee6718" +COMPATIBLE_MACHINE = ".*" DEPENDS = " \ gstreamer1.0 \ diff --git a/recipes-multimedia/gstreamer/gst-sei.bb b/recipes-multimedia/gstreamer/gst-sei.bb index cbd7a7b..2b7dc0e 100644 --- a/recipes-multimedia/gstreamer/gst-sei.bb +++ b/recipes-multimedia/gstreamer/gst-sei.bb @@ -4,6 +4,7 @@ HOMEPAGE = "https://www.ridgerun.com/gstseimetadata" SECTION = "multimedia" LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://COPYING;md5=2207b8e5f4ab4b3a0c794e43f2002ea3" +COMPATIBLE_MACHINE = ".*" DEPENDS = " \ diff --git a/recipes-multimedia/gstreamer/gst-shark.bb b/recipes-multimedia/gstreamer/gst-shark.bb index e5bf550..a0640f3 100644 --- a/recipes-multimedia/gstreamer/gst-shark.bb +++ b/recipes-multimedia/gstreamer/gst-shark.bb @@ -5,6 +5,7 @@ SECTION = "multimedia" LICENSE = "GPL-2.0-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=e1caa368743492879002ad032445fa97" +COMPATIBLE_MACHINE = ".*" DEPENDS = " \ gstreamer1.0 \ diff --git a/recipes-multimedia/gstreamer/gstd.bb b/recipes-multimedia/gstreamer/gstd.bb index 6b8ffe5..6f5d09d 100644 --- a/recipes-multimedia/gstreamer/gstd.bb +++ b/recipes-multimedia/gstreamer/gstd.bb @@ -4,6 +4,7 @@ HOMEPAGE = "https://developer.ridgerun.com/wiki/index.php?title=Gstd-1.0" SECTION = "multimedia" LICENSE = "LGPL-2.1-or-later" LIC_FILES_CHKSUM = "file://COPYING;md5=c71b653a0f608a58cdc5693ae57126bc" +COMPATIBLE_MACHINE = ".*" DEPENDS = " \ gstreamer1.0 \