Skip to content

Fix macOS AU build setup#31

Open
lpla wants to merge 56 commits into
tommitytom:dpffrom
lpla:fix/dpf-macos-au-build
Open

Fix macOS AU build setup#31
lpla wants to merge 56 commits into
tommitytom:dpffrom
lpla:fix/dpf-macos-au-build

Conversation

@lpla

@lpla lpla commented Jun 4, 2026

Copy link
Copy Markdown

Make the DPF branch build a macOS AU plugin reliably on current macOS.

  • Prefer Apple framework locations for SDL2.framework before falling back to pkg-config SDL2.
  • Use portable CPU-count detection in build.sh on macOS.
  • Allow RPC schema generation and tjsc bytecode generation to use host-built tools when building Apple target architectures that do not include the host architecture.
  • Build the SameBoy pb12 helper for the host architecture on Apple so arm64-only target builds can still run the helper on Intel hosts.
  • Update submodules for the DPF, rpcpp, and lv_binding_js fixes.

Depends on:

Validation:

  • Built retroplug-au for x86_64 and validated with auval -v aumu RPlg Dstr.
  • Built retroplug-au for arm64 using host-built rpc-schema-dump, tjsc, and retroplug-export overrides.
  • Built retroplug-au as universal x86_64;arm64; lipo confirmed both slices in the AU binary and helper tools.
  • Codesigned and installed the universal AU to ~/Library/Audio/Plug-Ins/Components/retroplug.component; auval -v aumu RPlg Dstr succeeded on the Intel host.

tommitytom and others added 30 commits May 17, 2026 00:12
Upstream DPF's CLAP stateLoad reads buffer[i] after restoring the byte
at the chunk boundary, which can be uninitialised stack memory; when it
happens to be zero, partial keys/values are processed as complete.
Fix lives on fix-clap-stateload-chunk-boundary in the fork. Revert
.gitmodules to DISTRHO/DPF once the fix lands upstream.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The three UI generation steps (gen-rpc-ts → bundle.js → bundle_data.c)
used add_custom_command(OUTPUT ...) rules with timestamp-tracked DEPENDS.
Three failure modes kept producing stale builds:

- Adding a new ui/*.tsx file didn't enter the glob until a reconfigure.
- Schema changes via rpc-schema-dump didn't always propagate through
  CMake's target-as-dep timestamp comparison.
- Per-variant bundle_data.c.o stayed at the old version even after
  bundle_data.c refreshed.

Replace all three rules with one add_custom_target(ui-regenerate ALL).
Run every build (~1-2s total). Guard the .c with `cmake -E
copy_if_different` so the C compile + plugin link stay incremental when
content didn't actually change. Make gen-rpc-ts.js's post-process
write-on-change so PluginService.ts mtime stays quiet for IDE consumers.

Verified: no-op build leaves binary mtime + hash unchanged; comment-only
schema touch produces identical .ts/.c bytes; adding a new tsx + import
relinks the plugin without `cmake -S . -B build`. retroplug-tests still
passes (23,319 assertions in 64 cases).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The first cut of the kit editor failed on three fronts: only 9 of 16
slots visible (column clipped), input dead (keyboard group was empty),
and floating scrollbar artifacts (overflow content in nested flex rows).
Per a screenshot the user shared, the footer was entirely off-screen.

Rewrite as a single vertical flex column (no nested rows) sized to fit
a 480x640 window so all 16 slots + section header + sample list + 3
footer rows render without clipping. Request 480x700 on mount via
plugin.setWindowSize so the standalone/host can grow the window.

Fix the focus-group wiring: items now register synchronously during
render via claimRefIdx() instead of the previous closure-captured
nextRefIdx that read stale values during JSX construction (causing all
refs to be indexed in reverse and the highlight to land on the wrong
row). Pattern lifted from MenuOverlay's working setup — refs[],
group.add(ref), group.focus(refs[0]), setKeyboardGroup(group). Hand
keyboard back to the parent sinkGroup on unmount so the menu/grid
receives keys again.

Replace non-ASCII glyphs (em-dash, ellipsis, ×) with ASCII equivalents
since LVGL's default font renders them as fallback rectangles.

Verified end-to-end with the Xvfb harness + RETROPLUG_AUTOLOAD_ROM:
the editor opens via menu nav, all 16 slots + footer render, and
arrow-key focus moves correctly (slot 03 highlights after 3 Downs).
Mouse clicks couldn't be verified under headless Xvfb (DPF's pointer
indev doesn't receive xdotool synthetic events for either the menu or
the editor), but the onClick wiring is identical to MenuOverlay which
works in real desktop sessions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
KitEditor.tsx's last commit showed up as `Bin 19962 -> 20787 bytes`
because git's binary heuristic picked up the UTF-8 em-dashes and arrows
in inline comments. The file is plain TypeScript; force a text diff so
review tooling shows the actual change instead of a binary churn line.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Picks up the submodule fix that adds LV_OBJ_FLAG_CLICKABLE to Text and
View component constructors. Pointer clicks on those widgets now fire
their onClick handlers — previously hit-testing skipped them and only
the keyboard (focused-widget) dispatch path worked, which is why mouse
input has never functioned anywhere in the UI (menu, kit editor,
emulator tiles).

Verified the rebuild propagates: lvgl-js-native.dir/.../{text,view}.cpp.o
recompile, plugin variants relink. Tests stay green (69 cases / 23 337
assertions). Real-desktop click verification needs to happen in a host
since Xvfb doesn't deliver synthetic mouse events to DPF.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lpla lpla marked this pull request as ready for review June 4, 2026 09:13
@tommitytom

Copy link
Copy Markdown
Owner

Thanks for this! I'll give this a proper look over the next couple of days - I'm a bit weary of the changes to DPF since that should already support MacOS and ideally I'd like to not be using a fork of it. Also worth mentioning the dpf branch is a work in progress, there are a lot of missing features. Don't trust your projects to it as you may experience data loss!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants