summaryrefslogtreecommitdiff
path: root/indra/newview/viewer_manifest.py
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/viewer_manifest.py')
-rw-r--r--[-rwxr-xr-x]indra/newview/viewer_manifest.py295
1 files changed, 167 insertions, 128 deletions
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index cb9dd32cbe..648366fa4c 100755..100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -4,36 +4,31 @@
# @brief Description of all installer viewer files, and methods for packaging
# them into installers for all supported platforms.
#
-# $LicenseInfo:firstyear=2006&license=viewergpl$
-#
-# Copyright (c) 2006-2009, Linden Research, Inc.
-#
+# $LicenseInfo:firstyear=2006&license=viewerlgpl$
# Second Life Viewer Source Code
-# The source code in this file ("Source Code") is provided by Linden Lab
-# to you under the terms of the GNU General Public License, version 2.0
-# ("GPL"), unless you have obtained a separate licensing agreement
-# ("Other License"), formally executed by you and Linden Lab. Terms of
-# the GPL can be found in doc/GPL-license.txt in this distribution, or
-# online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+# Copyright (C) 2010, Linden Research, Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation;
+# version 2.1 of the License only.
#
-# There are special exceptions to the terms and conditions of the GPL as
-# it is applied to this Source Code. View the full text of the exception
-# in the file doc/FLOSS-exception.txt in this software distribution, or
-# online at
-# http://secondlifegrid.net/programs/open_source/licensing/flossexception
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
#
-# By copying, modifying or distributing this software, you acknowledge
-# that you have read and understood your obligations described above,
-# and agree to abide by those obligations.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
-# ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
-# WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
-# COMPLETENESS OR PERFORMANCE.
+# Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
# $/LicenseInfo$
import sys
import os.path
import re
import tarfile
+import time
viewer_dir = os.path.dirname(__file__)
# add llmanifest library to our path so we don't have to muck with PYTHONPATH
sys.path.append(os.path.join(viewer_dir, '../lib/python/indra/util'))
@@ -41,9 +36,12 @@ from llmanifest import LLManifest, main, proper_windows_path, path_ancestors
class ViewerManifest(LLManifest):
def is_packaging_viewer(self):
- # This is overridden by the WindowsManifest sub-class,
- # which has different behavior if it is not packaging the viewer.
- return True
+ # Some commands, files will only be included
+ # if we are packaging the viewer on windows.
+ # This manifest is also used to copy
+ # files during the build (see copy_w_viewer_manifest
+ # and copy_l_viewer_manifest targets)
+ return 'package' in self.args['actions']
def construct(self):
super(ViewerManifest, self).construct()
@@ -105,6 +103,12 @@ class ViewerManifest(LLManifest):
self.end_prefix("*/html")
self.end_prefix("skins")
+ # local_assets dir (for pre-cached textures)
+ if self.prefix(src="local_assets"):
+ self.path("*.j2c")
+ self.path("*.tga")
+ self.end_prefix("local_assets")
+
# Files in the newview/ directory
self.path("gpu_table.txt")
@@ -169,13 +173,6 @@ class WindowsManifest(ViewerManifest):
else:
return ''.join(self.channel().split()) + '.exe'
- def is_packaging_viewer(self):
- # Some commands, files will only be included
- # if we are packaging the viewer on windows.
- # This manifest is also used to copy
- # files during the build.
- return 'package' in self.args['actions']
-
def test_msvcrt_and_copy_action(self, src, dst):
# This is used to test a dll manifest.
# It is used as a temporary override during the construct method
@@ -255,7 +252,7 @@ class WindowsManifest(ViewerManifest):
dst=""):
self.enable_crt_manifest_check()
-
+
# Get kdu dll, continue if missing.
try:
self.path('llkdu.dll', dst='llkdu.dll')
@@ -313,12 +310,16 @@ class WindowsManifest(ViewerManifest):
self.path(src="licenses-win32.txt", dst="licenses.txt")
self.path("featuretable.txt")
+ self.path("featuretable_xp.txt")
# For use in crash reporting (generates minidumps)
self.path("dbghelp.dll")
- # For using FMOD for sound... DJS
- self.path("fmod.dll")
+ try:
+ # FMOD for sound
+ self.path("fmod.dll")
+ except:
+ print "Skipping FMOD - not found"
self.enable_no_crt_manifest_check()
@@ -332,6 +333,12 @@ class WindowsManifest(ViewerManifest):
self.path("media_plugin_webkit.dll")
self.end_prefix()
+ # winmm.dll shim
+ if self.prefix(src='../media_plugins/winmmshim/%s' % self.args['configuration'], dst="llplugin"):
+ self.path("winmm.dll")
+ self.end_prefix()
+
+
if self.args['configuration'].lower() == 'debug':
if self.prefix(src=os.path.join(os.pardir, os.pardir, 'libraries', 'i686-win32', 'lib', 'debug'),
dst="llplugin"):
@@ -479,8 +486,8 @@ class WindowsManifest(ViewerManifest):
grid_vars_template = """
OutFile "%(installer_file)s"
!define INSTFLAGS "%(flags)s"
- !define INSTNAME "SecondLife"
- !define SHORTCUT "Second Life"
+ !define INSTNAME "SecondLifeViewer2"
+ !define SHORTCUT "Second Life Viewer 2"
!define URLNAME "secondlife"
Caption "Second Life ${VERSION}"
"""
@@ -551,6 +558,10 @@ class WindowsManifest(ViewerManifest):
class DarwinManifest(ViewerManifest):
+ def is_packaging_viewer(self):
+ # darwin requires full app bundle packaging even for debugging.
+ return True
+
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="")
@@ -629,24 +640,35 @@ class DarwinManifest(ViewerManifest):
if dylibs["llcommon"]:
for libfile in ("libapr-1.0.3.7.dylib",
"libaprutil-1.0.3.8.dylib",
- "libexpat.0.5.0.dylib"):
+ "libexpat.0.5.0.dylib",
+ "libexception_handler.dylib",
+ ):
self.path(os.path.join(libdir, libfile), libfile)
- #libfmodwrapper.dylib
- self.path(self.args['configuration'] + "/libfmodwrapper.dylib", "libfmodwrapper.dylib")
+ try:
+ # FMOD for sound
+ self.path(self.args['configuration'] + "/libfmodwrapper.dylib", "libfmodwrapper.dylib")
+ except:
+ print "Skipping FMOD - not found"
# our apps
self.path("../mac_crash_logger/" + self.args['configuration'] + "/mac-crash-logger.app", "mac-crash-logger.app")
self.path("../mac_updater/" + self.args['configuration'] + "/mac-updater.app", "mac-updater.app")
+ # plugin launcher
+ self.path("../llplugin/slplugin/" + self.args['configuration'] + "/SLPlugin.app", "SLPlugin.app")
+
# our apps dependencies on shared libs
if dylibs["llcommon"]:
mac_crash_logger_res_path = self.dst_path_of("mac-crash-logger.app/Contents/Resources")
mac_updater_res_path = self.dst_path_of("mac-updater.app/Contents/Resources")
+ slplugin_res_path = self.dst_path_of("SLPlugin.app/Contents/Resources")
for libfile in ("libllcommon.dylib",
"libapr-1.0.3.7.dylib",
"libaprutil-1.0.3.8.dylib",
- "libexpat.0.5.0.dylib"):
+ "libexpat.0.5.0.dylib",
+ "libexception_handler.dylib",
+ ):
target_lib = os.path.join('../../..', libfile)
self.run_command("ln -sf %(target)r %(link)r" %
{'target': target_lib,
@@ -656,9 +678,10 @@ class DarwinManifest(ViewerManifest):
{'target': target_lib,
'link' : os.path.join(mac_updater_res_path, libfile)}
)
-
- # plugin launcher
- self.path("../llplugin/slplugin/" + self.args['configuration'] + "/SLPlugin", "SLPlugin")
+ self.run_command("ln -sf %(target)r %(link)r" %
+ {'target': target_lib,
+ 'link' : os.path.join(slplugin_res_path, libfile)}
+ )
# plugins
if self.prefix(src="", dst="llplugin"):
@@ -686,7 +709,7 @@ class DarwinManifest(ViewerManifest):
def package_finish(self):
- channel_standin = 'Second Life' # hah, our default channel is not usable on its own
+ channel_standin = 'Second Life Viewer 2' # hah, our default channel is not usable on its own
if not self.default_channel():
channel_standin = self.channel()
@@ -716,55 +739,72 @@ class DarwinManifest(ViewerManifest):
# mount the image and get the name of the mount point and device node
hdi_output = self.run_command('hdiutil attach -private %r' % sparsename)
- devfile = re.search("/dev/disk([0-9]+)[^s]", hdi_output).group(0).strip()
- volpath = re.search('HFS\s+(.+)', hdi_output).group(1).strip()
+ try:
+ devfile = re.search("/dev/disk([0-9]+)[^s]", hdi_output).group(0).strip()
+ volpath = re.search('HFS\s+(.+)', hdi_output).group(1).strip()
- # Copy everything in to the mounted .dmg
+ # Copy everything in to the mounted .dmg
- if self.default_channel() and not self.default_grid():
- app_name = "Second Life " + self.args['grid']
- else:
- app_name = channel_standin.strip()
-
- # 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
- # adding multiple .DS_Store files to svn. There is one for release,
- # one for release candidate and one for first look. Any other channels
- # will use the release .DS_Store, and will look broken.
- # - Ambroff 2008-08-20
- dmg_template = os.path.join(
- 'installers',
- 'darwin',
- '%s-dmg' % "".join(self.channel_unique().split()).lower())
-
- 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",
- 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():
- print "Copying to dmg", s, d
- self.copy_action(self.src_path_of(s), os.path.join(volpath, d))
-
- # Hide the background image, DS_Store file, and volume icon file (set their "visible" bit)
- for f in ".VolumeIcon.icns", "background.jpg", ".DS_Store":
- self.run_command('SetFile -a V %r' % os.path.join(volpath, f))
-
- # Create the alias file (which is a resource file) from the .r
- self.run_command('rez %r -o %r' %
- (self.src_path_of("installers/darwin/release-dmg/Applications-alias.r"),
- os.path.join(volpath, "Applications")))
-
- # Set the alias file's alias and custom icon bits
- self.run_command('SetFile -a AC %r' % os.path.join(volpath, "Applications"))
-
- # Set the disk image root's custom icon bit
- self.run_command('SetFile -a C %r' % volpath)
-
- # Unmount the image
- self.run_command('hdiutil detach -force %r' % devfile)
+ if self.default_channel() and not self.default_grid():
+ app_name = "Second Life " + self.args['grid']
+ else:
+ app_name = channel_standin.strip()
+
+ # 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
+ # adding multiple .DS_Store files to svn. There is one for release,
+ # one for release candidate and one for first look. Any other channels
+ # will use the release .DS_Store, and will look broken.
+ # - Ambroff 2008-08-20
+ dmg_template = os.path.join(
+ 'installers',
+ 'darwin',
+ '%s-dmg' % "".join(self.channel_unique().split()).lower())
+
+ 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",
+ 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():
+ print "Copying to dmg", s, d
+ self.copy_action(self.src_path_of(s), os.path.join(volpath, d))
+
+ # Hide the background image, DS_Store file, and volume icon file (set their "visible" bit)
+ for f in ".VolumeIcon.icns", "background.jpg", ".DS_Store":
+ pathname = os.path.join(volpath, f)
+ # We've observed mysterious "no such file" failures of the SetFile
+ # command, especially on the first file listed above -- yet
+ # subsequent inspection of the target directory confirms it's
+ # there. Timing problem with copy command? Try to handle.
+ for x in xrange(3):
+ if os.path.exists(pathname):
+ print "Confirmed existence: %r" % pathname
+ break
+ print "Waiting for %s copy command to complete (%s)..." % (f, x+1)
+ sys.stdout.flush()
+ time.sleep(1)
+ # If we fall out of the loop above without a successful break, oh
+ # well, possibly we've mistaken the nature of the problem. In any
+ # case, don't hang up the whole build looping indefinitely, let
+ # the original problem manifest by executing the desired command.
+ self.run_command('SetFile -a V %r' % pathname)
+
+ # Create the alias file (which is a resource file) from the .r
+ self.run_command('rez %r -o %r' %
+ (self.src_path_of("installers/darwin/release-dmg/Applications-alias.r"),
+ os.path.join(volpath, "Applications")))
+
+ # Set the alias file's alias and custom icon bits
+ self.run_command('SetFile -a AC %r' % os.path.join(volpath, "Applications"))
+
+ # Set the disk image root's custom icon bit
+ self.run_command('SetFile -a C %r' % volpath)
+ finally:
+ # Unmount the image even if exceptions from any of the above
+ self.run_command('hdiutil detach -force %r' % devfile)
print "Converting temp disk image to final disk image"
self.run_command('hdiutil convert %(sparse)r -format UDZO -imagekey zlib-level=9 -o %(final)r' % {'sparse':sparsename, 'final':finalname})
@@ -792,6 +832,28 @@ class LinuxManifest(ViewerManifest):
# Create an appropriate gridargs.dat for this package, denoting required grid.
self.put_in_file(self.flags_list(), 'etc/gridargs.dat')
+ self.path("secondlife-bin","bin/do-not-directly-run-secondlife-bin")
+ self.path("../linux_crash_logger/linux-crash-logger","bin/linux-crash-logger.bin")
+ self.path("../linux_updater/linux-updater", "bin/linux-updater.bin")
+ self.path("../llplugin/slplugin/SLPlugin", "bin/SLPlugin")
+
+ if self.prefix("res-sdl"):
+ self.path("*")
+ # recurse
+ self.end_prefix("res-sdl")
+
+ # plugins
+ if self.prefix(src="", dst="bin/llplugin"):
+ self.path("../media_plugins/webkit/libmedia_plugin_webkit.so", "libmedia_plugin_webkit.so")
+ self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so")
+ self.end_prefix("bin/llplugin")
+
+ try:
+ self.path("../llcommon/libllcommon.so", "lib/libllcommon.so")
+ except:
+ print "Skipping llcommon.so (assuming llcommon was linked statically)"
+
+ self.path("featuretable_linux.txt")
def package_finish(self):
if 'installer_name' in self.args:
@@ -806,6 +868,10 @@ class LinuxManifest(ViewerManifest):
else:
installer_name += '_' + self.channel_oneword().upper()
+ if self.args['buildtype'].lower() == 'release' and self.is_packaging_viewer():
+ print "* Going strip-crazy on the packaged binaries, since this is a RELEASE build"
+ self.run_command("find %(d)r/bin %(d)r/lib -type f | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) # makes some small assumptions about our packaged dir structure
+
# Fix access permissions
self.run_command("""
find %(dst)s -type d | xargs --no-run-if-empty chmod 755;
@@ -842,40 +908,17 @@ class Linux_i686Manifest(LinuxManifest):
# install either the libllkdu we just built, or a prebuilt one, in
# decreasing order of preference. for linux package, this goes to bin/
- for lib, destdir in ("llkdu", "bin"), ("llcommon", "lib"):
- libfile = "lib%s.so" % lib
- try:
- self.path(self.find_existing_file(os.path.join(os.pardir, lib, libfile),
- '../../libraries/i686-linux/lib_release_client/%s' % libfile),
- dst=os.path.join(destdir, libfile))
- # keep this one to preserve syntax, open source mangling removes previous lines
- pass
- except RuntimeError:
- print "Skipping %s - not found" % libfile
- pass
-
- self.path("secondlife-bin","bin/do-not-directly-run-secondlife-bin")
-
- self.path("../linux_crash_logger/linux-crash-logger","bin/linux-crash-logger.bin")
- self.path("../linux_updater/linux-updater", "bin/linux-updater.bin")
- self.path("../llplugin/slplugin/SLPlugin", "bin/SLPlugin")
- if self.prefix("res-sdl"):
- self.path("*")
- # recurse
- self.end_prefix("res-sdl")
-
- # plugins
- if self.prefix(src="", dst="bin/llplugin"):
- self.path("../media_plugins/webkit/libmedia_plugin_webkit.so", "libmedia_plugin_webkit.so")
- self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so")
- self.end_prefix("bin/llplugin")
-
- self.path("featuretable_linux.txt")
- #self.path("secondlife-i686.supp")
+ try:
+ self.path(self.find_existing_file('../llkdu/libllkdu.so',
+ '../../libraries/i686-linux/lib_release_client/libllkdu.so'),
+ dst='bin/libllkdu.so')
+ except:
+ print "Skipping libllkdu.so - not found"
if self.prefix("../../libraries/i686-linux/lib_release_client", dst="lib"):
self.path("libapr-1.so.0")
self.path("libaprutil-1.so.0")
+ self.path("libbreakpad_client.so.0.0.0", "libbreakpad_client.so.0")
self.path("libdb-4.2.so")
self.path("libcrypto.so.0.9.7")
self.path("libexpat.so.1")
@@ -888,16 +931,16 @@ class Linux_i686Manifest(LinuxManifest):
self.path("libopenal.so", "libopenal.so.1")
self.path("libopenal.so", "libvivoxoal.so.1") # vivox's sdk expects this soname
try:
- self.path("libkdu_v42R.so", "libkdu.so")
+ self.path("libkdu.so")
pass
except:
- print "Skipping libkdu_v42R.so - not found"
+ print "Skipping libkdu.so - not found"
pass
try:
self.path("libfmod-3.75.so")
pass
except:
- print "Skipping libkdu_v42R.so - not found"
+ print "Skipping libfmod-3.75.so - not found"
pass
self.end_prefix("lib")
@@ -913,10 +956,6 @@ class Linux_i686Manifest(LinuxManifest):
self.path("libvivoxplatform.so")
self.end_prefix("lib")
- if self.args['buildtype'].lower() == 'release':
- print "* Going strip-crazy on the packaged binaries, since this is a RELEASE build"
- self.run_command("find %(d)r/bin %(d)r/lib -type f | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) # makes some small assumptions about our packaged dir structure
-
class Linux_x86_64Manifest(LinuxManifest):
def construct(self):
super(Linux_x86_64Manifest, self).construct()