Fix attempt #2 GI_TYPELIB_PATH is read before set
On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: install-scripts/ags.sh
This commit is contained in:
@@ -137,30 +137,35 @@ const exitCode = await module.main([programInvocationName, ...programArgs]);
|
|||||||
exit(exitCode);
|
exit(exitCode);
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Also install a convenience launcher in /usr/local/bin/ags
|
# Also install a convenience launcher in /usr/local/bin/ags as a shell wrapper
|
||||||
|
# so GI_TYPELIB_PATH is set *before* gjs and GIRepository are initialized.
|
||||||
sudo mkdir -p /usr/local/bin
|
sudo mkdir -p /usr/local/bin
|
||||||
sudo tee /usr/local/bin/ags >/dev/null <<'EOF'
|
sudo tee /usr/local/bin/ags >/dev/null <<'EOF'
|
||||||
#!/usr/sbin/gjs -m
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
import { exit, programArgs, programInvocationName } from "system";
|
# Start from user's home for configs that expect $HOME.
|
||||||
import GLib from "gi://GLib";
|
cd "$HOME" 2>/dev/null || true
|
||||||
|
|
||||||
GLib.setenv("GI_TYPELIB_PATH", "/usr/local/lib:/usr/lib/girepository-1.0", true);
|
# Locate AGS ESM entry
|
||||||
|
MAIN_JS="/usr/local/share/com.github.Aylur.ags/com.github.Aylur.ags"
|
||||||
|
if [ ! -f "$MAIN_JS" ]; then
|
||||||
|
MAIN_JS="/usr/share/com.github.Aylur.ags/com.github.Aylur.ags"
|
||||||
|
fi
|
||||||
|
if [ ! -f "$MAIN_JS" ]; then
|
||||||
|
echo "Unable to find AGS entry script (com.github.Aylur.ags) in /usr/local/share or /usr/share" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
imports.package.init({
|
# Ensure GI typelibs and native libs are discoverable before gjs ESM loads
|
||||||
name: "com.github.Aylur.ags",
|
export GI_TYPELIB_PATH="/usr/local/lib64:/usr/local/lib:/usr/local/lib64/girepository-1.0:/usr/local/lib/girepository-1.0:/usr/lib/x86_64-linux-gnu/girepository-1.0:/usr/lib/girepository-1.0:/usr/lib64/girepository-1.0:/usr/lib64/ags:${GI_TYPELIB_PATH-}"
|
||||||
version: "1.9.0",
|
export LD_LIBRARY_PATH="/usr/local/lib64:/usr/local/lib:${LD_LIBRARY_PATH-}"
|
||||||
prefix: "/usr/local",
|
|
||||||
libdir: "/usr/local/lib",
|
|
||||||
});
|
|
||||||
|
|
||||||
const module = await import("resource:///com/github/Aylur/ags/main.js");
|
exec /usr/bin/gjs -m "$MAIN_JS" -- "$@"
|
||||||
const exitCode = await module.main([programInvocationName, ...programArgs]);
|
|
||||||
exit(exitCode);
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
sudo chmod +x /usr/local/bin/ags
|
sudo chmod +x /usr/local/bin/ags
|
||||||
printf "${OK} AGS launcher installed.\n"
|
printf "${OK} AGS launcher installed.\\n"
|
||||||
# Move logs to Install-Logs directory
|
# Move logs to Install-Logs directory
|
||||||
mv "$MLOG" ../Install-Logs/ || true
|
mv "$MLOG" ../Install-Logs/ || true
|
||||||
cd ..
|
cd ..
|
||||||
|
|||||||
Reference in New Issue
Block a user