/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: Canonical.com Patch Queue Manager
  • Date: 2009-08-05 18:56:37 UTC
  • mfrom: (4580.5.16 1.18-win32-buildbot)
  • Revision ID: pqm@pqm.ubuntu.com-20090805185637-3f0y10upzcdw7e0g
Updates to buildout.cfg etc to have 'make installer-all' start being
        the preferred way to build win32 installer.

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',
65
65
            'package_data': {'bzrlib': ['doc/api/*.txt',
66
66
                                        'tests/test_patches_data/*',
67
67
                                        'help_topics/en/*.txt',
68
 
                                        'tests/ssl_certs/server_without_pass.key',
69
 
                                        'tests/ssl_certs/server_with_pass.key',
70
 
                                        'tests/ssl_certs/server.crt'
71
68
                                       ]},
72
69
           }
73
70
 
167
164
from distutils.extension import Extension
168
165
ext_modules = []
169
166
try:
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
 
167
    from Pyrex.Distutils import build_ext
177
168
except ImportError:
178
169
    have_pyrex = False
179
170
    # try to build the extension from the prior generated source.
186
177
    from distutils.command.build_ext import build_ext
187
178
else:
188
179
    have_pyrex = True
189
 
    pyrex_version_info = tuple(map(int, pyrex_version.split('.')))
 
180
    from Pyrex.Compiler.Version import version as pyrex_version
190
181
 
191
182
 
192
183
class build_ext_if_possible(build_ext):
271
262
 
272
263
add_pyrex_extension('bzrlib._annotator_pyx')
273
264
add_pyrex_extension('bzrlib._bencode_pyx')
 
265
add_pyrex_extension('bzrlib._btree_serializer_pyx')
274
266
add_pyrex_extension('bzrlib._chunks_to_lines_pyx')
275
267
add_pyrex_extension('bzrlib._groupcompress_pyx',
276
268
                    extra_source=['bzrlib/diff-delta.c'])
281
273
    add_pyrex_extension('bzrlib._dirstate_helpers_pyx',
282
274
                        libraries=['Ws2_32'])
283
275
    add_pyrex_extension('bzrlib._walkdirs_win32')
 
276
    z_lib = 'zdll'
284
277
else:
285
 
    if have_pyrex and pyrex_version_info[:3] == (0,9,4):
 
278
    if have_pyrex and pyrex_version == '0.9.4.1':
286
279
        # Pyrex 0.9.4.1 fails to compile this extension correctly
287
280
        # The code it generates re-uses a "local" pointer and
288
281
        # calls "PY_DECREF" after having set it to NULL. (It mixes PY_XDECREF
289
282
        # 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
283
        print 'Cannot build extension "bzrlib._dirstate_helpers_pyx" using'
293
284
        print 'your version of pyrex "%s". Please upgrade your pyrex' % (
294
285
            pyrex_version,)
297
288
    else:
298
289
        add_pyrex_extension('bzrlib._dirstate_helpers_pyx')
299
290
    add_pyrex_extension('bzrlib._readdir_pyx')
300
 
add_pyrex_extension('bzrlib._chk_map_pyx')
 
291
    z_lib = 'z'
 
292
add_pyrex_extension('bzrlib._chk_map_pyx', libraries=[z_lib])
301
293
ext_modules.append(Extension('bzrlib._patiencediff_c',
302
294
                             ['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')
318
295
 
319
296
 
320
297
if unavailable_files:
347
324
    # Ensure tbzrlib itself is on sys.path
348
325
    sys.path.append(tbzr_root)
349
326
 
 
327
    # Ensure our COM "entry-point" is on sys.path
 
328
    sys.path.append(os.path.join(tbzr_root, "shellext", "python"))
 
329
 
350
330
    packages.append("tbzrlib")
351
331
 
352
332
    # collect up our icons.
374
354
    excludes.extend("""pywin pywin.dialogs pywin.dialogs.list
375
355
                       win32ui crawler.Crawler""".split())
376
356
 
 
357
    # NOTE: We still create a DLL version of the Python implemented shell
 
358
    # extension for testing purposes - but it is *not* registered by
 
359
    # default - our C++ one is instead.  To discourage people thinking
 
360
    # this DLL is still necessary, its called 'tbzr_old.dll'
 
361
    tbzr = dict(
 
362
        modules=["tbzr"],
 
363
        create_exe = False, # we only want a .dll
 
364
        dest_base = 'tbzr_old',
 
365
    )
 
366
    com_targets.append(tbzr)
 
367
 
377
368
    # tbzrcache executables - a "console" version for debugging and a
378
369
    # GUI version that is generally used.
379
370
    tbzrcache = dict(
404
395
    console_targets.append(tracer)
405
396
 
406
397
    # The C++ implemented shell extensions.
407
 
    dist_dir = os.path.join(tbzr_root, "shellext", "build")
 
398
    dist_dir = os.path.join(tbzr_root, "shellext", "cpp", "tbzrshellext",
 
399
                            "build", "dist")
408
400
    data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x86.dll')]))
409
401
    data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x64.dll')]))
410
402
 
413
405
    # PyQt4 itself still escapes the plugin detection code for some reason...
414
406
    packages.append('PyQt4')
415
407
    excludes.append('PyQt4.elementtree.ElementTree')
416
 
    excludes.append('PyQt4.uic.port_v3')
417
408
    includes.append('sip') # extension module required for Qt.
418
409
    packages.append('pygments') # colorizer for qbzr
419
410
    packages.append('docutils') # html formatting
420
 
    includes.append('win32event')  # for qsubprocess stuff
421
411
    # but we can avoid many Qt4 Dlls.
422
412
    dll_excludes.extend(
423
413
        """QtAssistantClient4.dll QtCLucene4.dll QtDesigner4.dll
468
458
 
469
459
def get_svn_py2exe_info(includes, excludes, packages):
470
460
    packages.append('subvertpy')
471
 
    packages.append('sqlite3')
472
461
 
473
462
 
474
463
if 'bdist_wininst' in sys.argv:
552
541
                                     version = version_str,
553
542
                                     description = META_INFO['description'],
554
543
                                     author = META_INFO['author'],
555
 
                                     copyright = "(c) Canonical Ltd, 2005-2010",
 
544
                                     copyright = "(c) Canonical Ltd, 2005-2007",
556
545
                                     company_name = "Canonical Ltd.",
557
546
                                     comments = META_INFO['description'],
558
547
                                    )
571
560
    if sys.version.startswith('2.4'):
572
561
        # adding elementtree package
573
562
        additional_packages.add('elementtree')
574
 
    elif sys.version.startswith('2.6') or sys.version.startswith('2.5'):
 
563
    elif sys.version.startswith('2.5'):
575
564
        additional_packages.add('xml.etree')
576
565
    else:
577
566
        import warnings
623
612
            excludes.extend(["bzrlib.plugins." + d for d in dirs])
624
613
        x = []
625
614
        for i in files:
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"]:
 
615
            if os.path.splitext(i)[1] not in [".py", ".pyd", ".dll", ".mo"]:
631
616
                continue
632
617
            if i == '__init__.py' and root == 'bzrlib/plugins':
633
618
                continue
647
632
                       'tools/win32/bzr_postinstall.py',
648
633
                       ]
649
634
    gui_targets = []
 
635
    com_targets = []
650
636
    data_files = topics_files + plugins_files
651
637
 
652
638
    if 'qbzr' in plugins:
697
683
    setup(options=options_list,
698
684
          console=console_targets,
699
685
          windows=gui_targets,
 
686
          com_server=com_targets,
700
687
          zipfile='lib/library.zip',
701
688
          data_files=data_files,
702
689
          cmdclass={'install_data': install_data_with_bytecompile},
710
697
        # easy_install one
711
698
        DATA_FILES = [('man/man1', ['bzr.1'])]
712
699
 
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
 
 
726
700
    # std setup
727
701
    ARGS = {'scripts': ['bzr'],
728
702
            'data_files': DATA_FILES,