INNER CODE UNIT · Python
validate_runtime
CyrilPeng/Venera-Next · .github/scripts/appimage_runtime.py:153
def validate_runtime(appdir):
appdir = appdir.resolve()
lib = appdir / "usr/lib"
for binary in (p for p in appdir.rglob("*") if is_elf(p)):
for dependency in dependencies(binary, f"{lib / 'venera-next/lib'}:{lib}"):
if not dependency.is_relative_to(appdir) and not HOST_LIBRARIES.fullmatch(dependency.name):
raise RuntimeError(f"{binary} still requires host library {dependency}")
def runtime_environment(triplet):
return '''# Sourced by AppRun; APPDIR is the extracted or mounted image root.
export LD_LIBRARY_PATH="$APPDIR/usr/lib/venera-next/lib:$APPDIR/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export WEBKIT_INJECTED_BUNDLE_PATH="$APPDIR/usr/lib/TRIPLET/webkit2gtk-4.1/injected-bundle"
export XDG_DATA_DIRS="$APPDIR/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
export GSETTINGS_SCHEMA_DIR="$APPDIR/usr/share/glib-2.0/schemas"
export FONTCONFIG_PATH="$APPDIR/usr/lib/fontconfig"
export FONTCONFIG_FILE="$APPDIR/usr/lib/fontconfig/fonts.conf"
export GIO_MODULE_DIR="$APPDIR/usr/lib/TRIPLET/gio/modules"