# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have a packages directory, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
            ${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_COLLECTIONS += "digi-arm"
BBFILE_PATTERN_digi-arm := "^${LAYERDIR}/"
BBFILE_PRIORITY_digi-arm = "5"

BBFILES_DYNAMIC += " \
    freescale-layer:${LAYERDIR}/dynamic-layers/freescale-layer/*/*/*.bb \
    freescale-layer:${LAYERDIR}/dynamic-layers/freescale-layer/*/*/*.bbappend \
    stm-st-stm32mp:${LAYERDIR}/dynamic-layers/stm-st-stm32mp/*/*/*.bb \
    stm-st-stm32mp:${LAYERDIR}/dynamic-layers/stm-st-stm32mp/*/*/*.bbappend \
    wolfssl:${LAYERDIR}/dynamic-layers/wolfssl/*/*/*.bb \
    wolfssl:${LAYERDIR}/dynamic-layers/wolfssl/*/*/*.bbappend \
"

LAYERDEPENDS_digi-arm = "core"
LAYERDEPENDS_digi-arm += "${@oe.utils.conditional('DEY_SOC_VENDOR', 'NXP', 'freescale-layer', '', d)}"
LAYERDEPENDS_digi-arm += "${@oe.utils.conditional('DEY_SOC_VENDOR', 'STM', 'stm-st-stm32mp', '', d)}"

LAYERSERIES_COMPAT_digi-arm = "kirkstone"

# Define new EULAs and add them to the list defined in meta-freescale.
# See fsl-eula-unpack.bbclass.
FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V42 = "ea25d099982d035af85d193c88a1b479"
FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V45 = "63a38e9f392d8813d6f1f4d0d6fbe657"
FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V48 = "db4762b09b6bda63da103963e6e081de"
FSL_EULA_FILE_MD5SUMS:append = " \
    ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V42} \
    ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V45} \
    ${FSL_EULA_FILE_MD5SUM_LA_OPT_NXP_SOFTWARE_LICENSE_V48} \
"

# STM EULA
EULA_FILE_ST_${MACHINE} = "${LAYERDIR}/conf/eula/${MACHINE}"
EULA_FILE_ST_MD5SUM_${MACHINE} = "8b505090fb679839cefbcc784afe8ce9"

# Ignore some STM recipes
BBMASK += " \
    meta-st-stm32mp/recipes-bsp/alsa/alsa-state-stm32mp1.bb \
    meta-st-stm32mp/recipes-core/base-files/base-files_%.bbappend \
    meta-st-stm32mp/recipes-core/busybox/busybox_%.bbappend \
    meta-st-stm32mp/recipes-core/systemd/systemd-conf_%.bbappend \
    meta-st-stm32mp/recipes-kernel/linux/linux-stm32mp_5.15.bb \
"

# Tweak stm32mpu-ai dependencies to use ST's machine learning packages
LAYERDEPENDS_stm32mpu-ai:remove = "st-openstlinux"
BBMASK += " \
    meta-st-stm32mpu-ai/recipes-st/images/st-image-ai-userfs.bb \
    meta-st-stm32mpu-ai/recipes-st/images/st-image-ai.bb \
"

# Digi's General and Open Source license agreements
DIGI_EULA_FILE = "${LAYERDIR}/DIGI_EULA"
DIGI_OPEN_EULA_FILE = "${LAYERDIR}/DIGI_OPEN_EULA"

# Additional license directories
LICENSE_PATH += "${LAYERDIR}/custom-licenses"

DIGI_MTK_GIT ?= "git://stash.digi.com"
DIGI_PKG_SRC ?= "https://ftp1.digi.com/support/digiembeddedyocto/source"
DIGI_GITHUB_GIT ?= "git://github.com/digi-embedded"

# Disable CVE report generation by default
do_vigiles_check[noexec] = "1"
