2018-03-20 21:03:56 +00:00
|
|
|
project('libsecret', 'c',
|
2024-02-23 09:53:23 +00:00
|
|
|
version: '0.21.4',
|
2024-02-23 10:04:55 +00:00
|
|
|
license: 'LGPL-2.1-or-later AND GPL-2.0-or-later AND Apache-2.0',
|
2019-07-24 04:10:13 +00:00
|
|
|
meson_version: '>= 0.50',
|
2018-03-20 21:03:56 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
gnome = import('gnome')
|
|
|
|
i18n = import('i18n')
|
2019-10-11 12:33:41 +00:00
|
|
|
pkg = import('pkgconfig')
|
2018-03-20 21:03:56 +00:00
|
|
|
|
|
|
|
# API version
|
|
|
|
api_version = '1.0.0'
|
|
|
|
api_version_major = api_version.split('.')[0]
|
|
|
|
api_version_minor = api_version.split('.')[1]
|
|
|
|
api_version_micro = api_version.split('.')[2]
|
|
|
|
|
|
|
|
libtool_version = '0.0.0'
|
|
|
|
|
|
|
|
# Some variables
|
|
|
|
config_h_dir = include_directories('.')
|
2019-09-20 15:32:14 +00:00
|
|
|
build_dir = include_directories('build')
|
2018-03-20 21:03:56 +00:00
|
|
|
libsecret_prefix = get_option('prefix')
|
2019-07-24 04:18:36 +00:00
|
|
|
po_dir = meson.source_root() / 'po'
|
2018-03-20 21:03:56 +00:00
|
|
|
|
|
|
|
# Dependencies
|
|
|
|
min_glib_version = '2.44'
|
|
|
|
glib_deps = [
|
|
|
|
dependency('glib-2.0', version: '>=' + min_glib_version),
|
|
|
|
dependency('gio-2.0', version: '>=' + min_glib_version),
|
|
|
|
dependency('gio-unix-2.0', version: '>=' + min_glib_version),
|
|
|
|
]
|
2019-10-10 14:24:02 +00:00
|
|
|
|
2023-09-10 02:42:06 +00:00
|
|
|
with_gcrypt = false
|
|
|
|
with_gnutls = false
|
|
|
|
with_crypto = false
|
|
|
|
|
|
|
|
crypto_deps = []
|
|
|
|
|
|
|
|
if get_option('crypto') == 'libgcrypt'
|
|
|
|
min_libgcrypt_version = '1.2.2'
|
|
|
|
gcrypt_dep = dependency(
|
|
|
|
'libgcrypt',
|
|
|
|
version: '>=' + min_libgcrypt_version,
|
|
|
|
)
|
2024-02-16 18:58:12 +00:00
|
|
|
with_gcrypt = true
|
|
|
|
with_crypto = true
|
|
|
|
crypto_deps += gcrypt_dep
|
2023-09-10 02:42:06 +00:00
|
|
|
elif get_option('crypto') == 'gnutls'
|
|
|
|
min_gnutls_version = '3.8.2'
|
|
|
|
gnutls_dep = dependency(
|
|
|
|
'gnutls',
|
|
|
|
version: '>=' + min_gnutls_version,
|
|
|
|
)
|
2024-02-16 18:58:12 +00:00
|
|
|
with_gnutls = true
|
|
|
|
with_crypto = true
|
|
|
|
crypto_deps += gnutls_dep
|
2023-09-10 02:42:06 +00:00
|
|
|
endif
|
2018-03-20 21:03:56 +00:00
|
|
|
|
2021-07-02 12:00:06 +00:00
|
|
|
min_tss2_version = '3.0.3'
|
|
|
|
tss2_esys = dependency('tss2-esys', version: '>=' + min_tss2_version, required: get_option('tpm2'))
|
|
|
|
tss2_mu = dependency('tss2-mu', version: '>=' + min_tss2_version, required: get_option('tpm2'))
|
|
|
|
tss2_rc = dependency('tss2-rc', version: '>=' + min_tss2_version, required: get_option('tpm2'))
|
|
|
|
tss2_tctildr = dependency('tss2-tctildr', version: '>=' + min_tss2_version, required: get_option('tpm2'))
|
|
|
|
|
|
|
|
tss2_deps = []
|
|
|
|
if tss2_esys.found() and tss2_mu.found() and tss2_rc.found() and tss2_tctildr.found()
|
|
|
|
tss2_deps += [tss2_esys, tss2_mu, tss2_rc, tss2_tctildr]
|
|
|
|
endif
|
|
|
|
|
2018-03-20 21:03:56 +00:00
|
|
|
# Libraries
|
|
|
|
math = meson.get_compiler('c').find_library('m')
|
|
|
|
|
|
|
|
# Configuration
|
|
|
|
conf = configuration_data()
|
|
|
|
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
|
|
|
|
conf.set_quoted('G_LOG_DOMAIN', meson.project_name())
|
2020-06-01 07:05:58 +00:00
|
|
|
conf.set_quoted('LOCALEDIR', libsecret_prefix / get_option('localedir'))
|
2018-03-20 21:03:56 +00:00
|
|
|
conf.set_quoted('PACKAGE_NAME', meson.project_name())
|
|
|
|
conf.set_quoted('PACKAGE_STRING', meson.project_name())
|
|
|
|
conf.set_quoted('PACKAGE_VERSION', meson.project_version())
|
2023-09-10 02:42:06 +00:00
|
|
|
conf.set('WITH_GCRYPT', with_gcrypt)
|
|
|
|
conf.set('WITH_GNUTLS', with_gnutls)
|
|
|
|
conf.set('WITH_CRYPTO', with_crypto)
|
2021-07-02 12:00:06 +00:00
|
|
|
conf.set('WITH_TPM', get_option('tpm2'))
|
2023-09-10 02:42:06 +00:00
|
|
|
if with_gcrypt
|
2018-03-20 21:03:56 +00:00
|
|
|
conf.set_quoted('LIBGCRYPT_VERSION', min_libgcrypt_version)
|
|
|
|
endif
|
2021-07-02 12:00:06 +00:00
|
|
|
if get_option('tpm2')
|
|
|
|
conf.set_quoted('TSS2_VERSION', min_tss2_version)
|
|
|
|
endif
|
2020-06-01 07:05:58 +00:00
|
|
|
conf.set('WITH_DEBUG', get_option('debugging'))
|
|
|
|
conf.set('_DEBUG', get_option('debugging'))
|
2019-05-12 09:32:10 +00:00
|
|
|
conf.set('HAVE_MLOCK', meson.get_compiler('c').has_function('mlock'))
|
2023-11-03 04:37:44 +00:00
|
|
|
if get_option('pam')
|
|
|
|
conf.set_quoted('GNOME_KEYRING_DAEMON', get_option('prefix') /
|
|
|
|
get_option('bindir') / 'gnome-keyring-daemon')
|
|
|
|
endif
|
2018-03-20 21:03:56 +00:00
|
|
|
configure_file(output: 'config.h', configuration: conf)
|
|
|
|
|
2019-08-19 15:56:17 +00:00
|
|
|
# Test environment
|
|
|
|
test_env = environment()
|
|
|
|
test_env.set('abs_top_builddir', meson.build_root())
|
|
|
|
|
2018-03-20 21:03:56 +00:00
|
|
|
# Subfolders
|
|
|
|
subdir('po')
|
|
|
|
subdir('egg')
|
|
|
|
subdir('libsecret')
|
|
|
|
subdir('tool')
|
|
|
|
subdir('docs')
|
2023-11-03 04:37:44 +00:00
|
|
|
if get_option('pam')
|
|
|
|
subdir('pam')
|
|
|
|
endif
|