Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 1 | PACKAGECONFIG[drm] = ",,libdrm" |
| 2 | PACKAGECONFIG[fbdev] = ",," |
| 3 | PACKAGECONFIG[sdl] = ",,virtual/libsdl2" |
| 4 | PACKAGECONFIG[wayland] = ",,libxkbcommon wayland" |
| 5 | |
| 6 | LVGL_CONFIG_USE_DRM = "${@bb.utils.contains('PACKAGECONFIG', 'drm', '1', '0', d)}" |
| 7 | LVGL_CONFIG_DRM_CARD ?= "/dev/dri/card0" |
| 8 | |
| 9 | LVGL_CONFIG_USE_EVDEV = "${@bb.utils.contains_any('PACKAGECONFIG', 'drm fbdev', '1', '0', d)}" |
| 10 | LVGL_CONFIG_EVDEV_INPUT ?= "/dev/input/touchscreen" |
| 11 | |
| 12 | LVGL_CONFIG_USE_FBDEV = "${@bb.utils.contains('PACKAGECONFIG', 'fbdev', '1', '0', d)}" |
| 13 | |
| 14 | LVGL_CONFIG_USE_SDL = "${@bb.utils.contains('PACKAGECONFIG', 'sdl', '1', '0', d)}" |
| 15 | |
| 16 | LVGL_CONFIG_USE_WAYLAND = "${@bb.utils.contains('PACKAGECONFIG', 'wayland', '1', '0', d)}" |
| 17 | LVGL_CONFIG_WAYLAND_HOR_RES ?= "480" |
| 18 | LVGL_CONFIG_WAYLAND_VER_RES ?= "320" |
| 19 | |
| 20 | EXTRA_OECMAKE += "-Dinstall:BOOL=ON -DLIB_INSTALL_DIR=${baselib}" |
| 21 | |
| 22 | do_configure:append() { |
| 23 | # If there is a configuration template, start from that |
| 24 | [ -r "${S}/lv_drv_conf_template.h" ] && cp -Lv "${S}/lv_drv_conf_template.h" "${S}/lv_drv_conf.h" |
| 25 | |
| 26 | # Configure the software using sed |
| 27 | sed -e "s|#if 0 .*Set it to \"1\" to enable the content.*|#if 1 // Enabled by ${PN}|g" \ |
| 28 | \ |
| 29 | -e "s|\(^# define USE_DRM \).*|# define USE_DRM ${LVGL_CONFIG_USE_DRM}|g" \ |
| 30 | -e "s|\(^# define DRM_CARD \).*|# define DRM_CARD \"${LVGL_CONFIG_DRM_CARD}\"|g" \ |
| 31 | \ |
| 32 | -e "s|\(^# define USE_EVDEV \).*|# define USE_EVDEV ${LVGL_CONFIG_USE_EVDEV}|g" \ |
| 33 | -e "s|\(^# define EVDEV_NAME \).*|# define EVDEV_NAME \"${LVGL_CONFIG_EVDEV_INPUT}\"|g" \ |
| 34 | \ |
| 35 | -e "s|\(^# define USE_FBDEV \).*|# define USE_FBDEV ${LVGL_CONFIG_USE_FBDEV}|g" \ |
| 36 | \ |
| 37 | -e "s|\(^# define USE_SDL \).*|# define USE_SDL ${LVGL_CONFIG_USE_SDL}|g" \ |
| 38 | -e "s|\(^# define USE_SDL_GPU \).*|# define USE_SDL_GPU 1|g" \ |
| 39 | -e "s|\(^# define SDL_DOUBLE_BUFFERED \).*|# define SDL_DOUBLE_BUFFERED 1|g" \ |
| 40 | \ |
| 41 | -e "s|\(^# define USE_WAYLAND \).*|# define USE_WAYLAND ${LVGL_CONFIG_USE_WAYLAND}|g" \ |
| 42 | -e "s|\(^ *# *define *WAYLAND_HOR_RES *\).*|\1${LVGL_CONFIG_WAYLAND_HOR_RES}|g" \ |
| 43 | -e "s|\(^ *# *define *WAYLAND_VER_RES *\).*|\1${LVGL_CONFIG_WAYLAND_VER_RES}|g" \ |
| 44 | \ |
| 45 | -i "${S}/lv_drv_conf.h" |
| 46 | } |