summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2018-06-14 17:03:25 -0400
committerNat Goodspeed <nat@lindenlab.com>2018-06-14 17:03:25 -0400
commit67f6625c56406604197507c842496f031eb0986f (patch)
tree69db248ec54828cfdb1e9f4a451d62e1f1832285 /indra/newview
parent1378547bb6a077fbed594ae7b92289dac5942183 (diff)
SL-821: Continue changing macOS executable to match channel name.
Set our CMake 'product' variable to VIEWER_CHANNEL. This probably has far- reaching implications, but it seems the expedient way to keep everything self- consistent. Use ${product} in the DARWIN VIEWER_EXE_GLOBS used for Breakpad symbol dumping instead of hardcoding 'Second Life'. The Breakpad symbol dumping stanza was enclosed in nested (but not indented) conditions. To these we add another condition: don't bother if we're using BugSplat. Unify all three into a single horrendous outermost expression. Fix the MACOSX_BUNDLE_INFO_STRING, and hence CFBundleGetInfoString, to VIEWER_CHANNEL as well. Our CMake MACOSX_BUNDLE_SHORT_VERSION_STRING was never used before -- we were erroneously using MACOSX_BUNDLE_LONG_VERSION_STRING in the Info-SecondLife.plist template even for CFBundleShortVersionString. Looks like a classic copy/paste error. Fix that; also use four-part version number instead of three-part. With those two changes, we shouldn't need to patch the top-level Info.plist in viewer_manifest.py any more. viewer_manifest.py still needs to move the viewer executable(s) to the embedded viewer app bundle, but it no longer needs to rename the real executable to the channel name since we've already dealt with that in CMake land. This lets us unify the code that picks the biggest of those executables in the first and second viewer_manifest.py runs.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/CMakeLists.txt20
-rw-r--r--indra/newview/Info-SecondLife.plist2
-rwxr-xr-xindra/newview/viewer_manifest.py59
3 files changed, 33 insertions, 48 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index ba261c8e91..5648e3eb02 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -2082,16 +2082,18 @@ if (LINUX)
endif (LINUX)
if (DARWIN)
- # These all get set with PROPERTIES
- set(product "Second Life")
+ # These all get set with PROPERTIES. It's not that the property names are
+ # magically known to CMake -- it's that these names are referenced in the
+ # Info-SecondLife.plist file in the configure_file() directive below.
+ set(product "${VIEWER_CHANNEL}")
# this is the setting for the Python wrapper, see SL-322 and WRAPPER line in Info-SecondLife.plist
set(MACOSX_WRAPPER_EXECUTABLE_NAME "SL_Launcher")
- set(MACOSX_BUNDLE_INFO_STRING "Second Life Viewer")
+ set(MACOSX_BUNDLE_INFO_STRING "${VIEWER_CHANNEL}")
set(MACOSX_BUNDLE_ICON_FILE "secondlife.icns")
set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer")
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${VIEWER_CHANNEL} ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}")
set(MACOSX_BUNDLE_BUNDLE_NAME "SecondLife")
- set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}")
+ set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}")
set(MACOSX_BUNDLE_BUNDLE_VERSION "${VIEWER_SHORT_VERSION}${VIEWER_MACOSX_PHASE}${VIEWER_REVISION}")
set(MACOSX_BUNDLE_COPYRIGHT "Copyright © Linden Research, Inc. 2007")
set(MACOSX_BUNDLE_NSMAIN_NIB_FILE "SecondLife.nib")
@@ -2179,7 +2181,7 @@ if (INSTALL)
include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake)
endif (INSTALL)
-if (PACKAGE)
+if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND NOT DEFINED ENV{BUGSPLAT_DB})
set(SYMBOL_SEARCH_DIRS "")
# Note that the path to VIEWER_SYMBOL_FILE must match that in ../../build.sh
if (WINDOWS)
@@ -2198,8 +2200,8 @@ if (PACKAGE)
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}")
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}")
set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin-$ENV{AUTOBUILD_ADDRSIZE}.tar.bz2")
- set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger")
- set(VIEWER_EXE_GLOBS "'Second Life' mac-crash-logger")
+ set(VIEWER_EXE_GLOBS "'${product}' SLPlugin mac-crash-logger")
+ set(VIEWER_EXE_GLOBS "'${product}' mac-crash-logger")
set(VIEWER_LIB_GLOB "*.dylib")
endif (DARWIN)
if (LINUX)
@@ -2211,7 +2213,6 @@ if (PACKAGE)
set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest)
endif (LINUX)
- if(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING)
if(CMAKE_CFG_INTDIR STREQUAL ".")
set(LLBUILD_CONFIG ${CMAKE_BUILD_TYPE})
else(CMAKE_CFG_INTDIR STREQUAL ".")
@@ -2238,8 +2239,7 @@ if (PACKAGE)
add_dependencies(generate_breakpad_symbols "${VIEWER_COPY_MANIFEST}")
endif (WINDOWS OR LINUX)
add_dependencies(llpackage generate_breakpad_symbols)
- endif(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING)
-endif (PACKAGE)
+endif ()
if (LL_TESTS)
# To add a viewer unit test, just add the test .cpp file below
diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist
index af4cf26ac6..8aabd6818b 100644
--- a/indra/newview/Info-SecondLife.plist
+++ b/indra/newview/Info-SecondLife.plist
@@ -21,7 +21,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
+ <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 80370be109..49dc732457 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -27,7 +27,6 @@ Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
$/LicenseInfo$
"""
import errno
-import glob
import json
import os
import os.path
@@ -920,11 +919,6 @@ class DarwinManifest(ViewerManifest):
with self.prefix(src="", dst="Contents"): # everything goes in Contents
# top-level Info.plist is as generated by CMake
Info_plist = self.dst_path_of("Info.plist")
- # except we twiddle these entries
- Info = plistlib.readPlist(Info_plist)
- Info["CFBundleGetInfoString"] = self.channel()
- Info["CFBundleShortVersionString"] = '.'.join(self.args['version'])
- plistlib.writePlist(Info, Info_plist)
# the one file in top-level MacOS directory is the trampoline to
# our nested launcher_app
@@ -1014,37 +1008,28 @@ open "%s" --args "$@"
here = self.get_dst_prefix()
relbase = os.path.realpath(os.path.dirname(Info_plist))
self.cmakedirs(here)
- # don't move the trampoline script we just made!
- executables = [f for f in os.listdir(toplevel_MacOS)
- if f != os.path.basename(trampoline)]
- if executables:
- # there are still executables in toplevel_MacOS
- for f in executables:
- fromwhere = os.path.join(toplevel_MacOS, f)
- towhere = self.dst_path_of(f)
- print "Moving %s => %s" % \
- (self.relpath(fromwhere, relbase),
- self.relpath(towhere, relbase))
- # now do it, only without relativizing paths
- os.rename(fromwhere, towhere)
-
- # Pick the biggest of the executables as the real viewer.
- # Make (size, filename) pairs; sort by size; pick the
- # last pair; take the filename entry from that.
- SecondLife = sorted((os.path.getsize(self.dst_path_of(f)), f)
- for f in executables)[-1][1]
- # now rename it to match the channel name
- exename = self.channel()
- exepath = self.dst_path_of(exename)
- print "{} => {}".format(SecondLife, exename)
- os.rename(self.dst_path_of(SecondLife), exepath)
-
- else:
- # executables already located 'here' -- pick the
- # biggest, as above
- exepath = sorted((os.path.getsize(f), f)
- for f in glob.glob(os.path.join(here, '*')))[-1][1]
- exename = os.path.basename(exepath)
+ for f in os.listdir(toplevel_MacOS):
+ if f == os.path.basename(trampoline):
+ # don't move the trampoline script we just made!
+ continue
+ fromwhere = os.path.join(toplevel_MacOS, f)
+ towhere = self.dst_path_of(f)
+ print "Moving %s => %s" % \
+ (self.relpath(fromwhere, relbase),
+ self.relpath(towhere, relbase))
+ # now do it, only without relativizing paths
+ os.rename(fromwhere, towhere)
+
+ # Pick the biggest of the executables as the real viewer.
+ # Make (basename, fullpath) pairs; for each pair,
+ # expand to (size, basename, fullpath) triples; sort
+ # by size; pick the last triple; take the basename and
+ # fullpath from that.
+ _, exename, exepath = \
+ sorted((os.path.getsize(path), name, path)
+ for name, path in
+ ((name, os.path.join(here, name))
+ for name in os.listdir(here)))[-1]
if ("package" in self.args['actions'] or
"unpacked" in self.args['actions']):