diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2014-08-04 14:37:33 -0400 |
---|---|---|
committer | Cory Fields <cory-nospam-@coryfields.com> | 2014-08-06 19:29:19 -0400 |
commit | 71941ce580cac1f727bf19ba3226ca55e27d29fe (patch) | |
tree | d0f5ee87b37b33a66bc558a1d36ec85314b6c3df /contrib | |
parent | f8120f7e0f7194cb53d7626f3c401e2793361317 (diff) |
build: teach macdeploy the -translations-dir argument, for use with static qt
When QT is linked statically, macdeploy can't infer its paths. While plugins
and frameworks don't need to be packaged, translations still do (for now).
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/macdeploy/macdeployqtplus | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index eece81dd3d..23b57a76b3 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -449,6 +449,7 @@ ap.add_argument("-sign", dest="sign", action="store_true", default=False, help=" ap.add_argument("-dmg", nargs="?", const="", metavar="basename", help="create a .dmg disk image; if basename is not specified, a camel-cased version of the app name is used") ap.add_argument("-fancy", nargs=1, metavar="plist", default=[], help="make a fancy looking disk image using the given plist file with instructions; requires -dmg to work") ap.add_argument("-add-qt-tr", nargs=1, metavar="languages", default=[], help="add Qt translation files to the bundle's ressources; the language list must be separated with commas, not with whitespace") +ap.add_argument("-translations-dir", nargs=1, metavar="path", default=None, help="Path to Qt's translation files") ap.add_argument("-add-resources", nargs="+", metavar="path", default=[], help="list of additional files or folders to be copied into the bundle's resources; must be the last argument") config = ap.parse_args() @@ -467,6 +468,15 @@ if not os.path.exists(app_bundle): app_bundle_name = os.path.splitext(os.path.basename(app_bundle))[0] # ------------------------------------------------ +translations_dir = None +if config.translations_dir and config.translations_dir[0]: + if os.path.exists(config.translations_dir[0]): + translations_dir = config.translations_dir[0] + else: + if verbose >= 1: + sys.stderr.write("Error: Could not find translation dir \"%s\"\n" % (translations_dir)) + sys.exit(1) +# ------------------------------------------------ for p in config.add_resources: if verbose >= 3: @@ -590,7 +600,14 @@ if config.plugins: if len(config.add_qt_tr) == 0: add_qt_tr = [] else: - qt_tr_dir = os.path.join(deploymentInfo.qtPath, "translations") + if translations_dir is not None: + qt_tr_dir = translations_dir + else: + if deploymentInfo.qtPath is not None: + qt_tr_dir = os.path.join(deploymentInfo.qtPath, "translations") + else: + sys.stderr.write("Error: Could not find Qt translation path\n") + sys.exit(1) add_qt_tr = ["qt_%s.qm" % lng for lng in config.add_qt_tr[0].split(",")] for lng_file in add_qt_tr: p = os.path.join(qt_tr_dir, lng_file) |