Add Universal 2 support

This commit is contained in:
Mykola Grymalyuk
2023-09-17 12:25:13 -06:00
parent c2d26b4903
commit f7ec0ddf21
3 changed files with 4 additions and 34 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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,