Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
3-manifolds
GitHub Repository: 3-manifolds/Sage_macOS
Path: blob/main/Sage_framework/sign_sage.py
170 views
1
import subprocess
2
import os
3
import sys
4
DEV_ID = os.environ['DEV_ID']
5
entitlement_file = 'entitlement.plist'
6
framework_path = os.path.abspath('build/Sage.framework/Versions/Current')
7
extra_files = []
8
file_args = ['codesign', '-v', '-s', DEV_ID, '--timestamp', '--options',
9
'runtime', '--force', '--entitlements', entitlement_file]
10
11
if len(sys.argv) == 1 or sys.argv[1] != 'framework':
12
with open('files_to_sign') as infile:
13
for path in infile.readlines():
14
if path.find('_tkinter.cpython') >= 0:
15
continue
16
signee = path.strip()
17
result = subprocess.run(file_args + [signee], capture_output=True)
18
if result.returncode:
19
print('Failed on %s'%path)
20
print(result.stderr)
21
22
for path in extra_files:
23
signee = os.path.join(framework_path, path)
24
result = subprocess.run(file_args + [signee], capture_output=True)
25
if result.returncode:
26
print('Failed on %s'%path)
27
print(result.stderr)
28
29
print('Signing framework ...')
30
subprocess.run(file_args + ['build/Sage.framework'])
31
32
33
34