diff --git a/ports/muos/glyph/retrobios.png b/ports/muos/glyph/retrobios.png new file mode 100644 index 000000000..e869124c6 Binary files /dev/null and b/ports/muos/glyph/retrobios.png differ diff --git a/scripts/build_port.py b/scripts/build_port.py index b8ca5d671..6259433d8 100644 --- a/scripts/build_port.py +++ b/scripts/build_port.py @@ -109,6 +109,10 @@ def archive_members(name: str, root: Path = REPO_ROOT) -> list[tuple[str, Path | members = [ ("RetroBIOS/mux_launch.sh", source / "mux_launch.sh"), ("RetroBIOS/README.md", source / "README.md"), + # muOS draws an application's list glyph from glyph/.png + # in its own folder (apply_app_glyph, frontend common/ui/glyph.c): + # `# ICON: retrobios` resolved to nothing without it. + ("RetroBIOS/glyph/retrobios.png", source / "glyph" / "retrobios.png"), *_engine("RetroBIOS", root), ] elif name == TOOLS_ZIP: diff --git a/tests/test_handheld_launchers.py b/tests/test_handheld_launchers.py index 1427af7ac..3db152f52 100644 --- a/tests/test_handheld_launchers.py +++ b/tests/test_handheld_launchers.py @@ -309,6 +309,28 @@ class TheArchives(unittest.TestCase): self.assertEqual(top, []) self.assertIn("RetroBIOS/retrobios.gptk", names) + def test_the_muos_icon_is_the_glyph_its_header_names(self): + """muOS reads glyph/.png in the application's folder, and the + muxapp named an icon it did not carry.""" + header = (REPO_ROOT / "ports" / "muos" / "mux_launch.sh").read_text() + icon = re.search(r"^# ICON: (\S+)$", header, re.MULTILINE).group(1) + name = build_port.MUOS_APP + with zipfile.ZipFile(build_port.build_archive(name, self.out / name)) as zf: + data = zf.read(f"RetroBIOS/glyph/{icon}.png") + self.assertEqual(data[:8], b"\x89PNG\r\n\x1a\n") + + def test_no_tools_support_file_is_a_menu_entry(self): + """EmulationStation lists a folder only when it holds a file of the + system's extension (.sh for Tools and Ports): batocera-emulationstation + and EmulationStation-fcamod SystemData.cpp drop a folder with none. + The support folders must keep none, or each shows up in the menu.""" + for name in (build_port.TOOLS_ZIP, build_port.PORT_ZIP, build_port.BATOCERA_ZIP): + with self.subTest(archive=name): + with zipfile.ZipFile(build_port.build_archive(name, self.out / name)) as zf: + inside = [n for n in zf.namelist() + if "/" in n and n.lower().endswith(".sh")] + self.assertEqual(inside, []) + def test_each_carries_the_pinned_installer(self): pinned = build_port.pinned_installer_sha256() for name, (_script, folder) in self.LAYOUT.items():