From baf2153eff089d5285e31bf47118cf2bdf181b0d Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Wed, 14 Jan 2015 11:52:56 -0800
Subject: [PATCH] Integrate Callum's Mac slplugins package

---
 autobuild.xml                    | 14 +++++++++-
 indra/newview/viewer_manifest.py | 46 ++++++++++++++++----------------
 2 files changed, 36 insertions(+), 24 deletions(-)

diff --git a/autobuild.xml b/autobuild.xml
index af05d869c79..4dc3aa7af42 100755
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -2077,6 +2077,18 @@
         <string>slplugins</string>
         <key>platforms</key>
         <map>
+          <key>darwin</key>
+          <map>
+            <key>archive</key>
+            <map>
+              <key>hash</key>
+              <string>f6bfb026572f03a4c8ac6b2b7d7eb0ae</string>
+              <key>url</key>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/slplugins_3p-update-slplugins/rev/298079/arch/Darwin/installer/slplugins-3.7.24.297623.298079-darwin-298079.tar.bz2</string>
+            </map>
+            <key>name</key>
+            <string>darwin</string>
+          </map>
           <key>windows</key>
           <map>
             <key>archive</key>
@@ -2093,7 +2105,7 @@
           </map>
         </map>
         <key>version</key>
-        <string>3.7.22.297128.297645</string>
+        <string>3.7.24.297623.298079</string>
       </map>
       <key>slvoice</key>
       <map>
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 01590db6487..954e4540806 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -619,12 +619,16 @@ def construct(self):
         # copy over the build result (this is a no-op if run within the xcode script)
         self.path(self.args['configuration'] + "/Second Life.app", dst="")
 
+        pkgdir = os.path.join(self.args['build'], os.pardir, 'packages')
+        relpkgdir = os.path.join(pkgdir, "lib", "release")
+        debpkgdir = os.path.join(pkgdir, "lib", "debug")
+
         if self.prefix(src="", dst="Contents"):  # everything goes in Contents
             self.path("Info.plist", dst="Info.plist")
 
             # copy additional libs in <bundle>/Contents/MacOS/
-            self.path("../packages/lib/release/libndofdev.dylib", dst="Resources/libndofdev.dylib")
-            self.path("../packages/lib/release/libhunspell-1.3.0.dylib", dst="Resources/libhunspell-1.3.0.dylib")
+            self.path(os.path.join(relpkgdir, "libndofdev.dylib"), dst="Resources/libndofdev.dylib")
+            self.path(os.path.join(relpkgdir, "libhunspell-1.3.0.dylib"), dst="Resources/libhunspell-1.3.0.dylib")
 
             if self.prefix(dst="MacOS"):
                 self.path2basename("../viewer_components/updater/scripts/darwin", "*.py")
@@ -684,7 +688,6 @@ def path_optional(src, dst):
                     print "Skipping %s" % dst
                     return []
 
-                libdir = "../packages/lib/release"
                 # dylibs is a list of all the .dylib files we expect to need
                 # in our bundled sub-apps. For each of these we'll create a
                 # symlink from sub-app/Contents/Resources to the real .dylib.
@@ -694,7 +697,7 @@ def path_optional(src, dst):
                                                                "llcommon",
                                                                self.args['configuration'],
                                                                libfile),
-                                                               os.path.join(libdir, libfile)),
+                                                               os.path.join(relpkgdir, libfile)),
                                        dst=libfile)
 
                 for libfile in (
@@ -705,7 +708,7 @@ def path_optional(src, dst):
                                 "libexception_handler.dylib",
                                 "libGLOD.dylib",
                                 ):
-                    dylibs += path_optional(os.path.join(libdir, libfile), libfile)
+                    dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile)
 
                 # SLVoice and vivox lols, no symlinks needed
                 for libfile in (
@@ -717,30 +720,29 @@ def path_optional(src, dst):
                                 'ca-bundle.crt',
                                 'SLVoice',
                                 ):
-                     self.path2basename(libdir, libfile)
+                     self.path2basename(relpkgdir, libfile)
 
                 # dylibs that vary based on configuration
                 if self.args['configuration'].lower() == 'debug':
                     for libfile in (
                                 "libfmodexL.dylib",
                                 ):
-                        dylibs += path_optional(os.path.join("../packages/lib/debug",
-                                                             libfile), libfile)
+                        dylibs += path_optional(os.path.join(debpkgdir, libfile), libfile)
                 else:
                     for libfile in (
                                 "libfmodex.dylib",
                                 ):
-                        dylibs += path_optional(os.path.join("../packages/lib/release",
-                                                             libfile), libfile)
+                        dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile)
                 
                 # our apps
-                for app_bld_dir, app in (("mac_crash_logger", "mac-crash-logger.app"),
+                for app_bld_dir, app in ((os.path.join(os.pardir,
+                                                       "mac_crash_logger",
+                                                       self.args['configuration']),
+                                          "mac-crash-logger.app"),
                                          # plugin launcher
-                                         (os.path.join("llplugin", "slplugin"), "SLPlugin.app"),
+                                         (pkgdir, "SLPlugin.app"),
                                          ):
-                    self.path2basename(os.path.join(os.pardir,
-                                                    app_bld_dir, self.args['configuration']),
-                                       app)
+                    self.path2basename(app_bld_dir, app)
 
                     # our apps dependencies on shared libs
                     # for each app, for each dylib we collected in dylibs,
@@ -769,26 +771,24 @@ def path_optional(src, dst):
                                     'libQtWebKit.4.7.1.dylib',
                                     'libQtXml.4.dylib',
                                     'libQtXml.4.7.1.dylib'):
-                        self.path2basename("../packages/lib/release", libfile)
+                        self.path2basename(relpkgdir, libfile)
                     self.end_prefix("SLPlugin.app/Contents/Resources")
 
                 # Qt4 codecs go to llplugin.  Not certain why but this is the first
                 # location probed according to dtruss so we'll go with that.
-                if self.prefix(src="../packages/plugins/codecs/", dst="llplugin/codecs"):
+                if self.prefix(src=os.path.join(pkgdir, "llplugin/codecs/"), dst="llplugin/codecs"):
                     self.path("libq*.dylib")
                     self.end_prefix("llplugin/codecs")
 
                 # Similarly for imageformats.
-                if self.prefix(src="../packages/plugins/imageformats/", dst="llplugin/imageformats"):
+                if self.prefix(src=os.path.join(pkgdir, "llplugin/imageformats/"), dst="llplugin/imageformats"):
                     self.path("libq*.dylib")
                     self.end_prefix("llplugin/imageformats")
 
                 # SLPlugin plugins proper
-                if self.prefix(src="", dst="llplugin"):
-                    self.path2basename("../media_plugins/quicktime/" + self.args['configuration'],
-                                       "media_plugin_quicktime.dylib")
-                    self.path2basename("../media_plugins/webkit/" + self.args['configuration'],
-                                       "media_plugin_webkit.dylib")
+                if self.prefix(src=os.path.join(pkgdir, "llplugin"), dst="llplugin"):
+                    self.path("media_plugin_quicktime.dylib")
+                    self.path("media_plugin_webkit.dylib")
                     self.end_prefix("llplugin")
 
                 self.end_prefix("Resources")
-- 
GitLab