/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: Robert Collins
  • Date: 2010-05-06 11:08:10 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506110810-h3j07fh5gmw54s25
Cleaner matcher matching revised unlocking protocol.

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://www.bazaar-vcs.org/',
 
40
    'url':          'http://bazaar.canonical.com/',
41
41
    'description':  'Friendly distributed version control system',
42
42
    'license':      'GNU GPL v2',
43
 
    'download_url': 'http://bazaar-vcs.org/Download',
 
43
    'download_url': 'https://launchpad.net/bzr/+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('.')))
189
190
 
190
191
 
191
192
class build_ext_if_possible(build_ext):
270
271
 
271
272
add_pyrex_extension('bzrlib._annotator_pyx')
272
273
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 == '0.9.4.1':
 
286
    if have_pyrex and pyrex_version_info[:3] == (0,9,4):
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>
291
293
        print 'Cannot build extension "bzrlib._dirstate_helpers_pyx" using'
292
294
        print 'your version of pyrex "%s". Please upgrade your pyrex' % (
293
295
            pyrex_version,)
300
302
add_pyrex_extension('bzrlib._chk_map_pyx', libraries=[z_lib])
301
303
ext_modules.append(Extension('bzrlib._patiencediff_c',
302
304
                             ['bzrlib/_patiencediff_c.c']))
303
 
add_pyrex_extension('bzrlib._simple_set_pyx')
304
 
ext_modules.append(Extension('bzrlib._static_tuple_c',
305
 
                             ['bzrlib/_static_tuple_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
 
306
321
 
307
322
if unavailable_files:
308
323
    print 'C extension(s) not found:'
334
349
    # Ensure tbzrlib itself is on sys.path
335
350
    sys.path.append(tbzr_root)
336
351
 
337
 
    # Ensure our COM "entry-point" is on sys.path
338
 
    sys.path.append(os.path.join(tbzr_root, "shellext", "python"))
339
 
 
340
352
    packages.append("tbzrlib")
341
353
 
342
354
    # collect up our icons.
364
376
    excludes.extend("""pywin pywin.dialogs pywin.dialogs.list
365
377
                       win32ui crawler.Crawler""".split())
366
378
 
367
 
    # NOTE: We still create a DLL version of the Python implemented shell
368
 
    # extension for testing purposes - but it is *not* registered by
369
 
    # default - our C++ one is instead.  To discourage people thinking
370
 
    # this DLL is still necessary, its called 'tbzr_old.dll'
371
 
    tbzr = dict(
372
 
        modules=["tbzr"],
373
 
        create_exe = False, # we only want a .dll
374
 
        dest_base = 'tbzr_old',
375
 
    )
376
 
    com_targets.append(tbzr)
377
 
 
378
379
    # tbzrcache executables - a "console" version for debugging and a
379
380
    # GUI version that is generally used.
380
381
    tbzrcache = dict(
405
406
    console_targets.append(tracer)
406
407
 
407
408
    # The C++ implemented shell extensions.
408
 
    dist_dir = os.path.join(tbzr_root, "shellext", "cpp", "tbzrshellext",
409
 
                            "build", "dist")
 
409
    dist_dir = os.path.join(tbzr_root, "shellext", "build")
410
410
    data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x86.dll')]))
411
411
    data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x64.dll')]))
412
412
 
415
415
    # PyQt4 itself still escapes the plugin detection code for some reason...
416
416
    packages.append('PyQt4')
417
417
    excludes.append('PyQt4.elementtree.ElementTree')
 
418
    excludes.append('PyQt4.uic.port_v3')
418
419
    includes.append('sip') # extension module required for Qt.
419
420
    packages.append('pygments') # colorizer for qbzr
420
421
    packages.append('docutils') # html formatting
469
470
 
470
471
def get_svn_py2exe_info(includes, excludes, packages):
471
472
    packages.append('subvertpy')
 
473
    packages.append('sqlite3')
472
474
 
473
475
 
474
476
if 'bdist_wininst' in sys.argv:
552
554
                                     version = version_str,
553
555
                                     description = META_INFO['description'],
554
556
                                     author = META_INFO['author'],
555
 
                                     copyright = "(c) Canonical Ltd, 2005-2009",
 
557
                                     copyright = "(c) Canonical Ltd, 2005-2010",
556
558
                                     company_name = "Canonical Ltd.",
557
559
                                     comments = META_INFO['description'],
558
560
                                    )
571
573
    if sys.version.startswith('2.4'):
572
574
        # adding elementtree package
573
575
        additional_packages.add('elementtree')
574
 
    elif sys.version.startswith('2.5'):
 
576
    elif sys.version.startswith('2.6') or sys.version.startswith('2.5'):
575
577
        additional_packages.add('xml.etree')
576
578
    else:
577
579
        import warnings
623
625
            excludes.extend(["bzrlib.plugins." + d for d in dirs])
624
626
        x = []
625
627
        for i in files:
626
 
            if os.path.splitext(i)[1] not in [".py", ".pyd", ".dll", ".mo"]:
 
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"]:
627
633
                continue
628
634
            if i == '__init__.py' and root == 'bzrlib/plugins':
629
635
                continue
643
649
                       'tools/win32/bzr_postinstall.py',
644
650
                       ]
645
651
    gui_targets = []
646
 
    com_targets = []
647
652
    data_files = topics_files + plugins_files
648
653
 
649
654
    if 'qbzr' in plugins:
694
699
    setup(options=options_list,
695
700
          console=console_targets,
696
701
          windows=gui_targets,
697
 
          com_server=com_targets,
698
702
          zipfile='lib/library.zip',
699
703
          data_files=data_files,
700
704
          cmdclass={'install_data': install_data_with_bytecompile},
708
712
        # easy_install one
709
713
        DATA_FILES = [('man/man1', ['bzr.1'])]
710
714
 
 
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
 
711
728
    # std setup
712
729
    ARGS = {'scripts': ['bzr'],
713
730
            'data_files': DATA_FILES,