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'
242
246
c_name = path + '.c'
243
247
define_macros = []
244
248
if sys.platform == 'win32':
245
# pyrex uses the macro WIN32 to detect the platform, even though it should
246
# be using something like _WIN32 or MS_WINDOWS, oh well, we can give it the
249
# pyrex uses the macro WIN32 to detect the platform, even though it
250
# should be using something like _WIN32 or MS_WINDOWS, oh well, we can
251
# give it the right value.
248
252
define_macros.append(('WIN32', None))
250
254
source = [pyrex_name]
259
263
define_macros=define_macros, libraries=libraries))
266
add_pyrex_extension('bzrlib._annotator_pyx')
262
267
add_pyrex_extension('bzrlib._bencode_pyx')
263
add_pyrex_extension('bzrlib._btree_serializer_c')
268
add_pyrex_extension('bzrlib._btree_serializer_pyx')
264
269
add_pyrex_extension('bzrlib._chunks_to_lines_pyx')
265
270
add_pyrex_extension('bzrlib._groupcompress_pyx',
266
271
extra_source=['bzrlib/diff-delta.c'])
267
add_pyrex_extension('bzrlib._knit_load_data_c')
272
add_pyrex_extension('bzrlib._knit_load_data_pyx')
273
add_pyrex_extension('bzrlib._known_graph_pyx')
268
274
add_pyrex_extension('bzrlib._rio_pyx')
269
275
if sys.platform == 'win32':
270
add_pyrex_extension('bzrlib._dirstate_helpers_c',
276
add_pyrex_extension('bzrlib._dirstate_helpers_pyx',
271
277
libraries=['Ws2_32'])
272
278
add_pyrex_extension('bzrlib._walkdirs_win32')
277
283
# The code it generates re-uses a "local" pointer and
278
284
# calls "PY_DECREF" after having set it to NULL. (It mixes PY_XDECREF
279
285
# which is NULL safe with PY_DECREF which is not.)
280
print 'Cannot build extension "bzrlib._dirstate_helpers_c" using'
286
print 'Cannot build extension "bzrlib._dirstate_helpers_pyx" using'
281
287
print 'your version of pyrex "%s". Please upgrade your pyrex' % (
283
289
print 'install. For now, the non-compiled (python) version will'
284
290
print 'be used instead.'
286
add_pyrex_extension('bzrlib._dirstate_helpers_c')
292
add_pyrex_extension('bzrlib._dirstate_helpers_pyx')
287
293
add_pyrex_extension('bzrlib._readdir_pyx')
289
295
add_pyrex_extension('bzrlib._chk_map_pyx', libraries=[z_lib])
290
ext_modules.append(Extension('bzrlib._patiencediff_c', ['bzrlib/_patiencediff_c.c']))
296
ext_modules.append(Extension('bzrlib._patiencediff_c',
297
['bzrlib/_patiencediff_c.c']))
293
300
if unavailable_files:
397
404
data_files.append(('', [os.path.join(dist_dir, 'tbzrshellext_x64.dll')]))
400
def get_qbzr_py2exe_info(includes, excludes, packages):
407
def get_qbzr_py2exe_info(includes, excludes, packages, data_files):
401
408
# PyQt4 itself still escapes the plugin detection code for some reason...
402
409
packages.append('PyQt4')
403
410
excludes.append('PyQt4.elementtree.ElementTree')
411
418
QtSql4.dll QtTest4.dll QtWebKit4.dll QtXml4.dll
412
419
qscintilla2.dll""".split())
413
420
# the qt binaries might not be on PATH...
414
qt_dir = os.path.join(sys.prefix, "PyQt4", "bin")
415
path = os.environ.get("PATH","")
416
if qt_dir.lower() not in [p.lower() for p in path.split(os.pathsep)]:
417
os.environ["PATH"] = path + os.pathsep + qt_dir
421
# They seem to install to a place like C:\Python25\PyQt4\*
422
# Which is not the same as C:\Python25\Lib\site-packages\PyQt4
423
pyqt_dir = os.path.join(sys.prefix, "PyQt4")
424
pyqt_bin_dir = os.path.join(pyqt_dir, "bin")
425
if os.path.isdir(pyqt_bin_dir):
426
path = os.environ.get("PATH", "")
427
if pyqt_bin_dir.lower() not in [p.lower() for p in path.split(os.pathsep)]:
428
os.environ["PATH"] = path + os.pathsep + pyqt_bin_dir
429
# also add all imageformat plugins to distribution
430
# We will look in 2 places, dirname(PyQt4.__file__) and pyqt_dir
431
base_dirs_to_check = []
432
if os.path.isdir(pyqt_dir):
433
base_dirs_to_check.append(pyqt_dir)
439
pyqt4_base_dir = os.path.dirname(PyQt4.__file__)
440
if pyqt4_base_dir != pyqt_dir:
441
base_dirs_to_check.append(pyqt4_base_dir)
442
if not base_dirs_to_check:
443
log.warn("Can't find PyQt4 installation -> not including imageformat"
447
for base_dir in base_dirs_to_check:
448
plug_dir = os.path.join(base_dir, 'plugins', 'imageformats')
449
if os.path.isdir(plug_dir):
450
for fname in os.listdir(plug_dir):
451
# Include plugin dlls, but not debugging dlls
452
fullpath = os.path.join(plug_dir, fname)
453
if fname.endswith('.dll') and not fname.endswith('d4.dll'):
454
files.append(fullpath)
456
data_files.append(('imageformats', files))
458
log.warn('PyQt4 was found, but we could not find any imageformat'
459
' plugins. Are you sure your configuration is correct?')
420
462
def get_svn_py2exe_info(includes, excludes, packages):
597
639
data_files = topics_files + plugins_files
599
641
if 'qbzr' in plugins:
600
get_qbzr_py2exe_info(includes, excludes, packages)
642
get_qbzr_py2exe_info(includes, excludes, packages, data_files)
602
644
if 'svn' in plugins:
603
645
get_svn_py2exe_info(includes, excludes, packages)
654
696
# ad-hoc for easy_install
656
698
if not 'bdist_egg' in sys.argv:
657
# generate and install bzr.1 only with plain install, not easy_install one
699
# generate and install bzr.1 only with plain install, not the
658
701
DATA_FILES = [('man/man1', ['bzr.1'])]