diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-09-18 09:48:48 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-09-29 14:58:32 -0700 |
commit | 7d11d7cf68f5a0379ef3b50b853cea4a3ceb0636 (patch) | |
tree | 20e3a063b7d5d8241a6be5f93f99a61467df1507 /mesonbuild/dependencies/misc.py | |
parent | 354c1c1d09e906d2a62635e41516ac1f08648530 (diff) | |
download | meson-7d11d7cf68f5a0379ef3b50b853cea4a3ceb0636.zip meson-7d11d7cf68f5a0379ef3b50b853cea4a3ceb0636.tar.gz meson-7d11d7cf68f5a0379ef3b50b853cea4a3ceb0636.tar.bz2 |
dependencies/curses: Add support for using the ncurses config tools
These are mostly duplicated with pkg-config, but maybe someone has one
but not another, and they're easy to turn on with the
ConfigToolDependency.
Diffstat (limited to 'mesonbuild/dependencies/misc.py')
-rw-r--r-- | mesonbuild/dependencies/misc.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index c270758..c1e17d7 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -404,7 +404,23 @@ class ShadercDependency(ExternalDependency): return [DependencyMethods.SYSTEM, DependencyMethods.PKGCONFIG] -@factory_methods({DependencyMethods.PKGCONFIG}) +class CursesConfigToolDependency(ConfigToolDependency): + + """Use the curses config tools.""" + + tool = 'curses-config' + # ncurses5.4-config is for macOS Catalina + tools = ['ncursesw6-config', 'ncursesw5-config', 'ncurses6-config', 'ncurses5-config', 'ncurses5.4-config'] + + def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any], language: T.Optional[str] = None): + super().__init__(name, env, kwargs, language) + if not self.is_found: + return + self.compile_args = self.get_config_value(['--cflags'], 'compile_args') + self.link_args = self.get_config_value(['--libs'], 'link_args') + + +@factory_methods({DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL}) def curses_factory(env: 'Environment', for_machine: 'MachineChoice', kwargs: T.Dict[str, T.Any], methods: T.List[DependencyMethods]) -> T.List[T.Callable[[], 'Dependency']]: candidates = [] # type: T.List[T.Callable[[], Dependency]] @@ -414,6 +430,9 @@ def curses_factory(env: 'Environment', for_machine: 'MachineChoice', for pkg in pkgconfig_files: candidates.append(functools.partial(PkgConfigDependency, pkg, env, kwargs)) + if DependencyMethods.CONFIG_TOOL in methods: + candidates.append(functools.partial(CursesConfigToolDependency, 'curses', env, kwargs)) + return candidates |