weston_6.0.1.imx.bbappend 1.77 KB
#Weston falls back to use the GL backend
do_install_append_smarcimx8mm4g() {
    # Weston doesn't need the .la files to load modules, so wipe them
    rm -f ${D}/${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.la

    # If X11, ship a desktop file to launch it
    if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then
        install -d ${D}${datadir}/applications
        install ${WORKDIR}/weston.desktop ${D}${datadir}/applications

        install -d ${D}${datadir}/icons/hicolor/48x48/apps
        install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps
    fi

    if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then
        install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland
    fi

    if [ -z "${@bb.utils.filter('BBFILE_COLLECTIONS', 'aglprofilegraphical', d)}" ]; then
        if [ "${@bb.utils.filter('BBFILE_COLLECTIONS', 'ivi', d)}" ]; then
            WESTON_INI_SRC=${B}/ivi-shell/weston.ini
        else
            WESTON_INI_SRC=${B}/weston.ini
        fi
        WESTON_INI_DEST_DIR=${D}${sysconfdir}/xdg/weston
        install -d ${WESTON_INI_DEST_DIR}
        install -m 0644 ${WESTON_INI_SRC} ${WESTON_INI_DEST_DIR}
        cd ${WESTON_INI_DEST_DIR}
        case ${SOCNAME} in
        8mq)
            uncomment "gbm-format=argb8888" weston.ini
            uncomment "\\[shell\\]"         weston.ini
            uncomment "size=1920x1080"      weston.ini
            ;;
        esac
        if "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'true', 'false', d)}"; then
            uncomment "xwayland=true"       weston.ini
        fi
        cd -
    fi

    if [ -f ${WORKDIR}/weston.config ]; then
        install -Dm0755 ${WORKDIR}/weston.config ${D}${sysconfdir}/default/weston
    fi
}