INNER CODE UNIT · Python
collect_runtime
CyrilPeng/Venera-Next · .github/scripts/appimage_runtime.py:81
def collect_runtime(appdir):
appdir = appdir.resolve()
lib = appdir / "usr/lib"
packages = set(RUNTIME_PACKAGES)
for package in RUNTIME_PACKAGES:
for name in output("dpkg-query", "-L", package).splitlines():
source = Path(name)
if not source.is_file() or not name.startswith(("/usr/lib/", "/usr/share/", "/etc/fonts/", "/usr/bin/")):
continue
if name.startswith(("/usr/share/doc/", "/usr/share/man/", "/usr/share/locale/")):
continue
# WebKit binds LD_LIBRARY_PATH into its child sandbox. Keep font
# configuration underneath that prefix so it remains visible there.
destination = (lib / "fontconfig" / name.removeprefix("/etc/fonts/")) if name.startswith("/etc/fonts/") else appdir / name.lstrip("/")
copy_file(source, destination)
subprocess.run([
"cc", "-O2", "-Wall", "-Wextra", "-Werror",