From f5b467c4fbb9b5dcc241f9e361713e8fb4024d52 Mon Sep 17 00:00:00 2001 From: Jazzzny Date: Sat, 26 Aug 2023 18:59:50 -0400 Subject: [PATCH 1/4] Fix Rosetta detection --- resources/device_probe.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/device_probe.py b/resources/device_probe.py index 1c129eae0..c6d00f0f9 100644 --- a/resources/device_probe.py +++ b/resources/device_probe.py @@ -943,8 +943,9 @@ class Computer: self.oclp_sys_signed = sys_plist["Custom Signature"] def check_rosetta(self): - result = subprocess.run("sysctl -in sysctl.proc_translated".split(), stdout=subprocess.PIPE).stdout.decode() - if result: + arch = subprocess.run("uname -m".split(), stdout=subprocess.PIPE).stdout.decode() + kernel_ver = subprocess.run("sysctl kern.version".split(), stdout=subprocess.PIPE).stdout.decode() + if "arm64" not in arch and "ARM64" in kernel_ver: self.rosetta_active = True else: self.rosetta_active = False \ No newline at end of file From 91417bf75da96a54f359d767865e7365d1db9a8b Mon Sep 17 00:00:00 2001 From: Jazzzny Date: Sat, 26 Aug 2023 19:06:27 -0400 Subject: [PATCH 2/4] better fix --- resources/device_probe.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/device_probe.py b/resources/device_probe.py index c6d00f0f9..49c37e24d 100644 --- a/resources/device_probe.py +++ b/resources/device_probe.py @@ -943,9 +943,8 @@ class Computer: self.oclp_sys_signed = sys_plist["Custom Signature"] def check_rosetta(self): - arch = subprocess.run("uname -m".split(), stdout=subprocess.PIPE).stdout.decode() - kernel_ver = subprocess.run("sysctl kern.version".split(), stdout=subprocess.PIPE).stdout.decode() - if "arm64" not in arch and "ARM64" in kernel_ver: + result = subprocess.run("sysctl -in sysctl.proc_translated".split(), stdout=subprocess.PIPE).stdout.decode() + if "1" in result: self.rosetta_active = True else: self.rosetta_active = False \ No newline at end of file From c2d26b490348a5daf2ded0f4fbfc9efef73588ed Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 17 Sep 2023 12:07:02 -0600 Subject: [PATCH 3/4] Upgrade Python backend to 3.11 --- .github/workflows/build-app-wxpython.yml | 2 +- .github/workflows/validate.yml | 2 +- CHANGELOG.md | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-app-wxpython.yml b/.github/workflows/build-app-wxpython.yml index ed59695c8..69c7d98ed 100644 --- a/.github/workflows/build-app-wxpython.yml +++ b/.github/workflows/build-app-wxpython.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v3 - name: Build Binary - run: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 Build-Binary.command --reset_binaries --branch "${{ env.branch }}" --commit "${{ env.commiturl }}" --commit_date "${{ env.commitdate }}" --key "${{ env.ANALYTICS_KEY }}" --site "${{ env.ANALYTICS_SITE }}" + run: /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 Build-Binary.command --reset_binaries --branch "${{ env.branch }}" --commit "${{ env.commiturl }}" --commit_date "${{ env.commitdate }}" --key "${{ env.ANALYTICS_KEY }}" --site "${{ env.ANALYTICS_SITE }}" # - name: Import Certificate # if: (!security find-certificate -c "${{ env.MAC_CODESIGN_IDENTITY }}") diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 685097e37..fc66bd1d7 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -14,4 +14,4 @@ jobs: steps: - uses: actions/checkout@v3 - name: Validate - run: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3 OpenCore-Patcher-GUI.command --validate + run: /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 OpenCore-Patcher-GUI.command --validate diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d06f8343..5cd7fc983 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,14 @@ - BlueToolFixup 2.6.8 - rolling (2305aaa) - CryptexFixup 1.0.2 - release - PatcherSupportPkg 1.2.6 - release +- Build Server Changes: + - Upgrade Python backend to 3.11.5 + - Upgrade Python modules: + - requests - 2.31.0 + - pyobjc - 9.2 + - wxpython - 4.2.1 + - pyinstaller - 5.13.2 + - packaging - 23.1 ## 0.6.8 - Update non-Metal Binaries: From f7ec0ddf214dda47ec3991fc126c1875c727e326 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 17 Sep 2023 12:25:13 -0600 Subject: [PATCH 4/4] Add Universal 2 support --- Build-Binary.command | 33 --------------------------------- CHANGELOG.md | 3 +++ OpenCore-Patcher-GUI.spec | 2 +- 3 files changed, 4 insertions(+), 34 deletions(-) diff --git a/Build-Binary.command b/Build-Binary.command index 2df61ff3e..1f8ee9427 100755 --- a/Build-Binary.command +++ b/Build-Binary.command @@ -32,7 +32,6 @@ class CreateBinary: def __init__(self): start = time.time() self._set_cwd() - self._is_x86_64() print("Starting build script") self.args = self._parse_arguments() @@ -45,38 +44,6 @@ class CreateBinary: print(f"Build script completed in {str(round(time.time() - start, 2))} seconds") - def _is_x86_64(self): - """ - Check if invoked as x86_64 - Some of our dependancies are not universal, so we'll create a new virtual environment and invoke as Rosetta - """ - - if platform.machine() != "arm64": - return - - print("Detected ARM64, creating x86_64 environment") - - args = sys.argv[:] - if "python" in args[0].lower(): - args.pop(0) - - if not Path(".x86_64_venv").exists(): - print("Creating new venv") - subprocess.run(["arch", "-x86_64", sys.executable, "-m", "venv", ".x86_64_venv"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - print("Installing requirements") - subprocess.run(["arch", "-x86_64", ".x86_64_venv/bin/pip3", "install", "-r", "requirements.txt"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - - print("Relaunching as x86_64") - result = subprocess.run(["arch", "-x86_64", ".x86_64_venv/bin/python3"] + args) - - if result.returncode != 0: - if result.stdout: - print("STDOUT: " + result.stdout.decode("utf-8")) - if result.stderr: - print("STDERR: " + result.stderr.decode("utf-8")) - sys.exit(result.returncode) - - def _set_cwd(self): """ Initialize current working directory to parent of this script diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cd7fc983..d620c553d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ - Resolve BCM2046 and BCM2070 support on macOS 13.3 and newer - Workaround 13.3+ Kernel Panic on AMD GCN GPUs playing DRM content - Add new macOS Installer download menu (Jazzzny) +- Add support for Universal 2 distribution (x86_64 and ARM64) + - Drops Rosetta requirement on Apple Silicon Macs + - Note building from source will require Python 3.11 or newer and up-to-date Python modules - Increment Binaries: - OpenCorePkg 0.9.3 - release - Lilu 1.6.6 - release diff --git a/OpenCore-Patcher-GUI.spec b/OpenCore-Patcher-GUI.spec index e4490eb21..7100205f9 100644 --- a/OpenCore-Patcher-GUI.spec +++ b/OpenCore-Patcher-GUI.spec @@ -33,7 +33,7 @@ exe = EXE(pyz, upx=True, console=False, disable_windowed_traceback=False, - target_arch=None, + target_arch="universal2", codesign_identity=None, entitlements_file=None ) coll = COLLECT(exe,