diff --git a/.github/workflows/clean-build.yml b/.github/workflows/clean-build.yml index f3bb7a8..f70f0b4 100644 --- a/.github/workflows/clean-build.yml +++ b/.github/workflows/clean-build.yml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@v7 with: repository: micropython/micropython - ref: v1.28.0 + ref: v1.29.0 path: micropython # A unix build cannot show this one: the Makefile ports fold @@ -106,7 +106,7 @@ jobs: uses: actions/checkout@v7 with: repository: micropython/micropython - ref: v1.28.0 + ref: v1.29.0 path: micropython # Pinned to the lvgl-bindings commit that turns LV_USE_TJPGD off on @@ -118,7 +118,7 @@ jobs: uses: actions/checkout@v7 with: repository: PyDevices/lvgl-bindings - ref: aa6c6bc449aed6936b644ab45b11e453945a18ee + ref: d5f3d341e6bcfc97d52d66f776587c215c95ff4d path: lvgl-bindings submodules: true @@ -126,7 +126,7 @@ jobs: uses: actions/checkout@v7 with: repository: PyDevices/lvgl-micropython - ref: d7ea1938a6d53cd03a6559f9f46fc7f07f7c2300 + ref: 410e2e8dcf38e316f5da7bc63b35ba4b3fd07dfd path: lvgl-micropython - name: Install SDL2 @@ -135,17 +135,19 @@ jobs: sudo apt-get install -y libsdl2-dev - name: Build the unix port with displayif + lvgl-micropython + lvgl-bindings - # USER_C_MODULES is the PARENT directory again; displayif's jpegio - # sees $(USER_C_MODULES)/lvgl-micropython/micropython.mk and compiles - # its LVGL decoder. FROZEN_MANIFEST freezes lvgl-micropython's + # Both modules are named by their own manifests (MicroPython 1.29 + # c_module()), so a two-line manifest selects them and there is no + # USER_C_MODULES: passing the parent directory as well would include + # each module twice. FROZEN_MANIFEST also freezes lvgl-micropython's # display_driver.py / fs_driver.py (the file-source test uses the - # latter), the same command the local proof used. + # latter). jpegio sees lvgl-micropython in USER_C_MODULES (appended by + # the manifest) and compiles its LVGL decoder. run: | + printf 'include("displayif/manifest.py")\ninclude("lvgl-micropython/manifest.py")\n' > ci-manifest.py make -C micropython/mpy-cross -j2 make -C micropython/ports/unix submodules make -C micropython/ports/unix -j2 \ - USER_C_MODULES=$GITHUB_WORKSPACE \ - FROZEN_MANIFEST=$GITHUB_WORKSPACE/lvgl-micropython/manifest.py + FROZEN_MANIFEST=$GITHUB_WORKSPACE/ci-manifest.py - name: One TJpgDec in the firmware, and it is jpegio's # Exactly one object defines jd_prepare (displayif's tjpgd.o; LVGL's diff --git a/manifest.py b/manifest.py new file mode 100644 index 0000000..8a7b77a --- /dev/null +++ b/manifest.py @@ -0,0 +1,4 @@ +# Freeze manifest for this repo. Nothing Python to freeze here; the line below +# names the C module so a build that includes this manifest compiles it +# (MicroPython 1.29 c_module()). +c_module(".") # this directory holds the micropython.cmake / micropython.mk for the C half diff --git a/src/jpegio/micropython.mk b/src/jpegio/micropython.mk index c5d1a99..50a0786 100644 --- a/src/jpegio/micropython.mk +++ b/src/jpegio/micropython.mk @@ -18,10 +18,12 @@ SRC_USERMOD_C += $(JPEGIO_DIR)/jpegio.c # Library source: no qstrs, so it stays out of the QSTR scan. SRC_USERMOD_LIB_C += $(JPEGIO_DIR)/tjpgd/tjpgd.c -# Sibling detection is exactly py.mk's usermod glob, one level under -# USER_C_MODULES (works with a relative USER_C_MODULES too). Override with -# JPEGIO_LVGL=0/1 on the make command line. -JPEGIO_LVGL ?= $(if $(wildcard $(USER_C_MODULES)/lvgl-micropython/micropython.mk),1,0) +# lvgl-micropython is in this build if USER_C_MODULES names it -- either as a +# module directory itself (MicroPython 1.29 c_module()) or as a parent +# directory one level above it (py.mk's glob). Override with JPEGIO_LVGL=0/1 +# on the make command line. +JPEGIO_LVMP_DIR := $(firstword $(filter %/lvgl-micropython,$(USER_C_MODULES:/=)) $(foreach d,$(USER_C_MODULES),$(wildcard $(d)/lvgl-micropython))) +JPEGIO_LVGL ?= $(if $(JPEGIO_LVMP_DIR),1,0) ifeq ($(JPEGIO_LVGL),1) # The bindings checkout, derived the way lvgl-micropython/micropython.mk does @@ -30,7 +32,7 @@ ifeq ($(JPEGIO_LVGL),1) # lvgl-micropython's, so a `BINDINGS_DIR ?=` here would pre-empt theirs. A # BINDINGS_DIR given on the make command line is honoured so both usermods # compile against the same lv_conf.h (struct layouts depend on it). -JPEGIO_LVGL_BINDINGS_DIR ?= $(or $(BINDINGS_DIR),$(abspath $(USER_C_MODULES)/lvgl-micropython/../lvgl-bindings)) +JPEGIO_LVGL_BINDINGS_DIR ?= $(or $(BINDINGS_DIR),$(abspath $(JPEGIO_LVMP_DIR)/../lvgl-bindings)) # -I finds lv_conf.h (LVGL's lv_conf_internal.h picks it up through # __has_include, the same route lvgl-micropython's -I$(BINDINGS_DIR) uses); # -I/lvgl finds lvgl.h and the src/... private headers. @@ -40,5 +42,5 @@ SRC_USERMOD_LIB_C += $(JPEGIO_DIR)/lvgl_decoder.c # lvgl.h with LV_USE_FLOAT trips -Werror=double-promotion / float-conversion # on ports that append those after CFLAGS_USERMOD (unix, webassembly): the # same per-object suppression lvgl-micropython puts on LVGL's own objects. -$(eval $(BUILD)/$(patsubst $(USER_C_MODULES)/%,%,$(JPEGIO_DIR)/lvgl_decoder.o): CFLAGS += -Wno-double-promotion -Wno-float-conversion) +$(eval $(BUILD)/$(patsubst $(DISPLAYIF_MOD_DIR)/%,$(notdir $(DISPLAYIF_MOD_DIR))/%,$(JPEGIO_DIR)/lvgl_decoder.o): CFLAGS += -Wno-double-promotion -Wno-float-conversion) endif