Skip to content

Commit

Permalink
Recover from mac codesign error
Browse files Browse the repository at this point in the history
  • Loading branch information
domstoppable committed Jun 28, 2024
1 parent 6c9c616 commit c8427c3
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions deployment/neon_player.spec
Original file line number Diff line number Diff line change
Expand Up @@ -87,26 +87,30 @@ def main():
icon_name = "neon-" + name + ICON_EXT[current_platform]
icon_path = (deployment_root / "icons" / icon_name).resolve()

if current_platform == SupportedPlatform.macos:
codesign_identity = os.environ["MACOS_CODESIGN_IDENTITY"]
else:
codesign_identity = None

exe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
name=f"neon_{name}",
debug=False,
strip=False,
upx=False,
console=True,
icon=str(icon_path),
resources=[f"{icon_path},ICON,icon"],
target_arch="x86_64",
codesign_identity=codesign_identity,
entitlements_file="entitlements.plist",
)
exe_kwargs = {
"exclude_binaries": True,
"name": f"neon_{name}",
"debug": False,
"strip": False,
"upx": False,
"console": True,
"icon": str(icon_path),
"resources": [f"{icon_path},ICON,icon"],
"target_arch": "x86_64",
"entitlements_file": "entitlements.plist",
"codesign_identity": os.environ.get("MACOS_CODESIGN_IDENTITY", None),
}

try:
exe = EXE(pyz, a.scripts, **exe_kwargs)
except SystemError as exc:
if "codesign_identity" in exe_kwargs:
print("Failed to build EXE. Codesign problem? Trying again without codesign...", file=sys.stderr)
del exe_kwargs["codesign_identity"]
exe = EXE(pyz, a.scripts, **exe_kwargs)

else:
raise exc

extras: list[tuple[str, str, str]] = []
extras.append((version_file_path.name, str(version_file_path), "DATA"))
Expand Down

0 comments on commit c8427c3

Please sign in to comment.