sys_patch_dict.py: Treat mid cycle as float

Adds more legibility to patchset
This commit is contained in:
Mykola Grymalyuk
2023-04-18 09:23:46 -06:00
parent cb45138c5f
commit e4d0e471d9

View File

@@ -58,9 +58,15 @@ class SystemPatchDictionary():
self.os_major: int = os_major
self.os_minor: int = os_minor
self.os_float: float = float(f"{self.os_major}.{self.os_minor}")
self.non_metal_os_support: list = non_metal_os_support
self.patchset_dict: dict = {}
# XNU Kernel versions
self.macOS_12_0_B7: float = 21.1
self.macOS_12_4: float = 21.5
self.macOS_12_5: float = 21.6
self._generate_sys_patch_dict()
@@ -135,7 +141,7 @@ class SystemPatchDictionary():
},
"Processes": {
# 'When Space Allows' option introduced in 12.4 (XNU 21.5)
**({"defaults write /Library/Preferences/.GlobalPreferences.plist ShowDate -int 1": True } if os_data.os_conversion.is_os_newer(os_data.os_data.monterey, 4, self.os_major, self.os_minor) else {}),
**({"defaults write /Library/Preferences/.GlobalPreferences.plist ShowDate -int 1": True } if self.os_float >= self.macOS_12_4 else {}),
"defaults write /Library/Preferences/.GlobalPreferences.plist InternalDebugUseGPUProcessForCanvasRenderingEnabled -bool false": True,
},
},
@@ -538,7 +544,7 @@ class SystemPatchDictionary():
"NVDANV50HalTesla.kext": "10.13.6",
"NVDAResmanTesla.kext": "10.13.6",
# Apple dropped NVDAStartup in 12.0 Beta 7 (XNU 21.1)
**({ "NVDAStartup.kext": "12.0 Beta 6" } if os_data.os_conversion.is_os_newer(os_data.os_data.monterey, 0, self.os_major, self.os_minor) else {})
**({ "NVDAStartup.kext": "12.0 Beta 6" } if self.os_float >= self.macOS_12_0_B7 else {})
},
},
},
@@ -569,7 +575,7 @@ class SystemPatchDictionary():
},
"/System/Library/Frameworks": {
# XNU 21.6 (macOS 12.5)
**({ "Metal.framework": "12.5 Beta 2"} if (os_data.os_conversion.is_os_newer(os_data.os_data.monterey, 5, self.os_major, self.os_minor) and self.os_major < os_data.os_data.ventura) else {}),
**({ "Metal.framework": "12.5 Beta 2"} if (self.os_float >= self.macOS_12_5 and self.os_major < os_data.os_data.ventura) else {}),
},
"/System/Library/PrivateFrameworks": {
"GPUCompiler.framework": "11.6",
@@ -602,7 +608,7 @@ class SystemPatchDictionary():
},
"/System/Library/PrivateFrameworks": {
# Restore OpenCL by adding missing compiler files
**({ "GPUCompiler.framework": "11.6"} if os_data.os_conversion.is_os_newer(os_data.os_data.monterey, 0, self.os_major, self.os_minor) else {}),
**({ "GPUCompiler.framework": "11.6"} if self.os_major >= os_data.os_data.monterey else {}),
},
},
"Install Non-Root": {