1project('cinnamon-settings-daemon', 'c', version: '4.8.5', meson_version: '>= 0.47')
2
3gnome = import('gnome')
4i18n = import('i18n')
5pkg = import('pkgconfig')
6
7version = meson.project_version()
8pkgname = meson.project_name().to_lower()
9api_version = '3.0'
10
11cc = meson.get_compiler('c')
12
13# directories
14prefix = get_option('prefix')
15bindir = get_option('bindir')
16datadir = get_option('datadir')
17libdir = get_option('libdir')
18libexecdir = get_option('libexecdir')
19includedir = get_option('includedir')
20desktopdir = join_paths(datadir, 'applications')
21schemadir = join_paths(datadir, 'glib-2.0', 'schemas')
22pkglibdir = join_paths(libdir, pkgname)
23apilibdir = join_paths(libdir, '@0@-@1@'.format(pkgname, api_version))
24pkgdatadir = join_paths(datadir, pkgname)
25gtkbuilderdir = join_paths(prefix, datadir, pkgname)
26pkgincludedir = join_paths(includedir, pkgname)
27localedir = join_paths(prefix, datadir, 'locale')
28polkitdir = join_paths(datadir, 'polkit-1', 'actions')
29sysconfdir = get_option('sysconfdir')
30autostartdir = join_paths(sysconfdir, 'xdg', 'autostart')
31
32dbusservicedir = get_option('dbus_service_dir')
33if dbusservicedir == ''
34    dbusservicedir = join_paths(datadir, 'dbus-1', 'system-services')
35endif
36
37dbussystemdir = get_option('dbus_system_dir')
38if dbussystemdir == ''
39    dbussystemdir = join_paths(datadir, 'dbus-1', 'system.d')
40endif
41
42# dependencies
43cinnamon_desktop_required = '>= 4.8.0'
44canberra = dependency('libcanberra-gtk3')
45cinnamon_desktop = dependency('cinnamon-desktop', version: cinnamon_desktop_required)
46colord = dependency('colord', version: '>= 0.1.27')
47cups = dependency('cups', version: '>= 1.4', required: get_option('use_cups'))
48fontconfig = dependency('fontconfig')
49gio = dependency('gio-2.0', version: '>= 2.40.0')
50glib = dependency('glib-2.0', version: '>= 2.40.0')
51gnomekbd_required = '>= 3.6.0'
52gnomekbd = dependency('libgnomekbd', version: gnomekbd_required)
53gnomekbdui = dependency('libgnomekbdui', version: gnomekbd_required)
54gtk = dependency('gtk+-3.0', version: '>= 3.14.0')
55gudev = dependency('gudev-1.0', required: get_option('use_gudev'))
56libnotify = dependency('libnotify', version: '>= 0.7.3')
57kbproto = dependency('kbproto')
58nss = dependency('nss', version: '>= 3.11.2', required: get_option('enable_smartcard'))
59polkit = dependency('polkit-gobject-1', version: '>= 0.97', required: get_option('use_polkit'))
60upower_glib = dependency('upower-glib', version: '>= 0.9.11')
61wacom = dependency('libwacom', version: '>= 0.7', required: false)
62x11 = dependency('x11')
63xext = dependency('xext')
64xfixes = dependency('xfixes')
65xi = dependency('xi')
66xklavier = dependency('libxklavier', version: '>= 5.0')
67xtst = dependency('xtst')
68
69# currently we only use dbus if we're also using polkit if this changes in the future we can
70# simply remove the required field here
71dbus = dependency('dbus-1', version: '>= 1.1.2', required: polkit.found())
72dbus_glib = dependency('dbus-glib-1', required: polkit.found())
73
74# currently only used for the wacom plugin
75librsvg = dependency('librsvg-2.0', version: '>= 2.36.2', required: wacom.found())
76xorg_wacom = dependency('xorg-wacom', required: wacom.found())
77
78lcms = dependency('lcms2', version: '>= 2.2', required: false)
79has_new_lcms = lcms.found()
80if not has_new_lcms
81    lcms = dependency('lcms2')
82endif
83
84cargs = []
85
86using_logind = false
87if not get_option('use_logind').disabled()
88    logind = dependency('libsystemd-logind', required: false)
89    if not logind.found()
90        logind = dependency('libsystemd', required: false)
91    endif
92    if not logind.found()
93        # if logind is explicitly enabled, we want to make sure it gives an error if we don't find anything
94        logind = dependency('libelogind', required: get_option('use_logind'))
95    endif
96    if logind.found()
97        cargs += '-DHAVE_LOGIND'
98        using_logind = true
99    endif
100endif
101
102cc = meson.get_compiler('c')
103math = cc.find_library('m', required: false)
104
105# currently used by the datetime plugin, but dbus-glib is deprecated so we
106# should port it to gdbus asap, and this should be removed at that point
107dbus_binding_tool = find_program('dbus-binding-tool')
108
109csd_conf = configuration_data()
110csd_conf.set_quoted('GTKBUILDERDIR', gtkbuilderdir)
111csd_conf.set_quoted('CINNAMON_SETTINGS_LOCALEDIR', localedir)
112csd_conf.set_quoted('PACKAGE', meson.project_name())
113csd_conf.set_quoted('PACKAGE_NAME', meson.project_name())
114csd_conf.set_quoted('PACKAGE_VERSION', meson.project_version())
115csd_conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
116csd_conf.set_quoted('LIBEXECDIR', join_paths(prefix, libexecdir))
117csd_conf.set_quoted('SYSCONFDIR', sysconfdir)
118csd_conf.set_quoted('LIBDIR', libdir)
119
120if gudev.found()
121    cargs += '-DHAVE_GUDEV'
122endif
123
124if not get_option('enable_debug')
125    cargs += [
126          '-Wno-deprecated-declarations',
127          '-Wno-deprecated',
128          '-Wno-declaration-after-statement',
129          '-DGLIB_DISABLE_DEPRECATION_WARNINGS',
130    ]
131endif
132
133add_global_arguments(
134    cargs,
135    language: 'c'
136)
137
138# generate config.h
139config_h_file = configure_file(
140    output : 'config.h',
141    configuration : csd_conf
142)
143
144config_h = declare_dependency(
145    sources: config_h_file
146)
147
148include_dirs = include_directories('.', 'cinnamon-settings-daemon')
149
150subdir('data')
151subdir('cinnamon-settings-daemon')
152subdir('plugins')
153
154install_subdir(
155    'files',
156    install_dir: '/',
157    strip_directory: true,
158)
159
160subdir('install-scripts')
161