applied patch #2918870 - use of the zlib compression library provided by the system
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6030 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
9f7710ace6
commit
c39ffff404
34 changed files with 280 additions and 7431 deletions
53
SConstruct
53
SConstruct
|
@ -36,6 +36,7 @@ utils = [
|
|||
'Makensisw',
|
||||
'NSIS Menu',
|
||||
'UIs',
|
||||
'SubStart',
|
||||
'VPatch/Source/GenPat',
|
||||
'zip2exe'
|
||||
]
|
||||
|
@ -156,6 +157,7 @@ opts.Add(PathVariable('APPEND_LIBPATH', 'Additional paths to search for librarie
|
|||
opts.Add(('APPEND_CCFLAGS', 'Additional C/C++ compiler flags'))
|
||||
opts.Add(('APPEND_LINKFLAGS', 'Additional linker flags'))
|
||||
opts.Add(PathVariable('WXWIN', 'Path to wxWindows library folder (e.g. C:\\Dev\\wxWidgets-2.8.10)', os.environ.get('WXWIN')))
|
||||
opts.Add(PathVariable('ZLIB_W32', 'Path to Win32 zlib library folder (e.g. C:\\Dev\\zlib-1.2.3)', os.environ.get('ZLIB_W32')))
|
||||
# build options
|
||||
opts.Add(BoolVariable('DEBUG', 'Build executables with debugging information', 'no'))
|
||||
opts.Add(PathVariable('CODESIGNER', 'A program used to sign executables', None))
|
||||
|
@ -306,6 +308,14 @@ def DistributeDocs(files, names=[], path='', alias=None):
|
|||
def DistributeExamples(files, names=[], path='', alias=None):
|
||||
return defenv.Distribute(files, names, 'doc', 'Examples', path, alias, 'examples')
|
||||
|
||||
def FindMakeNSIS(env, path):
|
||||
exename = 'makensis_not_found'
|
||||
file = env.FindFile('makensis$PROGSUFFIX',
|
||||
[os.path.join(path, '.'), os.path.join(path, 'Bin')])
|
||||
if file:
|
||||
exename = str(file)
|
||||
return exename
|
||||
|
||||
def Sign(targets):
|
||||
if defenv.has_key('CODESIGNER'):
|
||||
for t in targets:
|
||||
|
@ -344,6 +354,12 @@ defenv.Append(LIBPATH = Split('$APPEND_LIBPATH'))
|
|||
|
||||
defenv.Default('$BUILD_PREFIX')
|
||||
|
||||
if 'ZLIB_W32' in defenv:
|
||||
defenv['ZLIB_W32_INC'] = os.path.join(defenv['ZLIB_W32'], 'include')
|
||||
defenv['ZLIB_W32_LIB'] = os.path.join(defenv['ZLIB_W32'], 'lib')
|
||||
defenv['ZLIB_W32_DLL'] = defenv.FindFile('zlib1.dll',
|
||||
[defenv['ZLIB_W32'], defenv['ZLIB_W32_LIB']])
|
||||
|
||||
tools = defenv['TOOLS']
|
||||
|
||||
envs = []
|
||||
|
@ -393,17 +409,21 @@ inst_env = {}
|
|||
inst_env['NSISDIR'] = os.path.abspath(str(defenv['INSTDISTDIR']))
|
||||
inst_env['NSISCONFDIR'] = os.path.abspath(str(defenv['INSTDISTDIR']))
|
||||
|
||||
def build_installer(target, source, env):
|
||||
cmdline = FindMakeNSIS(env, str(env['INSTDISTDIR'])) + ' %sDOUTFILE=%s %s' % (optchar, target[0].abspath, env['INSTVER'])
|
||||
cmd = env.Command(None, source, cmdline + ' $SOURCE')
|
||||
AlwaysBuild(cmd)
|
||||
AlwaysBuild(env.AddPostAction(cmd, Delete('$INSTDISTDIR')))
|
||||
env.Alias('dist-installer', cmd)
|
||||
|
||||
installer_target = defenv.Command('nsis-${VERSION}-setup${DISTSUFFIX}.exe',
|
||||
'$INSTDISTDIR' + os.sep + 'Examples' + os.sep + 'makensis.nsi',
|
||||
'$INSTDISTDIR' + os.sep + 'makensis$PROGSUFFIX ' +
|
||||
'%sDOUTFILE=$TARGET.abspath $INSTVER $SOURCE' % optchar,
|
||||
os.path.join('$INSTDISTDIR', 'Examples', 'makensis.nsi'),
|
||||
build_installer,
|
||||
ENV = inst_env)
|
||||
defenv.Depends(installer_target, '$INSTDISTDIR')
|
||||
defenv.Sign(installer_target)
|
||||
defenv.Alias('dist-installer', installer_target)
|
||||
|
||||
AlwaysBuild(defenv.AddPostAction(installer_target, Delete('$INSTDISTDIR')))
|
||||
|
||||
defenv.Alias('dist', ['dist-zip', 'dist-installer'])
|
||||
|
||||
######################################################################
|
||||
|
@ -462,7 +482,14 @@ makensis_env.SideEffect('%s/makensis.map' % build_dir, makensis)
|
|||
|
||||
defenv.Alias('makensis', makensis)
|
||||
|
||||
ins = defenv.DistributeBin(makensis,alias='install-compiler')
|
||||
if defenv['PLATFORM'] == 'win32':
|
||||
ins = defenv.DistributeW32Bin(makensis, alias='install-compiler')
|
||||
for d in ('$ZIPDISTDIR', '$INSTDISTDIR', '$TESTDISTDIR'):
|
||||
ins = defenv.InstallAs(os.path.join(d, 'makensis.exe'),
|
||||
os.path.join(d, 'Bin', 'substart.exe'))
|
||||
defenv.Alias('install-compiler', ins)
|
||||
else:
|
||||
ins = defenv.DistributeBin(makensis, alias='install-compiler')
|
||||
|
||||
######################################################################
|
||||
####### Common Functions ###
|
||||
|
@ -546,13 +573,21 @@ for plugin in plugin_libs + plugins:
|
|||
####### Utilities ###
|
||||
######################################################################
|
||||
|
||||
Import('AddZLib')
|
||||
|
||||
def BuildUtilEnv(defines = None, flags = None, libs = None,
|
||||
entry = None, nodeflib = None,
|
||||
cross_platform = False):
|
||||
if not cross_platform:
|
||||
env = util_env.Clone()
|
||||
platform = 'win32'
|
||||
else:
|
||||
env = cp_util_env.Clone()
|
||||
platform = env['PLATFORM']
|
||||
|
||||
if libs and 'z' in libs:
|
||||
libs.remove('z')
|
||||
AddZLib(env, platform)
|
||||
|
||||
AddEnvStandardFlags(env, defines, flags, libs, entry, nodeflib)
|
||||
|
||||
|
@ -692,6 +727,8 @@ def test_scripts(target, source, env):
|
|||
skipped_tests = env['SKIPTESTS'].split(',')
|
||||
ignored_tests = env['IGNORETESTS'].split(',')
|
||||
|
||||
compiler = FindMakeNSIS(env, env.subst('$TESTDISTDIR'))
|
||||
|
||||
for root, dirs, files in walk(instdir):
|
||||
for file in files:
|
||||
if file[-4:] == '.nsi':
|
||||
|
@ -702,9 +739,9 @@ def test_scripts(target, source, env):
|
|||
continue
|
||||
|
||||
if nsif in ignored_tests:
|
||||
cmd = env.Command(None, nsi, '-makensis $SOURCE')
|
||||
cmd = env.Command(None, nsi, '-' + compiler + ' $SOURCE')
|
||||
else:
|
||||
cmd = env.Command(None, nsi, 'makensis $SOURCE')
|
||||
cmd = env.Command(None, nsi, compiler + ' $SOURCE')
|
||||
AlwaysBuild(cmd)
|
||||
env.Alias('test-scripts', cmd)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue