291
291
def get_tbzr_py2exe_info(includes, excludes, packages, console_targets,
292
gui_targets, data_files):
293
293
packages.append('tbzrcommands')
295
295
# ModuleFinder can't handle runtime changes to __path__, but
341
341
excludes.extend("""pywin pywin.dialogs pywin.dialogs.list
342
342
win32ui crawler.Crawler""".split())
344
# NOTE: We still create a DLL version of the Python implemented shell
345
# extension for testing purposes - but it is *not* registered by
346
# default - our C++ one is instead. To discourage people thinking
347
# this DLL is still necessary, its called 'tbzr_old.dll'
345
349
modules=["tbzr"],
346
350
create_exe = False, # we only want a .dll
351
dest_base = 'tbzr_old',
348
353
com_targets.append(tbzr)
350
355
# tbzrcache executables - a "console" version for debugging and a
351
356
# GUI version that is generally used.
352
357
tbzrcache = dict(
353
script = os.path.join(tbzr_root, "Scripts", "tbzrcache.py"),
358
script = os.path.join(tbzr_root, "scripts", "tbzrcache.py"),
354
359
icon_resources = icon_resources,
355
360
other_resources = other_resources,
364
369
# ditto for the tbzrcommand tool
365
370
tbzrcommand = dict(
366
script = os.path.join(tbzr_root, "Scripts", "tbzrcommand.py"),
371
script = os.path.join(tbzr_root, "scripts", "tbzrcommand.py"),
367
372
icon_resources = [(0,'bzr.ico')],
369
374
console_targets.append(tbzrcommand)
371
376
tbzrcommandw["dest_base"]="tbzrcommandw"
372
377
gui_targets.append(tbzrcommandw)
376
script = os.path.join(tbzr_root, "Scripts", "tbzrtest.py"),
378
console_targets.append(tbzrtest)
380
# A utility to see python output from the shell extension - this will
381
# die when we get a c++ extension
382
# any .py file from pywin32's win32 lib will do (other than
383
# win32traceutil itself that is)
385
win32_lib_dir = os.path.dirname(winerror.__file__)
386
tracer = dict(script = os.path.join(win32_lib_dir, "win32traceutil.py"),
387
dest_base="tbzr_tracer")
379
# A utility to see python output from both C++ and Python based shell
381
tracer = dict(script=os.path.join(tbzr_root, "scripts", "tbzrtrace.py"))
388
382
console_targets.append(tracer)
384
# The C++ implemented shell extensions.
385
dist_dir = os.path.join(tbzr_root, "shellext", "cpp", "tbzrshellext",
387
data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x86.dll')]))
388
data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x64.dll')]))
391
391
def get_qbzr_py2exe_info(includes, excludes, packages):
392
392
# PyQt4 itself still escapes the plugin detection code for some reason...
551
551
for root, dirs, files in os.walk('bzrlib/plugins'):
552
552
if root == 'bzrlib/plugins':
553
553
plugins = set(dirs)
554
# We ship plugins as normal files on the file-system - however,
555
# the build process can cause *some* of these plugin files to end
556
# up in library.zip. Thus, we saw (eg) "plugins/svn/test" in
557
# library.zip, and then saw import errors related to that as the
558
# rest of the svn plugin wasn't. So we tell py2exe to leave the
559
# plugins out of the .zip file
560
excludes.extend(["bzrlib.plugins." + d for d in dirs])
556
563
if os.path.splitext(i)[1] not in [".py", ".pyd", ".dll", ".mo"]:
583
591
# TortoiseOverlays MSI installer file. It is in the TSVN svn repo and
584
592
# can be downloaded from (username=guest, blank password):
585
593
# http://tortoisesvn.tigris.org/svn/tortoisesvn/TortoiseOverlays/version-1.0.4/bin/TortoiseOverlays-1.0.4.11886-win32.msi
586
if not os.path.isfile(os.environ.get('TORTOISE_OVERLAYS_MSI_WIN32',
588
raise RuntimeError("Please set TORTOISE_OVERLAYS_MSI_WIN32 to the"
589
" location of the Win32 TortoiseOverlays .msi"
594
# Ditto for TORTOISE_OVERLAYS_MSI_X64, pointing at *-x64.msi.
595
for needed in ('TORTOISE_OVERLAYS_MSI_WIN32',
596
'TORTOISE_OVERLAYS_MSI_X64'):
597
if not os.path.isfile(os.environ.get(needed, '<nofile>')):
598
raise RuntimeError("Please set %s to the"
599
" location of the relevant TortoiseOverlays"
600
" .msi installer file" % needed)
591
601
get_tbzr_py2exe_info(includes, excludes, packages, console_targets,
602
gui_targets, data_files)
594
604
# print this warning to stderr as output is redirected, so it is seen
595
605
# at build time. Also to stdout so it appears in the log
614
624
windows=gui_targets,
615
625
com_server=com_targets,
616
626
zipfile='lib/library.zip',
617
data_files=topics_files + plugins_files,
627
data_files=data_files,
618
628
cmdclass={'install_data': install_data_with_bytecompile},