aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-09-18 09:48:48 -0700
committerDylan Baker <dylan@pnwbakers.com>2020-09-29 14:58:32 -0700
commit7d11d7cf68f5a0379ef3b50b853cea4a3ceb0636 (patch)
tree20e3a063b7d5d8241a6be5f93f99a61467df1507 /mesonbuild
parent354c1c1d09e906d2a62635e41516ac1f08648530 (diff)
downloadmeson-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')
-rw-r--r--mesonbuild/dependencies/misc.py21
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