/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: Andrew Bennetts
  • Date: 2008-10-01 05:40:45 UTC
  • mfrom: (3753 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20081001054045-z50qc0d3p9qsc5im
Merge from bzr.dev; resolve osutils.py conflict by reverting my sha import hackery.

Show diffs side-by-side

added added

removed removed

Lines of Context:
226
226
 
227
227
 
228
228
add_pyrex_extension('bzrlib._btree_serializer_c')
229
 
add_pyrex_extension('bzrlib._dirstate_helpers_c')
230
229
add_pyrex_extension('bzrlib._knit_load_data_c')
231
 
add_pyrex_extension('bzrlib._readdir_pyx')
232
230
if sys.platform == 'win32':
 
231
    add_pyrex_extension('bzrlib._dirstate_helpers_c',
 
232
                         libraries=['Ws2_32']
 
233
                       )
233
234
    # pyrex uses the macro WIN32 to detect the platform, even though it should
234
235
    # be using something like _WIN32 or MS_WINDOWS, oh well, we can give it the
235
236
    # right value.
236
237
    add_pyrex_extension('bzrlib._walkdirs_win32',
237
238
                        define_macros=[('WIN32', None)])
 
239
else:
 
240
    add_pyrex_extension('bzrlib._dirstate_helpers_c')
 
241
    add_pyrex_extension('bzrlib._readdir_pyx')
238
242
ext_modules.append(Extension('bzrlib._patiencediff_c', ['bzrlib/_patiencediff_c.c']))
239
243
 
240
244
 
253
257
    # win32com uses them.  Hook this in so win32com.shell is found.
254
258
    import modulefinder
255
259
    import win32com
 
260
    import cPickle as pickle
256
261
    for p in win32com.__path__[1:]:
257
262
        modulefinder.AddPackagePath("win32com", p)
258
263
    for extra in ["win32com.shell"]:
271
276
    sys.path.append(os.path.join(tbzr_root, "shellext", "python"))
272
277
 
273
278
    packages.append("tbzrlib")
 
279
 
 
280
    # collect up our icons.
 
281
    cwd = os.getcwd()
 
282
    ico_root = os.path.join(tbzr_root, 'tbzrlib', 'resources')
 
283
    icos = [] # list of (path_root, relative_ico_path)
 
284
    # First always bzr's icon and its in the root of the bzr tree.
 
285
    icos.append(('', 'bzr.ico'))
 
286
    for root, dirs, files in os.walk(ico_root):
 
287
        icos.extend([(ico_root, os.path.join(root, f)[len(ico_root)+1:])
 
288
                     for f in files if f.endswith('.ico')])
 
289
    # allocate an icon ID for each file and the full path to the ico
 
290
    icon_resources = [(rid, os.path.join(ico_dir, ico_name))
 
291
                      for rid, (ico_dir, ico_name) in enumerate(icos)]
 
292
    # create a string resource with the mapping.  Might as well save the
 
293
    # runtime some effort and write a pickle.
 
294
    # Runtime expects unicode objects with forward-slash seps.
 
295
    fse = sys.getfilesystemencoding()
 
296
    map_items = [(f.replace('\\', '/').decode(fse), rid)
 
297
                 for rid, (_, f) in enumerate(icos)]
 
298
    ico_map = dict(map_items)
 
299
    # Create a new resource type of 'ICON_MAP', and use ID=1
 
300
    other_resources = [ ("ICON_MAP", 1, pickle.dumps(ico_map))]
 
301
 
274
302
    excludes.extend("""pywin pywin.dialogs pywin.dialogs.list
275
303
                       win32ui crawler.Crawler""".split())
276
304
 
284
312
    # GUI version that is generally used.
285
313
    tbzrcache = dict(
286
314
        script = os.path.join(tbzr_root, "Scripts", "tbzrcache.py"),
287
 
        icon_resources = [(0,'bzr.ico')],
 
315
        icon_resources = icon_resources,
 
316
        other_resources = other_resources,
288
317
    )
289
318
    console_targets.append(tbzrcache)
290
319
 
326
355
    excludes.append('PyQt4.elementtree.ElementTree')
327
356
    includes.append('sip') # extension module required for Qt.
328
357
    packages.append('pygments') # colorizer for qbzr
 
358
    packages.append('docutils') # html formatting
329
359
    # but we can avoid many Qt4 Dlls.
330
360
    dll_excludes.extend(
331
361
        """QtAssistantClient4.dll QtCLucene4.dll QtDesigner4.dll
484
514
            plugins = set(dirs)
485
515
        x = []
486
516
        for i in files:
487
 
            if os.path.splitext(i)[1] not in [".py", ".pyd", ".dll"]:
 
517
            if os.path.splitext(i)[1] not in [".py", ".pyd", ".dll", ".mo"]:
488
518
                continue
489
519
            if i == '__init__.py' and root == 'bzrlib/plugins':
490
520
                continue