blob: a0a2ee0aa9fe3b2aaa788216f6664824c26404c5 [file] [log] [blame]
Andrew Geisslereff27472021-10-29 15:35:00 -05001# SPDX-FileCopyrightText: Huawei Inc.
Andrew Geissler595f6302022-01-24 19:11:47 +00002#
Andrew Geisslereff27472021-10-29 15:35:00 -05003# SPDX-License-Identifier: MIT
4
Andrew Geisslereff27472021-10-29 15:35:00 -05005HOMEPAGE = "https://docs.lvgl.io/latest/en/html/porting/index.html"
6SUMMARY = "LVGL's Display and Touch pad drivers"
7DESCRIPTION = "Collection of drivers: SDL, framebuffer, wayland and more..."
Andrew Geissler595f6302022-01-24 19:11:47 +00008LICENSE = "MIT"
9LIC_FILES_CHKSUM = "file://LICENSE;md5=d6fc0df890c5270ef045981b516bb8f2"
Andrew Geisslereff27472021-10-29 15:35:00 -050010
Andrew Geissler3eeda902023-05-19 10:14:02 -050011SRC_URI = "git://github.com/lvgl/lv_drivers;protocol=https;branch=release/v8.3"
12SRCREV = "71830257710f430b6d8d1c324f89f2eab52488f1"
Andrew Geissler595f6302022-01-24 19:11:47 +000013
Andrew Geissler3eeda902023-05-19 10:14:02 -050014DEPENDS = "lvgl"
Andrew Geisslereff27472021-10-29 15:35:00 -050015
Andrew Geissler3eeda902023-05-19 10:14:02 -050016PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland fbdev', d)}"
17PACKAGECONFIG[fbdev] = ",,"
18PACKAGECONFIG[wayland] = ",,libxkbcommon wayland"
19LVGL_CONFIG_USE_FBDEV = "${@bb.utils.contains('PACKAGECONFIG', 'fbdev', '1', '0', d)}"
20LVGL_CONFIG_USE_WAYLAND = "${@bb.utils.contains('PACKAGECONFIG', 'wayland', '1', '0', d)}"
Andrew Geisslereff27472021-10-29 15:35:00 -050021
22inherit cmake
Andrew Geisslereff27472021-10-29 15:35:00 -050023
Patrick Williams8e7b46e2023-05-01 14:19:06 -050024S = "${WORKDIR}/git"
Andrew Geisslereff27472021-10-29 15:35:00 -050025
Andrew Geissler595f6302022-01-24 19:11:47 +000026LVGL_CONFIG_WAYLAND_HOR_RES ?= "480"
27LVGL_CONFIG_WAYLAND_VER_RES ?= "320"
28
Patrick Williams8e7b46e2023-05-01 14:19:06 -050029EXTRA_OECMAKE += "-Dinstall:BOOL=ON -DLIB_INSTALL_DIR=${baselib}"
Andrew Geisslereff27472021-10-29 15:35:00 -050030
31TARGET_CFLAGS += "-DLV_CONF_INCLUDE_SIMPLE=1"
Patrick Williams8e7b46e2023-05-01 14:19:06 -050032TARGET_CFLAGS += "-I${STAGING_INCDIR}/lvgl"
Andrew Geisslereff27472021-10-29 15:35:00 -050033
Andrew Geissler595f6302022-01-24 19:11:47 +000034# Upstream does not support a default configuration
35# but propose a default "disabled" template, which is used as reference
36# More configuration can be done using external configuration variables
Andrew Geisslereff27472021-10-29 15:35:00 -050037do_configure:append() {
38 [ -r "${S}/lv_drv_conf.h" ] \
39 || sed -e "s|#if 0 .*Set it to \"1\" to enable the content.*|#if 1 // Enabled by ${PN}|g" \
Andrew Geissler3eeda902023-05-19 10:14:02 -050040 \
41 -e "s|\(^# define USE_FBDEV \).*|# define USE_FBDEV ${LVGL_CONFIG_USE_FBDEV}|g" \
42 -e "s|\(^# define USE_EVDEV \).*|# define USE_EVDEV ${LVGL_CONFIG_USE_FBDEV}|g" \
43 \
44 -e "s|\(^# define USE_WAYLAND \).*|# define USE_WAYLAND ${LVGL_CONFIG_USE_WAYLAND}|g" \
Andrew Geissler595f6302022-01-24 19:11:47 +000045 -e "s|\(^ *# *define *WAYLAND_HOR_RES *\).*|\1${LVGL_CONFIG_WAYLAND_HOR_RES}|g" \
46 -e "s|\(^ *# *define *WAYLAND_VER_RES *\).*|\1${LVGL_CONFIG_WAYLAND_VER_RES}|g" \
Andrew Geisslereff27472021-10-29 15:35:00 -050047 < "${S}/lv_drv_conf_template.h" > "${S}/lv_drv_conf.h"
48}
49
Andrew Geissler595f6302022-01-24 19:11:47 +000050FILES:${PN}-dev += "\
Andrew Geisslereff27472021-10-29 15:35:00 -050051 ${includedir}/lvgl/lv_drivers/ \
52 "