comp1,comp2,...: rebuild specified targets''', None),
# can be set to a non-existing directory
('prefix', 'install architecture-independent files in PREFIX', default_prefix),
+ # replace the default name and location of the windows installer
+ ('win_installer', 'name or full path to the windows installer', None),
# build directory, will use $mode if not set
('build_dir', 'Build directory', None),
# version suffix
else:
env.Tool('mingw')
env.AppendUnique(CPPPATH = ['#c:/MinGW/include'])
+ # fix a scons winres bug (there is a missing space between ${RCINCPREFIX} and ${SOURCE.dir}
+ # in version 0.96.93
+ env['RCCOM'] = '$RC $_CPPDEFFLAGS $RCINCFLAGS ${RCINCPREFIX} ${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET'
+
# we differentiate between hard-coded options and default options
# hard-coded options are required and will always be there
'CheckSelectArgType' : utils.checkSelectArgType,
'CheckBoostLibraries' : utils.checkBoostLibraries,
'CheckCommand' : utils.checkCommand,
+ 'CheckNSIS' : utils.checkNSIS,
'CheckCXXGlobalCstd' : utils.checkCXXGlobalCstd,
'CheckLC_MESSAGES' : utils.checkLC_MESSAGES,
'CheckIconvConst' : utils.checkIconvConst,
# check for msgfmt command
env['MSGFMT'] = conf.CheckCommand('msgfmt')
+# if under windows, check the nsis compiler
+if platform_name == 'win32':
+ env['NSIS'] = conf.CheckNSIS()
+
# cygwin packaging requires the binaries to be stripped
if platform_name == 'cygwin':
env['STRIP'] = conf.CheckCommand('strip')
if not succ:
# Under linux, I can test the following perfectly
# Under windows, lib names need to passed as libXXX4.a ...
- if platform_name == 'win32' and use_vc:
+ if platform_name == 'win32':
succ = conf.CheckLibWithHeader('QtCore4', 'QtGui/QApplication', 'c++', 'QApplication qapp();')
else:
succ = conf.CheckLibWithHeader('QtCore', 'QtGui/QApplication', 'c++', 'QApplication qapp();')
return os.path.isfile(File(env.subst('$BUILDDIR/common/%s/${PROGPREFIX}%s$PROGSUFFIX' % (apppath, appname))).abspath)
targets = BUILD_TARGETS
+build_installer = 'installer' in targets
# msvc need to pass full target name, so I have to look for path/lyx etc
-build_lyx = targets == [] or True in ['lyx' in x for x in targets] \
+build_lyx = build_installer or targets == [] or True in ['lyx' in x for x in targets] \
or 'install' in targets or 'all' in targets
build_boost = (included_boost and not libExists('boost_regex')) or 'boost' in targets
build_intl = (included_gettext and not libExists('included_intl')) or 'intl' in targets
build_graphics = build_lyx or 'graphics' in targets
build_controllers = build_lyx or 'controllers' in targets
build_client = True in ['client' in x for x in targets] \
- or 'install' in targets or 'all' in targets
+ or 'install' in targets or 'all' in targets or build_installer
build_tex2lyx = True in ['tex2lyx' in x for x in targets] \
- or 'install' in targets or 'all' in targets
+ or 'install' in targets or 'all' in targets or build_installer
build_lyxbase = build_lyx or 'lyxbase' in targets
build_po = 'po' in targets or 'install' in targets or 'all' in targets
build_qt4 = (build_lyx and frontend == 'qt4') or 'qt4' in targets
gmo_files.extend(env.Transfiles(f))
+if build_installer:
+ #
+ # build windows installer using NSIS
+ #
+ # NOTE:
+ # There is a nsis builder on scons wiki but it does not work with
+ # our lyx.nsi because it does not dig through all the include directives
+ # and find the dependencies automatically. Also, it can not parse
+ # OutFile in lyx.nsi since it is defined as SETUP_EXE which is in turn
+ # something rely on date.
+ # Because of this, I am doing a simple nsis builder here.
+ if platform_name != 'win32':
+ print 'installer target is only available for windows platform'
+ Exit(1)
+ if env.has_key('NSIS') and env['NSIS'] is not None:
+ # create a builder to strip and install
+ env['BUILDERS']['installer'] = Builder(generator=utils.env_nsis)
+ else:
+ print 'No nsis compiler is found. Existing...'
+ Exit(2)
+ if not env.has_key('win_installer') or env['win_installer'] is None:
+ if devel_version:
+ env['win_installer'] = '%s-%s-%s-Installer.exe' % (package_name, package_version, time.strftime('%Y-%m-%d'))
+ else:
+ env['win_installer'] = '%s-%s-Installer.exe' % (package_name, package_version)
+ # if absolute path is given, use it, otherwise, write to current directory
+ if not (':' in env['win_installer'] or '/' in env['win_installer'] or '\\' in env['win_installer']):
+ env['win_installer'] = os.path.join(env.Dir('$BUILDDIR').abspath, env['win_installer'])
+ env.Append(NSISDEFINES={'ExeFile':env['win_installer']})
+ installer = env.installer(env['win_installer'],
+ '$TOP_SRCDIR/development/Win32/packaging/installer/lyx.nsi')
+ # since I can not use a scanner, explicit dependent is required
+ env.Depends(installer, [lyx, tex2lyx] + \
+ ['$TOP_SRCDIR/development/Win32/packaging/installer/%s' % x for x in win32_packaging_installer_files] + \
+ ['$TOP_SRCDIR/development/Win32/packaging/installer/components/%s' % x for x in win32_packaging_installer_components_files] + \
+ ['$TOP_SRCDIR/development/Win32/packaging/installer/dialogs/%s' % x for x in win32_packaging_installer_dialogs_files] + \
+ ['$TOP_SRCDIR/development/Win32/packaging/installer/graphics/%s' % x for x in win32_packaging_installer_graphics_files] + \
+ ['$TOP_SRCDIR/development/Win32/packaging/installer/include/%s' % x for x in win32_packaging_installer_include_files] + \
+ ['$TOP_SRCDIR/development/Win32/packaging/installer/lang/%s' % x for x in win32_packaging_installer_lang_files ]
+ )
+ frontend_env.Alias('installer', installer)
+
+
if 'install' in targets:
#
# this part is a bit messy right now. Since scons will provide