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" |
Andrew Geissler | 8f84068 | 2023-07-21 09:09:43 -0500 | [diff] [blame] | 14 | require lv-drivers.inc |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 15 | |
| 16 | inherit cmake |
| 17 | |
| 18 | S = "${WORKDIR}/git" |
| 19 | |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 20 | TARGET_CFLAGS += "-I${STAGING_INCDIR}/libdrm" |
| 21 | |
| 22 | do_configure:prepend() { |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 23 | if [ "${LVGL_CONFIG_USE_DRM}" -eq 1 ] ; then |
| 24 | # Add libdrm build dependency |
| 25 | sed -i '/^target_link_libraries/ s@lvgl::drivers@& drm@' "${S}/CMakeLists.txt" |
| 26 | # Switch from fbdev to drm usage |
| 27 | sed -i 's@fbdev@drm@g' "${S}/main.c" |
| 28 | # Pull resolution from DRM instead of hardcoding it |
| 29 | sed -i '/disp_drv.hor_res/ d' "${S}/main.c" |
| 30 | 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" |
| 31 | fi |
| 32 | |
| 33 | if [ "${LVGL_CONFIG_USE_SDL}" -eq 1 ] ; then |
| 34 | # Add libsdl build dependency |
| 35 | sed -i '/^target_link_libraries/ s@lvgl::drivers@& SDL2@' "${S}/CMakeLists.txt" |
| 36 | # Switch from fbdev to sdl usage |
| 37 | sed -i 's@fbdev_flush@sdl_display_flush@g' "${S}/main.c" |
| 38 | sed -i 's@lv_drivers/display/fbdev.h@lv_drivers/sdl/sdl.h@g' "${S}/main.c" |
| 39 | sed -i 's@fbdev@sdl@g' "${S}/main.c" |
| 40 | fi |
| 41 | } |
| 42 | |
| 43 | do_install:append() { |
| 44 | install -d ${D}${bindir} |
| 45 | install -m 0755 ${B}/lvgl_fb ${D}${bindir}/ |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 46 | } |