-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 string_after(process, key):
- lines = p.stdout.decode('utf-8').splitlines()
- for i in range(0, len(lines)):
- if lines[i].find(key) != -1:
- return lines[i+1].strip().replace('<string>', '').replace('</string>', '')
-
- request_uuid = string_after(p, "RequestUUID")
- if request_uuid is None:
- raise Error('No RequestUUID found in response from Apple')
-
- for i in range(0, 30):
- print('Checking up on %s' % request_uuid)
- p = subprocess.run(['xcrun', 'altool', '--notarization-info', request_uuid, '-u', config.get('apple_id'), '-p', config.get('apple_password'), '--output-format', 'xml'], capture_output=True)
- status = string_after(p, 'Status')
- print('Got %s' % status)
- if status == 'invalid':
- raise Error("Notarization failed")
- elif status == 'success':
- subprocess.run(['xcrun', 'stapler', 'staple', dmg])
- return
- elif status != "in progress":
- print("Could not understand xcrun response")
- print(p)
- time.sleep(30)
+class FlatpakTarget(Target):
+ def __init__(self, project, checkout, work):
+ super(FlatpakTarget, self).__init__('flatpak')
+ self.build_dependencies = False
+ self.project = project
+ self.checkout = checkout
+ # If we use git references we end up with a checkout in one mount trying
+ # to link to the git reference repo in other, which doesn't work.
+ globals.use_git_reference = False
+ if config.has('flatpak_state_dir'):
+ self.mount(config.get('flatpak_state_dir'))
+
+ def command(self, c):
+ log_normal('host -> %s' % c)
+ command('%s %s' % (self.variables_string(), c))
+
+ def setup(self):
+ super().setup()
+ globals.trees.get(self.project, self.checkout, self).checkout_dependencies()
+
+ def flatpak(self):
+ return 'flatpak'
+
+ def flatpak_builder(self):
+ b = 'flatpak-builder'
+ if config.has('flatpak_state_dir'):
+ b += ' --state-dir=%s' % config.get('flatpak_state_dir')
+ return b