summaryrefslogtreecommitdiffstats
path: root/gears
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-08 21:24:55 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-08 21:24:55 +0000
commit5514903c95d657d5cf912dd037a661feb246a4f1 (patch)
treed12f7ebae4663476676318a7a19fcc672a466b05 /gears
parent9ecab85317b126cde2d20146d9789032881d74e2 (diff)
downloadchromium_src-5514903c95d657d5cf912dd037a661feb246a4f1.zip
chromium_src-5514903c95d657d5cf912dd037a661feb246a4f1.tar.gz
chromium_src-5514903c95d657d5cf912dd037a661feb246a4f1.tar.bz2
Add win32 installer to Gears SConscripts.
Review URL: http://codereview.chromium.org/6591 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3054 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gears')
-rw-r--r--gears/SConscript65
-rw-r--r--gears/SConscript.dll67
-rw-r--r--gears/SConscript.installers126
3 files changed, 184 insertions, 74 deletions
diff --git a/gears/SConscript b/gears/SConscript
index caeff89..07f06ff 100644
--- a/gears/SConscript
+++ b/gears/SConscript
@@ -86,7 +86,7 @@ env.Replace(
env.Replace(
MAJOR = '0',
MINOR = '4',
- BUILD = '22',
+ BUILD = '23',
PATCH = '0',
VERSION = '${MAJOR}.${MINOR}.${BUILD}.${PATCH}',
@@ -108,11 +108,14 @@ env.Replace(
SF_OUTDIR = '$BASE_OUTDIR/sf',
)
-# Add GNU tools to the PATH.
+# Add our tools to the PATH.
env.PrependENVPath('PATH',
env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/gnu/files').abspath)
env.PrependENVPath('PATH',
env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/python_24').abspath)
+if env['OS'] in ['win32', 'wince']:
+ env.PrependENVPath('PATH',
+ env.Dir('#/$PRIVATE_THIRD_PARTY_DIR/wix/v3_0_2925/files').abspath)
env.Tool('m4')
@@ -176,6 +179,64 @@ env.Append(
]
)
+# Languages
+
+env['I18N_LANGS'] = [
+ 'en-US',
+ 'ar',
+ 'bg',
+ 'ca',
+ 'cs',
+ 'da',
+ 'de',
+ 'el',
+ 'en-GB',
+ 'es',
+ 'et',
+ 'fa',
+ 'fi',
+ 'fil',
+ 'fr',
+ 'he',
+ 'hi',
+ 'hr',
+ 'hu',
+ 'id',
+ 'is',
+ 'it',
+ 'ja',
+ 'ko',
+ 'lt',
+ 'lv',
+ 'ms',
+ 'nl',
+ 'no',
+ 'pl',
+ 'pt-BR',
+ 'pt-PT',
+ 'ro',
+ 'ru',
+ 'sk',
+ 'sl',
+ 'sr',
+ 'sv',
+ 'th',
+ 'tr',
+ 'uk',
+ 'ur',
+ 'vi',
+ 'zh-CN',
+ 'zh-TW',
+ 'ml',
+ 'te',
+ 'gu',
+ 'kn',
+ 'or',
+ 'bn',
+ 'ta',
+ 'mr',
+]
+
# Platform-specific flags follow.
if env['OS'] == 'win32':
diff --git a/gears/SConscript.dll b/gears/SConscript.dll
index d5e023d..2bfb000 100644
--- a/gears/SConscript.dll
+++ b/gears/SConscript.dll
@@ -12,62 +12,6 @@ env = env.Clone()
# TODO: move all these builders out to site_scons or somesuch.
# Building M4 files
-i18n_langs = [
- 'en-US',
- 'ar',
- 'bg',
- 'ca',
- 'cs',
- 'da',
- 'de',
- 'el',
- 'en-GB',
- 'es',
- 'et',
- 'fa',
- 'fi',
- 'fil',
- 'fr',
- 'he',
- 'hi',
- 'hr',
- 'hu',
- 'id',
- 'is',
- 'it',
- 'ja',
- 'ko',
- 'lt',
- 'lv',
- 'ms',
- 'nl',
- 'no',
- 'pl',
- 'pt-BR',
- 'pt-PT',
- 'ro',
- 'ru',
- 'sk',
- 'sl',
- 'sr',
- 'sv',
- 'th',
- 'tr',
- 'uk',
- 'ur',
- 'vi',
- 'zh-CN',
- 'zh-TW',
- 'ml',
- 'te',
- 'gu',
- 'kn',
- 'or',
- 'bn',
- 'ta',
- 'mr',
-]
-
env.Append(
M4ARCH = (env['ARCH'] == 'i386' and 'x86' or '$ARCH'),
M4FLAGS = [
@@ -83,7 +27,7 @@ env.Append(
'-DPRODUCT_MAINTAINER="google"',
'-DPRODUCT_FRIENDLY_NAME_UQ="$FRIENDLY_NAME"',
'-DPRODUCT_SHORT_NAME_UQ="$SHORT_NAME"',
- '-DI18N_LANGUAGES="(' + ','.join(i18n_langs) + ')"',
+ '-DI18N_LANGUAGES="(${",".join(I18N_LANGS)})"',
],
M4PATH = [
'$OPEN_DIR',
@@ -100,6 +44,7 @@ env.Replace(
M4COM = '$M4 $M4FLAGS ${_M4INCFLAGS} $SOURCE > $TARGET',
)
+print env.backtick('echo hi')
# TODO: Dependency scanner for m4 files - doesn't work. It can't detect files
# that don't exist!
#m4_include_re = re.compile(r'm4_include\((.*)\)', re.M)
@@ -228,6 +173,10 @@ if env['BROWSER'] in ['FF2', 'FF3']:
env_common = env.Clone()
env_common.Prepend(
+ CPPDEFINES = [
+# Common items, like notifier, is not related to any browser.
+ 'BROWSER_NONE=1',
+ ]
)
env_browser = env.Clone()
@@ -803,6 +752,8 @@ srcs['IE'] += [
m4srcs['common'] += [
'$OPEN_DIR/installer/npapi_msi.wxs.m4',
+ '$OPEN_DIR/installer/win32_msi.wxs.m4',
+ '$OPEN_DIR/installer/wince_cab.inf.m4',
]
#-----------------------------------------------------------------------------
@@ -834,7 +785,7 @@ html_m4srcs['all'] += [
i18n_m4srcs['FF3'] += [
'$OPEN_DIR/ui/generated/' + lang + '/i18n.dtd.m4'
- for lang in i18n_langs
+ for lang in env['I18N_LANGS']
]
#TODO: $(IE_OUTDIR)/string_table.res
diff --git a/gears/SConscript.installers b/gears/SConscript.installers
index 7196893..9d81681 100644
--- a/gears/SConscript.installers
+++ b/gears/SConscript.installers
@@ -3,13 +3,19 @@
# found in the LICENSE file.
import os
+import re
+import subprocess
Import('env')
env = env.Clone(
INSTALLER_BASEDIR = 'installers',
INSTALLER_BASENAME = 'gears-${OS}-${MODE}-${VERSION}',
- FF_INSTALLER = '$INSTALLER_BASEDIR/${INSTALLER_BASENAME}.xpi',
+ FF_XPI = '$INSTALLER_BASEDIR/${INSTALLER_BASENAME}.xpi',
+ WIN32_INSTALLER_MSI = '$INSTALLER_BASEDIR/${INSTALLER_BASENAME}.msi',
+
+ FF2_MODULE = '${SHLIBPREFIX}gears_ff2${SHLIBSUFFIX}',
+ MODULE = '${SHLIBPREFIX}gears${SHLIBSUFFIX}',
# Qualify our OUTDIRs relative to the SConscript files. This is for use
# with Copy(), which runs from that dir.
@@ -35,6 +41,89 @@ common_resources = [
'$OPEN_DIR/ui/common/location_data.png',
]
+def Shell(cmd):
+ """Execute a shell command and return the output."""
+ cmd[0] = env.Entry(cmd[0]).abspath
+ cmd = env.subst(cmd)
+ return subprocess.Popen(
+ cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
+
+if env['OS'] == 'win32':
+ def GGUIDGen(value):
+ """Generate a GGUID for the given value."""
+ return Shell(['$GGUIDGEN', '$NAMESPACE_GUID', value + '-$VERSION'])
+ env.Replace(
+ GGUIDGEN = '#/$OPEN_DIR/tools/gguidgen.exe',
+ NAMESPACE_GUID = '36F65206-5D4E-4752-9D52-27708E10DA79',
+# MSI version numbers must have the form <major>.<minor>.<build>. To meet this,
+# we combine our build and patch version numbers like so:
+# MSI_VERSION = <major>.<minor>.<BUILD * 100 + PATCH>.
+# Note: This assumes that the BUILD and PATCH variables adhere to the range
+# requirements in version.mk. See comments in version.mk for more details.
+ MSI_BUILD = eval(env.subst('$BUILD * 100 + $PATCH')),
+ MSI_VERSION = '${MAJOR}.${MINOR}.${MSI_BUILD}',
+ )
+
+ # You can change the names of PRODUCT_ID vars, but NEVER change their values!
+
+ # Building wxiobjs with candle
+ env.Replace(
+ CANDLEDEFPREFIX = '-d',
+ CANDLEDEFSUFFIX = '',
+ _CANDLEDEFFLAGS = ('${_defines(CANDLEDEFPREFIX, CANDLEDEFINES, '
+ 'CANDLEDEFSUFFIX, __env__)}'),
+ CANDLECOM = 'candle.exe -out $TARGET $SOURCE ${_CANDLEDEFFLAGS}',
+ )
+ env.Append(
+# Note: Since light.exe is run from $OPEN_DIR, candle.exe must generate
+# output with paths relative to that dir.
+ SCONS_DIR = '../../../..', # the scons dir relative to OPEN_DIR
+ CANDLEDEFINES = [
+ ('OurWin32ProductId',
+ GGUIDGen('OUR_PRODUCT_ID')),
+ ('OurComponentGUID_FFComponentsDirFiles',
+ GGUIDGen('OUR_COMPONENT_GUID_FF_COMPONENTS_DIR_FILES')),
+ ('OurComponentGUID_FFContentDirFiles',
+ GGUIDGen('OUR_COMPONENT_GUID_FF_CONTENT_DIR_FILES')),
+ ('OurComponentGUID_FFDirFiles',
+ GGUIDGen('OUR_COMPONENT_GUID_FF_DIR_FILES')),
+ ('OurComponentGUID_FFLibDirFiles',
+ GGUIDGen('OUR_COMPONENT_GUID_FF_LIB_DIR_FILES')),
+ ('OurComponentGUID_FFRegistry',
+ GGUIDGen('OUR_COMPONENT_GUID_FF_REGISTRY')),
+ ('OurComponentGUID_IEFiles',
+ GGUIDGen('OUR_COMPONENT_GUID_IE_FILES')),
+ ('OurComponentGUID_IERegistry',
+ GGUIDGen('OUR_COMPONENT_GUID_IE_REGISTRY')),
+ ('OurComponentGUID_SharedFiles',
+ GGUIDGen('OUR_COMPONENT_GUID_SHARED_FILES')),
+ ('OurComponentGUID_SharedVersionedFiles',
+ GGUIDGen('OUR_COMPONENT_GUID_SHARED_VERSIONED_FILES')),
+ ('OurComponentGUID_SharedRegistry',
+ GGUIDGen('OUR_COMPONENT_GUID_SHARED_REGISTRY')),
+ ('OurNpapiProductId',
+ GGUIDGen('OUR_2ND_PRODUCT_ID')),
+ ('OurComponentGUID_NpapiFiles',
+ GGUIDGen('OUR_COMPONENT_GUID_NPAPI_FILES')),
+ ('OurComponentGUID_NpapiRegistry',
+ GGUIDGen('OUR_COMPONENT_GUID_NPAPI_REGISTRY')),
+ ('OurMsiVersion', '$MSI_VERSION'),
+ ('OurCommonPath', '$SCONS_DIR/$COMMON_OUTDIR'),
+ ('OurIEPath', '$SCONS_DIR/$IE_OUTDIR'),
+ ('OurIpcTestPath', '$SCONS_DIR/$BASE_OUTDIR/ipc_test'), # TODO
+ ('OurFFPath',
+ '$SCONS_DIR/$BASE_OUTDIR/$INSTALLER_BASEDIR/$INSTALLER_BASENAME'),
+ ('OurNpapiPath', '$SCONS_DIR/$NPAPI_OUTDIR'),
+ ]
+ )
+ wix_langs = [re.sub('-', '_', lang) for lang in env['I18N_LANGS']]
+ env.Append(
+ CANDLEDEFINES =
+ [('OurComponentGUID_FFLang' + lang + 'DirFiles',
+ GGUIDGen('OUR_COMPONENT_GUID_FF_' + lang + '_DIR_FILES'))
+ for lang in wix_langs],
+ )
+
def IsDir(path):
"""Test if path (relative to the toplevel dir) is a directory."""
path = env.Entry("#/" + path).abspath
@@ -84,10 +173,8 @@ def FirefoxInstaller(env):
('components/',
['$FF3_OUTDIR/gears.xpt',
'$OPEN_DIR/base/firefox/static_files/components/bootstrap.js']),
- ('components/${SHLIBPREFIX}gears_ff2${SHLIBSUFFIX}',
- ['$FF2_OUTDIR/${SHLIBPREFIX}gears${SHLIBSUFFIX}']),
- ('components/${SHLIBPREFIX}gears${SHLIBSUFFIX}',
- ['$FF3_OUTDIR/${SHLIBPREFIX}gears${SHLIBSUFFIX}']),
+ ('components/$FF2_MODULE', ['$FF2_OUTDIR/$MODULE']),
+ ('components/$MODULE', ['$FF3_OUTDIR/$MODULE']),
]
if env['OS'] != 'win32':
@@ -123,15 +210,26 @@ def FirefoxInstaller(env):
'(cd ${TARGET.base} && zip -r ../${TARGET.file} .)'
]
- return env.Command('$FF_INSTALLER', srcs, actions)
-
-def Win32Installer(env):
- env.Command('$WIN32_INSTALLER', [],
- 'light.exe -out $TARGET $SOURCE')
-
-
+ return env.Command('$FF_XPI', srcs, actions)
env.AddMethod(FirefoxInstaller, 'FirefoxInstaller')
+def Win32Installer(env):
+ wxiobj = env.Command(
+ StripOutdir(['$IE_OUTDIR/$GENFILES_DIR/win32_msi.wxiobj']),
+ StripOutdir(['$IE_OUTDIR/$GENFILES_DIR/win32_msi.wxs']),
+ '$CANDLECOM')
+ # light.exe must be run from $OPEN_DIR
+ msi = env.Command('$WIN32_INSTALLER_MSI', wxiobj,
+ 'cd $OPEN_DIR && light.exe -out ${TARGET.abspath} ${SOURCE.abspath}')
+ env.Depends(msi, '$FF_XPI')
+ env.Depends(msi, StripOutdir(['$IE_OUTDIR/$MODULE']))
+ return msi
+env.AddMethod(Win32Installer, 'Win32Installer')
+
+installers = []
if 'FF3' in env['VALID_BROWSERS']:
- installer = env.FirefoxInstaller()
- env.Alias('gears-installers', installer)
+ installers += env.FirefoxInstaller()
+if env['OS'] in 'win32':
+ installers += env.Win32Installer()
+
+env.Alias('gears-installers', installers)