Context:
- On systems where AGS v1 installs its typelibs to /usr/local/lib, gjs ESM imports like gi://GIRepository?version=2.0 fail with:
"Typelib file for namespace 'GIRepository', version '2.0' not found"
even though typelibs exist under /usr/lib{,64}/girepository-1.0.
- The upstream AGS launcher tries to call GIR.Repository.prepend_search_path()/prepend_library_path(),
but in recent GI (1.86) these are not available from the ESM namespace.
Changes:
- Replace import GIR from "gi://GIRepository?version=2.0" with import GLib from "gi://GLib" in the installed launcher.
- Remove deprecated GIR.Repository.prepend_search_path and prepend_library_path calls.
- Immediately after the GLib import, export GI_TYPELIB_PATH in-process so gjs finds typelibs under /usr/local/lib:
const __old = GLib.getenv('GI_TYPELIB_PATH');
GLib.setenv('GI_TYPELIB_PATH', '/usr/local/lib' + (__old ? ':' + __old : ''), true);
Result:
- ags -t overview no longer errors on GIRepository; proceeds until a GTK display is required.
- Behavior is scoped to the AGS process; no user shell env changes required.
Notes:
- Verified by patching an installed launcher on a target host; GI errors resolved.