~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to setup.py

Merge bzr.dev to unify _type_equality_funcs workarounds

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
import os.path
11
11
import sys
12
12
import copy
 
13
import glob
13
14
 
14
15
if sys.version_info < (2, 6):
15
16
    sys.stderr.write("[ERROR] Not a supported Python version. Need 2.6+\n")
70
71
                                        'tests/ssl_certs/server_without_pass.key',
71
72
                                        'tests/ssl_certs/server_with_pass.key',
72
73
                                        'tests/ssl_certs/server.crt',
73
 
                                        'locale/*/LC_MESSAGES/*.mo',
74
74
                                       ]},
75
75
           }
76
 
 
 
76
I18N_FILES = []
 
77
for filepath in glob.glob("bzrlib/locale/*/LC_MESSAGES/*.mo"):
 
78
    langfile = filepath[len("bzrlib/locale/"):]
 
79
    targetpath = os.path.dirname(os.path.join("share/locale", langfile))
 
80
    I18N_FILES.append((targetpath, [filepath]))
77
81
 
78
82
def get_bzrlib_packages():
79
83
    """Recurse through the bzrlib directory, and extract the package names"""
198
202
    from distutils.command.build_ext import build_ext
199
203
else:
200
204
    have_pyrex = True
201
 
    pyrex_version_info = tuple(map(int, pyrex_version.split('.')))
 
205
    import re
 
206
    _version = re.match("^[0-9.]+", pyrex_version).group(0)
 
207
    pyrex_version_info = tuple(map(int, _version.split('.')))
202
208
 
203
209
 
204
210
class build_ext_if_possible(build_ext):
478
484
    packages.append('sqlite3')
479
485
 
480
486
 
 
487
def get_fastimport_py2exe_info(includes, excludes, packages):
 
488
    # This is the python-fastimport package, not to be confused with the
 
489
    # bzr-fastimport plugin.
 
490
    packages.append('fastimport')
 
491
 
 
492
 
481
493
if 'bdist_wininst' in sys.argv:
482
494
    def find_docs():
483
495
        docs = []
502
514
            # help pages
503
515
            'data_files': find_docs(),
504
516
            # for building pyrex extensions
505
 
            'cmdclass': {'build_ext': build_ext_if_possible},
 
517
            'cmdclass': command_classes,
506
518
           }
507
519
 
508
520
    ARGS.update(META_INFO)
509
521
    ARGS.update(BZRLIB)
 
522
    PKG_DATA['package_data']['bzrlib'].append('locale/*/LC_MESSAGES/*.mo')
510
523
    ARGS.update(PKG_DATA)
511
 
    
 
524
 
512
525
    setup(**ARGS)
513
526
 
514
527
elif 'py2exe' in sys.argv:
515
 
    import glob
516
528
    # py2exe setup
517
529
    import py2exe
518
530
 
662
674
                       'tools/win32/bzr_postinstall.py',
663
675
                       ]
664
676
    gui_targets = [gui_target]
665
 
    data_files = topics_files + plugins_files
 
677
    data_files = topics_files + plugins_files + I18N_FILES
666
678
 
667
679
    if 'qbzr' in plugins:
668
680
        get_qbzr_py2exe_info(includes, excludes, packages, data_files)
670
682
    if 'svn' in plugins:
671
683
        get_svn_py2exe_info(includes, excludes, packages)
672
684
 
 
685
    if 'fastimport' in plugins:
 
686
        get_fastimport_py2exe_info(includes, excludes, packages)
 
687
 
673
688
    if "TBZR" in os.environ:
674
689
        # TORTOISE_OVERLAYS_MSI_WIN32 must be set to the location of the
675
690
        # TortoiseOverlays MSI installer file. It is in the TSVN svn repo and
725
740
            self.optimize = 2
726
741
 
727
742
    if __name__ == '__main__':
 
743
        command_classes['install_data'] = install_data_with_bytecompile
 
744
        command_classes['py2exe'] = py2exe_no_oo_exe
728
745
        setup(options=options_list,
729
746
              console=console_targets,
730
747
              windows=gui_targets,
731
748
              zipfile='lib/library.zip',
732
749
              data_files=data_files,
733
 
              cmdclass={'install_data': install_data_with_bytecompile,
734
 
                        'py2exe': py2exe_no_oo_exe},
 
750
              cmdclass=command_classes,
735
751
              )
736
752
 
737
753
else:
742
758
        # easy_install one
743
759
        DATA_FILES = [('man/man1', ['bzr.1'])]
744
760
 
 
761
    DATA_FILES = DATA_FILES + I18N_FILES
745
762
    # std setup
746
763
    ARGS = {'scripts': ['bzr'],
747
764
            'data_files': DATA_FILES,