diff options
author | Corentin Noël <corentin@elementary.io> | 2017-09-20 20:17:59 +0200 |
---|---|---|
committer | Corentin Noël <corentin@elementary.io> | 2017-09-20 20:17:59 +0200 |
commit | 6a2926870cc0f0a8bb970dc5f16aba85789c088c (patch) | |
tree | e315ad320844a1b40fa078d24708f3366971438b /mesonbuild/modules | |
parent | 96e24a50f91df198f6880ad2f76dd8f010b7f51f (diff) | |
download | meson-6a2926870cc0f0a8bb970dc5f16aba85789c088c.zip meson-6a2926870cc0f0a8bb970dc5f16aba85789c088c.tar.gz meson-6a2926870cc0f0a8bb970dc5f16aba85789c088c.tar.bz2 |
Add 'install' keyword to the gettext macro
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r-- | mesonbuild/modules/i18n.py | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py index 2af09de..2281cc1 100644 --- a/mesonbuild/modules/i18n.py +++ b/mesonbuild/modules/i18n.py @@ -81,7 +81,7 @@ class I18nModule(ExtensionModule): ct = build.CustomTarget(kwargs['output'] + '_merge', state.subdir, kwargs) return ModuleReturnValue(ct, [ct]) - @permittedKwargs({'po_dir', 'data_dirs', 'type', 'languages', 'args', 'preset'}) + @permittedKwargs({'po_dir', 'data_dirs', 'type', 'languages', 'args', 'preset', 'install'}) def gettext(self, state, args, kwargs): if len(args) != 1: raise coredata.MesonException('Gettext requires one positional argument (package name).') @@ -126,16 +126,21 @@ class I18nModule(ExtensionModule): updatepoargs.append(extra_args) updatepotarget = build.RunTarget(packagename + '-update-po', updatepoargs[0], updatepoargs[1:], [], state.subdir) - script = state.environment.get_build_command() - args = ['--internal', 'gettext', 'install', - '--subdir=' + state.subdir, - '--localedir=' + state.environment.coredata.get_builtin_option('localedir'), - pkg_arg] - if lang_arg: - args.append(lang_arg) - iscript = build.RunScript(script, args) - - return ModuleReturnValue(None, [pottarget, gmotarget, iscript, updatepotarget]) + targets = [pottarget, gmotarget, updatepotarget] + + install = kwargs.get('install') if ('install' in kwargs) else True + if install: + script = state.environment.get_build_command() + args = ['--internal', 'gettext', 'install', + '--subdir=' + state.subdir, + '--localedir=' + state.environment.coredata.get_builtin_option('localedir'), + pkg_arg] + if lang_arg: + args.append(lang_arg) + iscript = build.RunScript(script, args) + targets.append(iscript) + + return ModuleReturnValue(None, targets) def initialize(): return I18nModule() |