blob: 1a9421583965f824f0cb0ca0e1fb93c4232d7006 [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 Geissler595f6302022-01-24 19:11:47 +000011# TODO: Pin upstream release (current v7.11.0-80-g419a757)
12SRC_URI = "git://github.com/lvgl/lv_drivers;destsuffix=${S};protocol=https;nobranch=1"
13SRCREV = "419a757c23aaa67c676fe3a2196d64808fcf2254"
14
15DEPENDS = "libxkbcommon lvgl wayland"
Andrew Geisslereff27472021-10-29 15:35:00 -050016
17REQUIRED_DISTRO_FEATURES = "wayland"
18
19inherit cmake
20inherit features_check
21
22S = "${WORKDIR}/${PN}-${PV}"
23
Andrew Geissler595f6302022-01-24 19:11:47 +000024LVGL_CONFIG_WAYLAND_HOR_RES ?= "480"
25LVGL_CONFIG_WAYLAND_VER_RES ?= "320"
26
Andrew Geissler9aee5002022-03-30 16:27:02 +000027EXTRA_OECMAKE += "-Dinstall:BOOL=ON -DLIB_INSTALL_DIR=${BASELIB}"
Andrew Geisslereff27472021-10-29 15:35:00 -050028
29TARGET_CFLAGS += "-DLV_CONF_INCLUDE_SIMPLE=1"
30TARGET_CFLAGS += "-I${RECIPE_SYSROOT}/${includedir}/lvgl"
31
Andrew Geissler595f6302022-01-24 19:11:47 +000032# Upstream does not support a default configuration
33# but propose a default "disabled" template, which is used as reference
34# More configuration can be done using external configuration variables
Andrew Geisslereff27472021-10-29 15:35:00 -050035do_configure:append() {
36 [ -r "${S}/lv_drv_conf.h" ] \
37 || sed -e "s|#if 0 .*Set it to \"1\" to enable the content.*|#if 1 // Enabled by ${PN}|g" \
38 -e "s|# define USE_WAYLAND 0|# define USE_WAYLAND 1|g" \
Andrew Geissler595f6302022-01-24 19:11:47 +000039 -e "s|\(^ *# *define *WAYLAND_HOR_RES *\).*|\1${LVGL_CONFIG_WAYLAND_HOR_RES}|g" \
40 -e "s|\(^ *# *define *WAYLAND_VER_RES *\).*|\1${LVGL_CONFIG_WAYLAND_VER_RES}|g" \
Andrew Geisslereff27472021-10-29 15:35:00 -050041 < "${S}/lv_drv_conf_template.h" > "${S}/lv_drv_conf.h"
42}
43
Andrew Geissler595f6302022-01-24 19:11:47 +000044FILES:${PN}-dev += "\
Andrew Geisslereff27472021-10-29 15:35:00 -050045 ${includedir}/lvgl/lv_drivers/ \
46 "