I just added the sdl2 package to my local.conf file.
my bblayers file
LCONF_VERSION = "7"
BBPATH = "${TOPDIR}"
BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"
BBFILES ?= ""
BBLAYERS = " \
${BSPDIR}/sources/poky/meta \
${BSPDIR}/sources/poky/meta-poky \
\
${BSPDIR}/sources/meta-openembedded/meta-oe \
${BSPDIR}/sources/meta-openembedded/meta-multimedia \
\
${BSPDIR}/sources/meta-freescale \
${BSPDIR}/sources/meta-freescale-3rdparty \
${BSPDIR}/sources/meta-freescale-distro \
"
# i.MX Yocto Project Release layers
BBLAYERS += " ${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-bsp "
BBLAYERS += " ${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-sdk "
BBLAYERS += " ${BSPDIR}/sources/meta-browser "
BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-gnome "
BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-networking "
BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-python "
BBLAYERS += " ${BSPDIR}/sources/meta-openembedded/meta-filesystems "
BBLAYERS += " ${BSPDIR}/sources/meta-qt5 "
BBLAYERS += " \
${BSPDIR}/sources/meta-compulab \
${BSPDIR}/sources/meta-compulab-bsp/meta-desktop \
${BSPDIR}/sources/meta-compulab-bsp/meta-multimedia \
${BSPDIR}/sources/meta-bsp-imx8mq \
"
My local.conf
MACHINE ??= 'cl-som-imx8'
DISTRO ?= 'fsl-imx-xwayland'
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks dev-pkgs tools-sdk tools-debug tools-profile tools-testapps"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K \
ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
CONF_VERSION = "1"
DL_DIR ?= "${BSPDIR}/downloads/"
ACCEPT_FSL_EULA = "1"
CORE_IMAGE_EXTRA_INSTALL += " dhcp-client imx-gpu-viv-demos cl-uboot cl-deploy cl-stest cl-launcher cl-camera u-boot-fw-utils memtester htop iotop tmux iperf3 "
IMAGE_FEATURES += " package-management ssh-server-openssh "
LICENSE_FLAGS_WHITELIST = "commercial"
PREFERRED_RPROVIDER_u-boot-fw-utils = "u-boot-fw-utils"
BBMASK += "meta-compulab/recipes-xfce"
# Users' Configurations
UBOOT_CONFIG = "cfg"
# Add packages
IMAGE_INSTALL_append = " git ffmpeg python3-flask python3-bcrypt python3-jinja2 python3-lxml python3-beautifulsoup4 python3-pyalsaaudio python3-smbus python3-urllib3 libsdl2 libsdl2-mixer libsdl2-image libsdl2-ttf "