Fixed speech-dispatcher library in Play Palace.

This commit is contained in:
Storm Dragon
2026-02-22 06:30:55 -05:00
parent 1f7858e1fa
commit c86edee113
4 changed files with 46 additions and 48 deletions

View File

@@ -71,6 +71,7 @@ python3 .codex/skills/linux-game-manager-dev/scripts/audit_game_catalog.py
- Mismatched `.install/<Game>.sh` vs `.launch/<Game>.game` names create orphaned or invisible entries.
- Missing `installPath` reference in launcher prevents full uninstall.
- `game_removal` parses the first `installPath` match in launcher text, so comments containing `installPath` can break removal path detection.
- Missing `run_update()` in `.update` scripts breaks update flow.
- Bypassing shared download helpers risks cache and validation regressions.
- For `uv`-based Python games that use `accessible-output2`, include a host copy of `libspeechd.so.2` and export `LD_LIBRARY_PATH` from the launcher to avoid distro packaging differences.
- For `uv`-based Python games that need `speechd`, copy host Python `speechd` bindings into a game-local directory and export `PYTHONPATH` from the launcher.

View File

@@ -108,27 +108,24 @@ python3 .codex/skills/linux-game-manager-dev/scripts/audit_game_catalog.py
- For edited bash scripts, run shellcheck and fix all errors.
- If `shellcheck` is not installed, prompt the user to install it first (see `references/tooling-prereqs.md`).
## Pattern: uv + Speech Dispatcher Host Libraries
## Pattern: uv + Host Python speechd Bindings
Use this pattern for Python games installed with `uv` when runtime speech support depends on system `libspeechd`.
Use this pattern for Python games installed with `uv` when runtime speech support depends on `import speechd`.
1. In installer script:
- Check dependencies: `git` and `uv`.
- Check dependencies: `git`, `uv`, and host python binding import (`python-speechd:speechd`).
- Clone game repository into `${installPath}/<GameRepoDir>`.
- Run `uv sync` in the project directory that contains `pyproject.toml`.
- Locate `libspeechd.so.2` from host system using:
- `ldconfig -p` when available.
- Fallback paths for common distros:
- `/usr/lib/libspeechd.so.2` (Arch-style)
- `/usr/lib/x86_64-linux-gnu/libspeechd.so.2` (Debian/Ubuntu-style)
- `/usr/lib64/libspeechd.so.2` and related `/lib*` fallbacks
- Copy resolved library into a game-local directory such as:
- `${installPath}/<GameRepoDir>/<RuntimePath>/.host-libs/libspeechd.so.2`
- Fail with a clear message if library is not found.
- Resolve speechd source path from host Python via:
- `python3 -c 'import pathlib,speechd; print(pathlib.Path(speechd.__file__).resolve())'`
- Copy the module/package into a game-local directory such as:
- `${installPath}/<GameRepoDir>/<RuntimePath>/.host-python/`
- Fail with a clear message if import or copy fails.
2. In launcher script:
- Export `LD_LIBRARY_PATH` with the game-local `.host-libs` directory prepended.
- Export `PYTHONPATH` with the game-local `.host-python` directory prepended.
- Launch via `uv run ...` from the same directory used for `uv sync`.
3. Removal safety:
- Ensure first `installPath` line in launcher points to a path that lets `game_removal` infer the game root correctly.
- Do not put `installPath` in comments above that path line, because removal currently grabs the first matching line.