~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: John Arbash Meinel
  • Date: 2009-01-14 19:31:09 UTC
  • mfrom: (3932.2.3 1.11)
  • mto: (3932.2.4 1.11)
  • mto: This revision was merged to the branch mainline in revision 3960.
  • Revision ID: john@arbash-meinel.com-20090114193109-sramygcktbcz589f
Merge in bzr.1.11, resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
289
289
 
290
290
 
291
291
def get_tbzr_py2exe_info(includes, excludes, packages, console_targets,
292
 
                         gui_targets):
 
292
                         gui_targets, data_files):
293
293
    packages.append('tbzrcommands')
294
294
 
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())
343
343
 
 
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'
344
348
    tbzr = dict(
345
349
        modules=["tbzr"],
346
350
        create_exe = False, # we only want a .dll
 
351
        dest_base = 'tbzr_old',
347
352
    )
348
353
    com_targets.append(tbzr)
349
354
 
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,
356
361
    )
363
368
 
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')],
368
373
    )
369
374
    console_targets.append(tbzrcommand)
371
376
    tbzrcommandw["dest_base"]="tbzrcommandw"
372
377
    gui_targets.append(tbzrcommandw)
373
378
    
374
 
    # tbzr tests
375
 
    tbzrtest = dict(
376
 
        script = os.path.join(tbzr_root, "Scripts", "tbzrtest.py"),
377
 
    )
378
 
    console_targets.append(tbzrtest)
379
 
 
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)
384
 
    import winerror
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
 
380
    # extensions
 
381
    tracer = dict(script=os.path.join(tbzr_root, "scripts", "tbzrtrace.py"))
388
382
    console_targets.append(tracer)
389
383
 
 
384
    # The C++ implemented shell extensions.
 
385
    dist_dir = os.path.join(tbzr_root, "shellext", "cpp", "tbzrshellext",
 
386
                            "build", "dist")
 
387
    data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x86.dll')]))
 
388
    data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x64.dll')]))
 
389
 
390
390
 
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])
554
561
        x = []
555
562
        for i in files:
556
563
            if os.path.splitext(i)[1] not in [".py", ".pyd", ".dll", ".mo"]:
574
581
                       ]
575
582
    gui_targets = []
576
583
    com_targets = []
 
584
    data_files = topics_files + plugins_files
577
585
 
578
586
    if 'qbzr' in plugins:
579
587
        get_qbzr_py2exe_info(includes, excludes, packages)
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',
587
 
                                             '<nofile>')):
588
 
            raise RuntimeError("Please set TORTOISE_OVERLAYS_MSI_WIN32 to the"
589
 
                               " location of the Win32 TortoiseOverlays .msi"
590
 
                               " installer file")
 
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,
592
 
                             gui_targets)
 
602
                             gui_targets, data_files)
593
603
    else:
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},
619
629
          )
620
630