diff options
author | Jason Woodward <woodwardj@jaos.org> | 2021-02-21 23:46:20 -0500 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-02-27 14:35:23 +0200 |
commit | 50af09de031c8d003cd9e6afb44b774620b45696 (patch) | |
tree | 52e16c84d9f9b851a05307e4fa4f053e44bab00c /mesonbuild/interpreter.py | |
parent | 0047f7439c6bafe964438e2c59a3686201ff24c0 (diff) | |
download | meson-50af09de031c8d003cd9e6afb44b774620b45696.zip meson-50af09de031c8d003cd9e6afb44b774620b45696.tar.gz meson-50af09de031c8d003cd9e6afb44b774620b45696.tar.bz2 |
install_man locale support
Rather than having to manually build the locale aware man paths with
`install_data('foo.fr.1', install_dir: join_paths(get_option('mandir'), 'fr', 'man1'), rename: 'foo.1')`
Support doing
`install_man('foo.fr.1', locale: 'fr')`
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 0225de4..5642242 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -778,6 +778,9 @@ class ManHolder(InterpreterObject, ObjectHolder[build.Man]): def get_custom_install_mode(self) -> T.Optional[FileMode]: return self.held_object.custom_install_mode + def locale(self) -> T.Optional[str]: + return self.held_object.locale + def get_sources(self) -> T.List[mesonlib.File]: return self.held_object.sources @@ -2371,7 +2374,7 @@ permitted_kwargs = {'add_global_arguments': {'language', 'native'}, 'include_directories': {'is_system'}, 'install_data': {'install_dir', 'install_mode', 'rename', 'sources'}, 'install_headers': {'install_dir', 'install_mode', 'subdir'}, - 'install_man': {'install_dir', 'install_mode'}, + 'install_man': {'install_dir', 'install_mode', 'locale'}, 'install_subdir': {'exclude_files', 'exclude_directories', 'install_dir', 'install_mode', 'strip_directory'}, 'jar': build.known_jar_kwargs, 'project': {'version', 'meson_version', 'default_options', 'license', 'subproject_dir'}, @@ -4225,6 +4228,7 @@ This will become a hard error in the future.''' % kwargs['input'], location=self return HeadersHolder(h) @FeatureNewKwargs('install_man', '0.47.0', ['install_mode']) + @FeatureNewKwargs('install_man', '0.58.0', ['locale']) @permittedKwargs(permitted_kwargs['install_man']) def func_install_man(self, node, args, kwargs): sources = self.source_strings_to_files(args) @@ -4237,10 +4241,11 @@ This will become a hard error in the future.''' % kwargs['input'], location=self raise InvalidArguments('Man file must have a file extension of a number between 1 and 8') custom_install_mode = self._get_kwarg_install_mode(kwargs) custom_install_dir = kwargs.get('install_dir', None) + locale = kwargs.get('locale') if custom_install_dir is not None and not isinstance(custom_install_dir, str): raise InterpreterException('install_dir must be a string.') - m = build.Man(sources, custom_install_dir, custom_install_mode, self.subproject) + m = build.Man(sources, custom_install_dir, custom_install_mode, self.subproject, locale) self.build.man.append(m) return ManHolder(m) |