/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: Joe Julian
  • Date: 2010-01-10 02:25:31 UTC
  • mto: (4634.119.7 2.0)
  • mto: This revision was merged to the branch mainline in revision 4959.
  • Revision ID: joe@julianfamily.org-20100110022531-wqk61rsagz8xsiga
Added MANIFEST.in to allow bdist_rpm to have all the required include files and tools. bdist_rpm will still fail to build correctly on some distributions due to a disttools bug http://bugs.python.org/issue644744

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
43
    'download_url': 'https://launchpad.net/bzr/+download',
167
167
from distutils.extension import Extension
168
168
ext_modules = []
169
169
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
 
170
    from Pyrex.Distutils import build_ext
177
171
except ImportError:
178
172
    have_pyrex = False
179
173
    # try to build the extension from the prior generated source.
186
180
    from distutils.command.build_ext import build_ext
187
181
else:
188
182
    have_pyrex = True
189
 
    pyrex_version_info = tuple(map(int, pyrex_version.split('.')))
 
183
    from Pyrex.Compiler.Version import version as pyrex_version
190
184
 
191
185
 
192
186
class build_ext_if_possible(build_ext):
271
265
 
272
266
add_pyrex_extension('bzrlib._annotator_pyx')
273
267
add_pyrex_extension('bzrlib._bencode_pyx')
 
268
add_pyrex_extension('bzrlib._btree_serializer_pyx')
274
269
add_pyrex_extension('bzrlib._chunks_to_lines_pyx')
275
270
add_pyrex_extension('bzrlib._groupcompress_pyx',
276
271
                    extra_source=['bzrlib/diff-delta.c'])
281
276
    add_pyrex_extension('bzrlib._dirstate_helpers_pyx',
282
277
                        libraries=['Ws2_32'])
283
278
    add_pyrex_extension('bzrlib._walkdirs_win32')
 
279
    z_lib = 'zdll'
284
280
else:
285
 
    if have_pyrex and pyrex_version_info[:3] == (0,9,4):
 
281
    if have_pyrex and pyrex_version == '0.9.4.1':
286
282
        # Pyrex 0.9.4.1 fails to compile this extension correctly
287
283
        # The code it generates re-uses a "local" pointer and
288
284
        # calls "PY_DECREF" after having set it to NULL. (It mixes PY_XDECREF
289
285
        # 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
286
        print 'Cannot build extension "bzrlib._dirstate_helpers_pyx" using'
293
287
        print 'your version of pyrex "%s". Please upgrade your pyrex' % (
294
288
            pyrex_version,)
297
291
    else:
298
292
        add_pyrex_extension('bzrlib._dirstate_helpers_pyx')
299
293
    add_pyrex_extension('bzrlib._readdir_pyx')
300
 
add_pyrex_extension('bzrlib._chk_map_pyx')
 
294
    z_lib = 'z'
 
295
add_pyrex_extension('bzrlib._chk_map_pyx', libraries=[z_lib])
301
296
ext_modules.append(Extension('bzrlib._patiencediff_c',
302
297
                             ['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
298
 
319
299
 
320
300
if unavailable_files:
413
393
    # PyQt4 itself still escapes the plugin detection code for some reason...
414
394
    packages.append('PyQt4')
415
395
    excludes.append('PyQt4.elementtree.ElementTree')
416
 
    excludes.append('PyQt4.uic.port_v3')
417
396
    includes.append('sip') # extension module required for Qt.
418
397
    packages.append('pygments') # colorizer for qbzr
419
398
    packages.append('docutils') # html formatting
468
447
 
469
448
def get_svn_py2exe_info(includes, excludes, packages):
470
449
    packages.append('subvertpy')
471
 
    packages.append('sqlite3')
472
450
 
473
451
 
474
452
if 'bdist_wininst' in sys.argv:
552
530
                                     version = version_str,
553
531
                                     description = META_INFO['description'],
554
532
                                     author = META_INFO['author'],
555
 
                                     copyright = "(c) Canonical Ltd, 2005-2010",
 
533
                                     copyright = "(c) Canonical Ltd, 2005-2009",
556
534
                                     company_name = "Canonical Ltd.",
557
535
                                     comments = META_INFO['description'],
558
536
                                    )
571
549
    if sys.version.startswith('2.4'):
572
550
        # adding elementtree package
573
551
        additional_packages.add('elementtree')
574
 
    elif sys.version.startswith('2.6') or sys.version.startswith('2.5'):
 
552
    elif sys.version.startswith('2.5'):
575
553
        additional_packages.add('xml.etree')
576
554
    else:
577
555
        import warnings
623
601
            excludes.extend(["bzrlib.plugins." + d for d in dirs])
624
602
        x = []
625
603
        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"]:
 
604
            if os.path.splitext(i)[1] not in [".py", ".pyd", ".dll", ".mo"]:
631
605
                continue
632
606
            if i == '__init__.py' and root == 'bzrlib/plugins':
633
607
                continue
710
684
        # easy_install one
711
685
        DATA_FILES = [('man/man1', ['bzr.1'])]
712
686
 
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
687
    # std setup
727
688
    ARGS = {'scripts': ['bzr'],
728
689
            'data_files': DATA_FILES,