/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: Martin
  • Date: 2010-05-25 17:27:52 UTC
  • mfrom: (5254 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5257.
  • Revision ID: gzlist@googlemail.com-20100525172752-amm089xcikv968sw
Merge bzr.dev to unite with similar changes already made

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',
167
167
from distutils.extension import Extension
168
168
ext_modules = []
169
169
try:
170
 
    from Pyrex.Distutils import build_ext
 
170
    try:
 
171
        from Pyrex.Distutils import build_ext
 
172
        from Pyrex.Compiler.Version import version as pyrex_version
 
173
    except ImportError:
 
174
        print "No Pyrex, trying Cython..."
 
175
        from Cython.Distutils import build_ext
 
176
        from Cython.Compiler.Version import version as pyrex_version
171
177
except ImportError:
172
178
    have_pyrex = False
173
179
    # try to build the extension from the prior generated source.
180
186
    from distutils.command.build_ext import build_ext
181
187
else:
182
188
    have_pyrex = True
183
 
    from Pyrex.Compiler.Version import version as pyrex_version
 
189
    pyrex_version_info = tuple(map(int, pyrex_version.split('.')))
184
190
 
185
191
 
186
192
class build_ext_if_possible(build_ext):
265
271
 
266
272
add_pyrex_extension('bzrlib._annotator_pyx')
267
273
add_pyrex_extension('bzrlib._bencode_pyx')
268
 
add_pyrex_extension('bzrlib._btree_serializer_pyx')
269
274
add_pyrex_extension('bzrlib._chunks_to_lines_pyx')
270
275
add_pyrex_extension('bzrlib._groupcompress_pyx',
271
276
                    extra_source=['bzrlib/diff-delta.c'])
276
281
    add_pyrex_extension('bzrlib._dirstate_helpers_pyx',
277
282
                        libraries=['Ws2_32'])
278
283
    add_pyrex_extension('bzrlib._walkdirs_win32')
279
 
    z_lib = 'zdll'
280
284
else:
281
 
    if have_pyrex and pyrex_version == '0.9.4.1':
 
285
    if have_pyrex and pyrex_version_info[:3] == (0,9,4):
282
286
        # Pyrex 0.9.4.1 fails to compile this extension correctly
283
287
        # The code it generates re-uses a "local" pointer and
284
288
        # calls "PY_DECREF" after having set it to NULL. (It mixes PY_XDECREF
285
289
        # which is NULL safe with PY_DECREF which is not.)
 
290
        # <https://bugs.edge.launchpad.net/bzr/+bug/449372>
 
291
        # <https://bugs.edge.launchpad.net/bzr/+bug/276868>
286
292
        print 'Cannot build extension "bzrlib._dirstate_helpers_pyx" using'
287
293
        print 'your version of pyrex "%s". Please upgrade your pyrex' % (
288
294
            pyrex_version,)
291
297
    else:
292
298
        add_pyrex_extension('bzrlib._dirstate_helpers_pyx')
293
299
    add_pyrex_extension('bzrlib._readdir_pyx')
294
 
    z_lib = 'z'
295
 
add_pyrex_extension('bzrlib._chk_map_pyx', libraries=[z_lib])
 
300
add_pyrex_extension('bzrlib._chk_map_pyx')
296
301
ext_modules.append(Extension('bzrlib._patiencediff_c',
297
302
                             ['bzrlib/_patiencediff_c.c']))
 
303
if have_pyrex and pyrex_version_info < (0, 9, 6, 3):
 
304
    print
 
305
    print 'Your Pyrex/Cython version %s is too old to build the simple_set' % (
 
306
        pyrex_version)
 
307
    print 'and static_tuple extensions.'
 
308
    print 'Please upgrade to at least Pyrex 0.9.6.3'
 
309
    print
 
310
    # TODO: Should this be a fatal error?
 
311
else:
 
312
    # We only need 0.9.6.3 to build _simple_set_pyx, but static_tuple depends
 
313
    # on simple_set
 
314
    add_pyrex_extension('bzrlib._simple_set_pyx')
 
315
    ext_modules.append(Extension('bzrlib._static_tuple_c',
 
316
                                 ['bzrlib/_static_tuple_c.c']))
 
317
add_pyrex_extension('bzrlib._btree_serializer_pyx')
298
318
 
299
319
 
300
320
if unavailable_files:
327
347
    # Ensure tbzrlib itself is on sys.path
328
348
    sys.path.append(tbzr_root)
329
349
 
330
 
    # Ensure our COM "entry-point" is on sys.path
331
 
    sys.path.append(os.path.join(tbzr_root, "shellext", "python"))
332
 
 
333
350
    packages.append("tbzrlib")
334
351
 
335
352
    # collect up our icons.
357
374
    excludes.extend("""pywin pywin.dialogs pywin.dialogs.list
358
375
                       win32ui crawler.Crawler""".split())
359
376
 
360
 
    # NOTE: We still create a DLL version of the Python implemented shell
361
 
    # extension for testing purposes - but it is *not* registered by
362
 
    # default - our C++ one is instead.  To discourage people thinking
363
 
    # this DLL is still necessary, its called 'tbzr_old.dll'
364
 
    tbzr = dict(
365
 
        modules=["tbzr"],
366
 
        create_exe = False, # we only want a .dll
367
 
        dest_base = 'tbzr_old',
368
 
    )
369
 
    com_targets.append(tbzr)
370
 
 
371
377
    # tbzrcache executables - a "console" version for debugging and a
372
378
    # GUI version that is generally used.
373
379
    tbzrcache = dict(
398
404
    console_targets.append(tracer)
399
405
 
400
406
    # The C++ implemented shell extensions.
401
 
    dist_dir = os.path.join(tbzr_root, "shellext", "cpp", "tbzrshellext",
402
 
                            "build", "dist")
 
407
    dist_dir = os.path.join(tbzr_root, "shellext", "build")
403
408
    data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x86.dll')]))
404
409
    data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x64.dll')]))
405
410
 
408
413
    # PyQt4 itself still escapes the plugin detection code for some reason...
409
414
    packages.append('PyQt4')
410
415
    excludes.append('PyQt4.elementtree.ElementTree')
 
416
    excludes.append('PyQt4.uic.port_v3')
411
417
    includes.append('sip') # extension module required for Qt.
412
418
    packages.append('pygments') # colorizer for qbzr
413
419
    packages.append('docutils') # html formatting
462
468
 
463
469
def get_svn_py2exe_info(includes, excludes, packages):
464
470
    packages.append('subvertpy')
 
471
    packages.append('sqlite3')
465
472
 
466
473
 
467
474
if 'bdist_wininst' in sys.argv:
545
552
                                     version = version_str,
546
553
                                     description = META_INFO['description'],
547
554
                                     author = META_INFO['author'],
548
 
                                     copyright = "(c) Canonical Ltd, 2005-2009",
 
555
                                     copyright = "(c) Canonical Ltd, 2005-2010",
549
556
                                     company_name = "Canonical Ltd.",
550
557
                                     comments = META_INFO['description'],
551
558
                                    )
564
571
    if sys.version.startswith('2.4'):
565
572
        # adding elementtree package
566
573
        additional_packages.add('elementtree')
567
 
    elif sys.version.startswith('2.5'):
 
574
    elif sys.version.startswith('2.6') or sys.version.startswith('2.5'):
568
575
        additional_packages.add('xml.etree')
569
576
    else:
570
577
        import warnings
616
623
            excludes.extend(["bzrlib.plugins." + d for d in dirs])
617
624
        x = []
618
625
        for i in files:
619
 
            if os.path.splitext(i)[1] not in [".py", ".pyd", ".dll", ".mo"]:
 
626
            # Throw away files we don't want packaged. Note that plugins may
 
627
            # have data files with all sorts of extensions so we need to
 
628
            # be conservative here about what we ditch.
 
629
            ext = os.path.splitext(i)[1]
 
630
            if ext.endswith('~') or ext in [".pyc", ".swp"]:
620
631
                continue
621
632
            if i == '__init__.py' and root == 'bzrlib/plugins':
622
633
                continue
636
647
                       'tools/win32/bzr_postinstall.py',
637
648
                       ]
638
649
    gui_targets = []
639
 
    com_targets = []
640
650
    data_files = topics_files + plugins_files
641
651
 
642
652
    if 'qbzr' in plugins:
687
697
    setup(options=options_list,
688
698
          console=console_targets,
689
699
          windows=gui_targets,
690
 
          com_server=com_targets,
691
700
          zipfile='lib/library.zip',
692
701
          data_files=data_files,
693
702
          cmdclass={'install_data': install_data_with_bytecompile},
701
710
        # easy_install one
702
711
        DATA_FILES = [('man/man1', ['bzr.1'])]
703
712
 
 
713
    if sys.platform != 'win32':
 
714
        # see https://wiki.kubuntu.org/Apport/DeveloperHowTo
 
715
        #
 
716
        # checking the paths and hardcoding the check for root is a bit gross,
 
717
        # but I don't see a cleaner way to find out the locations in a way
 
718
        # that's going to align with the hardcoded paths in apport.
 
719
        if os.geteuid() == 0:
 
720
            DATA_FILES += [
 
721
                ('/usr/share/apport/package-hooks',
 
722
                    ['apport/source_bzr.py']),
 
723
                ('/etc/apport/crashdb.conf.d/',
 
724
                    ['apport/bzr-crashdb.conf']),]
 
725
 
704
726
    # std setup
705
727
    ARGS = {'scripts': ['bzr'],
706
728
            'data_files': DATA_FILES,