diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-01 19:50:23 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-01 19:50:23 +0000 |
commit | 04d34f27c22ef87e38df03d5effb26c38cfb8c92 (patch) | |
tree | 4934fbce5e855949ea4cfa9f264418eb5e67fa83 /gears | |
parent | 1188887b8d346d84ccaf4d0ec73e9f0195ebc622 (diff) | |
download | chromium_src-04d34f27c22ef87e38df03d5effb26c38cfb8c92.zip chromium_src-04d34f27c22ef87e38df03d5effb26c38cfb8c92.tar.gz chromium_src-04d34f27c22ef87e38df03d5effb26c38cfb8c92.tar.bz2 |
Clean up how we feed various outputs into the installer builders. Instead of
referencing them by name, we put them into toplevel environment variables and
reference them by the variable.
Also made DirBuilder more flexible in accepting SCons Nodes as inputs.
Review URL: http://codereview.chromium.org/12705
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6154 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gears')
-rw-r--r-- | gears/SConscript | 62 | ||||
-rw-r--r-- | gears/SConscript.browser | 31 | ||||
-rw-r--r-- | gears/SConscript.common | 27 | ||||
-rw-r--r-- | gears/SConscript.installers | 161 |
4 files changed, 144 insertions, 137 deletions
diff --git a/gears/SConscript b/gears/SConscript index e9e72f42..902495b 100644 --- a/gears/SConscript +++ b/gears/SConscript @@ -3,14 +3,17 @@ # found in the LICENSE file. # Notes: -# This assumes you have a working gears checkout from p4 in the current dir. -# Steps for this: -# > echo %USER%-chromegears > p4config -# or on linux/osx: -# > echo $USER-chromegears > p4config -# > set P4CONFIG=p4config -# > g4 client -p //depot/googleclient/gears/p4_depot_paths -# > g4 sync +# This is the main Gears SConscript file. From here, we include sub-scripts +# that handle building various targets (third party libs, common exes, the +# browser plugins themselves, and installers). Some sub-scripts return a +# dictionary of variables to be appended to the environment, so other +# sub-scripts can use them. +# +# To check out the Gears sources, you need to make sure this directory is in +# your .gclient file, so its DEPS get processed. Example: +# { "name" : "src/gears", +# "url" : "svn://chrome-svn/chrome/trunk/src/gears", +# }, # # This is a work-in-progress conversion of the current Gears set of Makefiles. # A lot of the stuff doesn't translate to SCons-land well, and I'm not sure @@ -39,7 +42,6 @@ env = env.Clone( PRIVATE_DIR = "gears_internal", THIRD_PARTY_DIR = "third_party", PRIVATE_THIRD_PARTY_DIR = "third_party_internal", - SYMBIAN_DIR = "symbian_internal", ) if not os.path.exists(env.Dir('#/$OPEN_DIR').abspath): @@ -127,9 +129,22 @@ env.Replace( GENFILES_DIR = "$BROWSER_OUTDIR/genfiles", COMMON_GENFILES_DIR = "$COMMON_OUTDIR/genfiles", - INSTALLER_BASEDIR = 'installers', + INSTALLER_OUTDIR = '$BASE_OUTDIR/installers', +) + +# Outputs +env.Replace( INSTALLER_BASENAME = 'gears-${OS}-${MODE}-${VERSION}', - INSTALLER_OUTDIR = '$BASE_OUTDIR/$INSTALLER_BASEDIR', + + FF_XPI = '$INSTALLER_OUTDIR/${INSTALLER_BASENAME}.xpi', + WIN32_INSTALLER_MSI = '$INSTALLER_OUTDIR/${INSTALLER_BASENAME}.msi', + WINCE_INSTALLER_CAB = '$INSTALLER_OUTDIR/${INSTALLER_BASENAME}.cab', + + SF_INSTALLER_PLUGIN_BUNDLE = '$INSTALLER_OUTDIR/Safari/StatsPane.bundle', + SF_PLUGIN_BUNDLE = '$INSTALLER_OUTDIR/Safari/Gears.bundle', + SF_PLUGIN_PROXY_BUNDLE = '$INSTALLER_OUTDIR/Safari/Gears.plugin', + SF_INPUTMANAGER_BUNDLE = '$INSTALLER_OUTDIR/Safari/GearsEnabler', + SF_INSTALLER_PKG = '$INSTALLER_OUTDIR/Safari/Gears.pkg', ) # Library flags @@ -706,8 +721,8 @@ elif env['OS'] == 'osx': 'WebKit', ], M4FLAGS = [ - '-DGEARS_ENABLER_PATH="$INSTALLER_OUTDIR/Safari/GearsEnabler"', - '-DGEARS_PLUGIN_PATH="$INSTALLER_OUTDIR/Safari/Gears.plugin"', + '-DGEARS_ENABLER_PATH="$SF_INPUTMANAGER_BUNDLE"', + '-DGEARS_PLUGIN_PATH="$SF_PLUGIN_PROXY_BUNDLE"', '-DGEARS_INSTALLER_OUT_DIR="$INSTALLER_OUTDIR/Safari"', ], ) @@ -766,33 +781,40 @@ sconscripts = [ # env = env.SConscript('#/$PRIVATE_DIR/SConscript', # exports=['env', 'env_res']) -# Include the input file list. -env = env.SConscript('SConscript.inputs', exports=['env']) - for each in sconscripts: env.SConscript(each, exports=['env'], variant_dir='$COMMON_OUTDIR', duplicate=0) -# Must come before SConscript.browser because it Imports targets from this -# SConscript. -env.SConscript('SConscript.common', +# Order of execution is important here. Each sub-script adds to the +# environment, for use by later scripts. +env = env.SConscript('SConscript.inputs', exports=['env']) + +outputs = env.SConscript('SConscript.common', exports=['env'], variant_dir='$COMMON_OUTDIR', duplicate=0) +env.Append(**outputs) browsers = [env['BROWSER']] if browsers[0] == 'all': browsers = env['VALID_BROWSERS'] print 'Building:', browsers +# We run the browser script once for each browser target we want to build. +# Each script adds variables to the environment in the form of +# '${BROWSER}_foo = bar' for use by the installers script. for each in browsers: env.Replace(BROWSER = each) - env.SConscript('SConscript.browser', + outputs = env.SConscript('SConscript.browser', exports=['env'], variant_dir='$BROWSER_OUTDIR', duplicate=0) + browser_outputs = {} + for key, value in outputs.iteritems(): + browser_outputs[each + '_' + key] = value + env.Append(**browser_outputs) # Note: even though the installers write to $INSTALLER_OUTDIR, they need to # read files from other dirs, so we give them a variant_dir at the toplevel. diff --git a/gears/SConscript.browser b/gears/SConscript.browser index 6e963a8..cb853d7 100644 --- a/gears/SConscript.browser +++ b/gears/SConscript.browser @@ -384,8 +384,7 @@ if env['OS'] == 'win32': def PatternRule(t, s): return utils.PatternRule(t, s, env) def GetInputs(var): return utils.GetInputs(var, env) -# Include the common targets generated by SConscript.common. -Import('common_targets') +outputs = {} # genfiles/%: %.m4 m4s = [env.M4(*PatternRule('$GENFILES_DIR/${SOURCE.filebase}', src)) @@ -427,7 +426,7 @@ for src in GetInputs('$BROWSER_IDLSRCS'): xptsrcs += [x for x in idl if str(x).endswith('.xpt')] if env['BROWSER'] in ['FF2', 'FF3']: - env.XptLink('gears.xpt', xptsrcs) + outputs['MODULE_TYPELIB'] = env.XptLink('gears.xpt', xptsrcs) # genfiles/%.res: %.rc env.Append(BROWSER_LINKSRCS = [ @@ -436,9 +435,6 @@ env.Append(BROWSER_LINKSRCS = [ for src in GetInputs('$BROWSER_RESSRCS')] ]) -# Add common sources. -env.Append(BROWSER_LINKSRCS = common_targets['link']) - # TODO: figure out why the .rc scanner doesn't notice these dependencies. if env['OS'] in ['win32', 'wince'] and env['BROWSER'] in ['NPAPI', 'IE']: env.Depends('$GENFILES_DIR/ui_resources.rc', html_m4s) @@ -488,17 +484,19 @@ if env['BROWSER'] == 'SF': module = env.ChromeSharedLibrary('gears-$OS-$ARCH-$MODE-${BROWSER}', env.SharedObject(GetInputs('$BROWSER_CPPSRCS')) + GetInputs('$BROWSER_LINKSRCS')) -module = env.InstallAs('${SHLIBPREFIX}gears${SHLIBSUFFIX}', module) +outputs['MODULE'] = env.InstallAs('${SHLIBPREFIX}gears${SHLIBSUFFIX}', module) if env['OS'] in ['win32', 'wince'] and env['MODE'] == 'dbg': - module += env.InstallAs('gears.pdb', 'gears-$OS-$ARCH-$MODE-${BROWSER}.pdb') -env.Alias('gears', module) + outputs['MODULE_PDB'] = env.InstallAs('gears.pdb', + 'gears-$OS-$ARCH-$MODE-${BROWSER}.pdb') + env.Alias('gears', outputs['MODULE_PDB']) +env.Alias('gears', outputs['MODULE']) if env['OS'] == 'wince': env.Append(WINCE_SETUP_LINKSRCS = [ [env_res.RES(*PatternRule('$GENFILES_DIR/${SOURCE.filebase}.res', src)) for src in GetInputs('$WINCE_SETUP_RESSRCS')] ]) - wince_setup = env.ChromeSharedLibrary('setup', + outputs['WINCE_SETUP_DLL'] = env.ChromeSharedLibrary('setup', env.SharedObject(GetInputs('$WINCE_SETUP_CPPSRCS')) + GetInputs('$WINCE_SETUP_LINKSRCS')) @@ -513,12 +511,17 @@ if env['OS'] == 'win32' and env['BROWSER'] == 'IE': env_res.File(src), EXTRA_DEFINES = 'VISTA_BROKER=1') for src in GetInputs('$VISTA_BROKER_RESSRCS')] ]) - vista_broker = env.ChromeProgram('vista_broker', + outputs['VISTA_BROKER_EXE'] = env.ChromeProgram('vista_broker', env.SharedObject(GetInputs('$VISTA_BROKER_CPPSRCS')) + GetInputs('$VISTA_BROKER_LINKSRCS')) - env.Alias('gears', vista_broker) + env.Alias('gears', outputs['VISTA_BROKER_EXE']) if env['BROWSER'] == 'SF': - env.ChromeSharedLibrary('gears_proxy', GetInputs('$SF_PROXY_DLL_CPPSRCS')) - env.ChromeProgram('GearsEnabler', GetInputs('$SF_INPUTMANAGER_CPPSRCS'), + outputs['PROXY_DLL'] = env.ChromeSharedLibrary('gears_proxy', + GetInputs('$SF_PROXY_DLL_CPPSRCS')) + outputs['INPUTMANAGER_EXE'] = env.ChromeProgram('GearsEnabler', + GetInputs('$SF_INPUTMANAGER_CPPSRCS'), FRAMEWORKS = env['FRAMEWORKS'] + Split('Foundation AppKit')) + +# See main SConscript for how 'outputs' is used. +Return('outputs') diff --git a/gears/SConscript.common b/gears/SConscript.common index 205392f1..47ad2bd 100644 --- a/gears/SConscript.common +++ b/gears/SConscript.common @@ -45,13 +45,13 @@ if env['OS'] == 'osx': #----------------------------------------------------------------------------- # Generate the dependency tree. -common_targets = {} - def PatternRule(t, s): return utils.PatternRule(t, s, env) def GetInputs(var): return utils.GetInputs(var, env) +outputs = {} + # genfiles/%: %.m4 -common_targets['m4'] = \ +outputs['COMMON_M4S'] = \ [env.M4(*PatternRule('$COMMON_GENFILES_DIR/${SOURCE.filebase}', src)) for src in GetInputs('$COMMON_M4SRCS')] @@ -60,19 +60,16 @@ if GetInputs('$COMMON_BINSRCS'): bins = [env.Bin2cpp(*PatternRule( '$COMMON_GENFILES_DIR/${SOURCE.file}.from_bin.cc', src)) for src in GetInputs('$COMMON_BINSRCS')] - common_targets['link'] = [env.SharedObject(bin) for bin in bins] -else: - common_targets['link'] = [] + outputs['BROWSER_LINKSRCS'] = [env.SharedObject(bin) for bin in bins] -Export('common_targets') - -env.ChromeProgram('ipc_test', GetInputs('$IPC_TEST_CPPSRCS')) +outputs['IPC_TEST_EXE'] = env.ChromeProgram('ipc_test', + GetInputs('$IPC_TEST_CPPSRCS')) # Note: crash_sender.exe name needs to stay in sync with name used in # exception_handler_win32.cc and exception_handler_osx/google_breakpad.mm. -crash_sender = None +outputs['CRASH_SENDER_EXE'] = None if env['OS'] == 'win32': - crash_sender = env.ChromeProgram('crash_sender', + outputs['CRASH_SENDER_EXE'] = env.ChromeProgram('crash_sender', GetInputs('$CRASH_SENDER_CPPSRCS'), LIBS = Split('advapi32.lib shell32.lib wininet.lib')) elif env['OS'] == 'osx': @@ -80,10 +77,12 @@ elif env['OS'] == 'osx': # crash_sender = env.Program('crash_sender', crash_sender_srcs, # FRAMEWORKS = Split('Carbon Cocoa Foundation IOKit SystemConfiguration'), # LIBS='stdc++') -env.Alias('gears', crash_sender) +env.Alias('gears', outputs['CRASH_SENDER_EXE']) if env['OS'] == 'osx': - # SF_INSTALLER_PLUGIN_EXE - env.ChromeSharedLibrary('stats_pane', + outputs['SF_INSTALLER_PLUGIN_EXE'] = env.ChromeSharedLibrary('stats_pane', GetInputs('$SF_INSTALLER_PLUGIN_CPPSRCS'), FRAMEWORKS = env['FRAMEWORKS'] + Split('Cocoa InstallerPlugins')) + +# See main SConscript for how 'outputs' is used. +Return('outputs') diff --git a/gears/SConscript.installers b/gears/SConscript.installers index 359a2b0..d72324a 100644 --- a/gears/SConscript.installers +++ b/gears/SConscript.installers @@ -8,24 +8,11 @@ import re import shutil import subprocess import utils +import SCons.Node Import('env') -env = env.Clone( - FF_XPI = '$INSTALLER_BASEDIR/${INSTALLER_BASENAME}.xpi', - WIN32_INSTALLER_MSI = '$INSTALLER_BASEDIR/${INSTALLER_BASENAME}.msi', - WINCE_INSTALLER_CAB = '$INSTALLER_BASEDIR/${INSTALLER_BASENAME}.cab', - - SF_INSTALLER_PLUGIN_BUNDLE = '$INSTALLER_BASEDIR/Safari/StatsPane.bundle', - SF_PLUGIN_BUNDLE = '$INSTALLER_BASEDIR/Safari/Gears.bundle', - SF_PLUGIN_PROXY_BUNDLE = '$INSTALLER_BASEDIR/Safari/Gears.plugin', - SF_INPUTMANAGER_BUNDLE = '$INSTALLER_BASEDIR/Safari/GearsEnabler', - SF_INSTALLER_PKG = '$INSTALLER_BASEDIR/Safari/Gears.pkg', - - FF2_MODULE = '${SHLIBPREFIX}gears_ff2${SHLIBSUFFIX}', - MODULE = '${SHLIBPREFIX}gears${SHLIBSUFFIX}', - WINCE_SETUP = '${SHLIBPREFIX}setup${SHLIBSUFFIX}', -) +env = env.Clone() if env['OS'] in ['win32', 'wince']: env.Append(DATE = 'echo %DATE%.%TIME%') @@ -102,9 +89,8 @@ if env['OS'] == 'win32': ('OurMsiVersion', '$MSI_VERSION'), ('OurCommonPath', '$COMMON_OUTDIR'), ('OurIEPath', '$IE_OUTDIR'), - ('OurIpcTestPath', '$BASE_OUTDIR/common'), - ('OurFFPath', - '$BASE_OUTDIR/$INSTALLER_BASEDIR/$INSTALLER_BASENAME'), + ('OurIpcTestPath', '$COMMON_OUTDIR'), + ('OurFFPath', '$INSTALLER_OUTDIR/$INSTALLER_BASENAME'), ('OurNpapiPath', '$NPAPI_OUTDIR'), ] ) @@ -157,15 +143,20 @@ def DirBuilder(env, dirtarget, dirsrcs): srcs = [] actions = [Delete('${TARGET.base}')] for target, sources in dirsrcs: - srcs += sources - target_is_dir = target.endswith('/') if target_is_dir: actions.append(SafeMkdir('${TARGET.base}/' + target)) else: actions.append(SafeMkdir('${TARGET.base}/' + os.path.dirname(target))) - for source in sources: - source = env.subst(str(source)) + for source in env.Flatten(sources): + source = env.subst(source, conv=lambda x:x) + srcs.append(source) + + # Special-case for Nodes and Node lists: use their absolute paths for + # the Copy() action, otherwise it will be relative to our variant dir + # (not what Copy expects). + if isinstance(source, list): source = source[0] + if isinstance(source, SCons.Node.Node): source = source.abspath # HACK: Compensate for the workaround below. We want the .dir file # to be the dependency to the Command() builder, but we want to copy @@ -188,19 +179,10 @@ def DirBuilder(env, dirtarget, dirsrcs): # that that file changes everytime we execute these actions. # See http://scons.tigris.org/issues/show_bug.cgi?id=2261 actions += ['$DATE > ${TARGET}'] - return env.Command(dirtarget + '.dir', srcs, actions) + return env.Command(env.subst(dirtarget) + '.dir', srcs, actions) env.AddMethod(DirBuilder) -def FirefoxInstaller(env): - # This step is a little hackish. - # Why: We want to copy files from both the build and source dirs. We have - # to be explicit about which tree to pull from, because otherwise scons gets - # confused - specifically, when copying a directory from the source dir, - # scons uses the build dir's version instead. - # How: We specify "*_OUTDIR" for outputs to pull from the build dir. - # However, this won't work as an input to a builder, so we strip that off - # when passing to Command(). The Copy action, however, receives the full - # qualified path, since it knows nothing about variant build dirs. +def FirefoxInstaller(): dirsrcs = [ ('/', ['$FF3_OUTDIR/genfiles/install.rdf', '$FF3_OUTDIR/genfiles/chrome.manifest']), @@ -209,31 +191,31 @@ def FirefoxInstaller(env): GetInputs('$FF3_RESOURCES $COMMON_RESOURCES')), ('chrome/chromeFiles/locale', ['$FF3_OUTDIR/genfiles/i18n']), ('components/', - ['$FF3_OUTDIR/gears.xpt', + ['$FF3_MODULE_TYPELIB', '$OPEN_DIR/base/firefox/static_files/components/bootstrap.js']), - ('components/$FF2_MODULE', ['$FF2_OUTDIR/$MODULE']), - ('components/$MODULE', ['$FF3_OUTDIR/$MODULE']), + ('components/${SHLIBPREFIX}gears${SHLIBSUFFIX}', ['$FF2_MODULE']), + ('components/${SHLIBPREFIX}gears_ff2${SHLIBSUFFIX}', ['$FF3_MODULE']), ] if env['USING_CCTESTS']: dirsrcs += [ - ('components/', ['$COMMON_OUTDIR/ipc_test${PROGSUFFIX}']), + ('components/', ['$IPC_TEST_EXE']), ] if env['OS'] != 'win32': # TODO(playmobil): Inspector should be located in extensions dir on win32. dirsrcs += [ - ('resources/inspector', [env.Dir('$OPEN_DIR/inspector')]), + ('resources/inspector', [env.Dir('#/$OPEN_DIR/inspector')]), ('resources/inspector/common/', ['$OPEN_DIR/sdk/gears_init.js', '$OPEN_DIR/sdk/samples/sample.js']), ] if env['MODE'] == 'dbg' and env['OS'] in ['win32', 'wince']: dirsrcs += [ - ('components/gears_ff2.pdb', ['$FF2_OUTDIR/gears.pdb']), - ('components/gears.pdb', ['$FF3_OUTDIR/gears.pdb']), + ('components/gears_ff2.pdb', ['$FF2_MODULE_PDB']), + ('components/gears.pdb', ['$FF3_MODULE_PDB']), ] # TODO: notifier, os x - dir = env.DirBuilder('$INSTALLER_BASEDIR/${INSTALLER_BASENAME}', dirsrcs) + dir = env.DirBuilder('$INSTALLER_OUTDIR/$INSTALLER_BASENAME', dirsrcs) actions = [ # Mark files writeable to allow .xpi rebuilds 'chmod -R 777 ${SOURCE.base}', @@ -241,9 +223,9 @@ def FirefoxInstaller(env): ] return env.Command('$FF_XPI', dir, actions) -env.AddMethod(FirefoxInstaller) +firefox_installer = FirefoxInstaller() -def Win32Installer(env): +def Win32Installer(): wxiobj = env.Command( '$COMMON_GENFILES_DIR/win32_msi.wxiobj', '$COMMON_GENFILES_DIR/win32_msi.wxs', @@ -260,13 +242,12 @@ def Win32Installer(env): # light.exe must be run from $OPEN_DIR msi = env.Command( '$WIN32_INSTALLER_MSI', - [wxiobj, notifier, '$FF_XPI', '$IE_OUTDIR/$MODULE', - '$NPAPI_OUTDIR/$MODULE'], + [wxiobj, notifier, firefox_installer, '$IE_MODULE', '$NPAPI_MODULE'], 'cd $OPEN_DIR && light.exe -out ${TARGET.abspath} ${SOURCES[0].abspath}') return msi -env.AddMethod(Win32Installer) +win32_installer = Win32Installer() -def WinCEInstaller(env): +def WinCEInstaller(): env['ToUnixPath'] = ToUnixPath inf_outdir = ToUnixPath(env.subst('$IE_OUTDIR')) inf = env.Command( @@ -275,97 +256,99 @@ def WinCEInstaller(env): 'sed -e "s#bin-....wince-arm.ie.#' + inf_outdir + '#g" $SOURCE > $TARGET') cab = env.Command( '$WINCE_INSTALLER_CAB', - [inf, '$IE_OUTDIR/$MODULE', '$IE_OUTDIR/$WINCE_SETUP'], + [inf, '$IE_MODULE', '$IE_WINCE_SETUP_DLL'], ['cabwiz ${ToUnixPath(str(SOURCE))} /compress' ' /err ${SOURCES[0].base}.log', Copy('$TARGET', '${SOURCE.base}.CAB')]) return cab -env.AddMethod(WinCEInstaller) +wince_installer = WinCEInstaller() -def SafariPluginBundle(env): +def SafariPluginBundle(): """This is the actual gears plugin bundle for Safari.""" dirsrcs = [ ('Contents/', ['$SF_OUTDIR/genfiles/Info.plist']), ('Contents/Resources/English.lproj/InfoPlist.strings', ['$OPEN_DIR/tools/osx/English.lproj/InfoPlist.strings']), - ('Contents/Resources/', env.Glob('$OPEN_DIR/ui/safari/*.nib')), + ('Contents/Resources/', env.Glob('#/$OPEN_DIR/ui/safari/*.nib')), # TODO(mpcomplete): crash sendor/inspector, launchurl - ('Contents/MacOS/', ['$SF_OUTDIR/$MODULE']), + ('Contents/MacOS/', ['$SF_MODULE']), ] if env['USING_CCTESTS']: dirsrcs += [ - ('Contents/Resources/', ['$COMMON_OUTDIR/ipc_test${PROGSUFFIX}']), + ('Contents/Resources/', ['$IPC_TEST_EXE']), ] - return env.DirBuilder('${SF_PLUGIN_BUNDLE}', dirsrcs) -env.AddMethod(SafariPluginBundle) + return env.DirBuilder('$SF_PLUGIN_BUNDLE', dirsrcs) +safari_plugin_bundle = SafariPluginBundle() -def SafariPluginProxyBundle(env): +def SafariPluginProxyBundle(): """This is a proxy plugin which simply loads gears into Safari and keeps it in memory. It exists so that gears doesn't unload when Safari wants us to, since that causes crashes.""" - plugin = env.SafariPluginBundle() dirsrcs = [ ('Contents/', ['$SF_OUTDIR/genfiles/Info.plist']), - ('Contents/MacOS/${SHLIBPREFIX}gears${SHLIBSUFFIX}', - ['$SF_OUTDIR/${SHLIBPREFIX}gears_proxy${SHLIBSUFFIX}']), - ('Contents/Resources/', ['$BASE_OUTDIR/' + str(plugin[0])]), + ('Contents/MacOS/${SHLIBPREFIX}gears${SHLIBSUFFIX}', ['$SF_PROXY_DLL']), + ('Contents/Resources/', [safari_plugin_bundle]), ('Contents/Resources/', ['$OPEN_DIR/tools/osx/uninstall.command']), ] - return env.DirBuilder('${SF_PLUGIN_PROXY_BUNDLE}', dirsrcs) -env.AddMethod(SafariPluginProxyBundle) + return env.DirBuilder('$SF_PLUGIN_PROXY_BUNDLE', dirsrcs) +safari_plugin_proxy_bundle = SafariPluginProxyBundle() -def SafariInstallerPluginBundle(env): +def SafariInstallerPluginBundle(): dirsrcs = [ ('Contents/Info.plist', ['$OPEN_DIR/base/safari/advanced_stats_sheet.plist']), - ('Contents/MacOS/', - ['$COMMON_OUTDIR/${SHLIBPREFIX}stats_pane${SHLIBSUFFIX}']), + ('Contents/MacOS/', ['$SF_INSTALLER_PLUGIN_EXE']), ('Contents/Resources/AdvancedStatsSheet.nib', - [env.Dir('$OPEN_DIR/base/safari/advanced_stats_sheet.nib')]), + [env.Dir('#/$OPEN_DIR/base/safari/advanced_stats_sheet.nib')]), ] - return env.DirBuilder('${SF_INSTALLER_PLUGIN_BUNDLE}', dirsrcs) -env.AddMethod(SafariInstallerPluginBundle) + return env.DirBuilder('$SF_INSTALLER_PLUGIN_BUNDLE', dirsrcs) +safari_installer_plugin_bundle = SafariInstallerPluginBundle() -def SafariInstallerPackage(env): - proxy = env.SafariPluginProxyBundle() - pkg = env.Iceberg(env.Dir('${SF_INSTALLER_PKG}'), - [ - '$SF_OUTDIR/genfiles/installer.packproj', - '$BASE_OUTDIR/' + str(proxy[0]), - ]) - return pkg -env.AddMethod(SafariInstallerPackage) - -def SafariInputManagerBundle(env): +def SafariInputManagerBundle(): info = env.Command('$SF_OUTDIR/genfiles/Enabler-Info.plist', '$OPEN_DIR/tools/osx/Enabler-Info.plist', 'cat $SOURCE |' 'sed \'s/$${EXECUTABLE_NAME}/GearsEnabler/\' |' 'sed \'s/$${PRODUCT_NAME}/GearsEnabler/\' > $TARGET') dirsrcs = [ - ('Contents/Info.plist', ['$BASE_OUTDIR/' + str(info[0])]), - ('Contents/MacOS/', ['$SF_OUTDIR/GearsEnabler']), + ('Contents/Info.plist', [info]), + ('Contents/MacOS/', ['$SF_INPUTMANAGER_EXE']), ('Contents/Resources/English.lproj/', ['$OPEN_DIR/tools/osx/English.lproj/InfoPlist.strings']), ] - return env.DirBuilder('${SF_INPUTMANAGER_BUNDLE}', dirsrcs) -env.AddMethod(SafariInputManagerBundle) + return env.DirBuilder('$SF_INPUTMANAGER_BUNDLE', dirsrcs) +safari_input_manager_bundle = SafariInputManagerBundle() + +def SafariInstallerPackage(): + pkg = env.Iceberg(env.Dir('${SF_INSTALLER_PKG}'), + [ + '$SF_OUTDIR/genfiles/installer.packproj', + safari_plugin_proxy_bundle, + safari_input_manager_bundle, + ]) + return pkg +safari_installer_package = SafariInstallerPackage() installers = [] if 'FF3' in env['VALID_BROWSERS']: - installers += env.FirefoxInstaller() + installers += firefox_installer if 'SF' in env['VALID_BROWSERS']: - installers += env.SafariInstallerPluginBundle() - installers += env.SafariInstallerPackage() - installers += env.SafariInputManagerBundle() + installers += [ + safari_input_manager_bundle, + safari_plugin_bundle, + safari_plugin_proxy_bundle, + safari_installer_plugin_bundle, + safari_installer_package, + safari_input_manager_bundle, + ] if env['OS'] == 'win32': - installers += env.Win32Installer() + installers += win32_installer if env['OS'] == 'wince': - installers += env.WinCEInstaller() + installers += wince_installer env.Alias('gears-installers', installers) |