summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarty E. Plummer <hanetzer@startmail.com>2018-08-23 02:41:29 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2018-09-16 15:08:43 +0300
commitadd55bb8613ce2d2da30412d3699d84c7f4f3772 (patch)
treea9d4b7d474894ddd5e018783a594ac86e350b78c
parent3cf03ec6d603d2c4699cefb9fabdbd8de321a3f2 (diff)
downloadmeson-add55bb8613ce2d2da30412d3699d84c7f4f3772.tar.gz
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>
-rw-r--r--mesonbuild/modules/i18n.py2
-rw-r--r--test cases/frameworks/6 gettext/data2/meson.build8
-rw-r--r--test cases/frameworks/6 gettext/data2/test.desktop.in6
-rw-r--r--test cases/frameworks/6 gettext/meson.build1
4 files changed, 16 insertions, 1 deletions
diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py
index 40f73f7ff..0fc052b77 100644
--- a/mesonbuild/modules/i18n.py
+++ b/mesonbuild/modules/i18n.py
@@ -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'])
diff --git a/test cases/frameworks/6 gettext/data2/meson.build b/test cases/frameworks/6 gettext/data2/meson.build
new file mode 100644
index 000000000..d927ba3af
--- /dev/null
+++ b/test cases/frameworks/6 gettext/data2/meson.build
@@ -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')
+)
diff --git a/test cases/frameworks/6 gettext/data2/test.desktop.in b/test cases/frameworks/6 gettext/data2/test.desktop.in
new file mode 100644
index 000000000..33b9a9fd8
--- /dev/null
+++ b/test cases/frameworks/6 gettext/data2/test.desktop.in
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Name=Test
+GenericName=Application
+Comment=Test Application
+Type=Application
+
diff --git a/test cases/frameworks/6 gettext/meson.build b/test cases/frameworks/6 gettext/meson.build
index e02234b56..9b8485606 100644
--- a/test cases/frameworks/6 gettext/meson.build
+++ b/test cases/frameworks/6 gettext/meson.build
@@ -14,3 +14,4 @@ i18n = import('i18n')
subdir('po')
subdir('src')
subdir('data')
+subdir('data2')