Files
geminux/scripts/test-webkit-gsettings.py
T
Luxferre e01806f3c8 Add Webarchy ultrawide browser, DNS UI, WLAN/st fixes, and media/CLI packages
- Port Webarchy GTK3/WebKit2GTK browser for 2160x1080 with flush-right vertical tab bar, DPI-scaled .Xresources SIGUSR1 theming, single-instance FIFO, and GPU crash CPU fallback (src/webarchy/webarchy.cpp, geminux-webarchy)
- Cross-compile pure-C gdk-pixbuf 2.42.12 (geminux-gdk-pixbuf) and compile rootfs GSettings schemas so webkit2gtk-4.1 and gst-plugins-good install with zero Rust ELFs
- Add zero-Rust geminux-mpv (mpv v0.40.0, FFmpeg n7.1.5, libplacebo, gst-libav 1.28.9) plus python3, py3-pip, mpg123, yt-dlp (quickjs), gnupg, gpg, pass, and pinentry-curses
- Fix MT6797 WLAN peer deauth and CCMP EAPOL GTK rekey (patch 0007), set wifi.powersave = 2, pin active WLAN connections in geminux-net, and add the DNS tab with geminux-dnsctl
- Restore st filled/hollow cursor focus across screenlock and libgemui grabs via dwm, libgemui, and st updates
- Update README.md, MANUAL.md, ARCHITECTURE.md, POWER-OPTIMIZATION.md, check-rebuild.sh, and host Python tests
2026-11-23 12:46:34 +02:00

90 lines
3.3 KiB
Python
Executable File

#!/usr/bin/env python3
"""Host test for the WebKitGTK GSettings schema build wiring in Geminux."""
import os
import pathlib
import shutil
import subprocess
import tempfile
BASE = pathlib.Path(__file__).resolve().parent.parent
HELPER = BASE / "scripts/compile-gsettings-schemas.sh"
PACKAGES = BASE / "scripts/rootfs-packages.txt"
OVERLAY = BASE / "scripts/apply-geminux-overlay.sh"
BOOTSTRAP = BASE / "scripts/bootstrap-rootfs-container.sh"
REBUILD = BASE / "rebuild-image.sh"
SCHEMA_XML = """<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema id="org.geminux.webkit.probe" path="/org/geminux/webkit/probe/">
<key name="enabled" type="b">
<default>true</default>
</key>
</schema>
</schemalist>
"""
def read(path):
return path.read_text(encoding="utf-8")
def main():
for tool in ("glib-compile-schemas", "gsettings"):
if not shutil.which(tool):
raise SystemExit("missing required host tool: %s" % tool)
if not HELPER.is_file() or not os.access(HELPER, os.X_OK):
raise SystemExit("missing executable scripts/compile-gsettings-schemas.sh")
helper = read(HELPER)
if "glib-compile-schemas --strict --targetdir" not in helper:
raise SystemExit("compile helper lost its strict targetdir compilation")
if "gschemas.compiled" not in helper:
raise SystemExit("compile helper no longer validates gschemas.compiled")
packages = {
line.strip()
for line in read(PACKAGES).splitlines()
if line.strip() and not line.lstrip().startswith("#")
}
for package in ("glib", "gsettings-desktop-schemas", "webkit2gtk-4.1", "gst-plugins-good"):
if package not in packages:
raise SystemExit("rootfs package set is missing %s" % package)
overlay = read(OVERLAY)
if "scripts/compile-gsettings-schemas.sh" not in overlay:
raise SystemExit("overlay application no longer compiles GSettings schemas")
bootstrap = read(BOOTSTRAP)
if "apk add --no-cache python3 kmod openssl glib" not in bootstrap:
raise SystemExit("bootstrap container no longer installs glib host tools")
rebuild = read(REBUILD)
if " glib " not in rebuild:
raise SystemExit("image build container no longer installs glib host tools")
print("[ok] WebKit GSettings package and build wiring")
with tempfile.TemporaryDirectory(prefix="geminux-gsettings-") as tmp:
root = pathlib.Path(tmp)
schema_dir = root / "usr/share/glib-2.0/schemas"
schema_dir.mkdir(parents=True)
(schema_dir / "org.geminux.webkit.probe.gschema.xml").write_text(
SCHEMA_XML, encoding="utf-8")
result = subprocess.run(
[str(HELPER), str(root)], capture_output=True, text=True)
if result.returncode != 0:
raise SystemExit("schema compile failed:\n%s" % result.stderr.strip())
compiled = schema_dir / "gschemas.compiled"
if not compiled.is_file() or compiled.stat().st_size == 0:
raise SystemExit("helper did not produce gschemas.compiled")
env = os.environ.copy()
env["GSETTINGS_SCHEMA_DIR"] = str(schema_dir)
listed = subprocess.run(
["gsettings", "list-schemas"], env=env,
capture_output=True, text=True)
if listed.returncode != 0 or \
"org.geminux.webkit.probe" not in listed.stdout:
raise SystemExit("compiled schema database is not readable by gsettings")
print("[ok] WebKit GSettings schema compilation")
if __name__ == "__main__":
main()