diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-01-08 15:20:24 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-01-29 09:11:24 -0800 |
commit | 70d28e453224626c2a47650e5c849d8808a504a0 (patch) | |
tree | 02078e9fc7f125873bb2ecea792bb13cdb0f4a8c /mesonbuild/dependencies/misc.py | |
parent | 4cc890e70aa732e89b632cd16be4833a744135ed (diff) | |
download | meson-70d28e453224626c2a47650e5c849d8808a504a0.zip meson-70d28e453224626c2a47650e5c849d8808a504a0.tar.gz meson-70d28e453224626c2a47650e5c849d8808a504a0.tar.bz2 |
dependencies: Use DependencyFactory for libwmf
Diffstat (limited to 'mesonbuild/dependencies/misc.py')
-rw-r--r-- | mesonbuild/dependencies/misc.py | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index fd4dcd8..a26d553 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -347,26 +347,13 @@ class CupsDependencyConfigTool(ConfigToolDependency): return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL, DependencyMethods.CMAKE] -class LibWmfDependency(ExternalDependency): - def __init__(self, environment, kwargs): - super().__init__('libwmf', environment, kwargs) +class LibWmfDependencyConfigTool(ConfigToolDependency): - @classmethod - def _factory(cls, environment, kwargs): - methods = process_method_kw(cls.get_methods(), kwargs) - candidates = [] - - if DependencyMethods.PKGCONFIG in methods: - candidates.append(functools.partial(PkgConfigDependency, 'libwmf', environment, kwargs)) - - if DependencyMethods.CONFIG_TOOL in methods: - candidates.append(functools.partial(ConfigToolDependency.factory, - 'libwmf', environment, None, kwargs, ['libwmf-config'], 'libwmf-config', LibWmfDependency.tool_finish_init)) - - return candidates + tools = ['libwmf-config'] + tool_name = 'libwmf-config' @staticmethod - def tool_finish_init(ctdep): + def finish_init(ctdep): ctdep.compile_args = ctdep.get_config_value(['--cflags'], 'compile_args') ctdep.link_args = ctdep.get_config_value(['--libs'], 'link_args') @@ -527,6 +514,12 @@ cups_factory = DependencyFactory( cmake_name='Cups', ) +libwmf_factory = DependencyFactory( + 'libwmf', + [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL], + configtool_class=LibWmfDependencyConfigTool, +) + pcap_factory = DependencyFactory( 'pcap', [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL], |