Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 1 | SUMMARY = "LVGL Demo Application for Framebuffer" |
| 2 | HOMEPAGE = "https://github.com/lvgl/lv_port_linux_frame_buffer" |
| 3 | LICENSE = "MIT" |
| 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=802d3d83ae80ef5f343050bf96cce3a4 \ |
| 5 | file://lv_drivers/LICENSE;md5=d6fc0df890c5270ef045981b516bb8f2 \ |
| 6 | file://lvgl/LICENCE.txt;md5=bf1198c89ae87f043108cea62460b03a" |
| 7 | |
| 8 | SRC_URI = "gitsm://github.com/lvgl/lv_port_linux_frame_buffer.git;branch=master;protocol=https" |
Andrew Geissler | 3eeda90 | 2023-05-19 10:14:02 -0500 | [diff] [blame] | 9 | SRCREV = "adf2c4490e17a1b9ec1902cc412a24b3b8235c8e" |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 10 | |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 11 | EXTRA_OEMAKE = "DESTDIR=${D}" |
| 12 | |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 13 | PACKAGECONFIG ??= "drm" |
| 14 | PACKAGECONFIG[drm] = ",,libdrm" |
| 15 | PACKAGECONFIG[fbdev] = ",," |
| 16 | PACKAGECONFIG[sdl] = ",,virtual/libsdl2" |
| 17 | LVGL_CONFIG_USE_DRM = "${@bb.utils.contains('PACKAGECONFIG', 'drm', '1', '0', d)}" |
| 18 | LVGL_CONFIG_DRM_CARD ?= "/dev/dri/card0" |
| 19 | LVGL_CONFIG_USE_FBDEV = "${@bb.utils.contains('PACKAGECONFIG', 'fbdev', '1', '0', d)}" |
| 20 | LVGL_CONFIG_USE_SDL = "${@bb.utils.contains('PACKAGECONFIG', 'sdl', '1', '0', d)}" |
| 21 | |
| 22 | inherit cmake |
| 23 | |
| 24 | S = "${WORKDIR}/git" |
| 25 | |
| 26 | EXTRA_OECMAKE += "-Dinstall:BOOL=ON -DLIB_INSTALL_DIR=${baselib}" |
| 27 | TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm" |
| 28 | |
| 29 | do_configure:prepend() { |
| 30 | sed -i -e "s|\(^# define USE_FBDEV \).*|# define USE_FBDEV ${LVGL_CONFIG_USE_FBDEV}|g" \ |
| 31 | -e "s|\(^# define USE_DRM \).*|# define USE_DRM ${LVGL_CONFIG_USE_DRM}|g" \ |
| 32 | -e "s|\(^# define DRM_CARD \).*|# define DRM_CARD \"${LVGL_CONFIG_DRM_CARD}\"|g" \ |
| 33 | -e "s|\(^# define USE_SDL \).*|# define USE_SDL ${LVGL_CONFIG_USE_SDL}|g" \ |
| 34 | -e "s|\(^# define USE_SDL_GPU \).*|# define USE_SDL_GPU 1|g" \ |
| 35 | -e "s|\(^# define SDL_DOUBLE_BUFFERED \).*|# define SDL_DOUBLE_BUFFERED 1|g" \ |
| 36 | "${S}/lv_drv_conf.h" |
| 37 | |
| 38 | if [ "${LVGL_CONFIG_USE_DRM}" -eq 1 ] ; then |
| 39 | # Add libdrm build dependency |
| 40 | sed -i '/^target_link_libraries/ s@lvgl::drivers@& drm@' "${S}/CMakeLists.txt" |
| 41 | # Switch from fbdev to drm usage |
| 42 | sed -i 's@fbdev@drm@g' "${S}/main.c" |
| 43 | # Pull resolution from DRM instead of hardcoding it |
| 44 | sed -i '/disp_drv.hor_res/ d' "${S}/main.c" |
| 45 | sed -i '/disp_drv.ver_res/ s@disp_drv.ver_res.*@drm_get_sizes(\&disp_drv.hor_res, \&disp_drv.ver_res, NULL);@' "${S}/main.c" |
| 46 | fi |
| 47 | |
| 48 | if [ "${LVGL_CONFIG_USE_SDL}" -eq 1 ] ; then |
| 49 | # Add libsdl build dependency |
| 50 | sed -i '/^target_link_libraries/ s@lvgl::drivers@& SDL2@' "${S}/CMakeLists.txt" |
| 51 | # Switch from fbdev to sdl usage |
| 52 | sed -i 's@fbdev_flush@sdl_display_flush@g' "${S}/main.c" |
| 53 | sed -i 's@lv_drivers/display/fbdev.h@lv_drivers/sdl/sdl.h@g' "${S}/main.c" |
| 54 | sed -i 's@fbdev@sdl@g' "${S}/main.c" |
| 55 | fi |
| 56 | } |
| 57 | |
| 58 | do_install:append() { |
| 59 | install -d ${D}${bindir} |
| 60 | install -m 0755 ${B}/lvgl_fb ${D}${bindir}/ |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 61 | } |