[gtk-mac-bundler] Update signing code to meet Apple's notarization requirements.



commit cc20917290cd7929cfd14fa5b7e18988fc86b733
Author: John Ralls <jralls ceridwen us>
Date:   Sun Jun 28 16:25:27 2020 -0700

    Update signing code to meet Apple's notarization requirements.

 bundler/bundler.py | 14 --------------
 bundler/project.py |  7 +++----
 2 files changed, 3 insertions(+), 18 deletions(-)
---
diff --git a/bundler/bundler.py b/bundler/bundler.py
index dbbc033..11c158f 100644
--- a/bundler/bundler.py
+++ b/bundler/bundler.py
@@ -507,24 +507,10 @@ class Bundler(object):
 
         main_binary_path.copy_target(self.project)
 
-        # Launcher script, if necessary.
         launcher_script = self.project.get_launcher_script()
         if launcher_script:
             path = launcher_script.copy_target(self.project)
 
-# If you want to sign your application, set $APPLICATION_CERT with the
-# appropriate certificate name in your default Keychain. This function
-# will sign every binary in the bundle with the certificate and the
-# bundle's id string.
-#
-            if "APPLICATION_CERT" in os.environ:
-                cert = os.environ["APPLICATION_CERT"]
-                ident = self.project.get_bundle_id()
-                cmdargs = ['codesign', '-s', cert, '-i', ident, "-f", path]
-                result = os.spawnvp(os.P_WAIT, 'codesign', cmdargs)
-                if result:
-                    raise OSError('"'+ " ".join(cmdargs) + '" failed %d' % result)
-
         if self.meta.overwrite:
             self.recursive_rm(final_path)
         shutil.move(self.project.get_bundle_path(), final_path)
diff --git a/bundler/project.py b/bundler/project.py
index 7c6e120..3383906 100644
--- a/bundler/project.py
+++ b/bundler/project.py
@@ -270,7 +270,7 @@ class Binary(Path):
         self.sign(project, dest)
         self.destinations.append(dest)
 
-    def copy_target(self, project):
+    def copy_target(self, project, log = False):
         self.destinations = []
         if os.path.isdir(self.compute_source_path(project)):
             source = self.source
@@ -305,8 +305,8 @@ class Binary(Path):
             return
         cert = os.getenv("APPLICATION_CERT")
         ident = project.get_bundle_id()
-        output = Popen(['codesign', '-s', cert, '-i',
-                        ident, target], stdout=PIPE, stderr=STDOUT)
+        output = Popen(['codesign', '-s', cert, '-i', ident, '--timestamp',
+                        '--options=runtime', target], stdout=PIPE, stderr=STDOUT)
         results = output.communicate()[0]
         if results:
             raise SystemError("Warning! Codesigning %s returned error %s."
@@ -606,7 +606,6 @@ class Project(object):
             else:
                 path.dest = "${bundle}/Contents/MacOS/${name}"
             return path
-
         return None
 
     def get_icon_themes(self):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]