Drop the on-device GCC suite and Janet runtime, keep Yabasic FFI intact

- Remove gcc, g++, musl-dev, make, janet, janet-dev and jpm from
  scripts/rootfs-packages.txt and add them to the prune denylist; 14 packages
  and 143.86 MiB disappear, with no runtime callers in the overlay.
- Verify the Yabasic chain by running the real armv7 binaries under qemu-arm
  in a chroot of the rebuilt rootfs: yabasic 2.92.1, basic print, import neonet
  (libffi -> libcurl.so.4) and import neoui (libffi -> libneoui.so) all work.
- Guard yabasic/yabasic-doc as critical, forbid compiler/Janet packages, and
  check the NeoUI/NeoNet FFI artifacts in check-rebuild.sh.
- Update README.md, MANUAL.md, AGENTS.md and SDK.md; replace the on-device
  compile examples with cross-compilation guidance and add SDK.md section 7,
  an inventory of paramount versus removable scripting runtimes.
- Rebuild images/bananarchy-nokia-argon.img (1.66 GiB, down from 1.84 GiB)
  and confirm via debugfs that the compiler/Janet binaries are gone while
  yabasic, libneoui.so, neoui.yab, neonet.yab and libcurl are present.
This commit is contained in:
Luxferre committed 2026-11-05 14:58:30 +02:00
1 parent dc2b6f6364
commit 2da4c86923
8 files changed
+96 -17

No files matched your search

+55 -5
View File
@@ -138,11 +138,20 @@ Any widget parameter accepting `icon_str` (or `neoui_icon(name)`) resolves the f
## 3. C SDK reference (`/usr/include/neoui.h`)
### 3.1 Compiling C applications on the device
### 3.1 Cross-compiling C applications
Bananarchy ships no on-device compiler. Build native C/C++ code on a host with
the same `armv7` cross toolchain used by `scripts/build-sxmo-x11.sh`:
```bash
gcc -O2 myapp.c -lneoui -o myapp
armv7-alpine-linux-musleabihf-gcc -O2 --sysroot=/path/to/armv7-sysroot \
-I/path/to/armv7-sysroot/usr/include myapp.c -lneoui -o myapp
```
`/usr/include/neoui.h` and `/usr/lib/libneoui.so` remain on the device for
runtime linking. For on-device programming, use the Yabasic FFI wrappers
(`import neoui`, `import neonet`); they need only `yabasic`, `libffi`,
`libneoui.so`, and `libcurl.so.4`, all of which are part of the base image.
### 3.2 C function summary
#### Window and daemon lifecycle
@@ -358,11 +367,15 @@ int main(void) {
When `#include <neoui.h>` is compiled under C++, it also exposes the `bananarchy` namespace used by Bananarchy's native DWM plugins (`src/dwm-plugins/*.cpp` and `src/xdrawer/xdrawer.cpp`).
### 4.1 Compiling C++ applications or plugins
### 4.1 Cross-compiling C++ applications or plugins
Use the `armv7` cross toolchain from `scripts/build-sxmo-x11.sh` (no on-device
compiler is shipped):
```bash
g++ -O2 -std=c++17 myapp.cpp \
armv7-alpine-linux-musleabihf-g++ -O2 -std=c++20 \
--sysroot=/path/to/armv7-sysroot \
$(pkgconf --cflags --libs x11 xft fontconfig freetype2 pango pangoxft) \
-lneoui -o myapp
myapp.cpp -lneoui -o myapp
```
### 4.2 Core C++ classes and helpers
@@ -661,3 +674,40 @@ print "UDP DNS resolved example.com -> ", ip$
r = neonet_cleanup()
```
---
## 7. On-device scripting runtime inventory
Bananarchy no longer ships an on-device compiler (`gcc`, `g++`, `musl-dev`,
`make`) or the Janet runtime (`janet`, `janet-dev`, `jpm`). Native code is
cross-compiled with `scripts/build-*.sh`; on-device development goes through
the Yabasic FFI SDK in sections 5 and 6.
### 7.1 Absolutely paramount (hard runtime dependencies)
| Runtime | Why it cannot be removed |
| --- | --- |
| `yabasic` + `yabasic-doc` | Executes `neoui.yab` / `neonet.yab`, the `~/Projects/*.yab` examples, and `bulls_cows.yab`; needs `libX11`, `libncursesw`, `libffi`, `libc`. |
| `libneoui.so` + `libcurl.so.4` + `libffi` | FFI targets of `neoui.yab` and `neonet.yab`; all of their `DT_NEEDED` libraries come from the X11/GTK/curl stack. |
| `python3` | `bananarchy-bt-obex` (Bluetooth OBEX), `msm-modem-uim-selection` (QMI voice), `sleep-inhibitor`, `bluez-simple-agent`, `umpv`, and the `yt-dlp` chain. |
| `bash` | Hard dep of `wireguard-tools-wg-quick`; the prebuilt `gsocket` scripts (`gsocket`, `gs-mount`, `gs-sftp`, `blitz`) use `#!/usr/bin/env bash`. |
| `tcl` | Hard dep of `expect`, which is a hard dep of `sxmo-utils-common`. |
| `luajit` | Hard dep of `mpv` (Sxmo audio/video playback). |
| `gawk`, `jq` | Hard deps of `sxmo-utils`. |
| `gojq` | Hard dep of `postmarketos-base-ui-networkmanager`. |
| `quickjs` | Hard dep of the `yt-dlp-ejs` chain pulled in by `sxmo-utils-common`. |
### 7.2 Removable without on-device regressions
| Packages | Approx. size | Notes |
| --- | --- | --- |
| `perl`, `perl-io-socket-ssl` | 31.8 MiB | `git` itself does not depend on Perl; only the optional `git svn` / `git send-email` helpers (`git-perl`, `perl-git`) would go. No overlay script invokes Perl. |
| `tcl-lib`, `tcl-tls`, `sqlite-tcl` | 12.1 MiB | Optional Tcl extensions with no reverse dependencies and no usage; `tcl` itself must stay for `expect`. |
| `lua5.4`, `lua5.4-dev`, `lua5.5`, `lua5.5-dev` | 3.0 MiB | No runtime callers; `mpv` uses `luajit`, not these. Removing them also requires dropping the `lua`/`luac` symlinks in `bootstrap-rootfs-container.sh` / `rebuild-image.sh` and the `lua5.5` critical-binary check. |
| `sqlite` (CLI) | 1.3 MiB | `sqlite-libs` stays (hard dep of WebKitGTK and Python); only the interactive CLI is unused. |
| `bc`, `ed`, `rlwrap` | 0.3 MiB | Interactive conveniences with no runtime callers. |
| `frotz`, `mandoc`, `nano`, `less` | small | Documented user-facing tools, not runtimes; removable only with matching documentation changes. |
These are recommendations, not applied changes: the current package set still
contains them so that the documented on-device scripting environment stays
intact.