aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/misc.py
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2018-09-23 15:23:39 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2018-10-03 01:22:59 +0300
commit46a42a69a6a761b3d058ca151028ad9b9f497281 (patch)
tree257da214573a063def89d02b94942c651f12c113 /mesonbuild/dependencies/misc.py
parent386e5b876fa1395ec2699c9895ac93e4eaf680ad (diff)
downloadmeson-46a42a69a6a761b3d058ca151028ad9b9f497281.zip
meson-46a42a69a6a761b3d058ca151028ad9b9f497281.tar.gz
meson-46a42a69a6a761b3d058ca151028ad9b9f497281.tar.bz2
Add custom libgcrypt dependency using libgcrypt-config
Fixes #3563
Diffstat (limited to 'mesonbuild/dependencies/misc.py')
-rw-r--r--mesonbuild/dependencies/misc.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
index 5164512..a2f7daf 100644
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -506,3 +506,34 @@ class LibWmfDependency(ExternalDependency):
@staticmethod
def get_methods():
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL]
+
+
+class LibGCryptDependency(ExternalDependency):
+ def __init__(self, environment, kwargs):
+ super().__init__('libgcrypt', environment, None, kwargs)
+
+ @classmethod
+ def _factory(cls, environment, kwargs):
+ methods = cls._process_method_kw(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
+
+ @staticmethod
+ def tool_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]
+
+ @staticmethod
+ def get_methods():
+ return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL]