Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions .github/workflows/clean-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -118,15 +118,15 @@ jobs:
uses: actions/checkout@v7
with:
repository: PyDevices/lvgl-bindings
ref: aa6c6bc449aed6936b644ab45b11e453945a18ee
ref: d5f3d341e6bcfc97d52d66f776587c215c95ff4d
path: lvgl-bindings
submodules: true

- name: Check out lvgl-micropython (pins that lvgl-bindings commit)
uses: actions/checkout@v7
with:
repository: PyDevices/lvgl-micropython
ref: d7ea1938a6d53cd03a6559f9f46fc7f07f7c2300
ref: 410e2e8dcf38e316f5da7bc63b35ba4b3fd07dfd
path: lvgl-micropython

- name: Install SDL2
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions manifest.py
Original file line number Diff line number Diff line change
@@ -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
14 changes: 8 additions & 6 deletions src/jpegio/micropython.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<bindings> 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<bindings>/lvgl finds lvgl.h and the src/... private headers.
Expand All @@ -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
Loading