From 7afaf65973cf5d23209df95a5d189b56ca4974a2 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Mon, 3 Nov 2025 17:08:58 -0500 Subject: [PATCH] =?UTF-8?q?Arch:=20robust=20AGS=20v1.9.0=20fix=20=E2=80=94?= =?UTF-8?q?=20env=20wrapper=20+=20hardened=20launcher=20patching?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem - AGS v1 under GJS ESM ignores GIR Repository.prepend_*; typelibs in /usr/local aren’t discovered reliably. - On Arch, users may install AGS into /usr/local while system typelibs can also live under /usr/lib64/ags or /usr/lib/ags. Solution - Keep the tolerant ESM patcher (no-op safe): remove deprecated GIR repo calls; ensure GLib import; inject GI_TYPELIB_PATH via GLib.setenv when editing the ESM main. - Add a distro-agnostic wrapper at /usr/local/bin/ags that sets: - GI_TYPELIB_PATH=/usr/local/lib64/girepository-1.0:/usr/local/lib/girepository-1.0:/usr/lib64/girepository-1.0:/usr/lib/girepository-1.0:/usr/local/lib64:/usr/local/lib:/usr/lib64/ags:/usr/lib/ags:$GI_TYPELIB_PATH - LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:$LD_LIBRARY_PATH Then execs: /usr/bin/gjs -m "$MAIN_JS" (resolved under /usr/local/share or /usr/share). Why - Ensures AGS v1 runs reliably on Arch without depending solely on fragile in-place edits; mirrors the working Fedora fix. File - install-scripts/ags.sh --- install-scripts/ags.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/install-scripts/ags.sh b/install-scripts/ags.sh index 74ff0a6..345cd99 100755 --- a/install-scripts/ags.sh +++ b/install-scripts/ags.sh @@ -99,6 +99,23 @@ if git clone --depth=1 https://github.com/JaKooLit/ags_v1.9.0.git; then sudo awk '{print} $0 ~ /^import GLib from "gi:\/\/GLib";$/ {print "const __old = GLib.getenv(\"GI_TYPELIB_PATH\");"; print "GLib.setenv(\"GI_TYPELIB_PATH\", \"/usr/local/lib\" + (__old ? \":\" + __old : \"\"), true);"}' "$LAUNCHER" | sudo tee "$LAUNCHER" >/dev/null printf "${OK} AGS launcher patched.\n" + + # Create an env-setting wrapper for AGS to ensure GI typelibs/libs are discoverable + printf "${NOTE} Creating env wrapper /usr/local/bin/ags...\n" + MAIN_JS="/usr/local/share/com.github.Aylur.ags/com.github.Aylur.ags" + if ! sudo test -f "$MAIN_JS"; then + MAIN_JS="/usr/share/com.github.Aylur.ags/com.github.Aylur.ags" + fi + sudo tee /usr/local/bin/ags >/dev/null <