2019-02-26 18:43:56 +01:00
|
|
|
|
project('malcontent', 'c',
|
2023-10-13 12:34:01 +02:00
|
|
|
|
version : '0.12.0',
|
2024-01-06 10:29:09 +01:00
|
|
|
|
meson_version : '>= 0.60.0',
|
2020-03-10 15:12:25 +01:00
|
|
|
|
license: ['LGPL-2.1-or-later', 'GPL-2.0-or-later'],
|
2018-09-24 16:36:41 +02:00
|
|
|
|
default_options : [
|
|
|
|
|
'buildtype=debugoptimized',
|
|
|
|
|
'warning_level=2',
|
|
|
|
|
'c_std=gnu11',
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
|
2018-10-02 16:57:04 +02:00
|
|
|
|
gnome = import('gnome')
|
2018-09-24 16:41:10 +02:00
|
|
|
|
i18n = import('i18n')
|
2018-09-24 16:36:41 +02:00
|
|
|
|
pkgconfig = import('pkgconfig')
|
|
|
|
|
|
2020-07-06 11:59:45 +02:00
|
|
|
|
meson_make_symlink = join_paths(meson.current_source_dir(), 'tools', 'meson-make-symlink.py')
|
|
|
|
|
po_dir = join_paths(meson.current_source_dir(), 'po')
|
2018-09-24 16:36:41 +02:00
|
|
|
|
|
|
|
|
|
prefix = get_option('prefix')
|
2018-10-02 18:03:33 +02:00
|
|
|
|
bindir = join_paths(prefix, get_option('bindir'))
|
2018-09-24 16:36:41 +02:00
|
|
|
|
datadir = join_paths(prefix, get_option('datadir'))
|
2019-12-06 18:09:57 +01:00
|
|
|
|
libdir = join_paths(prefix, get_option('libdir'))
|
2018-10-06 01:47:45 +02:00
|
|
|
|
libexecdir = join_paths(prefix, get_option('libexecdir'))
|
2020-04-04 01:00:04 +02:00
|
|
|
|
includedir = join_paths(prefix, get_option('includedir'))
|
2018-09-24 16:36:41 +02:00
|
|
|
|
|
|
|
|
|
# FIXME: This isn’t exposed in accountsservice.pc
|
2018-10-02 16:56:39 +02:00
|
|
|
|
# See https://gitlab.freedesktop.org/accountsservice/accountsservice/merge_requests/16
|
2018-09-24 16:36:41 +02:00
|
|
|
|
accountsserviceinterfacesdir = join_paths(datadir, 'accountsservice', 'interfaces')
|
|
|
|
|
|
2019-12-06 18:09:57 +01:00
|
|
|
|
# FIXME: pam.pc doesn’t exist
|
|
|
|
|
pamlibdir = get_option('pamlibdir')
|
|
|
|
|
if pamlibdir == ''
|
2020-01-20 18:13:53 +01:00
|
|
|
|
pamlibdir = join_paths(libdir, 'security')
|
2019-12-06 18:09:57 +01:00
|
|
|
|
endif
|
|
|
|
|
|
2018-09-24 16:36:41 +02:00
|
|
|
|
dbus = dependency('dbus-1')
|
2022-07-13 16:18:38 +02:00
|
|
|
|
dbusinterfacesdir = dbus.get_variable(pkgconfig: 'interfaces_dir',
|
|
|
|
|
pkgconfig_define: ['datadir', datadir])
|
2018-09-24 16:36:41 +02:00
|
|
|
|
|
|
|
|
|
polkit_gobject = dependency('polkit-gobject-1')
|
2022-07-13 16:18:38 +02:00
|
|
|
|
polkitpolicydir = polkit_gobject.get_variable(pkgconfig: 'policydir',
|
|
|
|
|
pkgconfig_define: ['prefix', prefix])
|
2018-09-24 16:36:41 +02:00
|
|
|
|
|
2018-09-28 10:11:11 +02:00
|
|
|
|
config_h = configuration_data()
|
2020-02-21 10:45:47 +01:00
|
|
|
|
config_h.set_quoted('GETTEXT_PACKAGE', 'malcontent')
|
|
|
|
|
config_h.set_quoted('PACKAGE_LOCALE_DIR', join_paths(get_option('prefix'), get_option('localedir')))
|
2020-03-26 02:56:33 +01:00
|
|
|
|
config_h.set_quoted('PAMLIBDIR', pamlibdir)
|
2020-03-27 23:07:34 +01:00
|
|
|
|
config_h.set_quoted('VERSION', meson.project_version())
|
2018-09-28 10:11:11 +02:00
|
|
|
|
configure_file(
|
|
|
|
|
output: 'config.h',
|
|
|
|
|
configuration: config_h,
|
|
|
|
|
)
|
|
|
|
|
root_inc = include_directories('.')
|
|
|
|
|
|
|
|
|
|
# Enable warning flags
|
|
|
|
|
test_c_args = [
|
|
|
|
|
'-fno-strict-aliasing',
|
|
|
|
|
'-fstack-protector-strong',
|
|
|
|
|
'-Waggregate-return',
|
|
|
|
|
'-Wall',
|
|
|
|
|
'-Wunused',
|
|
|
|
|
'-Warray-bounds',
|
|
|
|
|
'-Wcast-align',
|
|
|
|
|
'-Wclobbered',
|
|
|
|
|
'-Wno-declaration-after-statement',
|
2018-12-14 14:32:46 +01:00
|
|
|
|
'-Wdiscarded-qualifiers',
|
2018-09-28 10:11:11 +02:00
|
|
|
|
'-Wduplicated-branches',
|
|
|
|
|
'-Wduplicated-cond',
|
|
|
|
|
'-Wempty-body',
|
|
|
|
|
'-Wformat=2',
|
|
|
|
|
'-Wformat-nonliteral',
|
|
|
|
|
'-Wformat-security',
|
|
|
|
|
'-Wformat-signedness',
|
|
|
|
|
'-Wignored-qualifiers',
|
|
|
|
|
'-Wimplicit-function-declaration',
|
|
|
|
|
'-Wincompatible-pointer-types',
|
|
|
|
|
'-Wincompatible-pointer-types-discards-qualifiers',
|
|
|
|
|
'-Winit-self',
|
|
|
|
|
'-Wint-conversion',
|
|
|
|
|
'-Wlogical-op',
|
|
|
|
|
'-Wmisleading-indentation',
|
|
|
|
|
'-Wmissing-declarations',
|
|
|
|
|
'-Wmissing-format-attribute',
|
|
|
|
|
'-Wmissing-include-dirs',
|
|
|
|
|
'-Wmissing-noreturn',
|
|
|
|
|
'-Wmissing-parameter-type',
|
|
|
|
|
'-Wmissing-prototypes',
|
|
|
|
|
'-Wnested-externs',
|
|
|
|
|
'-Wno-error=cpp',
|
2019-05-15 15:31:44 +02:00
|
|
|
|
'-Wmissing-field-initializers',
|
2018-09-28 10:11:11 +02:00
|
|
|
|
'-Wno-suggest-attribute=format',
|
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
|
'-Wnull-dereference',
|
|
|
|
|
'-Wold-style-definition',
|
|
|
|
|
'-Woverflow',
|
|
|
|
|
'-Woverride-init',
|
|
|
|
|
'-Wparentheses',
|
|
|
|
|
'-Wpointer-arith',
|
|
|
|
|
'-Wredundant-decls',
|
|
|
|
|
'-Wreturn-type',
|
|
|
|
|
'-Wshadow',
|
|
|
|
|
'-Wsign-compare',
|
|
|
|
|
'-Wstrict-aliasing=2',
|
|
|
|
|
'-Wstrict-prototypes',
|
|
|
|
|
'-Wswitch-default',
|
|
|
|
|
'-Wswitch-enum',
|
|
|
|
|
'-Wtype-limits',
|
|
|
|
|
'-Wundef',
|
|
|
|
|
'-Wuninitialized',
|
|
|
|
|
'-Wunused-but-set-variable',
|
|
|
|
|
'-Wunused-result',
|
|
|
|
|
'-Wunused-variable',
|
|
|
|
|
'-Wwrite-strings'
|
|
|
|
|
]
|
|
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
add_project_arguments(cc.get_supported_arguments(test_c_args), language: 'c')
|
|
|
|
|
|
2018-10-06 01:47:45 +02:00
|
|
|
|
enable_installed_tests = get_option('installed_tests')
|
|
|
|
|
test_template = files('template.test.in')
|
|
|
|
|
test_env = [
|
|
|
|
|
'G_DEBUG=gc-friendly,fatal-warnings',
|
|
|
|
|
'MALLOC_CHECK_=2',
|
|
|
|
|
'LC_ALL=C.UTF-8',
|
|
|
|
|
]
|
|
|
|
|
|
2018-09-28 10:11:11 +02:00
|
|
|
|
subdir('accounts-service')
|
2020-03-13 18:09:35 +01:00
|
|
|
|
subdir('help')
|
2020-03-05 23:02:43 +01:00
|
|
|
|
if not get_option('use_system_libmalcontent')
|
|
|
|
|
subdir('libmalcontent')
|
|
|
|
|
else
|
|
|
|
|
libmalcontent_api_version = '0'
|
|
|
|
|
libmalcontent_dep = dependency('malcontent-' + libmalcontent_api_version, version: meson.project_version())
|
|
|
|
|
libmalcontent_gir = ['Malcontent-' + libmalcontent_api_version,
|
|
|
|
|
'Malcontent-' + libmalcontent_api_version + '.typelib']
|
|
|
|
|
endif
|
2020-03-05 16:44:46 +01:00
|
|
|
|
if get_option('ui').enabled()
|
2022-07-22 12:03:07 +02:00
|
|
|
|
gtk_dep = dependency('gtk4', version: '>= 4.6')
|
2022-07-08 02:20:30 +02:00
|
|
|
|
libadwaita_dep = dependency(
|
|
|
|
|
'libadwaita-1',
|
|
|
|
|
version: '>= 1.1',
|
|
|
|
|
fallback: ['libadwaita', 'libadwaita_dep'],
|
|
|
|
|
default_options: ['examples=false', 'introspection=disabled', 'tests=false', 'vapi=false'],
|
|
|
|
|
)
|
2020-03-05 16:44:46 +01:00
|
|
|
|
subdir('libmalcontent-ui')
|
|
|
|
|
endif
|
2019-12-17 16:41:03 +01:00
|
|
|
|
subdir('malcontent-client')
|
2020-03-05 16:44:46 +01:00
|
|
|
|
if get_option('ui').enabled()
|
|
|
|
|
subdir('malcontent-control')
|
2022-08-31 06:20:30 +02:00
|
|
|
|
|
|
|
|
|
gnome.post_install(
|
|
|
|
|
gtk_update_icon_cache: true,
|
|
|
|
|
update_desktop_database: true,
|
|
|
|
|
)
|
2020-03-05 16:44:46 +01:00
|
|
|
|
endif
|
2019-12-06 18:09:57 +01:00
|
|
|
|
subdir('pam')
|
2020-01-13 13:22:36 +01:00
|
|
|
|
subdir('po')
|
2024-01-06 10:29:09 +01:00
|
|
|
|
|
|
|
|
|
if get_option('dns').enabled()
|
|
|
|
|
subdir('nss')
|
|
|
|
|
endif
|