Skip to content

Commit

Permalink
sys_patch: Expand 32023 patching for 14.2 Beta 2+
Browse files Browse the repository at this point in the history
  • Loading branch information
khronokernel committed Nov 26, 2023
1 parent 03842d4 commit f1210de
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
- corecrypto_T1.kext
- corecaptureElCap.kext
- IO80211ElCap.kext
- Resolve 3802-GPU support for macOS 14.2 Beta 2 and newer.
- Applicable GPUs:
- Intel Ivy Bridge and Haswell iGPUs
- Nvidia Kepler dGPUs
- Increment Binaries:
- PatcherSupportPkg 1.4.6 - release

## 1.2.1
- Resolve `TeraScale 2 Acceleration` checkbox in Settings not being saved
Expand Down
6 changes: 6 additions & 0 deletions data/sys_patch_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def __init__(self, os_major: int, os_minor: int, non_metal_os_support: list) ->
self.macOS_12_5: float = 21.6
self.macOS_13_3: float = 22.4
self.macOS_14_1: float = 23.1
self.macOS_14_2: float = 23.2

self._generate_sys_patch_dict()

Expand Down Expand Up @@ -388,6 +389,11 @@ def _generate_sys_patch_dict(self):
**({ "MTLCompiler.framework": "13.2.1" } if self.os_major == os_data.os_data.ventura else {}),
**({ "GPUCompiler.framework": "13.2.1" } if self.os_major == os_data.os_data.ventura else {}),
"RenderBox.framework": "13.2.1-3802" if self.os_major == os_data.os_data.ventura else "14.0-3802",

# More issues for 3802, now with 14.2 Beta 2+...
# If there is a god, they clearly despise us and legacy Macs.
**({ "MTLCompiler.framework": "14.2 Beta 1" } if self.os_float >= self.macOS_14_2 else {}),
**({ "GPUCompiler.framework": "14.2 Beta 1" } if self.os_float >= self.macOS_14_2 else {}),
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion resources/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Constants:
def __init__(self) -> None:
# Patcher Versioning
self.patcher_version: str = "1.3.0" # OpenCore-Legacy-Patcher
self.patcher_support_pkg_version: str = "1.4.5" # PatcherSupportPkg
self.patcher_support_pkg_version: str = "1.4.6" # PatcherSupportPkg
self.copyright_date: str = "Copyright © 2020-2023 Dortania"
self.patcher_name: str = "OpenCore Legacy Patcher"

Expand Down
23 changes: 15 additions & 8 deletions resources/sys_patch/sys_patch_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,23 +235,30 @@ def patch_gpu_compiler_libraries(self, mount_point: Union[str, Path]):
- lib (entire directory)
Note: With macOS Sonoma, 32023 compiler is used instead and so this patch is not needed
until macOS 14.2 Beta 2 with version '32023.26'.
Parameters:
mount_point: The mount point of the target volume
"""

if self.constants.detected_os != os_data.os_data.ventura:
return
if self.constants.detected_os_minor < 4:
if os_data.os_data.sonoma < self.constants.detected_os < os_data.os_data.ventura:
return

LIBRARY_DIR = f"{mount_point}/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang"
GPU_VERSION = "31001.669"
if self.constants.detected_os == os_data.os_data.ventura:
if self.constants.detected_os_minor < 4: # 13.3
return
BASE_VERSION = "31001"
GPU_VERSION = f"{BASE_VERSION}.669"
elif self.constants.detected_os == os_data.os_data.sonoma:
if self.constants.detected_os_minor < 2: # 14.2 Beta 2
return
BASE_VERSION = "32023"
GPU_VERSION = f"{BASE_VERSION}.26"

LIBRARY_DIR = f"{mount_point}/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/{BASE_VERSION}/Libraries/lib/clang"
DEST_DIR = f"{LIBRARY_DIR}/{GPU_VERSION}"

if not Path(DEST_DIR).exists():
return
raise Exception(f"Failed to find GPUCompiler libraries at {DEST_DIR}")

for file in Path(LIBRARY_DIR).iterdir():
if file.is_file():
Expand All @@ -260,7 +267,7 @@ def patch_gpu_compiler_libraries(self, mount_point: Union[str, Path]):
continue

# Partial match as each OS can increment the version
if not file.name.startswith("31001."):
if not file.name.startswith(f"{BASE_VERSION}."):
continue

logging.info(f"Merging GPUCompiler.framework libraries to match binary")
Expand Down

0 comments on commit f1210de

Please sign in to comment.