diff options
| -rw-r--r-- | meta-oe/recipes-graphics/lvgl/lv-conf.inc | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/meta-oe/recipes-graphics/lvgl/lv-conf.inc b/meta-oe/recipes-graphics/lvgl/lv-conf.inc index ab3ad01a5a..cc8a2a16d9 100644 --- a/meta-oe/recipes-graphics/lvgl/lv-conf.inc +++ b/meta-oe/recipes-graphics/lvgl/lv-conf.inc | |||
| @@ -21,7 +21,7 @@ PACKAGECONFIG[gridnav] = ",," | |||
| 21 | PACKAGECONFIG[thorvg] = ",," | 21 | PACKAGECONFIG[thorvg] = ",," |
| 22 | PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image" | 22 | PACKAGECONFIG[sdl] = ",,virtual/libsdl2 libsdl2-image" |
| 23 | 23 | ||
| 24 | inherit python3native | 24 | inherit cml1 python3native |
| 25 | 25 | ||
| 26 | EXTRA_OECMAKE += "-DLV_BUILD_USE_KCONFIG=ON" | 26 | EXTRA_OECMAKE += "-DLV_BUILD_USE_KCONFIG=ON" |
| 27 | 27 | ||
| @@ -35,6 +35,7 @@ CXXFLAGS += "${LVGL_FLAGS}" | |||
| 35 | KCONFIG_CONFIG_ROOTDIR ?= "${S}" | 35 | KCONFIG_CONFIG_ROOTDIR ?= "${S}" |
| 36 | KCONFIG_FILE ?= "${KCONFIG_CONFIG_ROOTDIR}/Kconfig" | 36 | KCONFIG_FILE ?= "${KCONFIG_CONFIG_ROOTDIR}/Kconfig" |
| 37 | export KCONFIG_CONFIG ?= "${KCONFIG_CONFIG_ROOTDIR}/.config" | 37 | export KCONFIG_CONFIG ?= "${KCONFIG_CONFIG_ROOTDIR}/.config" |
| 38 | KCONFIG_CONFIG_COMMAND ?= "menuconfig ${KCONFIG_FILE}" | ||
| 38 | 39 | ||
| 39 | do_configure() { | 40 | do_configure() { |
| 40 | cat ${UNPACKDIR}/defconfig ${@" ".join(find_cfgs(d))} > ${B}/defconfig | 41 | cat ${UNPACKDIR}/defconfig ${@" ".join(find_cfgs(d))} > ${B}/defconfig |
| @@ -42,3 +43,48 @@ do_configure() { | |||
| 42 | 43 | ||
| 43 | cmake_do_configure | 44 | cmake_do_configure |
| 44 | } | 45 | } |
| 46 | |||
| 47 | # Copied from cml1.bbclass. The only modification is that | ||
| 48 | # ${KCONFIG_CONFIG_COMMAND} is not prefixed with "make" when called by | ||
| 49 | # oe_terminal. | ||
| 50 | python do_menuconfig() { | ||
| 51 | import shutil | ||
| 52 | |||
| 53 | if not bb.utils.to_boolean(d.getVar("KCONFIG_CONFIG_ENABLE_MENUCONFIG")): | ||
| 54 | bb.fatal("do_menuconfig is disabled, please check KCONFIG_CONFIG_ENABLE_MENUCONFIG variable.") | ||
| 55 | return | ||
| 56 | |||
| 57 | config = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config") | ||
| 58 | configorig = os.path.join(d.getVar('KCONFIG_CONFIG_ROOTDIR'), ".config.orig") | ||
| 59 | |||
| 60 | try: | ||
| 61 | mtime = os.path.getmtime(config) | ||
| 62 | shutil.copy(config, configorig) | ||
| 63 | except OSError: | ||
| 64 | mtime = 0 | ||
| 65 | |||
| 66 | # setup native pkg-config variables (kconfig scripts call pkg-config directly, cannot generically be overriden to pkg-config-native) | ||
| 67 | d.setVar("PKG_CONFIG_DIR", "${STAGING_DIR_NATIVE}${libdir_native}/pkgconfig") | ||
| 68 | d.setVar("PKG_CONFIG_PATH", "${PKG_CONFIG_DIR}:${STAGING_DATADIR_NATIVE}/pkgconfig") | ||
| 69 | d.setVar("PKG_CONFIG_LIBDIR", "${PKG_CONFIG_DIR}") | ||
| 70 | d.setVarFlag("PKG_CONFIG_SYSROOT_DIR", "unexport", "1") | ||
| 71 | # ensure that environment variables are overwritten with this tasks 'd' values | ||
| 72 | d.appendVar("OE_TERMINAL_EXPORTS", " PKG_CONFIG_DIR PKG_CONFIG_PATH PKG_CONFIG_LIBDIR PKG_CONFIG_SYSROOT_DIR") | ||
| 73 | |||
| 74 | oe_terminal("sh -c '%s; if [ $? -ne 0 ]; then echo \"Command failed.\"; printf \"Press any key to continue... \"; read r; fi'" % d.getVar('KCONFIG_CONFIG_COMMAND'), | ||
| 75 | d.getVar('PN') + ' Configuration', d) | ||
| 76 | |||
| 77 | try: | ||
| 78 | newmtime = os.path.getmtime(config) | ||
| 79 | except OSError: | ||
| 80 | newmtime = 0 | ||
| 81 | |||
| 82 | if newmtime > mtime: | ||
| 83 | bb.plain("Changed configuration saved at:\n %s\nRecompile will be forced" % config) | ||
| 84 | bb.build.write_taint('do_compile', d) | ||
| 85 | } | ||
| 86 | |||
| 87 | do_savedefconfig() { | ||
| 88 | bbplain "Saving defconfig to:\n${B}/defconfig" | ||
| 89 | savedefconfig --kconfig ${KCONFIG_FILE} --out ${B}/defconfig | ||
| 90 | } | ||
