for p in packages:
copyfile(p, os.path.join(output_dir, os.path.basename(devel_to_git(tree.git_commit, p))))
- def package(self, project, checkout, output_dir, options, no_notarize):
+ def package(self, project, checkout, output_dir, options, notarize):
tree = self.build(project, checkout, options)
tree.add_defaults(options)
p = self._build_packages(tree, options)
self.privileged = True
-def notarize(dmg, bundle_id):
+def notarize_dmg(dmg, bundle_id):
p = subprocess.run(
['xcrun', 'altool', '--notarize-app', '-t', 'osx', '-f', dmg, '--primary-bundle-id', bundle_id, '-u', config.get('apple_id'), '-p', config.get('apple_password'), '--output-format', 'xml'],
capture_output=True
def command(self, c):
command('%s %s' % (self.variables_string(False), c))
- def build(self, *a, **k):
+ def unlock_keychain(self):
self.command('security unlock-keychain -p %s %s' % (self.osx_keychain_password, self.osx_keychain_file))
- return super().build(*a, **k)
class OSXSingleTarget(OSXTarget):
self.set('CC', '"ccache gcc"')
self.set('CXX', '"ccache g++"')
- def package(self, project, checkout, output_dir, options, no_notarize):
+ def package(self, project, checkout, output_dir, options, notarize):
tree = self.build(project, checkout, options)
tree.add_defaults(options)
+ self.unlock_keychain()
p = self._build_packages(tree, options)
for x in p:
if not isinstance(x, tuple):
raise Error('macOS packages must be returned from cscript as tuples of (dmg-filename, bundle-id)')
- if not no_notarize:
- notarize(x[0], x[1])
+ if notarize:
+ notarize_dmg(x[0], x[1])
self._copy_packages(tree, [x[0] for x in p], output_dir)
super(OSXUniversalTarget, self).__init__(directory)
self.archs = archs
- def package(self, project, checkout, output_dir, options, no_notarize):
+ def package(self, project, checkout, output_dir, options, notarize):
sdk = config.get('osx_sdk')
for a in self.archs:
tree.build_dependencies(options)
tree.build(options)
+ self.unlock_keychain()
tree = globals.trees.get(project, checkout, self)
with TreeDirectory(tree):
- if len(inspect.getfullargspec(tree.cscript['package']).args) == 3:
- packages = tree.call('package', tree.version, options)
- else:
- log_normal("Deprecated cscript package() method with no options parameter")
- packages = tree.call('package', tree.version)
+ self._build_packages(tree, options)
for p in packages:
copyfile(p, os.path.join(output_dir, os.path.basename(devel_to_git(tree.git_commit, p))))
def cleanup(self):
rmtree(self.directory)
- def package(self, project, checkout, output_dir, options, no_notarize):
+ def package(self, project, checkout, output_dir, options, notarize):
tree = globals.trees.get(project, checkout, self)
with TreeDirectory(tree):
name = read_wscript_variable(os.getcwd(), 'APPNAME')
target = LinuxTarget(p[0], None, int(p[1]), args.work)
elif s == 'raspbian':
target = LinuxTarget(s, None, None, args.work)
- elif s == 'osx-intel':
- # Universal Intel 32/64-bit
+ elif s == 'osx-intel-32-64':
+ # Universal Intel 32/64-bit built for config's os_sdk
if args.command == 'build':
target = OSXSingleTarget('x86_64', args.work)
else:
target = OSXUniversalTarget(('i386', 'x86_64'), args.work)
- elif s == 'osx-arm':
- # Universal arm64 and Intel 64-bit
+ elif s == 'osx-arm-intel-64':
+ # Universal arm64 and Intel 64-bit built for SDK 11.0
target = OSXUniversalTarget(('arm64', 'x86_64'), args.work)
+ elif s == 'osx-arm64':
+ target = OSXSingleTarget('arm64', '11.0', args.work)
elif s == 'source':
target = SourceTarget()
elif s == 'flatpak':
output_dir = args.output
makedirs(output_dir)
- target.package(args.project, args.checkout, output_dir, get_command_line_options(args), args.no_notarize)
+ target.package(args.project, args.checkout, output_dir, get_command_line_options(args), not args.no_notarize)
except Error as e:
if target is not None and not args.keep:
target.cleanup()