mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-20 10:23:16 -05:00
fix: read the Steam macOS RetroArch as portable
This commit is contained in:
1 parent
7e71f06c57
commit
11fe7fada2
5 files changed
+28
-5
No files matched your search
+1
-1
@@ -8,7 +8,7 @@ param(
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$defaultInstallUrl = "https://raw.githubusercontent.com/Abdess/retrobios/main/install.py"
|
||||
$defaultInstallSha256 = "142edea98e646ed11e27052d3dd02125a27d4cdb7ee04392e6af8fcd28f9762f"
|
||||
$defaultInstallSha256 = "bf522ef64ecbefc14202a879b6c943e44939dfda37eb416b1897070ad7cefa85"
|
||||
$maximumInstallerBytes = 2MB
|
||||
$installerExit = 0
|
||||
$installer = if ($PSScriptRoot) { Join-Path $PSScriptRoot "install.py" } else { $null }
|
||||
|
||||
+10
-2
@@ -567,11 +567,19 @@ def _windows_retroarch_dirs() -> list[Path]:
|
||||
|
||||
def _macos_retroarch_base() -> Path:
|
||||
"""Where RetroArch on macOS keeps its system folder by default:
|
||||
~/Documents/RetroArch, or Application Support/RetroArch when that folder
|
||||
holds portable.txt (platform_darwin.m)."""
|
||||
~/Documents/RetroArch, or Application Support/RetroArch for a portable
|
||||
install. The Steam build is always portable (platform_darwin.m, `#if
|
||||
HAVE_STEAM portable = YES`), with no portable.txt to say so: its
|
||||
bundle under Steam's library, and no other RetroArch.app, mark it."""
|
||||
support = Path.home() / "Library" / "Application Support" / "RetroArch"
|
||||
if (support / "portable.txt").is_file():
|
||||
return support
|
||||
steam = (
|
||||
Path.home() / "Library" / "Application Support" / "Steam" / "steamapps"
|
||||
/ "common" / "RetroArch" / "RetroArch.app"
|
||||
)
|
||||
if steam.is_dir() and not Path("/Applications/RetroArch.app").is_dir():
|
||||
return support
|
||||
return Path.home() / "Documents" / "RetroArch"
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ esac
|
||||
TEMP_INSTALLER=""
|
||||
TEMP_DIRECTORY=""
|
||||
DEFAULT_INSTALL_URL="https://raw.githubusercontent.com/Abdess/retrobios/main/install.py"
|
||||
DEFAULT_INSTALL_SHA256="142edea98e646ed11e27052d3dd02125a27d4cdb7ee04392e6af8fcd28f9762f"
|
||||
DEFAULT_INSTALL_SHA256="bf522ef64ecbefc14202a879b6c943e44939dfda37eb416b1897070ad7cefa85"
|
||||
MAX_INSTALLER_BYTES=2097152
|
||||
|
||||
cleanup() {
|
||||
|
||||
@@ -2826,5 +2826,20 @@ class WindowsSeenFromWsl(unittest.TestCase):
|
||||
self.assertEqual(os.environ["ProgramFiles"], "")
|
||||
|
||||
|
||||
class SteamRetroArchOnMacIsPortable(unittest.TestCase):
|
||||
"""platform_darwin.m makes the Steam build portable (HAVE_STEAM) with no
|
||||
portable.txt: a default system_directory is Application Support's, and
|
||||
the installer took ~/Documents/RetroArch/system."""
|
||||
|
||||
def test_the_steam_bundle_moves_the_base(self):
|
||||
home = Path(_tempdir(self))
|
||||
support = home / "Library" / "Application Support"
|
||||
with unittest.mock.patch.dict(os.environ, {"HOME": str(home)}), \
|
||||
unittest.mock.patch.object(Path, "home", return_value=home):
|
||||
self.assertEqual(install._macos_retroarch_base(), home / "Documents" / "RetroArch")
|
||||
(support / "Steam/steamapps/common/RetroArch/RetroArch.app").mkdir(parents=True)
|
||||
self.assertEqual(install._macos_retroarch_base(), support / "RetroArch")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
+1
-1
@@ -306,7 +306,7 @@ WSL does not pass them. A forced `--platform retrobat` falls back to
|
||||
| `~/.var/app/org.libretro.RetroArch/config/retroarch/retroarch.cfg` | RetroArch (Flatpak) | `system_directory` |
|
||||
| `~/snap/retroarch/current/.config/retroarch/retroarch.cfg` | RetroArch (Snap) | `system_directory` |
|
||||
| `~/.config/retroarch/retroarch.cfg` | RetroArch (native) | `system_directory` |
|
||||
| `~/Library/Application Support/RetroArch/config/retroarch.cfg` | RetroArch (macOS) | `system_directory`; at default, `~/Documents/RetroArch/system` (portable: `Application Support/RetroArch/system`) |
|
||||
| `~/Library/Application Support/RetroArch/config/retroarch.cfg` | RetroArch (macOS) | `system_directory`; at default, `~/Documents/RetroArch/system` (portable, Steam build included: `Application Support/RetroArch/system`) |
|
||||
| `retroarch.cfg` beside `retroarch.exe` (`C:\RetroArch-Win64`, `C:\RetroArch`, `Program Files\RetroArch`) | RetroArch (Windows) | `system_directory`; at default or without a config, `system` beside the exe |
|
||||
| `%APPDATA%\RetroArch\retroarch.cfg` | RetroArch (Windows) | `system_directory`, read when the exe folder has no config |
|
||||
| `%ProgramFiles(x86)%\Steam\steamapps\common\RetroArch\retroarch.cfg` | RetroArch (Steam) | `system_directory` |
|
||||
|
||||
Reference in new issue
Block a user