mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-21 14:40:52 +10:00
OpenCore-Patcher-GUI.spec: Add type hinting for PyInstaller classes
This commit is contained in:
@@ -1,16 +1,28 @@
|
|||||||
# -*- mode: python ; coding: utf-8 -*-
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
|
||||||
import sys, os, time, subprocess, pathlib
|
import os
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from PyInstaller.building.api import PYZ, EXE, COLLECT
|
||||||
|
from PyInstaller.building.osx import BUNDLE
|
||||||
|
from PyInstaller.building.build_main import Analysis
|
||||||
|
|
||||||
sys.path.append(os.path.abspath(os.getcwd()))
|
sys.path.append(os.path.abspath(os.getcwd()))
|
||||||
|
|
||||||
from resources import constants
|
from resources import constants
|
||||||
|
|
||||||
block_cipher = None
|
block_cipher = None
|
||||||
|
|
||||||
datas = [
|
datas = [
|
||||||
('payloads.dmg', '.'),
|
('payloads.dmg', '.'),
|
||||||
('Universal-Binaries.dmg', '.'),
|
('Universal-Binaries.dmg', '.'),
|
||||||
|
|
||||||
]
|
]
|
||||||
if pathlib.Path("DortaniaInternalResources.dmg").exists():
|
|
||||||
|
if Path("DortaniaInternalResources.dmg").exists():
|
||||||
datas.append(('DortaniaInternalResources.dmg', '.'))
|
datas.append(('DortaniaInternalResources.dmg', '.'))
|
||||||
|
|
||||||
|
|
||||||
@@ -27,8 +39,10 @@ a = Analysis(['OpenCore-Patcher-GUI.command'],
|
|||||||
win_private_assemblies=False,
|
win_private_assemblies=False,
|
||||||
cipher=block_cipher,
|
cipher=block_cipher,
|
||||||
noarchive=False)
|
noarchive=False)
|
||||||
pyz = PYZ(a.pure, a.zipped_data,
|
|
||||||
cipher=block_cipher)
|
pyz = PYZ(a.pure,
|
||||||
|
a.zipped_data,
|
||||||
|
cipher=block_cipher)
|
||||||
|
|
||||||
exe = EXE(pyz,
|
exe = EXE(pyz,
|
||||||
a.scripts,
|
a.scripts,
|
||||||
@@ -43,7 +57,8 @@ exe = EXE(pyz,
|
|||||||
disable_windowed_traceback=False,
|
disable_windowed_traceback=False,
|
||||||
target_arch="universal2",
|
target_arch="universal2",
|
||||||
codesign_identity=None,
|
codesign_identity=None,
|
||||||
entitlements_file=None )
|
entitlements_file=None)
|
||||||
|
|
||||||
coll = COLLECT(exe,
|
coll = COLLECT(exe,
|
||||||
a.binaries,
|
a.binaries,
|
||||||
a.zipfiles,
|
a.zipfiles,
|
||||||
@@ -52,6 +67,7 @@ coll = COLLECT(exe,
|
|||||||
upx=True,
|
upx=True,
|
||||||
upx_exclude=[],
|
upx_exclude=[],
|
||||||
name='OpenCore-Patcher')
|
name='OpenCore-Patcher')
|
||||||
|
|
||||||
app = BUNDLE(coll,
|
app = BUNDLE(coll,
|
||||||
name='OpenCore-Patcher.app',
|
name='OpenCore-Patcher.app',
|
||||||
icon="payloads/OC-Patcher.icns",
|
icon="payloads/OC-Patcher.icns",
|
||||||
@@ -64,6 +80,6 @@ app = BUNDLE(coll,
|
|||||||
"NSRequiresAquaSystemAppearance": False,
|
"NSRequiresAquaSystemAppearance": False,
|
||||||
"NSHighResolutionCapable": True,
|
"NSHighResolutionCapable": True,
|
||||||
"Build Date": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),
|
"Build Date": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),
|
||||||
"BuildMachineOSBuild": subprocess.run("sw_vers -buildVersion".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode().strip(),
|
"BuildMachineOSBuild": subprocess.run(["/usr/bin/sw_vers", "-buildVersion"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode().strip(),
|
||||||
"NSPrincipalClass": "NSApplication",
|
"NSPrincipalClass": "NSApplication",
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user