Play your Steam library's Windows games on a jailbroken PS5.
C++
Stage kit 0.10 with the Wine fixes since kit H r9
Leonardo Lobato732fecfda777
diff --git a/tests/kit_h_media_staging_test.py b/tests/kit_h_media_staging_test.pyindex 17c4e20..c5f7e3f 100644--- a/tests/kit_h_media_staging_test.py+++ b/tests/kit_h_media_staging_test.py@@ -305,17 +305,20 @@ class NormalMediaStagingTests(unittest.TestCase):class R10UpdateTests(unittest.TestCase):- """r9 -> r10: the build is r9's plus the media patches, and every cross module replaces r9's."""+ """r9 -> 0.10: the build is r9's plus the kit's patches, and every cross module replaces r9's."""BASE_PATCHES = ['0958-ntdll-honor-wine-cpu-topology-s-processor-count.patch', '0963-vkd3d-shader-hlsl.patch']def kit(self, root, extra_patch=False, new_module=False, skip_ntdll=False):cross, registration, media, _, _ = NormalMediaStagingTests().fixture(root)- previous, here = root / 'r9', root / 'r10'+ previous, here = root / 'r9', root / '0.10'runtime, template = here / 'inputs/runtime/wine', here / 'inputs/template/game'files = []modules = [('x86_64-unix', 'ntdll.prx', None, True), ('x86_64-unix', 'libgnutls.prx', None, False),('i386-windows', 'rtworkq.dll', 'syswow64', True), ('x86_64-windows', 'rtworkq.dll', 'system32', True),('x86_64-windows', 'wined3d.dll', 'system32', False)]+ modules += [('x86_64-unix', 'win32u.prx', None, True), ('x86_64-unix', 'wineserver.prx', None, True)]+ modules += [(arch, name, None, True) for arch in ('i386-windows', 'x86_64-windows')+ for name in ('kernelbase.dll', 'xaudio2_7.dll')]for arch, name, folder, rebuilt in modules:old = runtime / 'lib/wine' / arch / nameold.parent.mkdir(parents=True, exist_ok=True)@@ -355,12 +358,15 @@ class R10UpdateTests(unittest.TestCase):def test_stages_media_and_the_rebuilt_modules(self):with tempfile.TemporaryDirectory() as directory:here, previous, cross, registration, media, base = self.kit(Path(directory))- result = module.stage(here, previous, cross, registration, media, base, 'c' * 40, 'r10-dev-20261015.1')- self.assertEqual(sorted(result['changed']), ['lib/wine/i386-windows/rtworkq.dll',- 'lib/wine/x86_64-unix/ntdll.prx', 'lib/wine/x86_64-windows/rtworkq.dll'])+ result = module.stage(here, previous, cross, registration, media, base, 'c' * 40, '0.10-dev.20261015.1')+ self.assertEqual(sorted(result['changed']), [+ 'lib/wine/i386-windows/kernelbase.dll', 'lib/wine/i386-windows/rtworkq.dll',+ 'lib/wine/i386-windows/xaudio2_7.dll', 'lib/wine/x86_64-unix/ntdll.prx', 'lib/wine/x86_64-unix/win32u.prx',+ 'lib/wine/x86_64-unix/wineserver.prx', 'lib/wine/x86_64-windows/kernelbase.dll',+ 'lib/wine/x86_64-windows/rtworkq.dll', 'lib/wine/x86_64-windows/xaudio2_7.dll'])self.assertEqual(sorted(result['template_changed']), ['drive_c/windows/system32/rtworkq.dll','drive_c/windows/syswow64/rtworkq.dll'])- self.assertEqual(result['wine_patches'][-1], '0964-ntdll-ps5-retire-thread-alert-kqueues')+ self.assertEqual(result['wine_patches'][-1], '0981-win32u-register-builtin-classes-without-waiting')runtime = here / 'inputs/runtime/wine/lib/wine'self.assertEqual((runtime / 'x86_64-unix/ntdll.prx').read_bytes(), b'r10 ntdll.prx')self.assertEqual((runtime / 'x86_64-windows/wined3d.dll').read_bytes(), b'r9 wined3d.dll')@@ -368,10 +374,10 @@ class R10UpdateTests(unittest.TestCase):self.assertEqual((here / 'inputs/template/game/drive_c/windows/syswow64/rtworkq.dll').read_bytes(),b'r10 rtworkq.dll')spec = json.loads((here / 'kit-spec.json').read_text())- self.assertEqual(spec['runtime']['artifact_revision'], 'ccccccc-kit-h-r10-dev-20261015.1')+ self.assertEqual(spec['runtime']['artifact_revision'], 'ccccccc-kit-0.10-dev.20261015.1')self.assertFalse(spec['sources']['media']['playback_verified'])record = json.loads((here / 'inputs/stage-record.json').read_text())- self.assertEqual(record['r10']['base_runtime'], 'b9b0aa5-kit-h-r9')+ self.assertEqual(record['0.10']['base_runtime'], 'b9b0aa5-kit-h-r9')self.assertIn('i386-windows/winegstreamer.dll', record['cross_pe_modules'])inventory = json.loads((here / 'inputs/runtime-inventory.json').read_text())self.assertEqual(inventory['wine/lib/wine/x86_64-unix/ntdll.prx'], module.sha(runtime / 'x86_64-unix/ntdll.prx'))@@ -390,8 +396,9 @@ class R10UpdateTests(unittest.TestCase):def test_rejects_a_base_other_than_r9_and_bad_names(self):with tempfile.TemporaryDirectory() as directory:here, previous, cross, registration, media, base = self.kit(Path(directory))- with self.assertRaisesRegex(ValueError, 'name is r10'):- module.stage(here, previous, cross, registration, media, base, 'c' * 40, 'r11')+ for name in ('r10', '0.11', '0.10-dev-20261015.1'):+ with self.assertRaisesRegex(ValueError, 'name is 0.10'):+ module.stage(here, previous, cross, registration, media, base, 'c' * 40, name)module.write_json(here / 'kit-spec.json', {'runtime': {'artifact_revision': 'x-kit-h-r8'}})with self.assertRaisesRegex(ValueError, 'starts from r9'):module.stage(here, previous, cross, registration, media, base, 'c' * 40)diff --git a/tools/kit-h/README.md b/tools/kit-h/README.mdindex 5bd3a21..2d1843c 100644--- a/tools/kit-h/README.md+++ b/tools/kit-h/README.md@@ -1,6 +1,6 @@# Kit H build scripts (record)-These are the scripts that built runtime kit H, the kit this release uses. They are kept as a record. **not** a turnkey build yet: read this first.+These are the scripts that built runtime kit H and kit 0.10, the kit this release uses. They are kept as a record. **not** a turnkey build yet: read this first.## What they need@@ -77,7 +77,7 @@ report the title's direct-memory budget instead of about zero, so Fallout: New V`build_wine_ps5.sh` on 13fa077 into the same `wine-ps5` work folder as before (assert messages keep the source path, soanother folder name changes every PRX), then run `update_r8.py` on a copy of r6's inputs and spec with`PLAYDEN_CROSS_PRX` at that build's `prx/sce_module`. Only `ntdll.prx` changes, so bottles need no Recreate. Kit H r9-(the kit this release uses; runtime `d069101-kit-h-r9`) is r8 with Wine patches 0959-0963: vkd3d-shader builds the D3DX+(runtime `d069101-kit-h-r9`) is r8 with Wine patches 0959-0963: vkd3d-shader builds the D3DXeffects that DoDonPachi Resurrection and Star Wars: Empire at War compile at runtime. Build with `build_wine_ps5.sh` ond069101 into the same `wine-ps5` folder (every cross PRX must still be r8's), strip the build's `pe/*/wined3d.dll` with`*-mingw32-strip -s`, then run `update_r9.py` on a copy of r8's inputs and spec with `PLAYDEN_CROSS_PE` at those PE files.@@ -111,18 +111,22 @@ plus `share/wine/THIRD_PARTY` and neutral build provenance in `share/wine/media-FFmpeg configurations with `--enable-gpl` or `--enable-nonfree` are rejected. Use onlyLGPL GStreamer plugin sets. Package with the matching runtime revision's`tools/package_playden_kit.py` in strict mode: omit `--development-build-paths`.-A release requires zero build-path exceptions. Decoder probes alone do not qualify+The media files must add no build-path exceptions (kit 0.10 has four, all in the+prebuilt Wine Mono and Mesa DLLs, so it is packaged with `--development-build-paths` as r9 was). Decoder probes alone do not qualifythe kit for playback capability.-Kit H r10 is r9 with the media backend (Wine patches 0480-0482 and 0964). Build `build_wine_ps5.sh` on the-prospero-win commit with `--media-root` (or `build_cross.sh` with `PLAYDEN_MEDIA_WORK` set). Keep r9's build `report.json`:-the media build maps build paths out of every module, so every cross PRX and PE module differs from r9's and is replaced.-Strip the build's PE modules except `winegstreamer.dll` with `*-mingw32-strip -s` (the registration records that DLL's-hash), register `winegstreamer.dll` as above, then run `update_r10.py --kit NEW_KIT --from-kit R9_KIT --cross WINE_WORK---registration REGISTRATION_DIR --media-work MEDIA_WORK --base-report R9_REPORT --revision FULL_COMMIT` on a copy of r9's-inputs and spec, where the absolute archive paths in `media-flags.json` resolve. Staging stops before it writes when the-build's Wine commit or patch list is not r9's plus those four patches, or when the build makes a module r9 lacks (besides-`winegstreamer`; `rtworkq.dll` is now cross-built). `--name r10-dev-YYYYMMDD.N` stages a development kit with the same checks.+Kit 0.10 (the first stable kit, runtime `cd3de27-kit-0.10`) is r9 with the media backend (Wine patches 0480-0482) and+the fixes in patches 0964, 0965, 0970-0972, 0980 and 0981. Build `build_tls_ps5.sh` and `build_wine_ps5.sh` on prospero-win+cd3de27 in a fresh work folder with `--media-root` (or `build_cross.sh` with `PLAYDEN_MEDIA_WORK` set). Keep r9's build+`report.json`: the media build maps build paths out of every module, so every cross PRX and PE module differs from r9's+and is replaced. Strip the build's PE modules except `winegstreamer.dll` with `*-mingw32-strip -s` (the registration+records that DLL's hash), register `winegstreamer.dll` as above on a real x86-64 machine (32-bit Wine does not run under+Rosetta), then run `update_r10.py --kit NEW_KIT --from-kit R9_KIT --cross WINE_WORK --registration REGISTRATION_DIR+--media-work MEDIA_WORK --base-report R9_REPORT --revision FULL_COMMIT` on a copy of r9's inputs and spec, where the+absolute archive paths in `media-flags.json` resolve. Staging stops before it writes when the build's Wine commit or patch+list is not r9's plus those patches, or when the build makes a module r9 lacks (besides `winegstreamer`; `rtworkq.dll` is+now cross-built). `--name 0.10-dev.YYYYMMDD.N` stages a development kit with the same checks. Package with the pinned+prospero-win's `tools/package_playden_kit.py` (its `REQUIRED_PROVENANCE` names cd3de27).Install a matching Playden app with the kit. On the next Play, Playden merges thekit's media COM/parser values into the stopped bottle's `system.reg`, in both thediff --git a/tools/kit-h/update_r10.py b/tools/kit-h/update_r10.pyindex b5b28ff..b0e7b50 100644--- a/tools/kit-h/update_r10.py+++ b/tools/kit-h/update_r10.py@@ -1,27 +1,37 @@#!/usr/bin/env python3-"""Kit H r10: kit H r9 plus the static media backend (winegstreamer with GStreamer and FFmpeg, LGPL).+"""Kit 0.10: kit H r9 plus the static media backend (winegstreamer with GStreamer and FFmpeg, LGPL) and the Wine fixes since.-The prospero-win commit adds Wine patches 0480-0482 and 0964 to r9's: 0480-0481 build winegstreamer with static plugins and-make it fail cleanly, 0482 adds rtworkq cleanup groups and 0964 retires thread-alert kqueues in ntdll's Unix side. The media-build also maps build paths out of every module (-ffile-prefix-map), so every cross PRX and PE module comes out different from-r9's, and all of them are replaced. What is checked instead: the build's Wine commit and patch list are r9's plus exactly those-four patches, and the build makes no module r9 lacks besides winegstreamer (rtworkq.dll is now cross-built; r9 had the host-build's). The template's copies follow the runtime, and the template gets the media registry values.+The prospero-win commit adds these Wine patches to r9's: 0480-0481 build winegstreamer with static plugins and make it fail+cleanly, 0482 adds rtworkq cleanup groups, 0964 retires thread-alert kqueues in ntdll's Unix side, 0965 stops win32u's pixel+format message loop on the desktop, 0970 traces each process query class once, 0971 ends a crashed title instead of starting a+debugger, 0972 keeps FAudio's resampler inside its buffer (xaudio2_*, xactengine*), 0980 dumps long-waiting stacks in the+wineserver watchdog and 0981 registers win32u's builtin classes without waiting on another thread. The media build also maps+build paths out of every module (-ffile-prefix-map), so every cross PRX and PE module comes out different from r9's, and all of+them are replaced. What is checked instead: the build's Wine commit and patch list are r9's plus exactly those patches, and+the build makes no module r9 lacks besides winegstreamer (rtworkq.dll is now cross-built; r9 had the host build's). The+template's copies follow the runtime, and the template gets the media registry values.Copy kit H r9's inputs and kit-spec.json to the new kit folder first (cp -c works). Build with build_wine_ps5.sh--media-root (build_cross.sh with PLAYDEN_MEDIA_WORK set), strip the cross PE modules except winegstreamer.dll with*-mingw32-strip -s (its hash is the registered one), and register both winegstreamer.dll builds in a disposable prefix-(README.md, Media backend). --base-report is r9's cross build report.json. --name sets the artifact suffix, so the same-script stages a development kit (r10-dev-YYYYMMDD.N) and the release.+(README.md, Media backend). --base-report is r9's cross build report.json. --name sets the kit version in the artifact+revision, so the same script stages a development kit (0.10-dev.YYYYMMDD.N) and the release (0.10)."""import argparse, json, re, shutilfrom pathlib import Pathfrom media_staging import validate_media, stage_media, sha, write_jsonWINE_PATCHES = ['0480-winegstreamer-ps5-static-plugins.patch', '0481-winegstreamer-media-failure.patch',- '0482-rtworkq-cleanup-groups.patch', '0964-ntdll-ps5-retire-thread-alert-kqueues.patch']+ '0482-rtworkq-cleanup-groups.patch', '0964-ntdll-ps5-retire-thread-alert-kqueues.patch',+ '0965-win32u-ps5-no-pixel-format-message-loop-on-the-desktop.patch',+ '0970-ntdll-ps5-trace-each-process-query-class-once.patch', '0971-kernelbase-ps5-no-debugger-in-a-title.patch',+ '0972-faudio-keep-resampling-taps-within-the-samples.patch',+ '0980-server-ps5-dump-long-waiting-stacks-in-the-watchdog.patch',+ '0981-win32u-register-builtin-classes-without-waiting.patch']NEW = {'x86_64-unix': {'winegstreamer.prx'}, 'i386-windows': {'winegstreamer.dll'}, 'x86_64-windows': {'winegstreamer.dll'}}-REQUIRED = ['x86_64-unix/ntdll.prx', 'i386-windows/rtworkq.dll', 'x86_64-windows/rtworkq.dll']+REQUIRED = ['x86_64-unix/ntdll.prx', 'x86_64-unix/win32u.prx', 'x86_64-unix/wineserver.prx', 'i386-windows/rtworkq.dll',+ 'x86_64-windows/rtworkq.dll', 'i386-windows/kernelbase.dll', 'x86_64-windows/kernelbase.dll',+ 'i386-windows/xaudio2_7.dll', 'x86_64-windows/xaudio2_7.dll']def cross_modules(cross):@@ -31,13 +41,13 @@ def cross_modules(cross):def check_build(runtime, cross, base_report):- """The cross modules that replace r9's, after checking the build is r9's plus the media patches."""+ """The cross modules that replace r9's, after checking the build is r9's plus the kit's patches."""report = json.loads((cross / 'report.json').read_text())if report['wine_commit'] != base_report['wine_commit']:raise ValueError('Wine commit differs from r9')added, removed = set(report['patches']) - set(base_report['patches']), set(base_report['patches']) - set(report['patches'])if added != set(WINE_PATCHES) or removed:- raise ValueError(f'patches differ from r9 plus the media patches: added {sorted(added)}, removed {sorted(removed)}')+ raise ValueError(f'patches differ from r9 plus the kit patches: added {sorted(added)}, removed {sorted(removed)}')replace, unexpected = [], []for arch, sources in cross_modules(cross):for source in sources:@@ -53,23 +63,23 @@ def check_build(runtime, cross, base_report):return replace-def stage(here, previous, cross, registration, media_work, base_report, revision, name='r10'):+def stage(here, previous, cross, registration, media_work, base_report, revision, name='0.10'):here, previous, cross, registration, media_work = (Path(p).resolve() for p in (here, previous, cross, registration, media_work))if here == previous or previous in here.parents:- raise ValueError('r10 must be a separate copy of r9')+ raise ValueError('the kit must be a separate copy of r9')if not re.fullmatch('[0-9a-f]{40}', revision):raise ValueError('full runtime commit required')- if not re.fullmatch(r'r10(-dev-[0-9]{8}\.[0-9]+)?', name):- raise ValueError('name is r10 or r10-dev-YYYYMMDD.N')+ if not re.fullmatch(r'0\.10(-dev\.[0-9]{8}\.[0-9]+)?', name):+ raise ValueError('name is 0.10 or 0.10-dev.YYYYMMDD.N')evidence = validate_media(cross, registration, media_work)spec_path = here / 'kit-spec.json'spec = json.loads(spec_path.read_text().replace(str(previous) + '/', str(here) + '/'))if not spec['runtime']['artifact_revision'].endswith('-kit-h-r9'):- raise ValueError('r10 starts from r9')+ raise ValueError('kit 0.10 starts from r9')record_path = here / 'inputs/stage-record.json'record = json.loads(record_path.read_text())- if 'r10' in record:- raise ValueError('r10 already staged')+ if '0.10' in record or 'r10' in record:+ raise ValueError('kit 0.10 already staged')runtime, template = here / 'inputs/runtime/wine', here / 'inputs/template/game'replace = check_build(runtime, cross, json.loads(Path(base_report).read_text()))substitutions_path = here / 'inputs/template-substitutions.json'@@ -98,7 +108,7 @@ def stage(here, previous, cross, registration, media_work, base_report, revisionentry['after_sha256'] = sha(target)template_changed.append(entry['template_path'])- artifact = f'{revision[:7]}-kit-h-{name}'+ artifact = f'{revision[:7]}-kit-{name}'spec['runtime'].update(wine_revision=revision, artifact_revision=artifact)spec['sources']['wine']['revision'] = revisionspec['sources']['media'] = {'wine_commit': evidence['report']['wine_commit'], 'registry_idl_sha256': sha(evidence['idl']),@@ -110,20 +120,20 @@ def stage(here, previous, cross, registration, media_work, base_report, revisionwrite_json(substitutions_path, substitutions)write_json(here / 'inputs/runtime-inventory.json',{'wine/' + p.relative_to(runtime).as_posix(): sha(p) for p in sorted(runtime.rglob('*')) if p.is_file()})- record['r10'] = {'wine_patches': [p.removesuffix('.patch') for p in WINE_PATCHES], 'changed': changed, 'template_changed': template_changed,+ record['0.10'] = {'wine_patches': [p.removesuffix('.patch') for p in WINE_PATCHES], 'changed': changed, 'template_changed': template_changed,'media': media, 'base_runtime': record['artifact_revision']}record['cross_pe_modules'] = sorted(set(record.get('cross_pe_modules', [])) |{c.removeprefix('lib/wine/') for c in changed + media['changed'] if c.endswith('.dll')})record['prospero_win'] = revisionrecord['artifact_revision'] = artifactwrite_json(record_path, record)- return record['r10']+ return record['0.10']if __name__ == '__main__':parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)for option in ('kit', 'from-kit', 'cross', 'registration', 'media-work', 'base-report', 'revision'):parser.add_argument('--' + option, required=True)- parser.add_argument('--name', default='r10')+ parser.add_argument('--name', default='0.10')a = parser.parse_args()print(json.dumps(stage(a.kit, a.from_kit, a.cross, a.registration, a.media_work, a.base_report, a.revision, a.name), indent=2))