-
Notifications
You must be signed in to change notification settings - Fork 862
Expand file tree
/
Copy pathmeson.build
More file actions
273 lines (233 loc) · 8.37 KB
/
meson.build
File metadata and controls
273 lines (233 loc) · 8.37 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
project('Cinnamon', 'c', version : '6.7.0', meson_version : '>=0.56.0')
gnome = import('gnome')
i18n = import('i18n')
version = meson.project_version()
# directories
prefix = get_option('prefix')
bindir = get_option('bindir')
datadir = get_option('datadir')
libdir = join_paths(prefix, get_option('libdir'))
includedir = get_option('includedir')
libexecdir = get_option('libexecdir')
sysconfdir = join_paths(prefix, get_option('sysconfdir'))
desktopdir = join_paths(datadir, 'applications')
x_sessiondir = join_paths(datadir, 'xsessions')
wayland_sessiondir = join_paths(datadir, 'wayland-sessions')
schemadir = join_paths(datadir, 'glib-2.0', 'schemas')
pkglibdir = join_paths(libdir, meson.project_name().to_lower())
pkgdatadir = join_paths(datadir, meson.project_name().to_lower())
po_dir = join_paths(meson.project_source_root(), 'po')
dbus = dependency('dbus-1')
servicedir = dbus.get_variable(pkgconfig: 'session_bus_services_dir', pkgconfig_define: ['datadir', datadir])
# dependencies
cjs = dependency('cjs-1.0', version: '>= 115.0')
clutter = dependency('muffin-clutter-0')
cmenu = dependency('libcinnamon-menu-3.0', version: '>= 4.8.0')
cogl = dependency('muffin-cogl-0')
cogl_path = dependency('muffin-cogl-path-0')
gcr = dependency('gcr-base-3', version: '>= 3.7.5')
gdkx11 = dependency('gdk-x11-3.0')
polkit = dependency('polkit-agent-1', version: '>= 0.100')
atk = dependency('atk-bridge-2.0')
gio = dependency('gio-2.0', version: '>= 2.36.0')
gio_unix = dependency('gio-unix-2.0')
use_gir20 = false
if cjs.version().version_compare('>= 139.9')
gi = dependency('girepository-2.0', version: '>= 2.36.0')
use_gir20 = true
else
gi = dependency('gobject-introspection-1.0', version: '>= 0.9.2')
endif
gl = dependency('gl')
glib_version = '2.79.2'
glib = dependency('glib-2.0', version: '>= ' + glib_version)
gtk = dependency('gtk+-3.0', version: '>= 3.12.0')
muffin = dependency('libmuffin-0', version: '>= 5.2.0')
muffin_typelibdir = muffin.get_variable(pkgconfig: 'typelibdir')
pango = dependency('muffin-cogl-pango-0')
xapp = dependency('xapp', version: '>= 2.6.0')
X11 = dependency('x11')
xcomposite = dependency('xcomposite')
xext = dependency('xext')
xml = dependency('libxml-2.0')
nm_deps = []
internal_nm_agent = false
session_conf = configuration_data()
session_conf.set('REQUIRED', '')
nm_option = get_option('nm_agent')
if nm_option == 'internal'
internal_nm_agent = true
nm_deps += dependency('libnm', version: '>= 1.10.4')
nm_deps += dependency('libsecret-1', version: '>= 0.18')
message('Building internal NetworkManager agent.')
elif nm_option == 'external'
session_conf.set('REQUIRED', 'nm-applet;')
message('Requiring external NetworkManager agent.')
else
message('Building without any NetworkManager support.')
endif
if get_option('build_recorder')
gstreamer = dependency('gstreamer-1.0')
gstreamer_base = dependency('gstreamer-base-1.0')
else
gstreamer = dependency('', required: false)
gstreamer_base = dependency('', required: false)
endif
message('Building recorder: @0@'.format(get_option('build_recorder')))
# on some systems we need to find the math lib to make sure it builds
cc = meson.get_compiler('c')
math = cc.find_library('m', required: false)
xdo = dependency('libxdo', required: false)
if not xdo.found()
xdo = cc.find_library('xdo')
endif
# PAM authentication library
pam_compile = '''#include <stdio.h>
#include <stdlib.h>
#include <security/pam_appl.h>
int main ()
{
pam_handle_t *pamh = 0;
char *s = pam_strerror(pamh, PAM_SUCCESS);
return 0;
}'''
pam = cc.find_library('pam')
if not cc.has_function('sigtimedwait')
pam = [pam, cc.find_library('rt')]
endif
python = find_program('python3')
# generate config.h
cinnamon_conf = configuration_data()
cinnamon_conf.set_quoted('VERSION', version)
cinnamon_conf.set_quoted('GETTEXT_PACKAGE', meson.project_name().to_lower())
cinnamon_conf.set('BUILT_NM_AGENT', internal_nm_agent)
cinnamon_conf.set10('USE_GIR20', use_gir20)
have_mallinfo = cc.has_function('mallinfo', prefix: '#include <malloc.h>')
if have_mallinfo
cinnamon_conf.set10('HAVE_MALLINFO', true)
endif
# Check for unistd.h (needed by PAM helper)
if cc.has_header('unistd.h')
cinnamon_conf.set('HAVE_UNISTD_H', true)
endif
# Check for sigaction (needed by PAM helper)
if cc.has_function('sigaction', args: '-D_GNU_SOURCE')
cinnamon_conf.set('HAVE_SIGACTION', true)
endif
# PAM configuration checks
if cc.compiles(pam_compile, dependencies: pam)
cinnamon_conf.set('PAM_STRERROR_TWO_ARGS', 1)
endif
if cc.has_function('pam_syslog', dependencies: pam)
cinnamon_conf.set('HAVE_PAM_SYSLOG', 1)
endif
langinfo_test = '''
#include <langinfo.h>
int main () {
nl_langinfo(_NL_TIME_FIRST_WEEKDAY);
}
'''
have_nl_time_first_weekday = cc.compiles(
langinfo_test,
name : 'langinfo _NL_TIME_FIRST_WEEKDAY check')
if have_nl_time_first_weekday
cinnamon_conf.set10('HAVE__NL_TIME_FIRST_WEEKDAY', true)
endif
# Check for X11 Shape extension (needed by backup-locker)
if cc.has_header('X11/extensions/shape.h', dependencies: [X11, xext])
cinnamon_conf.set('HAVE_SHAPE_EXT', 1)
endif
config_h_file = configure_file(
output : 'config.h',
configuration : cinnamon_conf
)
config_h = declare_dependency(
sources: config_h_file
)
# includes
include_root = include_directories('.')
if polkit.version()[0] == '0' # older versions '0.105' ...
pkv = 1
else
pkv = polkit.version().to_int()
endif
# compiler flags
c_args = [
'-DDATADIR="@0@"'.format(join_paths(prefix, datadir)),
'-DLIBDIR="@0@"'.format(join_paths(prefix, libdir)),
'-DBINDIR="@0@"'.format(join_paths(prefix, bindir)),
'-DCINNAMON_DATADIR="@0@"'.format(join_paths(prefix, pkgdatadir)),
'-DJSDIR="@0@/js"'.format(join_paths(prefix, pkgdatadir)),
'-DMUFFIN_TYPELIB_DIR="@0@"'.format(muffin_typelibdir),
'-DPOLKIT_VERSION=@0@'.format(pkv),
]
if not get_option('deprecated_warnings')
c_args += [
'-Wno-deprecated-declarations',
'-Wno-deprecated',
'-Wno-declaration-after-statement',
]
endif
add_global_arguments(c_args, language: 'c')
subdir('data')
subdir('src')
# tests are not currently functional
# subdir('tests')
subdir('docs/reference')
install_subdir(
'js',
exclude_files: ['misc/config.js.in'],
install_dir: join_paths(datadir, meson.project_name().to_lower()),
)
config_js_conf = configuration_data()
config_js_conf.set('PACKAGE_NAME', meson.project_name().to_lower())
config_js_conf.set('PACKAGE_VERSION', version)
config_js_conf.set10('BUILT_NM_AGENT', internal_nm_agent)
config_js_conf.set('LIBEXECDIR', join_paths(prefix, libexecdir))
config_js_conf.set10('USE_GIR20', use_gir20)
configure_file(
input: 'js/misc/config.js.in',
output: 'config.js',
configuration: config_js_conf,
install_dir: 'share/cinnamon/js/misc/'
)
excluded_files = []
if get_option('exclude_info_settings')
excluded_files += ['usr/share/applications/cinnamon-settings-info.desktop']
excluded_files += ['usr/share/cinnamon/cinnamon-settings/modules/cs_info.py']
endif
if get_option('exclude_users_settings')
excluded_files += ['usr/bin/cinnamon-settings-users']
excluded_files += ['usr/share/applications/cinnamon-settings-user.desktop']
excluded_files += ['usr/share/applications/cinnamon-settings-users.desktop']
excluded_files += ['usr/share/cinnamon/cinnamon-settings-users/cinnamon-settings-users.py']
excluded_files += ['usr/share/cinnamon/cinnamon-settings-users/cinnamon-settings-users.ui']
excluded_files += ['usr/share/cinnamon/cinnamon-settings-users/cinnamon-settings-users.svg']
excluded_files += ['usr/share/cinnamon/cinnamon-settings/modules/cs_user.py']
endif
install_subdir(
'files',
install_dir: '/',
strip_directory: true,
exclude_files : excluded_files
)
session_files = ['cinnamon.session', 'cinnamon2d.session']
if get_option('wayland')
session_files += ['cinnamon-wayland.session']
endif
foreach session_file : session_files
configure_file(
input: session_file + '.in',
output: session_file,
configuration: session_conf,
install_dir: join_paths(prefix, datadir, 'cinnamon-session', 'sessions'),
)
endforeach
install_subdir(
'man',
install_dir: join_paths(prefix, get_option('mandir'), 'man1'),
strip_directory: true,
)
subdir('calendar-server')
subdir('python3')
subdir('install-scripts')