diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-01-08 15:23:02 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-01-29 09:11:24 -0800 |
commit | 69835a7c5333523eda1c062f8f46a1b045458d63 (patch) | |
tree | 326d672e813fc37b8e4b15565fc726167947d0b4 /mesonbuild/dependencies/misc.py | |
parent | 70d28e453224626c2a47650e5c849d8808a504a0 (diff) | |
download | meson-69835a7c5333523eda1c062f8f46a1b045458d63.zip meson-69835a7c5333523eda1c062f8f46a1b045458d63.tar.gz meson-69835a7c5333523eda1c062f8f46a1b045458d63.tar.bz2 |
dependencies: Use DependencyFactory for LibGcrypt
Diffstat (limited to 'mesonbuild/dependencies/misc.py')
-rw-r--r-- | mesonbuild/dependencies/misc.py | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py index a26d553..df167b2 100644 --- a/mesonbuild/dependencies/misc.py +++ b/mesonbuild/dependencies/misc.py @@ -362,28 +362,13 @@ class LibWmfDependencyConfigTool(ConfigToolDependency): return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL] -class LibGCryptDependency(ExternalDependency): - def __init__(self, environment, kwargs): - super().__init__('libgcrypt', environment, kwargs) +class LibGCryptDependencyConfigTool(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, 'libgcrypt', environment, kwargs)) - - if DependencyMethods.CONFIG_TOOL in methods: - candidates.append(functools.partial(ConfigToolDependency.factory, - 'libgcrypt', environment, None, kwargs, ['libgcrypt-config'], - 'libgcrypt-config', - LibGCryptDependency.tool_finish_init)) - - return candidates + tools = ['libgcrypt-config'] + tool_name = 'libgcrypt-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') ctdep.version = ctdep.get_config_value(['--version'], 'version')[0] @@ -514,6 +499,12 @@ cups_factory = DependencyFactory( cmake_name='Cups', ) +libgcrypt_factory = DependencyFactory( + 'libgcrypt', + [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL], + configtool_class=LibGCryptDependencyConfigTool, +) + libwmf_factory = DependencyFactory( 'libwmf', [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL], |