/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Andrew Bennetts
  • Date: 2009-10-08 08:16:35 UTC
  • mfrom: (4732 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4734.
  • Revision ID: andrew.bennetts@canonical.com-20091008081635-hwoh2m0566lkqgqq
MergeĀ lp:bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    'version':      bzrlib.__version__,
38
38
    'author':       'Canonical Ltd',
39
39
    'author_email': 'bazaar@lists.canonical.com',
40
 
    'url':          'http://bazaar.canonical.com/',
 
40
    'url':          'http://www.bazaar-vcs.org/',
41
41
    'description':  'Friendly distributed version control system',
42
42
    'license':      'GNU GPL v2',
43
 
    'download_url': 'https://launchpad.net/bzr/+download',
 
43
    'download_url': 'http://bazaar-vcs.org/Download',
44
44
    'long_description': get_long_description(),
45
45
    'classifiers': [
46
46
        'Development Status :: 6 - Mature',
186
186
    from distutils.command.build_ext import build_ext
187
187
else:
188
188
    have_pyrex = True
189
 
    pyrex_version_info = tuple(map(int, pyrex_version.split('.')))
190
189
 
191
190
 
192
191
class build_ext_if_possible(build_ext):
271
270
 
272
271
add_pyrex_extension('bzrlib._annotator_pyx')
273
272
add_pyrex_extension('bzrlib._bencode_pyx')
 
273
add_pyrex_extension('bzrlib._btree_serializer_pyx')
274
274
add_pyrex_extension('bzrlib._chunks_to_lines_pyx')
275
275
add_pyrex_extension('bzrlib._groupcompress_pyx',
276
276
                    extra_source=['bzrlib/diff-delta.c'])
283
283
    add_pyrex_extension('bzrlib._walkdirs_win32')
284
284
    z_lib = 'zdll'
285
285
else:
286
 
    if have_pyrex and pyrex_version_info[:3] == (0,9,4):
 
286
    if have_pyrex and pyrex_version == '0.9.4.1':
287
287
        # Pyrex 0.9.4.1 fails to compile this extension correctly
288
288
        # The code it generates re-uses a "local" pointer and
289
289
        # calls "PY_DECREF" after having set it to NULL. (It mixes PY_XDECREF
290
290
        # which is NULL safe with PY_DECREF which is not.)
291
 
        # <https://bugs.edge.launchpad.net/bzr/+bug/449372>
292
 
        # <https://bugs.edge.launchpad.net/bzr/+bug/276868>
293
291
        print 'Cannot build extension "bzrlib._dirstate_helpers_pyx" using'
294
292
        print 'your version of pyrex "%s". Please upgrade your pyrex' % (
295
293
            pyrex_version,)
302
300
add_pyrex_extension('bzrlib._chk_map_pyx', libraries=[z_lib])
303
301
ext_modules.append(Extension('bzrlib._patiencediff_c',
304
302
                             ['bzrlib/_patiencediff_c.c']))
305
 
if have_pyrex and pyrex_version_info < (0, 9, 6, 3):
306
 
    print
307
 
    print 'Your Pyrex/Cython version %s is too old to build the simple_set' % (
308
 
        pyrex_version)
309
 
    print 'and static_tuple extensions.'
310
 
    print 'Please upgrade to at least Pyrex 0.9.6.3'
311
 
    print
312
 
    # TODO: Should this be a fatal error?
313
 
else:
314
 
    # We only need 0.9.6.3 to build _simple_set_pyx, but static_tuple depends
315
 
    # on simple_set
316
 
    add_pyrex_extension('bzrlib._simple_set_pyx')
317
 
    ext_modules.append(Extension('bzrlib._static_tuple_c',
318
 
                                 ['bzrlib/_static_tuple_c.c']))
319
 
add_pyrex_extension('bzrlib._btree_serializer_pyx')
320
303
 
321
304
 
322
305
if unavailable_files:
349
332
    # Ensure tbzrlib itself is on sys.path
350
333
    sys.path.append(tbzr_root)
351
334
 
 
335
    # Ensure our COM "entry-point" is on sys.path
 
336
    sys.path.append(os.path.join(tbzr_root, "shellext", "python"))
 
337
 
352
338
    packages.append("tbzrlib")
353
339
 
354
340
    # collect up our icons.
376
362
    excludes.extend("""pywin pywin.dialogs pywin.dialogs.list
377
363
                       win32ui crawler.Crawler""".split())
378
364
 
 
365
    # NOTE: We still create a DLL version of the Python implemented shell
 
366
    # extension for testing purposes - but it is *not* registered by
 
367
    # default - our C++ one is instead.  To discourage people thinking
 
368
    # this DLL is still necessary, its called 'tbzr_old.dll'
 
369
    tbzr = dict(
 
370
        modules=["tbzr"],
 
371
        create_exe = False, # we only want a .dll
 
372
        dest_base = 'tbzr_old',
 
373
    )
 
374
    com_targets.append(tbzr)
 
375
 
379
376
    # tbzrcache executables - a "console" version for debugging and a
380
377
    # GUI version that is generally used.
381
378
    tbzrcache = dict(
406
403
    console_targets.append(tracer)
407
404
 
408
405
    # The C++ implemented shell extensions.
409
 
    dist_dir = os.path.join(tbzr_root, "shellext", "build")
 
406
    dist_dir = os.path.join(tbzr_root, "shellext", "cpp", "tbzrshellext",
 
407
                            "build", "dist")
410
408
    data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x86.dll')]))
411
409
    data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x64.dll')]))
412
410
 
415
413
    # PyQt4 itself still escapes the plugin detection code for some reason...
416
414
    packages.append('PyQt4')
417
415
    excludes.append('PyQt4.elementtree.ElementTree')
418
 
    excludes.append('PyQt4.uic.port_v3')
419
416
    includes.append('sip') # extension module required for Qt.
420
417
    packages.append('pygments') # colorizer for qbzr
421
418
    packages.append('docutils') # html formatting
470
467
 
471
468
def get_svn_py2exe_info(includes, excludes, packages):
472
469
    packages.append('subvertpy')
473
 
    packages.append('sqlite3')
474
470
 
475
471
 
476
472
if 'bdist_wininst' in sys.argv:
554
550
                                     version = version_str,
555
551
                                     description = META_INFO['description'],
556
552
                                     author = META_INFO['author'],
557
 
                                     copyright = "(c) Canonical Ltd, 2005-2010",
 
553
                                     copyright = "(c) Canonical Ltd, 2005-2009",
558
554
                                     company_name = "Canonical Ltd.",
559
555
                                     comments = META_INFO['description'],
560
556
                                    )
573
569
    if sys.version.startswith('2.4'):
574
570
        # adding elementtree package
575
571
        additional_packages.add('elementtree')
576
 
    elif sys.version.startswith('2.6') or sys.version.startswith('2.5'):
 
572
    elif sys.version.startswith('2.5'):
577
573
        additional_packages.add('xml.etree')
578
574
    else:
579
575
        import warnings
625
621
            excludes.extend(["bzrlib.plugins." + d for d in dirs])
626
622
        x = []
627
623
        for i in files:
628
 
            # Throw away files we don't want packaged. Note that plugins may
629
 
            # have data files with all sorts of extensions so we need to
630
 
            # be conservative here about what we ditch.
631
 
            ext = os.path.splitext(i)[1]
632
 
            if ext.endswith('~') or ext in [".pyc", ".swp"]:
 
624
            if os.path.splitext(i)[1] not in [".py", ".pyd", ".dll", ".mo"]:
633
625
                continue
634
626
            if i == '__init__.py' and root == 'bzrlib/plugins':
635
627
                continue
649
641
                       'tools/win32/bzr_postinstall.py',
650
642
                       ]
651
643
    gui_targets = []
 
644
    com_targets = []
652
645
    data_files = topics_files + plugins_files
653
646
 
654
647
    if 'qbzr' in plugins:
699
692
    setup(options=options_list,
700
693
          console=console_targets,
701
694
          windows=gui_targets,
 
695
          com_server=com_targets,
702
696
          zipfile='lib/library.zip',
703
697
          data_files=data_files,
704
698
          cmdclass={'install_data': install_data_with_bytecompile},
712
706
        # easy_install one
713
707
        DATA_FILES = [('man/man1', ['bzr.1'])]
714
708
 
715
 
    if sys.platform != 'win32':
716
 
        # see https://wiki.kubuntu.org/Apport/DeveloperHowTo
717
 
        #
718
 
        # checking the paths and hardcoding the check for root is a bit gross,
719
 
        # but I don't see a cleaner way to find out the locations in a way
720
 
        # that's going to align with the hardcoded paths in apport.
721
 
        if os.geteuid() == 0:
722
 
            DATA_FILES += [
723
 
                ('/usr/share/apport/package-hooks',
724
 
                    ['apport/source_bzr.py']),
725
 
                ('/etc/apport/crashdb.conf.d/',
726
 
                    ['apport/bzr-crashdb.conf']),]
727
 
 
728
709
    # std setup
729
710
    ARGS = {'scripts': ['bzr'],
730
711
            'data_files': DATA_FILES,