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
This commit is contained in:
1 parent
c12ed68d19
commit
e01806f3c8
82 files changed
+5499
-117
No files matched your search
Executable
+158
@@ -0,0 +1,158 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Host unit test for Geminux Webarchy renderer profile & ultrawide vertical tab wiring."""
|
||||
import pathlib
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
BASE = pathlib.Path(__file__).resolve().parent.parent
|
||||
SOURCE = BASE / "src/webarchy/webarchy.cpp"
|
||||
FUNCTIONS = (
|
||||
"std::string deviceTreeCompatibles",
|
||||
"bool webarchySoftwareRendererPreferred",
|
||||
"void configureWebkitRenderer",
|
||||
)
|
||||
|
||||
|
||||
def extract(name, text):
|
||||
start = text.find("\n" + name + "(")
|
||||
if start < 0:
|
||||
raise SystemExit("missing function %s in src/webarchy/webarchy.cpp" % name)
|
||||
start += 1
|
||||
depth = 0
|
||||
opened = False
|
||||
for pos in range(start, len(text)):
|
||||
if text[pos] == "{":
|
||||
depth += 1
|
||||
opened = True
|
||||
elif text[pos] == "}":
|
||||
depth -= 1
|
||||
if opened and depth == 0:
|
||||
return text[start:pos + 1] + "\n"
|
||||
raise SystemExit("unterminated function %s" % name)
|
||||
|
||||
|
||||
HARNESS_HEAD = r'''
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
|
||||
static const char* g_compat_path = nullptr;
|
||||
static const char* g_home = nullptr;
|
||||
|
||||
std::string getHomeDirPath() { return std::string(g_home); }
|
||||
|
||||
SOFTWARE_FLAG
|
||||
|
||||
#define CHECK(cond) do { \
|
||||
if (!(cond)) { std::fprintf(stderr, "FAIL %s:%d: %s\n", __FILE__, __LINE__, #cond); return 1; } \
|
||||
} while (0)
|
||||
|
||||
'''
|
||||
|
||||
HARNESS_MAIN = r'''
|
||||
int main(int argc, char** argv) {
|
||||
CHECK(argc == 4);
|
||||
g_compat_path = argv[1];
|
||||
g_home = argv[2];
|
||||
const int expect_software = (argv[3][0] == '1');
|
||||
std::string flag = std::string(g_home) + kSoftwareRendererFlag;
|
||||
|
||||
CHECK(webarchySoftwareRendererPreferred() == (expect_software != 0));
|
||||
::unlink(flag.c_str());
|
||||
::setenv("WEBKIT_DISABLE_DMABUF_RENDERER", "0", 1);
|
||||
::setenv("WEBKIT_DISABLE_COMPOSITING_MODE", "0", 1);
|
||||
::setenv("JSC_useJIT", "0", 1);
|
||||
configureWebkitRenderer(false);
|
||||
CHECK(::getenv("WEBKIT_DISABLE_DMABUF_RENDERER") == nullptr);
|
||||
CHECK(::getenv("WEBKIT_DISABLE_COMPOSITING_MODE") == nullptr);
|
||||
CHECK(std::string(::getenv("JSC_useJIT")) == "0");
|
||||
|
||||
FILE* f = std::fopen(flag.c_str(), "wb");
|
||||
CHECK(f != nullptr);
|
||||
std::fclose(f);
|
||||
CHECK(webarchySoftwareRendererPreferred());
|
||||
configureWebkitRenderer(true);
|
||||
CHECK(std::string(::getenv("WEBKIT_DISABLE_DMABUF_RENDERER")) == "1");
|
||||
CHECK(std::string(::getenv("WEBKIT_SKIA_ENABLE_CPU_RENDERING")) == "1");
|
||||
CHECK(std::string(::getenv("WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS")) == "1");
|
||||
CHECK(std::string(::getenv("GDK_BACKEND")) == "x11");
|
||||
return 0;
|
||||
}
|
||||
'''
|
||||
|
||||
|
||||
def main():
|
||||
text = SOURCE.read_text(encoding="utf-8")
|
||||
for needle in (
|
||||
'gtk_box_pack_end(GTK_BOX(root), app->tabSidebar',
|
||||
'gtk_widget_set_hexpand(app->tabSidebar, FALSE)',
|
||||
'gtk_widget_set_hexpand_set(app->tabSidebar, TRUE)',
|
||||
'"wa-tabbar"',
|
||||
'"wa-tablist"',
|
||||
'g_unix_signal_add(SIGUSR1, onSigUsr1ThemeReload',
|
||||
'onWebProcessTerminated',
|
||||
'WEBKIT_WEB_PROCESS_CRASHED',
|
||||
'WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION',
|
||||
):
|
||||
if needle not in text:
|
||||
raise SystemExit("missing expected Webarchy UI/engine marker: %s" % needle)
|
||||
if 'gtk_widget_set_hexpand(GTK_WIDGET(app->tabHeaderLabel), TRUE)' in text:
|
||||
raise SystemExit("tabHeaderLabel must not set hexpand=TRUE (expands right sidebar)")
|
||||
if re.search(r"font-size:\s*[0-9.]+px", text):
|
||||
raise SystemExit("src/webarchy/webarchy.cpp CSS must use DPI-scaled 'pt' font sizes, not 'px'")
|
||||
|
||||
flag_decl = re.search(
|
||||
r'constexpr const char\* kSoftwareRendererFlag =\s*"([^"]+)";', text)
|
||||
if not flag_decl:
|
||||
raise SystemExit("missing kSoftwareRendererFlag in src/webarchy/webarchy.cpp")
|
||||
funcs = "\n".join(extract(name, text) for name in FUNCTIONS)
|
||||
funcs = funcs.replace('"/proc/device-tree/compatible"', 'g_compat_path')
|
||||
if '"/proc/device-tree/compatible"' in funcs:
|
||||
raise SystemExit("could not redirect the device-tree path")
|
||||
harness = HARNESS_HEAD.replace(
|
||||
"SOFTWARE_FLAG",
|
||||
'constexpr const char* kSoftwareRendererFlag = "%s";' % flag_decl.group(1))
|
||||
harness += funcs + HARNESS_MAIN
|
||||
with tempfile.TemporaryDirectory(prefix="geminux-webarchy-") as tmp:
|
||||
root = pathlib.Path(tmp)
|
||||
src = root / "renderer_test.cpp"
|
||||
exe = root / "renderer_test"
|
||||
compat = root / "compatible"
|
||||
home = root / "home"
|
||||
(home / ".config/geminux/webarchy").mkdir(parents=True)
|
||||
flag = home / flag_decl.group(1).lstrip("/")
|
||||
src.write_text(harness, encoding="utf-8")
|
||||
build = subprocess.run(
|
||||
["g++", "-std=c++20", "-Wall", "-Wextra", "-Werror", str(src), "-o", str(exe)],
|
||||
capture_output=True, text=True)
|
||||
if build.returncode:
|
||||
sys.stderr.write(build.stderr)
|
||||
return 1
|
||||
cases = (
|
||||
("geminux-x27", b"planet,gemini-pda\0mediatek,mt6797\0", "0", False),
|
||||
("beatles", b"nokia,beatles\0nokia,argon\0qcom,msm8905\0", "1", False),
|
||||
("geminux-x27 + override", b"planet,gemini-pda\0mediatek,mt6797\0", "1", True),
|
||||
)
|
||||
for label, data, expected, override in cases:
|
||||
compat.write_bytes(data)
|
||||
if override:
|
||||
flag.write_bytes(b"1\n")
|
||||
elif flag.exists():
|
||||
flag.unlink()
|
||||
probe = subprocess.run([str(exe), str(compat), str(home), expected],
|
||||
capture_output=True, text=True)
|
||||
if probe.returncode:
|
||||
sys.stderr.write("%s: %s" % (label, probe.stderr))
|
||||
return 1
|
||||
print("[ok] renderer profile: %s" % label)
|
||||
print("webarchy renderer & layout: all checks passed")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
Reference in new issue
Block a user