i18n: allow custom target names for merge_file

As it currently stands, if for whatever reason you have two files you
want to merge with the same output name, it will fail due to multiple
targets with the same name due to the target name being autogenerated
from the output kwarg.

Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
pull/4453/head
Marty E. Plummer 7 years ago committed by Jussi Pakkanen
parent 3cf03ec6d6
commit add55bb861
  1. 2
      mesonbuild/modules/i18n.py
  2. 8
      test cases/frameworks/6 gettext/data2/meson.build
  3. 6
      test cases/frameworks/6 gettext/data2/test.desktop.in
  4. 1
      test cases/frameworks/6 gettext/meson.build

@ -92,7 +92,7 @@ class I18nModule(ExtensionModule):
outputs = mesonlib.substitute_values([output], values)
output = outputs[0]
ct = build.CustomTarget(output + '_merge', state.subdir, state.subproject, kwargs)
ct = build.CustomTarget(output + '_' + state.subdir + '_merge', state.subdir, state.subproject, kwargs)
return ModuleReturnValue(ct, [ct])
@FeatureNewKwargs('i18n.gettext', '0.37.0', ['preset'])

@ -0,0 +1,8 @@
i18n.merge_file(
input: 'test.desktop.in',
output: 'test.desktop',
type: 'desktop',
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
)

@ -0,0 +1,6 @@
[Desktop Entry]
Name=Test
GenericName=Application
Comment=Test Application
Type=Application

@ -14,3 +14,4 @@ i18n = import('i18n')
subdir('po')
subdir('src')
subdir('data')
subdir('data2')

Loading…
Cancel
Save