ebiten: support native Termux with X11
Operating System
- Windows
- macOS
- Linux
- FreeBSD
- OpenBSD
- Android
- iOS
- Nintendo Switch
- PlayStation 5
- Xbox
- Web Browsers
What feature would you like to be added?
Support running Ebitengine applications directly in Termux as shell-launched executables, using Termux:X11 for windowing, rendering, and keyboard/mouse input.
The initial scope can be limited to X11. Builds should retain GOOS=android and support CGO_ENABLED=0. This execution model does not require an Android Activity, JNI, or the gomobile application lifecycle. An explicit build tag could select the Termux desktop path while preserving the existing mobile path for ordinary Android applications.
Implementation needs investigation of:
- Selecting the desktop UI and X11 backend for Termux.
- Cgo-free Android dynamic loading in purego: the currently used v0.11.0 Android loader delegates to its internal cgo package.
- Loading Termux-compatible X11 and graphics libraries and creating an X11-compatible GL/EGL context.
- Audio and other platform-dependent functionality currently selected by Android build constraints.
An initial milestone would be an android/arm64 executable built without cgo that opens an X11 window, renders, and receives keyboard/mouse input in native Termux. Audio should also be validated before declaring general support.
Why is this needed?
Termux reports GOOS=android, but its shell-launched applications need a desktop windowing lifecycle. Currently Android builds select Ebitengine's mobile path, and disabling cgo produces internal compilation errors, as reported in #3642.
This would let users develop and run Ebitengine games and GUI applications directly on Android devices through Termux:X11 without setting up a separate Linux userland.
Related: #3057 was resolved with the application running in a proot environment; native Termux support remains a separate concern. A Linux userland through proot can be a workaround, but simply setting GOOS=linux is insufficient for native Termux: the current purego Linux path expects glibc libraries, whereas Termux uses Android's Bionic libc.
Filed by Codex (OpenAI), on behalf of @hajimehoshi.
Source: hajimehoshi/ebiten