Klango added. Not really a game, but it does contain games, so it counts I guess.

This commit is contained in:
Storm Dragon committed 2026-11-26 15:22:48 -05:00
1 parent 428dfbe99a
commit 3d0d77dca3
7 files changed
+106

No files matched your search

+6
View File
@@ -24,6 +24,12 @@ else
errorList+=("Critical: Curl is not installed. Critical functionality will not work.")
fi
packageList+=("curl")
if command -v python3 &> /dev/null ; then
[[ $# -eq 0 ]] && echo "Python 3 is installed."
else
errorList+=("Warning: Python 3 is not installed. Required to install Klango and some other games.")
fi
packageList+=("python3")
if command -v dialog &> /dev/null ; then
[[ $# -eq 0 ]] && echo "Dialog is installed."
else
+17
View File
@@ -242,6 +242,23 @@ relaunch City of Division twice, check the language menu and main menu keys,
then switch away and back using the window list. Confirm the game accepts keys
after returning and does not pull focus back while you use another window.
## Klango
Choose **Klango** from `./audiogame-manager.sh -i`. AGM installs Klango 4.0.0b1
in the shared `~/.local/wine64` bottle under `C:\Program Files\Klango4`.
Native Linux Python 3 extracts the Windows ZIP with usable paths and directory
permissions; without this repair, NumPy cannot load and Klango exits at startup.
No separate setup script or Windows Python installation is needed.
An existing standalone installation in `~/.local/klango` is left intact. AGM's
installation has its own Klango preferences and account setup. Before submitting,
review the diff and test installation through both the console and graphical
menus, then launch **Klango** and check first-run prompts, speech, keyboard
navigation, game audio, and quitting/relaunching. The standalone permission
repair was confirmed working; the AGM installation still needs live acceptance.
Run `bash tests/klango_installer_tests.sh` for the isolated extraction and
failure checks, which do not start Wine or access the network or installed games.
## AI-assisted contributions
AI-assisted contributions are welcome. The person submitting the contribution remains responsible for reviewing and testing the changes before submission. Please review the generated diff, run the relevant tests, and describe what changed and how it was tested.
+79
View File
@@ -0,0 +1,79 @@
#!/usr/bin/env python3
"""Extract Klango's Windows ZIP with usable Unix paths and permissions."""
from pathlib import Path, PurePosixPath
import shutil
import stat
import sys
import zipfile
def prepare_directory(directoryPath, installPath):
parents = []
while directoryPath != installPath:
parents.append(directoryPath)
directoryPath = directoryPath.parent
parents.append(installPath)
for parentPath in reversed(parents):
if parentPath.is_symlink():
raise ValueError(f"Refusing a symbolic link: {parentPath}")
parentPath.mkdir(parents=True, exist_ok=True)
# Enter each parent before trying to inspect or create its children.
parentPath.chmod(parentPath.stat().st_mode | 0o700)
def extract_klango(archivePath, installPath):
installPath = Path(installPath).absolute()
with zipfile.ZipFile(archivePath) as archive:
entries = []
seenPaths = set()
for info in archive.infolist():
name = info.filename.replace("\\", "/")
parts = PurePosixPath(name).parts
if (not parts or parts[0] != "Klango4" or ".." in parts
or any(":" in part for part in parts)
or stat.S_ISLNK(info.external_attr >> 16)):
raise ValueError(f"Unexpected archive path: {name!r}")
relativePath = PurePosixPath(*parts[1:])
if relativePath in seenPaths:
raise ValueError(f"Duplicate archive path: {name!r}")
seenPaths.add(relativePath)
isDirectory = name.endswith("/") or bool(info.external_attr & 0x10)
if not parts[1:] and not isDirectory:
raise ValueError("The archive root must be a directory")
entries.append((info, installPath.joinpath(*parts[1:]), isDirectory))
requiredPaths = {installPath / "Klango4.exe", installPath / "_internal/python313.dll"}
if not requiredPaths.issubset({path for _, path, isDir in entries if not isDir}):
raise ValueError("Missing Klango4.exe or its bundled Python runtime")
# Reject corrupt downloads before replacing any installed application files.
badFile = archive.testzip()
if badFile:
raise ValueError(f"Archive integrity check failed: {badFile}")
for info, targetPath, isDirectory in entries:
prepare_directory(targetPath if isDirectory else targetPath.parent, installPath)
if isDirectory:
continue
if targetPath.is_symlink():
raise ValueError(f"Refusing a symbolic link: {targetPath}")
if targetPath.exists():
targetPath.chmod(targetPath.stat().st_mode | 0o600)
with archive.open(info) as source, targetPath.open("wb") as destination:
shutil.copyfileobj(source, destination)
targetPath.chmod(targetPath.stat().st_mode | 0o600)
print(f"Klango extracted to {installPath}; directory permissions repaired.")
def main():
if len(sys.argv) != 3:
print("Usage: klango-extract.py ZIP INSTALL_DIRECTORY", file=sys.stderr)
return 2
try:
extract_klango(sys.argv[1], sys.argv[2])
except (OSError, ValueError, zipfile.BadZipFile, RuntimeError) as error:
print(f"Could not extract Klango: {error}", file=sys.stderr)
return 1
return 0
if __name__ == "__main__":
sys.exit(main())
+1
View File
@@ -40,6 +40,7 @@ configure_arch() {
gst-plugins-ugly
gst-libav
p7zip
python
xdg-utils
)
if [[ "$(uname -m)" == "x86_64" ]]; then
+1
View File
@@ -16,6 +16,7 @@ configure_debian() {
gstreamer1.0-plugins-ugly:i386
mono-complete
ncurses5-dev
python3
w3m
winehq-stable
)
+1
View File
@@ -29,6 +29,7 @@ configure_fedora() {
ncurses
openal-soft
pulseaudio-libs
python3
sdl2-compat
sox
sqlite
+1
View File
@@ -16,6 +16,7 @@ configure_debian() {
gstreamer1.0-plugins-ugly:i386
mono-complete
libncurses5-dev
python3
w3m
winehq-stable
)