From a74b3691aff94dfbd0fbfdce05f8a03168328ca7 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Sun, 9 Sep 2018 09:22:06 -0400
Subject: [PATCH] DRTVWR-474, MAINT-9047: Make viewer_manifest use same bundle
 name.

---
 indra/newview/viewer_manifest.py | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 14ff2c194ed..bddacf357d0 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -871,6 +871,9 @@ class Windows_x86_64_Manifest(WindowsManifest):
 class DarwinManifest(ViewerManifest):
     build_data_json_platform = 'mac'
 
+    def app_bundle(self):
+        return self.app_name() + ".app"
+
     def finish_build_data_dict(self, build_data_dict):
         build_data_dict.update({'Bundle Id':self.args['bundleid']})
         return build_data_dict
@@ -881,7 +884,10 @@ def is_packaging_viewer(self):
 
     def construct(self):
         # copy over the build result (this is a no-op if run within the xcode script)
-        self.path(os.path.join(self.args['configuration'], "Second Life.app"), dst="")
+        # Second Life.app is what CMake / Xcode builds
+        # self.app_bundle() is what we ultimately expect to sign and package
+        self.path(os.path.join(self.args['configuration'], "Second Life.app"),
+                  dst=self.app_bundle())
 
         pkgdir = os.path.join(self.args['build'], os.pardir, 'packages')
         relpkgdir = os.path.join(pkgdir, "lib", "release")
@@ -930,8 +936,6 @@ def construct(self):
                 with self.prefix(src=pkgdir,dst=""):
                     self.path("ca-bundle.crt")
 
-                self.path("SecondLife.nib")
-
                 # Translations
                 self.path("English.lproj/language.txt")
                 self.replace_in(src="English.lproj/InfoPlist.strings",
@@ -1180,8 +1184,6 @@ def package_finish(self):
 
             # Copy everything in to the mounted .dmg
 
-            app_name = self.app_name()
-
             # Hack:
             # Because there is no easy way to coerce the Finder into positioning
             # the app bundle in the same place with different app names, we are
@@ -1195,7 +1197,7 @@ def package_finish(self):
             if not os.path.exists (self.src_path_of(dmg_template)):
                 dmg_template = os.path.join ('installers', 'darwin', 'release-dmg')
 
-            for s,d in {self.get_dst_prefix():app_name + ".app",
+            for s,d in {self.get_dst_prefix(): self.app_bundle(),
                         os.path.join(dmg_template, "_VolumeIcon.icns"): ".VolumeIcon.icns",
                         os.path.join(dmg_template, "background.jpg"): "background.jpg",
                         os.path.join(dmg_template, "_DS_Store"): ".DS_Store"}.items():
@@ -1238,7 +1240,7 @@ def package_finish(self):
             # the signature are preserved; moving the files using python will leave them behind
             # and invalidate the signatures.
             if 'signature' in self.args:
-                app_in_dmg=os.path.join(volpath,self.app_name()+".app")
+                app_in_dmg=os.path.join(volpath,self.app_bundle())
                 print "Attempting to sign '%s'" % app_in_dmg
                 identity = self.args['signature']
                 if identity == '':
@@ -1293,9 +1295,6 @@ def package_finish(self):
                                 raise
                     self.run_command(['spctl', '-a', '-texec', '-vv', app_in_dmg])
 
-            imagename="SecondLife_" + '_'.join(self.args['version'])
-
-
         finally:
             # Unmount the image even if exceptions from any of the above 
             self.run_command(['hdiutil', 'detach', '-force', devfile])
-- 
GitLab