aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
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
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')
-rw-r--r--mesonbuild/dependencies/__init__.py3
-rw-r--r--mesonbuild/dependencies/misc.py31
2 files changed, 33 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/__init__.py b/mesonbuild/dependencies/__init__.py
index 00b6fa2..0375537 100644
--- a/mesonbuild/dependencies/__init__.py
+++ b/mesonbuild/dependencies/__init__.py
@@ -18,7 +18,7 @@ from .base import ( # noqa: F401
ExternalDependency, NotFoundDependency, ExternalLibrary, ExtraFrameworkDependency, InternalDependency,
PkgConfigDependency, find_external_dependency, get_dep_identifier, packages, _packages_accept_language)
from .dev import GMockDependency, GTestDependency, LLVMDependency, ValgrindDependency
-from .misc import (MPIDependency, OpenMPDependency, Python3Dependency, ThreadDependency, PcapDependency, CupsDependency, LibWmfDependency)
+from .misc import (MPIDependency, OpenMPDependency, Python3Dependency, ThreadDependency, PcapDependency, CupsDependency, LibWmfDependency, LibGCryptDependency)
from .platform import AppleFrameworks
from .ui import GLDependency, GnuStepDependency, Qt4Dependency, Qt5Dependency, SDL2Dependency, WxDependency, VulkanDependency
@@ -39,6 +39,7 @@ packages.update({
'pcap': PcapDependency,
'cups': CupsDependency,
'libwmf': LibWmfDependency,
+ 'libgcrypt': LibGCryptDependency,
# From platform:
'appleframeworks': AppleFrameworks,
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]