aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/i18n.py
diff options
context:
space:
mode:
authorDavid Ward <david.ward@gatech.edu>2022-09-04 08:15:57 -0400
committerEli Schwartz <eschwartz93@gmail.com>2022-09-12 00:27:21 -0400
commit68add86f7b9b50e51e75447077f460bc2dc78e79 (patch)
tree9424e382be0ea3b173fabe55311a8c546158b2d0 /mesonbuild/modules/i18n.py
parent7eb5709bd9105c3ab9eec935b4b2b14d2ca7940b (diff)
downloadmeson-68add86f7b9b50e51e75447077f460bc2dc78e79.zip
meson-68add86f7b9b50e51e75447077f460bc2dc78e79.tar.gz
meson-68add86f7b9b50e51e75447077f460bc2dc78e79.tar.bz2
i18n: Fix source root in Gettext targets for subprojects
Gettext should search for input files relative to the (sub)project source root, not the global source root. This change exposes a root_subdir member in ModuleState.
Diffstat (limited to 'mesonbuild/modules/i18n.py')
-rw-r--r--mesonbuild/modules/i18n.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py
index 2af1198..2a7a9ad 100644
--- a/mesonbuild/modules/i18n.py
+++ b/mesonbuild/modules/i18n.py
@@ -256,10 +256,13 @@ class I18nModule(ExtensionModule):
extra_arg = '--extra-args=' + '@@'.join(extra_args) if extra_args else None
+ source_root = path.join(state.source_root, state.root_subdir)
+ subdir = path.relpath(state.subdir, start=state.root_subdir) if state.subdir else None
+
potargs = state.environment.get_build_command() + ['--internal', 'gettext', 'pot', pkg_arg]
- potargs.append(f'--source-root={state.source_root}')
- if state.subdir:
- potargs.append(f'--subdir={state.subdir}')
+ potargs.append(f'--source-root={source_root}')
+ if subdir:
+ potargs.append(f'--subdir={subdir}')
if datadirs:
potargs.append(datadirs)
if extra_arg:
@@ -302,9 +305,9 @@ class I18nModule(ExtensionModule):
targets.append(allgmotarget)
updatepoargs = state.environment.get_build_command() + ['--internal', 'gettext', 'update_po', pkg_arg]
- updatepoargs.append(f'--source-root={state.source_root}')
- if state.subdir:
- updatepoargs.append(f'--subdir={state.subdir}')
+ updatepoargs.append(f'--source-root={source_root}')
+ if subdir:
+ updatepoargs.append(f'--subdir={subdir}')
if lang_arg:
updatepoargs.append(lang_arg)
if datadirs: