From 1ed7fe89eacec86ea940ffa300129374890834a9 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 31 Aug 2026 23:44:24 +0000 Subject: [PATCH] Add PCSX2 and Dolphin to wolf.sh's auto-download emulators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Factored the existing Azahar-only download block into a reusable _wolf_download_emulator_appimage() helper (same fetch-latest-release- and-find-.AppImage-asset logic, parameterized), then reused it for: - PCSX2 (PS2) — officially publishes Linux AppImages via GitHub Releases (PCSX2/pcsx2), same pattern as Azahar. - Dolphin (GameCube/Wii) — dolphin-emu.org's own Linux distribution is Flatpak-only, no official AppImage at all. Uses the well-regarded community AppImage build (pkgforge-dev/Dolphin-emu-AppImage) instead, with explicit warnings before the prompt and in the generated README that this is a third-party build, not an official Dolphin release — so the user can decide knowingly rather than this silently substituting an unofficial build for what looks like an official option. Motivated by a live "could not write to/read from Wii system memory" error — GameCube/Wii isn't handled by a RetroArch libretro core in any stable way (Dolphin's libretro core is unstable for Wii specifically), so ES-DE needs a real standalone Dolphin binary to hand those systems off to, the same way it already does for 3DS via Azahar. Also updated the DRY-RUN summary and the generated README's emulators section to describe all three instead of just Azahar. --- services/wolf.sh | 126 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 87 insertions(+), 39 deletions(-) diff --git a/services/wolf.sh b/services/wolf.sh index 04259c5..5cf6aa4 100644 --- a/services/wolf.sh +++ b/services/wolf.sh @@ -205,6 +205,45 @@ fi register_service wolf gaming "Cloud gaming via Moonlight (Games-on-Whales Wolf)" 47989 +# Downloads the latest GitHub-released AppImage for a standalone emulator into +# $EMU_DIR (skipped if a matching file is already there). AppImages dropped +# there are found automatically by ES-DE's app finder (it checks +# ~/Applications inside the container, mounted from emulators/) — this covers +# every system ES-DE hands off to a standalone frontend instead of a +# RetroArch libretro core (3DS, GameCube/Wii, PS2, ...). Same shape as the +# original Azahar-only download this was factored out of, just parameterized +# so PCSX2/Dolphin/anything else reuse the same fetch-latest-release logic +# instead of copy-pasting it per emulator. +_wolf_download_emulator_appimage() { + local _display_name="$1" _owner_repo="$2" _existing_glob="$3" _dir="$4" + if ls "$_dir"/$_existing_glob 2>/dev/null | grep -q .; then + log_info "$_display_name already present in $_dir/" + return 0 + fi + local _get="" + echo "" + log_info "$_display_name can be auto-downloaded." + prompt_yn "Download $_display_name AppImage now? (y/n):" "y" _get + [[ "$_get" =~ ^[Yy]$ ]] || return 0 + + log_info "Fetching latest $_display_name release from GitHub..." + local _url + _url=$(curl -fsSL "https://api.github.com/repos/${_owner_repo}/releases/latest" \ + | python3 -c "import sys,json; r=json.load(sys.stdin); \ + print(next((a['browser_download_url'] for a in r['assets'] \ + if a['name'].endswith('.AppImage')), ''))" 2>/dev/null) + if [[ -z "$_url" ]]; then + log_warning "Could not resolve download URL — get it manually from https://github.com/${_owner_repo}/releases" + return 1 + fi + local _file="$_dir/$(basename "$_url")" + curl -fL --progress-bar -o "$_file" "$_url" \ + && chmod +x "$_file" \ + && chown "$ACTUAL_USER:$ACTUAL_USER" "$_file" \ + && log_success "$_display_name downloaded: $_file" \ + || log_warning "Download failed — get it manually from https://github.com/${_owner_repo}/releases" +} + install_wolf() { require_docker || return 1 @@ -237,6 +276,8 @@ EOF echo " - Open Moonlight UFW ports: TCP ${WOLF_PORTS_TCP[*]} / UDP ${WOLF_PORTS_UDP[*]}" echo " - Start Wolf and inject Steam + EmulationStation app profiles" echo " - Create bios/ + retroarch/{cores,shaders,overlays}/ on the game drive and pre-download RetroArch cores (~1.5 GB)" + echo " - Offer to auto-download standalone emulator AppImages into emulators/:" + echo " Azahar (3DS), PCSX2 (PS2), Dolphin (GameCube/Wii — unofficial community build)" return 0 fi @@ -771,37 +812,33 @@ UDEV log_success "Storage layout: $GAME_STORAGE_DIR/{roms//,steam,saves,media,emulators,...}" log_info "ES-DE ROM directories pre-created. Drop ROMs in the matching subfolder." - # ── Optional: download Azahar (3DS emulator) ───────────────────────────── - # Azahar is an open-source Citra fork — the recommended legal 3DS emulator - # for ES-DE. AppImages dropped in emulators/ are found automatically by - # ES-DE's app finder (checks ~/Applications inside the container). - local _AZAHAR_DIR="$GAME_STORAGE_DIR/emulators" - if ! ls "$_AZAHAR_DIR"/azahar*.AppImage 2>/dev/null | grep -q .; then - local _get_az="" - echo "" - log_info "3DS emulation: Azahar (open-source Citra fork) can be auto-downloaded." - prompt_yn "Download Azahar 3DS emulator AppImage now? (y/n):" "y" _get_az - if [[ "$_get_az" =~ ^[Yy]$ ]]; then - log_info "Fetching latest Azahar release from GitHub..." - local _AZ_URL - _AZ_URL=$(curl -fsSL "https://api.github.com/repos/azahar-emu/azahar/releases/latest" \ - | python3 -c "import sys,json; r=json.load(sys.stdin); \ - print(next((a['browser_download_url'] for a in r['assets'] \ - if a['name'].endswith('.AppImage')), ''))" 2>/dev/null) - if [[ -n "$_AZ_URL" ]]; then - local _AZ_FILE="$_AZAHAR_DIR/$(basename "$_AZ_URL")" - curl -fL --progress-bar -o "$_AZ_FILE" "$_AZ_URL" \ - && chmod +x "$_AZ_FILE" \ - && chown "$ACTUAL_USER:$ACTUAL_USER" "$_AZ_FILE" \ - && log_success "Azahar downloaded: $_AZ_FILE" \ - || log_warning "Download failed — get it manually from https://github.com/azahar-emu/azahar/releases" - else - log_warning "Could not resolve download URL — get it manually from https://github.com/azahar-emu/azahar/releases" - fi - fi - else - log_info "Azahar already present in $GAME_STORAGE_DIR/emulators/" + # ── Optional: download standalone emulator AppImages ───────────────────── + # AppImages dropped in emulators/ are found automatically by ES-DE's app + # finder (checks ~/Applications inside the container). These are the + # systems ES-DE hands off to a standalone frontend rather than a + # RetroArch libretro core (Dolphin's libretro core in particular is + # unstable for Wii — confirmed live: "could not write to/read from Wii + # system memory" errors go away once a real standalone Dolphin build is + # present instead). + local _EMU_DIR="$GAME_STORAGE_DIR/emulators" + _wolf_download_emulator_appimage \ + "Azahar (3DS — open-source Citra fork)" "azahar-emu/azahar" "azahar*.AppImage" "$_EMU_DIR" + _wolf_download_emulator_appimage \ + "PCSX2 (PS2)" "PCSX2/pcsx2" "pcsx2*.AppImage" "$_EMU_DIR" + + # Dolphin itself ships no official Linux AppImage — dolphin-emu.org's own + # Linux distribution is Flatpak-only. pkgforge-dev/Dolphin-emu-AppImage is + # a well-regarded THIRD-PARTY community build, not an official Dolphin + # release — flagged explicitly rather than silently offered as if it were + # one, so skip it and grab Dolphin's own Flatpak/build by hand instead if + # you'd rather not run an unofficial build. + if ! ls "$_EMU_DIR"/*[Dd]olphin*.AppImage 2>/dev/null | grep -q .; then + log_warning "Dolphin (GameCube/Wii) has no official Linux AppImage (dolphin-emu.org ships Flatpak only)." + log_warning "The option below is a well-regarded but THIRD-PARTY community build (pkgforge-dev), not" + log_warning "an official Dolphin release." fi + _wolf_download_emulator_appimage \ + "Dolphin (GameCube/Wii, community AppImage build)" "pkgforge-dev/Dolphin-emu-AppImage" "*[Dd]olphin*.AppImage" "$_EMU_DIR" # ── App selection ───────────────────────────────────────────────────────── echo "" @@ -3055,7 +3092,7 @@ Two things live on the game drive (\`$GAME_STORAGE_DIR\`): - \`retroarch/shaders/\` → ~/.config/retroarch/shaders (shaders/CRT filters — persist) - \`retroarch/overlays/\` → ~/.config/retroarch/overlays (bezels/overlays — persist) - \`saves/\` → /mnt/games/saves (RetroArch saves & states) -- \`emulators/\` → /mnt/games/emulators + ~/Applications (Azahar 3DS AppImage, etc.) +- \`emulators/\` → /mnt/games/emulators + ~/Applications (Azahar/PCSX2/Dolphin AppImages) **2. \`wolf-state/\`** — Wolf's entire state folder (\`WOLF_STATE_DIR\` in \`.env\`). This is the key to keeping games off the OS drive: it holds @@ -3096,14 +3133,25 @@ ES-DE is usable the moment you launch it; only ROMs and BIOS are yours to add. - **Exit a game** back to ES-DE: Start+Select opens the RetroArch menu → Quit, or use the Wolf hotkey START+UP+RB (Ctrl+Alt+Shift+W on a keyboard). -## 3DS emulation -Azahar (open-source Citra fork) AppImage lives in \`emulators/\` → mounted at -\`/mnt/games/emulators\` and \`~/Applications\` (where ES-DE's app finder looks). -Point ES-DE's 3DS system at it via Alternative Emulators if it isn't -auto-detected. Re-download with: -\`\`\`bash -cd $WOLF_DIR && ./manage.sh apps -\`\`\` +## Standalone emulators (3DS / PS2 / GameCube+Wii) +RetroArch's own libretro cores handle these systems poorly or not at all +(Dolphin's libretro core in particular is unstable for Wii), so ES-DE hands +them off to standalone AppImages instead: + +- **Azahar** (3DS, open-source Citra fork) — official releases +- **PCSX2** (PS2) — official releases +- **Dolphin** (GameCube/Wii) — Dolphin itself ships no official Linux + AppImage (dolphin-emu.org's own Linux distribution is Flatpak-only); this + uses a well-regarded but **third-party** community AppImage build + (pkgforge-dev) instead. Skip it and install Dolphin's own Flatpak by hand + if you'd rather not run an unofficial build. + +All three live in \`emulators/\` → mounted at \`/mnt/games/emulators\` and +\`~/Applications\` (where ES-DE's app finder looks). Point ES-DE's +3DS/PS2/GameCube/Wii systems at one via Alternative Emulators if it isn't +auto-detected. Missing ones get offered again on a fresh install +(\`sudo ./setup.sh wolf\`); to grab just one by hand, download its AppImage +into \`emulators/\`, \`chmod +x\` it. ## Troubleshooting: app exits immediately ("Permission denied") If a launcher (Steam, etc.) closes the moment it opens, its Wolf-managed home