From 0879cdc24035a3816ea36aa0c5ee7517280631bb Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 11 Aug 2017 15:46:04 -0700 Subject: [PATCH] Ensure that the locale message catalogs are included in the source and binary archives. --- MANIFEST.in | 1 + build.py | 16 +++++++++++----- buildtools/config.py | 2 +- wscript | 3 +-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 0f8652cb..7c5cad2c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -7,6 +7,7 @@ # recursive-include wx ** +recursive-include wx/locale ** recursive-include license *.txt include LICENSE.txt graft docs diff --git a/build.py b/build.py index c0aaaf62..a82ef9f1 100755 --- a/build.py +++ b/build.py @@ -1422,9 +1422,9 @@ def cmd_build_py(options, args): runcmd(cmd) copyWxDlls(options) - if isWindows or isDarwin: - cfg = Config() - cfg.build_locale_dir(opj(cfg.PKGDIR, 'locale')) + + cfg = Config() + cfg.build_locale_dir(opj(cfg.PKGDIR, 'locale')) print("\n------------ BUILD FINISHED ------------") 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, '*')): copyFile(name, destdir) for wc in ['*.py', '*.pi', '*.pyi']: - destdir = posixjoin(PDEST, 'wx') - for name in glob.glob(posixjoin('wx', wc)): + destdir = posixjoin(PDEST, cfg.PKGDIR) + for name in glob.glob(posixjoin(cfg.PKGDIR, wc)): copyFile(name, destdir) # Copy the license files from wxWidgets + msg('Copying license files...') updateLicenseFiles(cfg) shutil.copytree('license', opj(PDEST, 'license')) 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 getWafCmd() copyFile('bin/waf-%s' % wafCurrentVersion, os.path.join(PDEST, 'bin')) diff --git a/buildtools/config.py b/buildtools/config.py index ef854786..079a561f 100644 --- a/buildtools/config.py +++ b/buildtools/config.py @@ -413,7 +413,7 @@ class Configuration(object): 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')) for src in moFiles: lang = os.path.splitext(os.path.basename(src))[0] diff --git a/wscript b/wscript index c888e05a..a1b65e03 100644 --- a/wscript +++ b/wscript @@ -492,8 +492,7 @@ def build(bld): # 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_file('src/__init__.py', cfg.PKGDIR, update=1, verbose=1)