diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 00000000..15e147c5 --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,83 @@ +name: update recipes + +on: + schedule: + - cron: '10 21 * * 1' + workflow_dispatch: + +jobs: + update: + name: update recipes + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Check out the repository + uses: actions/checkout@v5 + + - name: Configure git + run: | + git config user.email "info@linux-automation.com" + git config user.name "Recipe Updater Bot" + + - name: Create a new branch + run: git checkout -b "update/recipes-$(date +%Y%m%d)" + + - name: Run update script + run: python3 -u tools/update/update.py tools/update/recipes.yaml + + - name: Commit changes to recipes + id: recipe-commit + run: | + git add . + git commit --signoff --message="Recipe updates for $(date +%Y-%m-%d)" + continue-on-error: true + + - name: Update rust dependencies + if: ${{ steps.recipe-commit.outcome == 'success' }} + run: | + # Set up the system for use with bitbake + sudo apt-get install chrpath diffstat + echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns + + # Get meta layers + git submodule init + git submodule update --single-branch --depth 1 + + # Configure bitbake to use pre-built sstate + mkdir -p build/conf + cat < build/conf/auto.conf + # Use the shared sstate cache + SSTATE_MIRRORS = "file://.* https://github-runner.pengutronix.de/sstate-cache/PATH" + + # As long as we do not have a global hash equivalence server running together + # with the sstate mirror, using a (local) hash equivalence server will be + # ineffective as hashes match less often. Disable hash equivalence for now. + BB_SIGNATURE_HANDLER = "OEBasicHash" + BB_HASHSERVE = "" + + # Prefer fast compression over small file size + OPKGBUILDCMD = "opkg-build -Z gzip -a -1n" + EOF + + # Update the -crates.inc files + source oe-init-build-env + bitbake -c update_crates bottom tacd ripgrep + + - name: Commit changes to rust dependencies + if: ${{ steps.recipe-commit.outcome == 'success' }} + run: | + git add . + git commit --signoff --message="Rust crate update for $(date +%Y-%m-%d)" + continue-on-error: true + + - name: Push changes upstream + if: ${{ steps.recipe-commit.outcome == 'success' }} + run: git push --set-upstream origin "$(git branch --show-current)" + + - name: Create pull request + if: ${{ steps.recipe-commit.outcome == 'success' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr create --base "${{ github.ref_name }}" --fill-first diff --git a/meta-lxatac-software/recipes-devtools/github-act-runner/github-act-runner.inc b/meta-lxatac-software/recipes-devtools/github-act-runner/github-act-runner.inc index d1cbb5ea..977e5a26 100644 --- a/meta-lxatac-software/recipes-devtools/github-act-runner/github-act-runner.inc +++ b/meta-lxatac-software/recipes-devtools/github-act-runner/github-act-runner.inc @@ -4,7 +4,7 @@ DESCRIPTION = "Alternative implementation of the GitHub Action runner protocol w GO_IMPORT = "github.com/ChristopherHX/github-act-runner" SRC_URI = " \ - git://${GO_IMPORT};branch=main;protocol=https;destsuffix=${BPN}-${PV}/src/${GO_IMPORT} \ + git://${GO_IMPORT};branch=${SRCBRANCH};protocol=https;destsuffix=${BPN}-${PV}/src/${GO_IMPORT} \ file://github-act-runner.service \ " diff --git a/meta-lxatac-software/recipes-devtools/github-act-runner/github-act-runner_0.12.0.bb b/meta-lxatac-software/recipes-devtools/github-act-runner/github-act-runner_0.12.0.bb index 316e87aa..12b58a4b 100644 --- a/meta-lxatac-software/recipes-devtools/github-act-runner/github-act-runner_0.12.0.bb +++ b/meta-lxatac-software/recipes-devtools/github-act-runner/github-act-runner_0.12.0.bb @@ -1,3 +1,7 @@ +# This file was generated by tools/update/update.py + require github-act-runner.inc +# Git tag v0.12.0 pointing at a commit from 2025-09-12 15:58:57 +0000 +SRCBRANCH = "main" SRCREV = "1636dd12fe3f21f235a673aef773eaf2853b6ce2" diff --git a/meta-lxatac-software/recipes-devtools/gitlab-runner/gitlab-runner_18.5.0.bb b/meta-lxatac-software/recipes-devtools/gitlab-runner/gitlab-runner_18.5.0.bb deleted file mode 100644 index 0392d930..00000000 --- a/meta-lxatac-software/recipes-devtools/gitlab-runner/gitlab-runner_18.5.0.bb +++ /dev/null @@ -1,4 +0,0 @@ -require gitlab-runner.inc - -SRCBRANCH = "18-5-stable" -SRCREV = "bda84871762de5fb1573f4495940e044e8a5a010" diff --git a/meta-lxatac-software/recipes-devtools/gitlab-runner/gitlab-runner_18.6.1.bb b/meta-lxatac-software/recipes-devtools/gitlab-runner/gitlab-runner_18.6.1.bb new file mode 100644 index 00000000..fc5753d4 --- /dev/null +++ b/meta-lxatac-software/recipes-devtools/gitlab-runner/gitlab-runner_18.6.1.bb @@ -0,0 +1,7 @@ +# This file was generated by tools/update/update.py + +require gitlab-runner.inc + +# Git tag v18.6.1 pointing at a commit from 2025-11-20 22:34:41 -0800 +SRCBRANCH = "18-6-stable" +SRCREV = "b5e9c6d04ecb017785f6d475dbc88868c7ff7fc1" diff --git a/meta-lxatac-software/recipes-devtools/qdl/qdl.inc b/meta-lxatac-software/recipes-devtools/qdl/qdl.inc new file mode 100644 index 00000000..33836994 --- /dev/null +++ b/meta-lxatac-software/recipes-devtools/qdl/qdl.inc @@ -0,0 +1,22 @@ +SUMMARY = "Qualcomm DownLoader flashing tool" +DESCRIPTION = "Communicate with Qualcomm SoCs to upload new software or \ +dump memory" +HOMEPAGE = "https://github.com/linux-msm/qdl" +SECTION = "devel" + +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=da6bfde9cb5bc5120a51775381f6edf1" + +DEPENDS = "libxml2 libusb1" + +inherit pkgconfig + +SRC_URI = "git://github.com/linux-msm/${BPN}.git;branch=${SRCBRANCH};protocol=https" + +S = "${WORKDIR}/git" + +do_install () { + oe_runmake install DESTDIR=${D} prefix=${prefix} +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-lxatac-software/recipes-devtools/qdl/qdl_2.2.bb b/meta-lxatac-software/recipes-devtools/qdl/qdl_2.2.bb index 750afa33..ad287ce8 100644 --- a/meta-lxatac-software/recipes-devtools/qdl/qdl_2.2.bb +++ b/meta-lxatac-software/recipes-devtools/qdl/qdl_2.2.bb @@ -1,23 +1,7 @@ -SUMMARY = "Qualcomm DownLoader flashing tool" -DESCRIPTION = "Communicate with Qualcomm SoCs to upload new software or \ -dump memory" -HOMEPAGE = "https://github.com/linux-msm/qdl.git" -SECTION = "devel" +# This file was generated by tools/update/update.py -LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://LICENSE;md5=da6bfde9cb5bc5120a51775381f6edf1" +require qdl.inc -DEPENDS = "libxml2 libusb1" - -inherit pkgconfig - -SRC_URI = "git://github.com/linux-msm/${BPN}.git;branch=master;protocol=https" +# Git tag v2.2 pointing at a commit from 2025-09-08 14:16:39 -0500 +SRCBRANCH = "master" SRCREV = "a601db1868bcda454a77b6769ca9efac3b0a114c" - -S = "${WORKDIR}/git" - -do_install () { - oe_runmake install DESTDIR=${D} prefix=${prefix} -} - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-lxatac-software/recipes-devtools/rkdeveloptool/rkdeveloptool.inc b/meta-lxatac-software/recipes-devtools/rkdeveloptool/rkdeveloptool.inc new file mode 100644 index 00000000..9cfd8c26 --- /dev/null +++ b/meta-lxatac-software/recipes-devtools/rkdeveloptool/rkdeveloptool.inc @@ -0,0 +1,17 @@ +SUMMARY = "Rockchip Development Tool" +DESCRIPTION = "Communicate with the Rockchip Boot ROM to upload new software \ + read/write to memory locations and reset the device." +HOMEPAGE = "https://github.com/rockchip-linux/rkdeveloptool" +SECTION = "devel" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://license.txt;md5=ea9445d9cc03d508cf6bb769d15a54ef" + +SRC_URI = "git://github.com/rockchip-linux/rkdeveloptool.git;protocol=https;branch=${SRCBRANCH} \ + file://0001-Makefile-disable-format-truncation-errors.patch \ + " + +S = "${WORKDIR}/git" + +DEPENDS = "libusb1 udev" + +inherit autotools pkgconfig diff --git a/meta-lxatac-software/recipes-devtools/rkdeveloptool/rkdeveloptool_git.bb b/meta-lxatac-software/recipes-devtools/rkdeveloptool/rkdeveloptool_git.bb index dbca385d..78ddf533 100644 --- a/meta-lxatac-software/recipes-devtools/rkdeveloptool/rkdeveloptool_git.bb +++ b/meta-lxatac-software/recipes-devtools/rkdeveloptool/rkdeveloptool_git.bb @@ -1,20 +1,7 @@ -SUMMARY = "Rockchip Development Tool" -DESCRIPTION = "Communicate with the Rockchip Boot ROM to upload new software \ - read/write to memory locations and reset the device." -HOMEPAGE = "https://github.com/rockchip-linux/rkdeveloptool" -SECTION = "devel" -LICENSE = "GPL-2.0-only" -LIC_FILES_CHKSUM = "file://license.txt;md5=ea9445d9cc03d508cf6bb769d15a54ef" +# This file was generated by tools/update/update.py -SRC_URI = "git://github.com/rockchip-linux/rkdeveloptool.git;protocol=https;branch=master \ - file://0001-Makefile-disable-format-truncation-errors.patch \ - " +require rkdeveloptool.inc -SRCREV = "46bb4c073624226c3f05b37b9ecc50bbcf543f5a" -PV = "1.32+git" - -S = "${WORKDIR}/git" - -DEPENDS = "libusb1 udev" - -inherit autotools pkgconfig +# Commit 304f073752fd25c854e1bcf05d8e7f925b1f4e14 created 2025-03-07 15:34:30 +0800 +SRCBRANCH = "master" +SRCREV = "304f073752fd25c854e1bcf05d8e7f925b1f4e14" diff --git a/meta-lxatac-software/recipes-graphics/panel-mipi-dbi/panel-mipi-dbi-native_git.bbappend b/meta-lxatac-software/recipes-graphics/panel-mipi-dbi/panel-mipi-dbi-native_git.bbappend new file mode 100644 index 00000000..c21ee95a --- /dev/null +++ b/meta-lxatac-software/recipes-graphics/panel-mipi-dbi/panel-mipi-dbi-native_git.bbappend @@ -0,0 +1,5 @@ +# This file was generated by tools/update/update.py + +# Commit 1cbd40135a8c7f25d7b444a7fac77fd3c3ad471e created 2024-10-29 10:51:22 +0100 +SRCBRANCH = "main" +SRCREV = "1cbd40135a8c7f25d7b444a7fac77fd3c3ad471e" diff --git a/meta-lxatac-software/recipes-rust/bottom/bottom.inc b/meta-lxatac-software/recipes-rust/bottom/bottom.inc new file mode 100644 index 00000000..d63b81b5 --- /dev/null +++ b/meta-lxatac-software/recipes-rust/bottom/bottom.inc @@ -0,0 +1,21 @@ +inherit cargo cargo-update-recipe-crates + +SRC_URI += "git://github.com/ClementTsang/bottom.git;protocol=https;branch=${SRCBRANCH}" +S = "${WORKDIR}/git" +CARGO_SRC_DIR = "" + +# The bottom Cargo.toml strips release builds, why makes it hard to debug. +# Yocto has its own stripping feature, that preserves the debug symbols but +# only installs the stripped version. +# Pre-stripped binaries trigger a yocto QA error. +CARGO_BUILD_FLAGS += "--config profile.release.strip=false" + +LIC_FILES_CHKSUM = " \ + file://LICENSE;md5=5d45cffa3a75da17d285cc60c0c458cc \ +" + +SUMMARY = "A customizable cross-platform graphical process/system monitor for the terminal. Supports Linux, macOS, and Windows." +HOMEPAGE = "https://github.com/ClementTsang/bottom" +LICENSE = "MIT" + +require bottom-crates.inc diff --git a/meta-lxatac-software/recipes-rust/bottom/bottom_0.10.2.bb b/meta-lxatac-software/recipes-rust/bottom/bottom_0.10.2.bb index 38872035..63cc3234 100644 --- a/meta-lxatac-software/recipes-rust/bottom/bottom_0.10.2.bb +++ b/meta-lxatac-software/recipes-rust/bottom/bottom_0.10.2.bb @@ -1,22 +1,7 @@ -inherit cargo cargo-update-recipe-crates +# This file was generated by tools/update/update.py -SRC_URI += "git://github.com/ClementTsang/bottom.git;protocol=https;branch=main" -SRCREV = "2ec1fb56c9db0b37acc4eca3230adfb52720376b" -S = "${WORKDIR}/git" -CARGO_SRC_DIR = "" - -# The bottom Cargo.toml strips release builds, why makes it hard to debug. -# Yocto has its own stripping feature, that preserves the debug symbols but -# only installs the stripped version. -# Pre-stripped binaries trigger a yocto QA error. -CARGO_BUILD_FLAGS += "--config profile.release.strip=false" - -LIC_FILES_CHKSUM = " \ - file://LICENSE;md5=5d45cffa3a75da17d285cc60c0c458cc \ -" +require bottom.inc -SUMMARY = "A customizable cross-platform graphical process/system monitor for the terminal. Supports Linux, macOS, and Windows." -HOMEPAGE = "https://github.com/ClementTsang/bottom" -LICENSE = "MIT" - -require bottom-crates.inc +# Git tag 0.10.2 pointing at a commit from 2024-08-05 20:28:17 -0400 +SRCBRANCH = "main" +SRCREV = "2ec1fb56c9db0b37acc4eca3230adfb52720376b" diff --git a/meta-lxatac-software/recipes-rust/ripgrep/ripgrep.inc b/meta-lxatac-software/recipes-rust/ripgrep/ripgrep.inc new file mode 100644 index 00000000..909a66ac --- /dev/null +++ b/meta-lxatac-software/recipes-rust/ripgrep/ripgrep.inc @@ -0,0 +1,19 @@ +inherit cargo cargo-update-recipe-crates + +SRC_URI += "git://github.com/BurntSushi/ripgrep.git;protocol=https;branch=${SRCBRANCH}" + +S = "${WORKDIR}/git" +CARGO_SRC_DIR = "" + +LIC_FILES_CHKSUM = " \ + file://LICENSE-MIT;md5=8d0d0aa488af0ab9aafa3b85a7fc8e12 \ + file://UNLICENSE;md5=7246f848faa4e9c9fc0ea91122d6e680 \ +" + +SUMMARY = "ripgrep is a line-oriented search tool that recursively searches your current \ +directory for a regex pattern while respecting your gitignore rules. ripgrep \ +has first class support on Windows, macOS and Linux." +HOMEPAGE = "https://github.com/BurntSushi/ripgrep" +LICENSE = "Unlicense | MIT" + +require ripgrep-crates.inc diff --git a/meta-lxatac-software/recipes-rust/ripgrep/ripgrep_14.1.1.bb b/meta-lxatac-software/recipes-rust/ripgrep/ripgrep_14.1.1.bb index d712e153..85cacfd3 100644 --- a/meta-lxatac-software/recipes-rust/ripgrep/ripgrep_14.1.1.bb +++ b/meta-lxatac-software/recipes-rust/ripgrep/ripgrep_14.1.1.bb @@ -1,19 +1,7 @@ -inherit cargo cargo-update-recipe-crates +# This file was generated by tools/update/update.py -SRC_URI += "git://github.com/BurntSushi/ripgrep.git;protocol=https;branch=master" -SRCREV = "4649aa9700619f94cf9c66876e9549d83420e16c" -S = "${WORKDIR}/git" -CARGO_SRC_DIR = "" - -LIC_FILES_CHKSUM = " \ - file://LICENSE-MIT;md5=8d0d0aa488af0ab9aafa3b85a7fc8e12 \ - file://UNLICENSE;md5=7246f848faa4e9c9fc0ea91122d6e680 \ -" +require ripgrep.inc -SUMMARY = "ripgrep is a line-oriented search tool that recursively searches your current \ -directory for a regex pattern while respecting your gitignore rules. ripgrep \ -has first class support on Windows, macOS and Linux." -HOMEPAGE = "https://github.com/BurntSushi/ripgrep" -LICENSE = "Unlicense | MIT" - -require ripgrep-crates.inc +# Git tag 14.1.1 pointing at a commit from 2024-09-08 22:15:00 -0400 +SRCBRANCH = "master" +SRCREV = "4649aa9700619f94cf9c66876e9549d83420e16c" diff --git a/meta-lxatac-software/recipes-rust/tacd/tacd.inc b/meta-lxatac-software/recipes-rust/tacd/tacd.inc index 859f85a9..8c66bcf6 100644 --- a/meta-lxatac-software/recipes-rust/tacd/tacd.inc +++ b/meta-lxatac-software/recipes-rust/tacd/tacd.inc @@ -1,4 +1,12 @@ +inherit cargo +inherit cargo-update-recipe-crates +inherit pkgconfig +inherit systemd + +DEFAULT_PREFERENCE = "-1" + SRC_URI += " \ + git://github.com/linux-automation/tacd.git;protocol=https;branch=${SRCBRANCH} \ file://tacd.service \ file://tacd-failsafe.sh \ file://de.pengutronix.tacd.conf \ @@ -6,8 +14,12 @@ SRC_URI += " \ file://05_testing.yaml \ " -inherit pkgconfig -inherit systemd +S = "${WORKDIR}/git" +CARGO_SRC_DIR = "" + +SUMMARY = "tacd" +HOMEPAGE = "https://github.com/linux-automation/tacd" +LICENSE = "GPL-2.0-or-later" DEPENDS:append = " libiio " @@ -25,3 +37,9 @@ do_install:append() { install -d ${D}${sysconfdir}/dbus-1/system.d install -m 0644 ${UNPACKDIR}/de.pengutronix.tacd.conf ${D}/${sysconfdir}/dbus-1/system.d/ } + +LIC_FILES_CHKSUM = " \ + file://LICENSE;md5=570a9b3749dd0463a1778803b12a6dce \ +" + +require tacd-crates.inc diff --git a/meta-lxatac-software/recipes-rust/tacd/tacd_git.bb b/meta-lxatac-software/recipes-rust/tacd/tacd_git.bb index 54d00c78..2392788c 100644 --- a/meta-lxatac-software/recipes-rust/tacd/tacd_git.bb +++ b/meta-lxatac-software/recipes-rust/tacd/tacd_git.bb @@ -1,25 +1,7 @@ -inherit cargo -inherit cargo-update-recipe-crates +# This file was generated by tools/update/update.py -DEFAULT_PREFERENCE = "-1" +require tacd.inc -SRC_URI += "git://github.com/linux-automation/tacd.git;protocol=https;branch=main" +# Commit 1c2f16f8b4041b31cee702677630298614c23feb created 2025-09-23 16:58:43 +0200 +SRCBRANCH = "main" SRCREV = "1c2f16f8b4041b31cee702677630298614c23feb" -S = "${WORKDIR}/git" -CARGO_SRC_DIR = "" -PV = "0.1.0+git${SRCPV}" - -LIC_FILES_CHKSUM = " \ - file://LICENSE;md5=570a9b3749dd0463a1778803b12a6dce \ -" - -SUMMARY = "tacd" -HOMEPAGE = "https://github.com/linux-automation/tacd" -LICENSE = "GPL-2.0-or-later" - -# includes this file if it exists but does not fail -# this is useful for anything you may want to override from -# what cargo-bitbake generates. -include tacd-${PV}.inc -include tacd-crates.inc -include tacd.inc diff --git a/meta-lxatac-software/recipes-support/bcu/bcu_%.bbappend b/meta-lxatac-software/recipes-support/bcu/bcu_%.bbappend index f7f0e6ef..e0265ff5 100644 --- a/meta-lxatac-software/recipes-support/bcu/bcu_%.bbappend +++ b/meta-lxatac-software/recipes-support/bcu/bcu_%.bbappend @@ -1,4 +1,8 @@ -PV = "1.1.121" -SRCREV = "523d6fd8c75e8c82a987ec23c7674ec12990762a" +# This file was generated by tools/update/update.py + +# Git tag bcu_1.1.124 pointing at a commit from 2025-11-05 15:03:30 +0800 +SRCBRANCH = "master" +SRCREV = "98d4db41651e9e094a065baed105ce2c6fb8c86e" +PV = "1.1.124" SRC_URI:remove = "file://0001-CMakeLists-do-not-use-vendored-libcurl.patch" diff --git a/meta-lxatac-software/recipes-support/imx-uuu/imx-uuu_1.5.233.bb b/meta-lxatac-software/recipes-support/imx-uuu/imx-uuu.inc similarity index 86% rename from meta-lxatac-software/recipes-support/imx-uuu/imx-uuu_1.5.233.bb rename to meta-lxatac-software/recipes-support/imx-uuu/imx-uuu.inc index ffb3e14c..2272fd3d 100644 --- a/meta-lxatac-software/recipes-support/imx-uuu/imx-uuu_1.5.233.bb +++ b/meta-lxatac-software/recipes-support/imx-uuu/imx-uuu.inc @@ -2,8 +2,7 @@ SUMMARY = "Universal Update Utility" DESCRIPTION = "Image deployment tool for i.MX chips" HOMEPAGE = "https://github.com/NXPmicro/mfgtools" -SRC_URI = "git://github.com/nxp-imx/mfgtools.git;protocol=https;branch=master" -SRCREV = "79ce7d2b2e7459e7b7c94f902d172c30b08884ab" +SRC_URI = "git://github.com/nxp-imx/mfgtools.git;protocol=https;branch=${SRCBRANCH}" LICENSE = "BSD-3-Clause" LIC_FILES_CHKSUM = "file://LICENSE;md5=38ec0c18112e9a92cffc4951661e85a5" diff --git a/meta-lxatac-software/recipes-support/imx-uuu/imx-uuu_1.5.239.bb b/meta-lxatac-software/recipes-support/imx-uuu/imx-uuu_1.5.239.bb new file mode 100644 index 00000000..6a757e55 --- /dev/null +++ b/meta-lxatac-software/recipes-support/imx-uuu/imx-uuu_1.5.239.bb @@ -0,0 +1,7 @@ +# This file was generated by tools/update/update.py + +require imx-uuu.inc + +# Git tag uuu_1.5.239 pointing at a commit from 2025-10-29 09:09:34 -0500 +SRCBRANCH = "master" +SRCREV = "051561b5bf64e5befbdd1c9fe9b414a5c9570d74" diff --git a/meta-lxatac-software/recipes-webadmin/tacd-webinterface/tacd-webinterface.inc b/meta-lxatac-software/recipes-webadmin/tacd-webinterface/tacd-webinterface.inc new file mode 100644 index 00000000..303a54cd --- /dev/null +++ b/meta-lxatac-software/recipes-webadmin/tacd-webinterface/tacd-webinterface.inc @@ -0,0 +1,41 @@ +SUMMARY = "The LXA TAC System Daemon - Web Interface" +SRC_URI = " \ + git://github.com/linux-automation/tacd.git;protocol=https;branch=main \ + npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json;destsuffix=git/web \ + " +LICENSE = "GPL-2.0-or-later" +LIC_FILES_CHKSUM = " \ + file://../LICENSE;md5=570a9b3749dd0463a1778803b12a6dce \ +" + +S = "${WORKDIR}/sources/git/web" +UNPACKDIR = "${WORKDIR}/sources" + +inherit npm + +# Remove the runtime dependency on nodejs. We only use it during the +# build process to generate static html, js and css files. +RDEPENDS:${PN}:remove = "nodejs" + +WEBUI_INSTALL_DIR = "${NPM_BUILD}/lib/node_modules/tacd-web" + +npm_run_build () { + cd "${WEBUI_INSTALL_DIR}" + npm run build + + # Provide compressed variants of all files worth compressing + find build/ -type f \ + \( -name "*.html" -or -name "*.css" -or -name "*.js" -or -name "*.svg" \) \ + -exec gzip -fk9 {} \; +} + +do_compile:append() { + bb.build.exec_func("npm_run_build", d) +} + +do_install() { + install -d "${D}${datadir}/tacd" + cp -r "${WEBUI_INSTALL_DIR}/build" "${D}${datadir}/tacd/webui" +} + +FILES:${PN} = "${datadir}/tacd" diff --git a/meta-lxatac-software/recipes-webadmin/tacd-webinterface/tacd-webinterface_git.bb b/meta-lxatac-software/recipes-webadmin/tacd-webinterface/tacd-webinterface_git.bb index 7ec5c7e4..029aa037 100644 --- a/meta-lxatac-software/recipes-webadmin/tacd-webinterface/tacd-webinterface_git.bb +++ b/meta-lxatac-software/recipes-webadmin/tacd-webinterface/tacd-webinterface_git.bb @@ -1,44 +1,7 @@ -SUMMARY = "The LXA TAC System Daemon - Web Interface" -SRC_URI = " \ - git://github.com/linux-automation/tacd.git;protocol=https;branch=main \ - npmsw://${THISDIR}/${BPN}/npm-shrinkwrap.json;destsuffix=git/web \ - " -LICENSE = "GPL-2.0-or-later" -LIC_FILES_CHKSUM = " \ - file://../LICENSE;md5=570a9b3749dd0463a1778803b12a6dce \ -" +# This file was generated by tools/update/update.py -PV = "0.1.0+git${SRCPV}" -SRCREV = "1c2f16f8b4041b31cee702677630298614c23feb" - -S = "${WORKDIR}/sources/git/web" -UNPACKDIR = "${WORKDIR}/sources" - -inherit npm - -# Remove the runtime dependency on nodejs. We only use it during the -# build process to generate static html, js and css files. -RDEPENDS:${PN}:remove = "nodejs" - -WEBUI_INSTALL_DIR = "${NPM_BUILD}/lib/node_modules/tacd-web" +require tacd-webinterface.inc -npm_run_build () { - cd "${WEBUI_INSTALL_DIR}" - npm run build - - # Provide compressed variants of all files worth compressing - find build/ -type f \ - \( -name "*.html" -or -name "*.css" -or -name "*.js" -or -name "*.svg" \) \ - -exec gzip -fk9 {} \; -} - -do_compile:append() { - bb.build.exec_func("npm_run_build", d) -} - -do_install() { - install -d "${D}${datadir}/tacd" - cp -r "${WEBUI_INSTALL_DIR}/build" "${D}${datadir}/tacd/webui" -} - -FILES:${PN} = "${datadir}/tacd" +# Commit 1c2f16f8b4041b31cee702677630298614c23feb created 2025-09-23 16:58:43 +0200 +SRCBRANCH = "main" +SRCREV = "1c2f16f8b4041b31cee702677630298614c23feb" diff --git a/tools/update/recipes.yaml b/tools/update/recipes.yaml new file mode 100644 index 00000000..e13ab0de --- /dev/null +++ b/tools/update/recipes.yaml @@ -0,0 +1,103 @@ +recipes: + - recipe: "meta-lxatac-software/recipes-devtools/github-act-runner/github-act-runner_$PV.bb" + template: "template.bb.jinja2" + git_tag: + url: "https://github.com/ChristopherHX/github-act-runner.git" + version_pattern: "^v([\\d+\\.]*\\d+)$" + version_order: semver + header: |- + require github-act-runner.inc + + - recipe: "meta-lxatac-software/recipes-devtools/gitlab-runner/gitlab-runner_$PV.bb" + template: "template.bb.jinja2" + git_tag: + url: "https://gitlab.com/gitlab-org/gitlab-runner.git" + version_pattern: "^v([\\d+\\.]*\\d+)$" + version_order: semver + header: |- + require gitlab-runner.inc + + - recipe: "meta-lxatac-software/recipes-devtools/qdl/qdl_$PV.bb" + template: "template.bb.jinja2" + git_tag: + url: "https://github.com/linux-msm/qdl.git" + version_pattern: "^v([\\d+\\.]*\\d+)$" + version_order: semver + header: |- + require qdl.inc + + - recipe: "meta-lxatac-software/recipes-devtools/rkdeveloptool/rkdeveloptool_git.bb" + template: "template.bb.jinja2" + git_branch: + url: "https://github.com/rockchip-linux/rkdeveloptool.git" + branch: master + header: |- + require rkdeveloptool.inc + + - recipe: "meta-lxatac-software/recipes-rust/bottom/bottom_$PV.bb" + template: "template.bb.jinja2" + git_tag: + url: "https://github.com/ClementTsang/bottom.git" + # Limit to 0.10.x releases for now because the sysinfo dependency in + # in its version 0.37.0 requires edition2024, which is to new for the + # rustc in walnascar. + # TODO: change back to "^([\\d+\\.]*\\d+)$" when moving on from + # walnascar. + version_pattern: "^(0\\.10[\\.\\d+]*)$" + version_order: semver + header: |- + require bottom.inc + + - recipe: "meta-lxatac-software/recipes-rust/ripgrep/ripgrep_$PV.bb" + template: "template.bb.jinja2" + git_tag: + url: "https://github.com/BurntSushi/ripgrep.git" + # Limit to 14.x releases for now because ripgrep 15.x requires + # edition2024, which is to new for the rustc in walnascar. + # TODO: change back to "^([\\d+\\.]*\\d+)$" when moving on from + # walnascar. + version_pattern: "^(14\\.[\\d+\\.]*\\d+)$" + version_order: semver + header: |- + require ripgrep.inc + + - recipe: "meta-lxatac-software/recipes-rust/tacd/tacd_git.bb" + template: "template.bb.jinja2" + git_branch: + url: "https://github.com/linux-automation/tacd.git" + branch: main + header: |- + require tacd.inc + + - recipe: "meta-lxatac-software/recipes-support/imx-uuu/imx-uuu_$PV.bb" + template: "template.bb.jinja2" + git_tag: + url: "https://github.com/nxp-imx/mfgtools.git" + version_pattern: "^uuu_([\\d+\\.]*\\d+)$" + version_order: semver + header: |- + require imx-uuu.inc + + - recipe: "meta-lxatac-software/recipes-webadmin/tacd-webinterface/tacd-webinterface_git.bb" + template: "template.bb.jinja2" + git_branch: + url: "https://github.com/linux-automation/tacd.git" + branch: main + header: |- + require tacd-webinterface.inc + + - recipe: "meta-lxatac-software/recipes-support/bcu/bcu_%.bbappend" + template: "template.bb.jinja2" + git_tag: + url: "https://github.com/nxp-imx/bcu.git" + version_pattern: "^bcu_(1\\.1[\\.\\d+]*)$" + version_order: semver + add_pv: true + trailer: |- + SRC_URI:remove = "file://0001-CMakeLists-do-not-use-vendored-libcurl.patch" + + - recipe: "meta-lxatac-software/recipes-graphics/panel-mipi-dbi/panel-mipi-dbi-native_git.bbappend" + template: "template.bb.jinja2" + git_branch: + url: "https://github.com/notro/panel-mipi-dbi.git" + branch: main diff --git a/tools/update/template.bb.jinja2 b/tools/update/template.bb.jinja2 new file mode 100644 index 00000000..ab77dd49 --- /dev/null +++ b/tools/update/template.bb.jinja2 @@ -0,0 +1,29 @@ +# This file was generated by tools/update/update.py + +{% if "header" in info %} +{{ info.header }} + +{% endif %} +{% if "git_branch" in info %} +{% if "describe" in info.git_branch %} +# Version {{ info.git_branch.describe }} commited {{ info.git_branch.commit_date }} +{% else %} +# Commit {{ info.git_branch.commit_hash }} created {{ info.git_branch.commit_date }} +{% endif %} +{% if info.git_branch.pv %} +PV = "{{ info.git_branch.pv }}" +{% endif %} +SRCBRANCH = "{{ info.git_branch.branch }}" +SRCREV = "{{ info.git_branch.commit_hash }}" +{% elif "git_tag" in info %} +# Git tag {{ info.git_tag.tag.name }} pointing at a commit from {{ info.git_tag.tag.date }} +SRCBRANCH = "{{ info.git_tag.tag.branch }}" +SRCREV = "{{ info.git_tag.tag.hash }}" +{% if "add_pv" in info.git_tag and info.git_tag.add_pv %} +PV = "{{ info.git_tag.pv }}" +{% endif %} +{% endif %} +{% if "trailer" in info %} + +{{ info.trailer }} +{% endif %} diff --git a/tools/update/update.py b/tools/update/update.py new file mode 100644 index 00000000..27eeb001 --- /dev/null +++ b/tools/update/update.py @@ -0,0 +1,203 @@ +#!/usr/bin/env python3 + +import glob +from tempfile import TemporaryDirectory +import re +import os.path +import subprocess + +import yaml +from jinja2 import Environment, FileSystemLoader, StrictUndefined + + +BRANCH_PRIORITIES = tuple( + (re.compile(pattern), prio) + for pattern, prio in ( + ("main", 9999), + ("master", 9998), + ("release.*", 9997), + ("stable.*", 9996), + (".*release", 9995), + (".*stable", 9994), + ("bugfix.*", 6001), + ("hotfix.*", 6000), + # The default is 5000 + ("next", 4003), + ("develop", 4002), + ("staging", 4001), + ("feature.*", 4000), + (".*/.*", 2000), + ) +) + + +def semver_key(pv): + return tuple(int(n) for n in pv.split(".")) + + +def branch_key(name): + """Assign a priority to a branch name + + A commit will likely be contained in multiple branches and we want to use + the most descriptive one as SRCBRANCH in the recipes. + Assign priorities to common branch names based on how descriptive they are. + """ + + for pattern, prio in BRANCH_PRIORITIES: + if pattern.fullmatch(name): + return (prio, name) + + return (5000, name) + + +def run(cmd, capture=True): + stdout = subprocess.PIPE if capture else None + return subprocess.run(cmd, stdout=stdout, check=True, text=True).stdout + + +def fetch_git_branch(info): + url = info["url"] + branch = info["branch"] + + with TemporaryDirectory() as dir: + git_dir = os.path.join(dir, "repo.git") + git = ["git", "-C", git_dir] + + run(["git", "clone", "--bare", "--filter=blob:none", url, git_dir], False) + + commit_hash = run([*git, "rev-parse", f"refs/heads/{branch}"]).strip() + commit_date = run([*git, "log", "-1", "--format=%ci", commit_hash]).strip() + + try: + info["describe"] = run([*git, "describe", "--tags", branch]).strip() + except subprocess.CalledProcessError: + pass + + version_pattern = info.get("version_pattern") + version = re.match(version_pattern, info["describe"])[1] if version_pattern else "" + + info["pv"] = f"{version}+git" if version else "" + info["commit_hash"] = commit_hash + info["commit_date"] = commit_date + + +def fetch_git_tag(info): + url = info["url"] + version_pattern = re.compile(info["version_pattern"]) + + versions = dict() + + with TemporaryDirectory() as dir: + git_dir = os.path.join(dir, "repo.git") + git = ["git", "-C", git_dir] + + run(["git", "clone", "--bare", "--filter=blob:none", url, git_dir], False) + + tags = run([*git, "tag", "--list"]).strip() + + for tag in tags.split("\n"): + version_match = version_pattern.match(tag) + + if version_match is not None: + pv = version_match[1] + versions[pv] = {"name": tag} + + if info["version_order"] == "semver": + # When sorting by semver we do not need to get all commit dates, + # only the one for the newest commit by semver in the tag name. + # We can thus reduce the versions dict to only one entry. + pv = max(versions, key=semver_key) + versions = {pv: versions[pv]} + + for tag in versions.values(): + name = tag["name"] + + tag["hash"] = run( + [*git, "rev-parse", f"refs/tags/{name}^{{commit}}"] + ).strip() + tag["date"] = run([*git, "log", "-1", "--format=%ci", tag["hash"]]).strip() + tag["timestamp"] = int( + run([*git, "log", "-1", "--format=%ct", tag["hash"]]).strip() + ) + + branches = run( + [ + *git, + "branch", + "--format=%(refname:lstrip=2)", + "--contains", + tag["hash"], + ] + ).strip() + + tag["branches"] = list(branch.strip() for branch in branches.split("\n")) + tag["branch"] = max(tag["branches"], key=branch_key) + + # Sort the remaining candidates by date. + # If the version_order is semver the dict will only have one element + # at this point in time. + newest = max(versions, key=lambda v: versions[v]["timestamp"]) + + info["tag"] = versions[newest] + info["pv"] = newest + + +def fetch_info(recipe_info): + if "git_branch" in recipe_info: + fetch_git_branch(recipe_info["git_branch"]) + recipe_info["source"] = recipe_info["git_branch"] + + elif "git_tag" in recipe_info: + fetch_git_tag(recipe_info["git_tag"]) + recipe_info["source"] = recipe_info["git_tag"] + + +def write_recipe(recipe_info, jinja_env): + # Generate new recipe content + template = jinja_env.get_template(recipe_info["template"]) + recipe_bb = template.render(info=recipe_info) + + # Delete old recipes + old_recipes = glob.glob(glob.escape(recipe_info["recipe"]).replace("$PV", "*")) + for old_recipe in old_recipes: + os.remove(old_recipe) + print(f"Removed {old_recipe}") + + # Write new recipe to disk + recipe_path = recipe_info["recipe"].replace("$PV", recipe_info["source"]["pv"]) + recipe_dir = os.path.dirname(recipe_path) + + os.makedirs(recipe_dir, exist_ok=True) + + with open(recipe_path, "w") as fd: + fd.write(recipe_bb) + print(f"Wrote {recipe_path}") + + +def main(argv): + config_path = argv[1] + config_dir = os.path.dirname(config_path) + + with open(argv[1]) as fd: + config = yaml.safe_load(fd) + + jinja_env = Environment( + loader=FileSystemLoader(config_dir), + undefined=StrictUndefined, + trim_blocks=True, + lstrip_blocks=True, + ) + + for recipe in config["recipes"]: + print(f"\n\nGenerate: {recipe['recipe']}") + + fetch_info(recipe) + write_recipe(recipe, jinja_env) + + print("done") + + +if __name__ == "__main__": + import sys + + main(sys.argv)