summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2019-06-25 22:28:17 +0200
committerAllan McRae <allan@archlinux.org>2019-06-28 02:20:58 +0200
commit796c02af4c39b6f90f955d4764676711357c5db0 (patch)
tree9dd6b2e0e1e0f71a548bd3265219b5d98041d220
parente7a2b2764ad0b4240f87b742fdf0c404be11af03 (diff)
downloadpacman-796c02af4c39b6f90f955d4764676711357c5db0.tar.gz
pacman-796c02af4c39b6f90f955d4764676711357c5db0.tar.xz
meson: use dependency('gpgme') exclusively
This works everywhere that gpgme >= 1.13.0 because it is a pkg-config dependency, and meson 0.51 adds a fallback config-tool dependency provider that detects older versions of gpgme seamlessly via gpgme-config. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--meson.build33
-rw-r--r--meson_options.txt2
2 files changed, 5 insertions, 30 deletions
diff --git a/meson.build b/meson.build
index f5fdd733..db9e9349 100644
--- a/meson.build
+++ b/meson.build
@@ -97,36 +97,13 @@ libcurl = dependency('libcurl',
static : get_option('buildstatic'))
conf.set('HAVE_LIBCURL', libcurl.found())
-want_gpgme = get_option('gpgme')
+needed_gpgme_version = '>=1.3.0'
gpgme = dependency('gpgme',
- required : false,
- static : get_option('buildstatic'))
-# gpgme recently began providing a pkg-config file. Create a fake dependency
-# object if it cannot be found, by manually searching for libs.
-if not want_gpgme.disabled() and not gpgme.found()
- gpgme_config = find_program('gpgme-config', required : want_gpgme)
- if gpgme_config.found()
- gpgme_version = run_command(gpgme_config, '--version').stdout().strip()
-
- needed_gpgme_version = '>=1.3.0'
- if gpgme_version.version_compare(needed_gpgme_version)
- gpgme_libs = [
- cc.find_library('gpgme',
- dirs : [get_option('gpgme-libdir')]),
- cc.find_library('gpg-error',
- dirs : [get_option('gpgme-libdir')]),
- cc.find_library('assuan',
- dirs : [get_option('gpgme-libdir')]),
- ]
- gpgme = declare_dependency(dependencies : gpgme_libs)
- endif
- endif
-endif
-
+ version : needed_gpgme_version,
+ required : get_option('gpgme'),
+ static : get_option('buildstatic'),
+ not_found_message : 'gpgme @0@ is needed for GPG signature support'.format(needed_gpgme_version))
conf.set('HAVE_LIBGPGME', gpgme.found())
-if want_gpgme.enabled() and not conf.get('HAVE_LIBGPGME')
- error('gpgme @0@ is needed for GPG signature support'.format(needed_gpgme_version))
-endif
want_crypto = get_option('crypto')
if want_crypto == 'openssl'
diff --git a/meson_options.txt b/meson_options.txt
index ffa4ddff..2d640e87 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -47,8 +47,6 @@ option('crypto', type : 'combo', choices : ['openssl', 'nettle'],
option('gpgme', type : 'feature', value : 'auto',
description : 'use GPGME for PGP signature verification')
-option('gpgme-libdir', type : 'string', value : '/usr/lib',
- description : 'search directory for gpgme libraries.')
option('i18n', type : 'boolean', value : true,
description : 'enable localization of pacman, libalpm and scripts')