aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/misc.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/dependencies/misc.py')
-rw-r--r--mesonbuild/dependencies/misc.py29
1 files changed, 10 insertions, 19 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
index df167b2..cd4fcb1 100644
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -378,28 +378,13 @@ class LibGCryptDependencyConfigTool(ConfigToolDependency):
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL]
-class GpgmeDependency(ExternalDependency):
- def __init__(self, environment, kwargs):
- super().__init__('gpgme', environment, kwargs)
-
- @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, 'gpgme', environment, kwargs))
-
- if DependencyMethods.CONFIG_TOOL in methods:
- candidates.append(functools.partial(ConfigToolDependency.factory,
- 'gpgme', environment, None, kwargs, ['gpgme-config'],
- 'gpgme-config',
- GpgmeDependency.tool_finish_init))
+class GpgmeDependencyConfigTool(ConfigToolDependency):
- return candidates
+ tools = ['gpgme-config']
+ tool_name = 'gpg-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]
@@ -499,6 +484,12 @@ cups_factory = DependencyFactory(
cmake_name='Cups',
)
+gpgme_factory = DependencyFactory(
+ 'gpgme',
+ [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL],
+ configtool_class=GpgmeDependencyConfigTool,
+)
+
libgcrypt_factory = DependencyFactory(
'libgcrypt',
[DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL],