-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathmeson.build
More file actions
164 lines (140 loc) · 5.22 KB
/
meson.build
File metadata and controls
164 lines (140 loc) · 5.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
project('cinnamon-settings-daemon', 'c', version : '6.7.0', meson_version : '>=0.56.0')
gnome = import('gnome')
i18n = import('i18n')
pkg = import('pkgconfig')
version = meson.project_version()
pkgname = meson.project_name().to_lower()
api_version = '3.0'
cc = meson.get_compiler('c')
cargs = []
# directories
prefix = get_option('prefix')
bindir = get_option('bindir')
datadir = get_option('datadir')
libdir = get_option('libdir')
libexecdir = get_option('libexecdir')
includedir = get_option('includedir')
desktopdir = join_paths(datadir, 'applications')
schemadir = join_paths(datadir, 'glib-2.0', 'schemas')
pkglibdir = join_paths(libdir, pkgname)
apilibdir = join_paths(libdir, '@0@-@1@'.format(pkgname, api_version))
pkgdatadir = join_paths(datadir, pkgname)
gtkbuilderdir = join_paths(prefix, datadir, pkgname)
pkgincludedir = join_paths(includedir, pkgname)
localedir = join_paths(prefix, datadir, 'locale')
polkitdir = join_paths(datadir, 'polkit-1', 'actions')
sysconfdir = get_option('sysconfdir')
autostartdir = join_paths(sysconfdir, 'xdg', 'autostart')
dbusservicedir = get_option('dbus_service_dir')
if dbusservicedir == ''
dbusservicedir = join_paths(datadir, 'dbus-1', 'system-services')
endif
dbussystemdir = get_option('dbus_system_dir')
if dbussystemdir == ''
dbussystemdir = join_paths(datadir, 'dbus-1', 'system.d')
endif
# dependencies
cinnamon_desktop_required = '>= 4.8.0'
canberra = dependency('libcanberra-gtk3')
cinnamon_desktop = dependency('cinnamon-desktop', version: cinnamon_desktop_required)
colord = dependency('colord', version: '>= 0.1.27', required: get_option('use_color'))
cups = dependency('cups', version: '>= 1.4', required: get_option('use_cups'))
cvc = dependency('cvc', version: cinnamon_desktop_required)
fontconfig = dependency('fontconfig')
gio = dependency('gio-2.0', version: '>= 2.40.0')
gio_unix = dependency('gio-unix-2.0', version: '>= 2.40.0')
glib = dependency('glib-2.0', version: '>= 2.40.0')
gtk = dependency('gtk+-3.0', version: '>= 3.14.0')
gudev = dependency('gudev-1.0', required: get_option('use_gudev'))
libnotify = dependency('libnotify', version: '>= 0.7.3')
nss = dependency('nss', version: '>= 3.11.2', required: get_option('use_smartcard'))
polkit = dependency('polkit-gobject-1', version: '>= 0.97', required: get_option('use_polkit'))
upower_glib = dependency('upower-glib', version: '>= 0.99.11')
wacom = dependency('libwacom', version: '>= 0.7', required: get_option('use_wacom'))
x11 = dependency('x11')
xext = dependency('xext')
xi = dependency('xi')
# currently only used for the wacom plugin
if wacom.found()
librsvg = dependency('librsvg-2.0', version: '>= 2.36.2')
pango = dependency('pango', version: '>= 1.20.0')
endif
lcms = dependency('lcms2', required: colord.found())
if lcms.version().version_compare('>=2.2')
cargs += '-DHAVE_NEW_LCMS'
endif
using_logind = false
if not get_option('use_logind').disabled()
logind = dependency('libsystemd-logind', required: false)
if not logind.found()
logind = dependency('libsystemd', required: false)
endif
if not logind.found()
# if logind is explicitly enabled, we want to make sure it gives an error if we don't find anything
logind = dependency('libelogind', required: get_option('use_logind'))
endif
if logind.found()
cargs += '-DHAVE_LOGIND'
using_logind = true
endif
endif
gtk_layer_shell_enabled = get_option('gtk_layer_shell')
gtk_layer_shell = dependency('', required: false)
wayland_client = dependency('', required: false)
if gtk_layer_shell_enabled
gtk_layer_shell = dependency('gtk-layer-shell-0', version: '>= 0.8', required: true)
wayland_client = dependency('wayland-client', required: true)
endif
cc = meson.get_compiler('c')
math = cc.find_library('m', required: false)
has_timerfd_create = cc.has_function('timerfd_create')
csd_conf = configuration_data()
csd_conf.set_quoted('GTKBUILDERDIR', gtkbuilderdir)
csd_conf.set_quoted('CINNAMON_SETTINGS_LOCALEDIR', localedir)
csd_conf.set_quoted('PACKAGE', meson.project_name())
csd_conf.set_quoted('PACKAGE_NAME', meson.project_name())
csd_conf.set_quoted('PACKAGE_VERSION', meson.project_version())
csd_conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
csd_conf.set_quoted('LIBEXECDIR', join_paths(prefix, libexecdir))
csd_conf.set_quoted('SYSCONFDIR', sysconfdir)
csd_conf.set_quoted('LIBDIR', libdir)
csd_conf.set10('HAVE_TIMERFD', has_timerfd_create)
if gtk_layer_shell_enabled
csd_conf.set('HAVE_GTK_LAYER_SHELL', 1)
endif
if gudev.found()
cargs += '-DHAVE_GUDEV'
endif
if wacom.found()
cargs += '-DHAVE_WACOM'
endif
if not get_option('enable_debug')
cargs += [
'-Wno-deprecated-declarations',
'-Wno-deprecated',
'-Wno-declaration-after-statement',
'-DGLIB_DISABLE_DEPRECATION_WARNINGS',
]
endif
add_global_arguments(
cargs,
language: 'c'
)
# generate config.h
config_h_file = configure_file(
output : 'config.h',
configuration : csd_conf
)
config_h = declare_dependency(
sources: config_h_file
)
include_dirs = include_directories('.', 'cinnamon-settings-daemon')
subdir('data')
subdir('cinnamon-settings-daemon')
subdir('plugins')
install_subdir(
'files/usr',
install_dir: prefix,
strip_directory: true,
)
subdir('install-scripts')