Merge patch for better installs on POSIX platforms.

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4486 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
pabs3 2006-01-21 09:54:23 +00:00
parent c16ca4f9fc
commit 0913023f33
25 changed files with 286 additions and 134 deletions

View file

@ -6,6 +6,7 @@ appendices = 9
htmls = Split('IndexPage.html Contents.html') \
+ map(lambda ch: 'Chapter' + str(ch + 1) + '.html', range(chapters)) \
+ map(lambda ap: 'Appendix' + chr(ord('A') + ap) + '.html', range(appendices))
fixed_htmls = map(lambda fn: 'fixed/'+fn, htmls)
chm_config_but = 'chm_config.but'
@ -55,6 +56,7 @@ buts = Split("""
""")
import os
import re
Import('halibut env build_chm')
@ -62,6 +64,15 @@ env.Append(ENV = {'PATH' : os.environ['PATH']})
build_dir = Dir(GetBuildPath('.')).abspath
replacement = '<a href="%s/\\1/' % env.subst('$PREFIX_DATA')
def fix_html(target, source, env):
for i in range(len(source)):
data = open(str(source[i]),'rb').read()
data = re.sub('<a href="../(Include|Stubs|Plugins|Contrib)/', replacement, data)
open(str(target[i]),'wb').write(data)
return None
if build_chm:
hhc_action = Action('cd "%s" && hhc nsis.hhp' % (build_dir))
execute = hhc_action.execute
@ -83,7 +94,7 @@ if build_chm:
chm = env.HalibutCHM('NSIS.chm', [chm_config_but] + buts)
env.Depends(chm, halibut)
env.Distribute('', chm)
env.DistributeDoc(chm)
else:
html_builder = Builder(
@ -92,10 +103,14 @@ else:
Action('cd "%s" && "%s" ${SOURCES.abspath}' % (build_dir, halibut[0].abspath))
]
)
html_fixer = Builder(action = fix_html, suffix = '.html', src_suffix = '.html')
env.Append(BUILDERS = {'Halibut' : html_builder})
env.Append(BUILDERS = {'Halibut' : html_builder, 'FixHTML': html_fixer})
html = env.Halibut(htmls, [config_but] + buts)
fixed_html = env.FixHTML(fixed_htmls, htmls)
env.Depends(html, halibut)
env.DistributeDocs('', build_dir + '/style.css')
env.DistributeDocs('', htmls)
env.Depends(fixed_html, html)
env.DistributeDocs('#Docs/style.css')
env.DistributeDocs(fixed_html)