Ensure that the locale message catalogs are included in the source and binary archives.

This commit is contained in:
Robin Dunn
2017-08-11 15:46:04 -07:00
parent 9cfe80a912
commit 0879cdc240
4 changed files with 14 additions and 8 deletions

View File

@@ -7,6 +7,7 @@
# #
recursive-include wx ** recursive-include wx **
recursive-include wx/locale **
recursive-include license *.txt recursive-include license *.txt
include LICENSE.txt include LICENSE.txt
graft docs graft docs

View File

@@ -1422,9 +1422,9 @@ def cmd_build_py(options, args):
runcmd(cmd) runcmd(cmd)
copyWxDlls(options) copyWxDlls(options)
if isWindows or isDarwin:
cfg = Config() cfg = Config()
cfg.build_locale_dir(opj(cfg.PKGDIR, 'locale')) cfg.build_locale_dir(opj(cfg.PKGDIR, 'locale'))
print("\n------------ BUILD FINISHED ------------") print("\n------------ BUILD FINISHED ------------")
print("To use wxPython from the build folder (without installing):") print("To use wxPython from the build folder (without installing):")
@@ -1753,15 +1753,21 @@ def cmd_sdist(options, args):
for name in glob.glob(posixjoin('sip', srcdir, '*')): for name in glob.glob(posixjoin('sip', srcdir, '*')):
copyFile(name, destdir) copyFile(name, destdir)
for wc in ['*.py', '*.pi', '*.pyi']: for wc in ['*.py', '*.pi', '*.pyi']:
destdir = posixjoin(PDEST, 'wx') destdir = posixjoin(PDEST, cfg.PKGDIR)
for name in glob.glob(posixjoin('wx', wc)): for name in glob.glob(posixjoin(cfg.PKGDIR, wc)):
copyFile(name, destdir) copyFile(name, destdir)
# Copy the license files from wxWidgets # Copy the license files from wxWidgets
msg('Copying license files...')
updateLicenseFiles(cfg) updateLicenseFiles(cfg)
shutil.copytree('license', opj(PDEST, 'license')) shutil.copytree('license', opj(PDEST, 'license'))
copyFile('LICENSE.txt', PDEST) copyFile('LICENSE.txt', PDEST)
# Copy the locale message catalogs
msg('Copying message catalog files...')
cfg.build_locale_dir(opj(cfg.PKGDIR, 'locale'))
shutil.copytree(opj(cfg.PKGDIR, 'locale'), opj(PDEST, cfg.PKGDIR, 'locale'))
# Also add the waf executable, fetching it first if we don't already have it # Also add the waf executable, fetching it first if we don't already have it
getWafCmd() getWafCmd()
copyFile('bin/waf-%s' % wafCurrentVersion, os.path.join(PDEST, 'bin')) copyFile('bin/waf-%s' % wafCurrentVersion, os.path.join(PDEST, 'bin'))

View File

@@ -413,7 +413,7 @@ class Configuration(object):
def build_locale_dir(self, destdir, verbose=1): def build_locale_dir(self, destdir, verbose=1):
"""Build a locale dir under the wxPython package. Used for MSW and OSX""" """Build a locale dir under the wxPython package."""
moFiles = glob.glob(opj(self.WXDIR, 'locale', '*.mo')) moFiles = glob.glob(opj(self.WXDIR, 'locale', '*.mo'))
for src in moFiles: for src in moFiles:
lang = os.path.splitext(os.path.basename(src))[0] lang = os.path.splitext(os.path.basename(src))[0]

View File

@@ -492,8 +492,7 @@ def build(bld):
# copy the wx locale message catalogs to the package dir # copy the wx locale message catalogs to the package dir
if isWindows or isDarwin: cfg.build_locale_dir(opj(cfg.PKGDIR, 'locale'))
cfg.build_locale_dir(opj(cfg.PKGDIR, 'locale'))
# copy __init__.py # copy __init__.py
copy_file('src/__init__.py', cfg.PKGDIR, update=1, verbose=1) copy_file('src/__init__.py', cfg.PKGDIR, update=1, verbose=1)