Desktop dev loop: czdev CLI + emulator + SDK + NC2000/APPLaunch/LVGL demos#1
Merged
Desktop dev loop: czdev CLI + emulator + SDK + NC2000/APPLaunch/LVGL demos#1
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Update product name, identifier, and window title - Add build-tauri.yml: builds on Linux/macOS/Windows, creates GitHub release on tags - Update README, docs, package.json, index.html Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tauri-apps/tauri-action expects `npm run tauri build` to work.
r.code is number | null, use nullish coalescing to default to 1.
Pins eggfly/M5CardputerZero-Emulator@318527b. Provides the SDL2+LVGL 9.5 desktop emulator and the lvgl/UserDemo nested submodules needed by the czdev desktop dev loop. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
DESKTOP_DEV.md freezes the app ABI (app_main + app_event + CZ_EV_*), the LVGL-shared-via-dlopen mechanism, and the 8-issue Windows plan so future work can't silently drift. APP_BUILDER_JSON.md documents the backward-compatible schema extension (runtime / entry / lvgl_version / caps / assets). QUICKSTART.md is the 3-minute onboarding for mac/Linux. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
sdk/include/cz_app.h is the public ABI apps link against: two extern "C" entry points (app_main, app_event) and the CZ_EV_* event enum. sdk/cmake/CZApp.cmake gives app authors a one-liner (cz_add_lvgl_app(target SOURCES ...)) that sets the right per-OS link flags (-undefined dynamic_lookup on mac, --unresolved-symbols=ignore-all on Linux, loud warning on Windows until T08 lands) and emits a ui_init thunk so the current emulator keeps working while apps migrate to the new ABI. discover_projects.py now surfaces the new schema fields with safe defaults so existing app-builder.json files still work unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Turns the repo into a Cargo workspace with src-tauri and crates/czdev as members. czdev is the desktop dev loop: `czdev doctor` checks SDL2 and toolchain deps with per-OS install hints; `czdev build` configures and builds an app's shared library into .czdev/build/; `czdev run` first-time-builds the emulator submodule, stages the .dylib/.so into emulator/build/apps/, and launches it; `czdev watch` polls source mtimes (no notify crate) and rebuilds+relaunches on change; `czdev deploy` is an scp+dpkg wrapper for pre-built .debs. .gitignore picks up target/ and per-app .czdev/ caches. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three files (src/hello_cz.c + CMakeLists.txt + app-builder.json) exercise the full SDK: implement app_main/app_event, include sdk/cmake/CZApp.cmake, and declare runtime=lvgl-dlopen. Serves as the canonical template for new apps and the fixture for CI smoke. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Matrix job installs SDL2/freetype/cmake, runs czdev doctor, builds hello_cz, then headless-launches the emulator with SDL_VIDEODRIVER=dummy and asserts it survives for 5s. Windows has a separate informational job that surfaces the pending LVGL DLL rework (T08 in DESKTOP_DEV.md §4) rather than failing silently. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The emulator always dlsyms lv_sdl_keyboard_create / lv_sdl_keyboard_handler and, when the app provides neither, falls back to a bare keypad indev with no read_cb. LVGL then spams "indev_read_cb is not registered" every tick. CZApp.cmake now emits weak defaults that install a proper no-op read_cb, matching LVGL's signature (returns lv_indev_t*). Apps that want real keyboard input override these with strong definitions at link time. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…d apps/nc2000 emulator submodule bumped to ci-cd branch head which enables LVGL's built-in demos (widgets, music, keypad_encoder) as host-resolved symbols. Apps can now declare `extern void lv_demo_widgets(void);` and call it from app_main without vendoring demo sources. apps/nc2000 is a new submodule pointing at CardputerZero-NC2000's ci-cd branch, which adds the port_lvgl/ frontend producing libnc2000.dylib/.so via cz_app.h. port_fb on the device is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… opt-out sdk/include/lv_conf.h mirrors the emulator's (music + keypad_encoder demos enabled) so apps using the SDK see the same LVGL feature set the host provides. sdk/cmake/CZApp.cmake gains: - demos/ header search path so apps can #include "widgets/lv_demo_widgets.h" etc. - NO_KBD_STUBS option for apps that want to resolve the host's real lv_sdl_keyboard_create at dlopen time (instead of the weak inert stub). Default weak stub stays for the 90% of apps that don't care about keyboard input. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…r-app runtime
Three small features so more app types can plug into the desktop loop
without touching emulator or UserDemo sources:
- Manifest gains cmake_args (extra -DX=Y) and cmake_target fields.
NC2000 uses both: passes ENABLE_PORT_LVGL=ON, points the SDK/LVGL
paths via ${CZ_SDK_DIR}/${CZ_LVGL_DIR} placeholders, and builds the
nc2000_lvgl target instead of the default bin_name.
- Manifest gains `env` with ${APP_DIR} substitution so apps can
declare runtime env vars (e.g. NC2000_ROM_DIR pointing at the
checked-out ROMs directory).
- New `runtime: "prebuilt-emulator-app"` for apps whose library is
built by the emulator's own CMake (e.g. APPLaunch via the UserDemo
submodule). czdev skips cmake for these and uses the pre-staged
file directly. Also fixed a same-path copy truncating the prebuilt
dylib to 0 bytes on macOS.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- apps/applaunch: prebuilt-emulator-app manifest that reuses the libAPPLaunch.dylib the emulator's own CMake produces from the UserDemo submodule. Zero edits to UserDemo. - examples/lvgl_widgets: 3-line lv_demo_widgets() call, proving the force-loaded demo symbols from the emulator are reachable. - examples/lvgl_music: lv_demo_music() — LVGL's built-in music UI. - examples/key_echo: lv_demo_keypad_encoder() — keyboard-driven navigation demo covering the "pressing keys does something" case. hello_cz gets a trivial text tweak. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lays down a working desktop development environment for CardputerZero LVGL apps on macOS and Linux — clone, run one command, see a 320×170 LCD skin with your app loaded. Same source tree builds into an aarch64
.debvia the existing CI. Windows is pre-wired with a known-issue plan (T08 indocs/DESKTOP_DEV.md §4).What you can run today
All verified running locally (macOS/arm64). CI run: https://github.com/m5stack/CardputerZero-AppBuilder/actions/runs/25414878081 (mac + Linux smoke green).
Architecture
emulator/(submodule)sdk/include/cz_app.happ_main(lv_obj_t *parent)+app_event(int, void*)+CZ_EV_*enum — same contract on desktop and on the devicesdk/include/lv_conf.hsdk/cmake/CZApp.cmakecz_add_lvgl_app(name SOURCES ...)one-liner — handles per-OS link flags, generatesui_initthunk, default weak keyboard stubs with a real indev read_cbcrates/czdev/src-tauri/—doctor / list / build / run / watch / deployapps/applaunch/libAPPLaunch.dylibthe emulator's own CMake builds; newruntime: "prebuilt-emulator-app"apps/nc2000/CardputerZero-NC2000:ci-cdwhich addsport_lvgl/alongside existingport_fb/— produceslibnc2000.dylibimplementing the cz_app.h ABI,NC2000_ROM_DIRauto-set via manifest envManifest schema (
app-builder.json)Backward-compatible extension: existing packaging fields (
package_name,version,bin_name, …) keep working. New optional fields for desktop dev:runtime:"lvgl-dlopen"(default),"legacy-deb-only","prebuilt-emulator-app"entry/event_entry: C symbol names (defaultapp_main/app_event)lvgl_version: host must match on major.minor (currently"9.5")cmake_args: extra-DX=Yargs with${CZ_SDK_DIR}/${CZ_LVGL_DIR}substitutioncmake_target: override the CMake target nameenv: runtime env vars with${APP_DIR}substitutioncaps: declared capabilities (keyboard,audio,network, …) — metadata now, wiring laterFull schema:
docs/APP_BUILDER_JSON.md.What's explicitly out of scope this round
Listed in
docs/DESKTOP_DEV.md §5:CardputerZero-Examples/scripts/dev-on-mac/Docker path)dlclose/ live reload (czdev watchrestarts the emulator instead)docs/DESKTOP_DEV.md §4. The CI has awindows-todoplaceholder job that surfaces this rather than failing silently.CI
.github/workflows/desktop-smoke.yml— mac + Linux matrix, builds the emulator + hello_cz via czdev, headless-launches withSDL_VIDEODRIVER=dummyand asserts the process survives 5 s.Submodule notes
emulator/pinned toeggfly/M5CardputerZero-Emulator:ci-cd(repo unarchived for this PR; two-commit diff: force-loadlvgl_demos+ enable music/keypad demo flags).apps/nc2000/trackseggfly/CardputerZero-NC2000:ci-cd(addsport_lvgl/and its manifest; leavesport_fb/untouched).M5CardputerZero-UserDemois not modified — APPLaunch is consumed via the emulator submodule's existing vendor path.🤖 Generated with Claude Code