summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gears/SConscript23
-rw-r--r--gears/SConscript.browser5
-rw-r--r--gears/SConscript.common2
-rwxr-xr-xgears/SConscript.inputs23
-rw-r--r--gears/SConscript.installers116
5 files changed, 156 insertions, 13 deletions
diff --git a/gears/SConscript b/gears/SConscript
index 83cfa9c..eaa7609 100644
--- a/gears/SConscript
+++ b/gears/SConscript
@@ -129,6 +129,7 @@ env.Replace(
INSTALLER_BASEDIR = 'installers',
INSTALLER_BASENAME = 'gears-${OS}-${MODE}-${VERSION}',
+ INSTALLER_OUTDIR = '$BASE_OUTDIR/$INSTALLER_BASEDIR',
)
# Library flags
@@ -252,6 +253,23 @@ env.Replace(
#env.Append(SCANNERS = m4_scanner)
+# OS X Iceberg package builder
+
+env.Replace(ICEBERG = '/usr/local/bin/freeze')
+if env.WhereIs('$ICEBERG'):
+ env.Replace(ICEBERGCOM = '"$ICEBERG" -v $SOURCE')
+else:
+ env.Replace(ICEBERGCOM =
+ 'echo To create a Safari installer for Gears, you must install Iceberg'
+ ' from http://s.sudre.free.fr/Software/Iceberg.html. You can install'
+ ' the Safari version manually by running the'
+ ' $OPEN_DIR/tools/osx/install_gears.sh script.')
+
+iceberg_builder = Builder(action = '$ICEBERGCOM',
+ suffix = '.pkg', src_suffix = '.packproj')
+env.Append(BUILDERS = {'Iceberg': iceberg_builder})
+
+
# C++ build flags.
# Clear out the inherited defines from Chrome's build. I want to match Gears'
@@ -687,6 +705,11 @@ elif env['OS'] == 'osx':
'Cocoa',
'WebKit',
],
+ M4FLAGS = [
+ '-DGEARS_ENABLER_PATH="$INSTALLER_OUTDIR/Safari/GearsEnabler"',
+ '-DGEARS_PLUGIN_PATH="$INSTALLER_OUTDIR/Safari/Gears.plugin"',
+ '-DGEARS_INSTALLER_OUT_DIR="$INSTALLER_OUTDIR/Safari"',
+ ],
)
if not env['OFFICIAL_BUILD']:
# For PortAudio:
diff --git a/gears/SConscript.browser b/gears/SConscript.browser
index 1fa2400..ff97e80 100644
--- a/gears/SConscript.browser
+++ b/gears/SConscript.browser
@@ -502,3 +502,8 @@ if env['OS'] == 'win32' and env['BROWSER'] == 'IE':
env.SharedObject(GetInputs('$VISTA_BROKER_CPPSRCS')) +
GetInputs('$VISTA_BROKER_LINKSRCS'))
env.Alias('gears', vista_broker)
+
+if env['BROWSER'] == 'SF':
+ env.ChromeSharedLibrary('gears_proxy', GetInputs('$SF_PROXY_DLL_CPPSRCS'))
+ env.ChromeProgram('GearsEnabler', GetInputs('$SF_INPUTMANAGER_CPPSRCS'),
+ FRAMEWORKS = env['FRAMEWORKS'] + Split('Foundation AppKit'))
diff --git a/gears/SConscript.common b/gears/SConscript.common
index 5df142b..385c6c4 100644
--- a/gears/SConscript.common
+++ b/gears/SConscript.common
@@ -87,6 +87,6 @@ env.Alias('gears', crash_sender)
if env['OS'] == 'osx':
# SF_INSTALLER_PLUGIN_EXE
- env.ChromeProgram('stats_pane',
+ env.ChromeSharedLibrary('stats_pane',
GetInputs('$SF_INSTALLER_PLUGIN_CPPSRCS'),
FRAMEWORKS = env['FRAMEWORKS'] + Split('Cocoa InstallerPlugins'))
diff --git a/gears/SConscript.inputs b/gears/SConscript.inputs
index b63f6da..dee3132 100755
--- a/gears/SConscript.inputs
+++ b/gears/SConscript.inputs
@@ -102,6 +102,14 @@ env.Append(COMMON_M4SRCS = [
])
#-----------------------------------------------------------------------------
+# installer/safari
+
+env.Append(SF_M4SRCS = [
+ '$OPEN_DIR/installer/safari/installer.packproj.m4',
+ '$OPEN_DIR/tools/osx/Info.plist.m4',
+])
+
+#-----------------------------------------------------------------------------
# mozjs bindings
mozjs_sources = [
@@ -954,6 +962,21 @@ env.Append(SF_INSTALLER_PLUGIN_CPPSRCS = [
])
#-----------------------------------------------------------------------------
+# Safari InputManager
+
+env.Append(SF_INPUTMANAGER_CPPSRCS = [
+ '$OPEN_DIR/base/safari/enabler.m',
+ '$OPEN_DIR/base/safari/loader.mm',
+])
+
+#-----------------------------------------------------------------------------
+# Safari Proxy DLL
+
+env.Append(SF_PROXY_DLL_CPPSRCS = [
+ '$OPEN_DIR/base/safari/plugin_proxy.mm',
+])
+
+#-----------------------------------------------------------------------------
# resources
if env_res and env['OS'] in ['win32', 'wince']:
diff --git a/gears/SConscript.installers b/gears/SConscript.installers
index 52d81c6..8cfb9de 100644
--- a/gears/SConscript.installers
+++ b/gears/SConscript.installers
@@ -13,7 +13,12 @@ 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}',
@@ -115,7 +120,7 @@ def IsDir(path):
def StripOutdir(paths):
"""Strips the Hammer/gears/$MODE/ part from the paths, if its there."""
def StripOne(path):
- path = os.path.normpath(env.subst(path))
+ path = os.path.normpath(env.subst(str(path)))
is_dir = IsDir(path)
pattern = env.subst('$BASE_OUTDIR')
if path.startswith(pattern): path = path[len(pattern)+1:]
@@ -158,13 +163,21 @@ def DirBuilder(env, dirtarget, dirsrcs):
# be relative to the outdir already.
srcs += StripOutdir(sources)
- is_dir = target.endswith('/')
- if is_dir:
+ 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:
- if is_dir:
+ source = env.subst(str(source))
+
+ # HACK: Compensate for the workaround below. We want the .dir file
+ # to be the dependency to the Command() builder, but we want to copy
+ # the actual directory - so strip the extension here.
+ if source.endswith('.dir'):
+ source = source[:-4]
+
+ if target_is_dir:
actions.append(
Copy('${TARGET.base}/' + target + os.path.basename(source),
source))
@@ -172,15 +185,16 @@ def DirBuilder(env, dirtarget, dirsrcs):
actions.append(Copy('${TARGET.base}/' + target, source))
# Remove any .svn directories that were copied.
+ # TODO(mpcomplete): maybe use os.walk + shutil.rmtree instead?
actions += ['rm -rf `find ${TARGET.base} -name .svn`']
# HACK: Workaround for bug in scons where directories aren't checked for
# dependency changes. Instead, we make a temp file the target, and ensure
# that that file changes everytime we execute these actions.
+ # See http://scons.tigris.org/issues/show_bug.cgi?id=2261
actions += ['date > ${TARGET}']
- realtarget = env.Command(dirtarget + '.dir', srcs, actions)
- return [dirtarget, realtarget]
-env.AddMethod(DirBuilder, 'DirBuilder')
+ return env.Command(dirtarget + '.dir', srcs, actions)
+env.AddMethod(DirBuilder)
def FirefoxInstaller(env):
# This step is a little hackish.
@@ -227,12 +241,12 @@ def FirefoxInstaller(env):
dir = env.DirBuilder('$INSTALLER_BASEDIR/${INSTALLER_BASENAME}', dirsrcs)
actions = [
# Mark files writeable to allow .xpi rebuilds
- 'chmod -R 777 $SOURCE',
- '(cd $SOURCE && zip -r ../${TARGET.file} .)'
+ 'chmod -R 777 ${SOURCE.base}',
+ '(cd ${SOURCE.base} && zip -r ../${TARGET.file} .)'
]
return env.Command('$FF_XPI', dir, actions)
-env.AddMethod(FirefoxInstaller, 'FirefoxInstaller')
+env.AddMethod(FirefoxInstaller)
def Win32Installer(env):
wxiobj = env.Command(
@@ -256,7 +270,7 @@ def Win32Installer(env):
StripOutdir(['$NPAPI_OUTDIR/$MODULE'])],
'cd $OPEN_DIR && light.exe -out ${TARGET.abspath} ${SOURCES[0].abspath}')
return msi
-env.AddMethod(Win32Installer, 'Win32Installer')
+env.AddMethod(Win32Installer)
def WinCEInstaller(env):
env['ToUnixPath'] = ToUnixPath
@@ -273,11 +287,89 @@ def WinCEInstaller(env):
' /err ${SOURCES[0].base}.log',
Copy('$TARGET', '${SOURCE.base}.CAB')])
return cab
-env.AddMethod(WinCEInstaller, 'WinCEInstaller')
+env.AddMethod(WinCEInstaller)
+
+def SafariPluginBundle(env):
+ """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')),
+ # TODO(mpcomplete): crash sendor/inspector, launchurl
+ ('Contents/MacOS/', ['$SF_OUTDIR/$MODULE']),
+ ]
+
+ if env['USING_CCTESTS']:
+ dirsrcs += [
+ ('Contents/Resources/', ['$COMMON_OUTDIR/ipc_test${PROGSUFFIX}']),
+ ]
+
+ return env.DirBuilder('${SF_PLUGIN_BUNDLE}', dirsrcs)
+env.AddMethod(SafariPluginBundle)
+
+def SafariPluginProxyBundle(env):
+ """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/Resources/', ['$OPEN_DIR/tools/osx/uninstall.command']),
+ ]
+
+ return env.DirBuilder('${SF_PLUGIN_PROXY_BUNDLE}', dirsrcs)
+env.AddMethod(SafariPluginProxyBundle)
+
+def SafariInstallerPluginBundle(env):
+ dirsrcs = [
+ ('Contents/Info.plist',
+ ['$OPEN_DIR/base/safari/advanced_stats_sheet.plist']),
+ ('Contents/MacOS/',
+ ['$COMMON_OUTDIR/${SHLIBPREFIX}stats_pane${SHLIBSUFFIX}']),
+ ('Contents/Resources/AdvancedStatsSheet.nib',
+ ['$OPEN_DIR/base/safari/advanced_stats_sheet.nib']),
+ ]
+
+ return env.DirBuilder('${SF_INSTALLER_PLUGIN_BUNDLE}', dirsrcs)
+env.AddMethod(SafariInstallerPluginBundle)
+
+def SafariInstallerPackage(env):
+ proxy = env.SafariPluginProxyBundle()
+ pkg = env.Iceberg(env.Dir('${SF_INSTALLER_PKG}'),
+ StripOutdir([
+ '$SF_OUTDIR/genfiles/installer.packproj',
+ '$BASE_OUTDIR/' + str(proxy[0]),
+ ]))
+ return pkg
+env.AddMethod(SafariInstallerPackage)
+
+def SafariInputManagerBundle(env):
+ 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/Resources/English.lproj/',
+ ['$OPEN_DIR/tools/osx/English.lproj/InfoPlist.strings']),
+ ]
+
+ return env.DirBuilder('${SF_INPUTMANAGER_BUNDLE}', dirsrcs)
+env.AddMethod(SafariInputManagerBundle)
installers = []
if 'FF3' in env['VALID_BROWSERS']:
installers += env.FirefoxInstaller()
+if 'SF' in env['VALID_BROWSERS']:
+ installers += env.SafariInstallerPluginBundle()
+ installers += env.SafariInstallerPackage()
+ installers += env.SafariInputManagerBundle()
if env['OS'] == 'win32':
installers += env.Win32Installer()
if env['OS'] == 'wince':