From 15e8c0eccb25729e57dc9cba68d266216b2d9cd2 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 26 Mar 2026 09:31:34 +0100 Subject: [PATCH] feat: add Vita target via libretro-super recipes --- .../targets/retroarch_targets_scraper.py | 43 ++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/scripts/scraper/targets/retroarch_targets_scraper.py b/scripts/scraper/targets/retroarch_targets_scraper.py index 5d20dc69..ae500113 100644 --- a/scripts/scraper/targets/retroarch_targets_scraper.py +++ b/scripts/scraper/targets/retroarch_targets_scraper.py @@ -56,9 +56,16 @@ TARGETS: list[tuple[str, str, str]] = [ ("nintendo/wiiu/latest", "nintendo-wiiu", "ppc"), ("playstation/ps2/latest", "playstation-ps2", "mips"), ("playstation/psp/latest", "playstation-psp", "mips"), - # vita: only VPK bundles, no individual cores on buildbot + # vita: only VPK bundles on buildbot — cores listed via libretro-super recipes ] +# Recipe-based targets: (recipe_path_under_RECIPE_BASE_URL, target_name, architecture) +RECIPE_TARGETS: list[tuple[str, str, str]] = [ + ("playstation/vita", "playstation-vita", "armv7"), +] + +RECIPE_BASE_URL = "https://raw.githubusercontent.com/libretro/libretro-super/master/recipes/" + # Match any href containing _libretro followed by a platform-specific extension # Covers: .so.zip, .dll.zip, .dylib.zip, .nro.zip, .dol.zip, .rpx.zip, # .3dsx.zip, .PBP.zip, .elf.zip, _android.so.zip @@ -106,6 +113,29 @@ class Scraper(BaseTargetScraper): cores.append(core) return sorted(cores) + def _parse_recipe_cores(self, text: str) -> list[str]: + cores: list[str] = [] + seen: set[str] = set() + for line in text.splitlines(): + line = line.strip() + if not line or line.startswith("#"): + continue + parts = line.split() + if not parts: + continue + core = parts[0] + if core not in seen: + seen.add(core) + cores.append(core) + return sorted(cores) + + def _fetch_cores_for_recipe(self, recipe_path: str) -> list[str]: + url = f"{RECIPE_BASE_URL}{recipe_path}" + text = self._fetch_url(url) + if text is None: + return [] + return self._parse_recipe_cores(text) + def fetch_targets(self) -> dict: targets: dict[str, dict] = {} for path, target_name, arch in TARGETS: @@ -119,6 +149,17 @@ class Scraper(BaseTargetScraper): "cores": cores, } print(f" {target_name}: {len(cores)} cores", file=sys.stderr) + for recipe_path, target_name, arch in RECIPE_TARGETS: + print(f" fetching {target_name} (recipe)...", file=sys.stderr) + cores = self._fetch_cores_for_recipe(recipe_path) + if not cores: + print(f" warning: no cores found for {target_name}", file=sys.stderr) + continue + targets[target_name] = { + "architecture": arch, + "cores": cores, + } + print(f" {target_name}: {len(cores)} cores", file=sys.stderr) return { "platform": "retroarch", "source": self.url,