~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: John Arbash Meinel
  • Date: 2009-10-12 21:44:27 UTC
  • mto: This revision was merged to the branch mainline in revision 4737.
  • Revision ID: john@arbash-meinel.com-20091012214427-zddi1kmc2jlf7v31
Py_ssize_t and its associated function typedefs are not available w/ python 2.4

So we define them in python-compat.h
Even further, gcc issued a warning for:
static int
_workaround_pyrex_096()
So we changed it to:
_workaround_pyrex_096(void)

Also, some python api funcs were incorrectly defined as 'char *' when they meant
'const char *'. Work around that with a (char *) cast, to avoid compiler warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
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',
270
270
 
271
271
add_pyrex_extension('bzrlib._annotator_pyx')
272
272
add_pyrex_extension('bzrlib._bencode_pyx')
 
273
add_pyrex_extension('bzrlib._btree_serializer_pyx')
273
274
add_pyrex_extension('bzrlib._chunks_to_lines_pyx')
274
275
add_pyrex_extension('bzrlib._groupcompress_pyx',
275
276
                    extra_source=['bzrlib/diff-delta.c'])
282
283
    add_pyrex_extension('bzrlib._walkdirs_win32')
283
284
    z_lib = 'zdll'
284
285
else:
285
 
    if have_pyrex and pyrex_version.startswith('0.9.4'):
 
286
    if have_pyrex and pyrex_version == '0.9.4.1':
286
287
        # Pyrex 0.9.4.1 fails to compile this extension correctly
287
288
        # The code it generates re-uses a "local" pointer and
288
289
        # calls "PY_DECREF" after having set it to NULL. (It mixes PY_XDECREF
289
290
        # 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>
292
291
        print 'Cannot build extension "bzrlib._dirstate_helpers_pyx" using'
293
292
        print 'your version of pyrex "%s". Please upgrade your pyrex' % (
294
293
            pyrex_version,)
304
303
add_pyrex_extension('bzrlib._simple_set_pyx')
305
304
ext_modules.append(Extension('bzrlib._static_tuple_c',
306
305
                             ['bzrlib/_static_tuple_c.c']))
307
 
add_pyrex_extension('bzrlib._btree_serializer_pyx')
308
 
 
309
306
 
310
307
if unavailable_files:
311
308
    print 'C extension(s) not found:'
337
334
    # Ensure tbzrlib itself is on sys.path
338
335
    sys.path.append(tbzr_root)
339
336
 
 
337
    # Ensure our COM "entry-point" is on sys.path
 
338
    sys.path.append(os.path.join(tbzr_root, "shellext", "python"))
 
339
 
340
340
    packages.append("tbzrlib")
341
341
 
342
342
    # collect up our icons.
364
364
    excludes.extend("""pywin pywin.dialogs pywin.dialogs.list
365
365
                       win32ui crawler.Crawler""".split())
366
366
 
 
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
 
367
378
    # tbzrcache executables - a "console" version for debugging and a
368
379
    # GUI version that is generally used.
369
380
    tbzrcache = dict(
394
405
    console_targets.append(tracer)
395
406
 
396
407
    # The C++ implemented shell extensions.
397
 
    dist_dir = os.path.join(tbzr_root, "shellext", "build")
 
408
    dist_dir = os.path.join(tbzr_root, "shellext", "cpp", "tbzrshellext",
 
409
                            "build", "dist")
398
410
    data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x86.dll')]))
399
411
    data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x64.dll')]))
400
412
 
403
415
    # PyQt4 itself still escapes the plugin detection code for some reason...
404
416
    packages.append('PyQt4')
405
417
    excludes.append('PyQt4.elementtree.ElementTree')
406
 
    excludes.append('PyQt4.uic.port_v3')
407
418
    includes.append('sip') # extension module required for Qt.
408
419
    packages.append('pygments') # colorizer for qbzr
409
420
    packages.append('docutils') # html formatting
632
643
                       'tools/win32/bzr_postinstall.py',
633
644
                       ]
634
645
    gui_targets = []
 
646
    com_targets = []
635
647
    data_files = topics_files + plugins_files
636
648
 
637
649
    if 'qbzr' in plugins:
682
694
    setup(options=options_list,
683
695
          console=console_targets,
684
696
          windows=gui_targets,
 
697
          com_server=com_targets,
685
698
          zipfile='lib/library.zip',
686
699
          data_files=data_files,
687
700
          cmdclass={'install_data': install_data_with_bytecompile},