-
-
Notifications
You must be signed in to change notification settings - Fork 193
/
meson.build
373 lines (328 loc) · 11.3 KB
/
meson.build
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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
project(
'blueman', 'c',
version: '2.4.3',
license: 'GPL3',
meson_version: '>=0.56.0',
default_options: 'b_lundef=false'
)
package_name = meson.project_name()
# Import needed modules
python = import('python')
gnome = import('gnome')
i18n = import('i18n')
pyinstall = python.find_installation('python3', required: true)
if not pyinstall.language_version().version_compare('>=3.8')
error('Python 3.8 or higher not found which is required.')
endif
# Setup all directories we install in
prefix = get_option('prefix')
datadir = get_option('datadir')
pkgdatadir = join_paths([datadir, package_name])
bindir = get_option('bindir')
libdir = get_option('libdir')
dbusdir = join_paths([datadir, 'dbus-1'])
libexecdir = get_option('libexecdir')
schemadir = join_paths([datadir, 'glib-2.0', 'schemas'])
polkitdir = join_paths([datadir, 'polkit-1'])
pythondir = pyinstall.get_install_dir()
systemd_base_path = join_paths(libdir, 'systemd')
if get_option('policykit')
have_polkit = 'True'
else
have_polkit = 'False'
endif
# Setup congfiguration
conf_data = configuration_data()
conf_data.set('BINDIR', join_paths(prefix, bindir))
conf_data.set('LIBEXECDIR', join_paths(prefix, libexecdir))
conf_data.set('VERSION', meson.project_version())
conf_data.set('PACKAGE', package_name)
conf_data.set('prefix', prefix)
conf_data.set('pkgdatadir', join_paths(prefix, pkgdatadir))
conf_data.set('LOCALEDIR', join_paths(prefix, get_option('localedir')))
conf_data.set('icondir', join_paths(prefix, datadir, 'icons'))
conf_data.set('dhconfig', get_option('dhcp-config-path'))
conf_data.set('bluetoothd_path', get_option('bluetoothd-path'))
conf_data.set('POLKIT', have_polkit)
conf_data.set('GETTEXT_PACKAGE', package_name)
conf_data.set('PYTHON', pyinstall.full_path())
# Check for build dependencies
pythonlib = pyinstall.dependency()
pygobject = dependency('pygobject-3.0', required: true)
bluez = dependency('bluez', version: '>= 5.0', required: true)
gthread = dependency('gthread-2.0', version: '>= 2.32', required: true)
# Check for runtime deps and when not found fail based on runtime_deps_check
do_runtime_checks = get_option('runtime_deps_check')
ip = find_program('ip', required: false)
ifconfig = find_program('ifconfig', required: false)
if not ip.found() and not ifconfig.found() and do_runtime_checks
error('blueman requires ip (recommended) or ifconfig network utilities')
endif
# Configure blueman apps
foreach libexecapp: ['blueman-mechanism', 'blueman-rfcomm-watcher']
configure_file(
input: join_paths('apps', libexecapp + '.in'),
output: libexecapp,
install_dir: libexecdir,
install_mode: 'rwxr-xr-x',
configuration: conf_data
)
endforeach
binapps = ['blueman-adapters', 'blueman-applet', 'blueman-manager',
'blueman-sendto', 'blueman-services', 'blueman-tray']
foreach binapp: binapps
configure_file(
input: join_paths('apps', binapp + '.in'),
output: binapp,
install_dir: bindir,
install_mode: 'rwxr-xr-x',
configuration: conf_data
)
endforeach
# Install all the artwork and icons
# FIXME use strip_directory when meson 0.45.0 is mainstream
install_data(
'data/icons/pixmaps/blueman-battery-10.png',
'data/icons/pixmaps/blueman-battery-20.png',
'data/icons/pixmaps/blueman-battery-30.png',
'data/icons/pixmaps/blueman-battery-40.png',
'data/icons/pixmaps/blueman-battery-50.png',
'data/icons/pixmaps/blueman-battery-60.png',
'data/icons/pixmaps/blueman-battery-70.png',
'data/icons/pixmaps/blueman-battery-80.png',
'data/icons/pixmaps/blueman-battery-90.png',
'data/icons/pixmaps/blueman-battery-100.png',
'data/icons/pixmaps/blueman-rssi-10.png',
'data/icons/pixmaps/blueman-rssi-20.png',
'data/icons/pixmaps/blueman-rssi-30.png',
'data/icons/pixmaps/blueman-rssi-40.png',
'data/icons/pixmaps/blueman-rssi-50.png',
'data/icons/pixmaps/blueman-rssi-60.png',
'data/icons/pixmaps/blueman-rssi-70.png',
'data/icons/pixmaps/blueman-rssi-80.png',
'data/icons/pixmaps/blueman-rssi-90.png',
'data/icons/pixmaps/blueman-rssi-100.png',
'data/icons/pixmaps/blueman-tpl-10.png',
'data/icons/pixmaps/blueman-tpl-20.png',
'data/icons/pixmaps/blueman-tpl-30.png',
'data/icons/pixmaps/blueman-tpl-40.png',
'data/icons/pixmaps/blueman-tpl-50.png',
'data/icons/pixmaps/blueman-tpl-60.png',
'data/icons/pixmaps/blueman-tpl-70.png',
'data/icons/pixmaps/blueman-tpl-80.png',
'data/icons/pixmaps/blueman-tpl-90.png',
'data/icons/pixmaps/blueman-tpl-100.png',
install_dir: join_paths([datadir, package_name, 'pixmaps'])
)
icon_makefiles = [
'Makefile.am',
'128x128/apps/Makefile.am',
'128x128/status/Makefile.am',
'128x128/Makefile.am',
'16x16/actions/Makefile.am',
'16x16/apps/Makefile.am',
'16x16/devices/Makefile.am',
'16x16/status/Makefile.am',
'16x16/Makefile.am',
'192x192/apps/Makefile.am',
'192x192/status/Makefile.am',
'192x192/Makefile.am',
'22x22/apps/Makefile.am',
'22x22/status/Makefile.am',
'22x22/Makefile.am',
'24x24/actions/Makefile.am',
'24x24/apps/Makefile.am',
'24x24/status/Makefile.am',
'24x24/Makefile.am',
'256x256/apps/Makefile.am',
'256x256/status/Makefile.am',
'256x256/Makefile.am',
'32x32/actions/Makefile.am',
'32x32/apps/Makefile.am',
'32x32/status/Makefile.am',
'32x32/Makefile.am',
'48x48/actions/Makefile.am',
'48x48/apps/Makefile.am',
'48x48/status/Makefile.am',
'48x48/Makefile.am',
'64x64/apps/Makefile.am',
'64x64/status/Makefile.am',
'64x64/Makefile.am',
'72x72/apps/Makefile.am',
'72x72/status/Makefile.am',
'72x72/Makefile.am',
'96x96/apps/Makefile.am',
'96x96/status/Makefile.am',
'96x96/Makefile.am',
'scalable/actions/Makefile.am',
'scalable/apps/Makefile.am',
'scalable/devices/Makefile.am',
'scalable/status/Makefile.am',
'scalable/Makefile.am'
]
install_subdir(
'data/icons/hicolor',
install_dir: join_paths([datadir, 'icons']),
exclude_files: icon_makefiles
)
# GtkBuilder UI files
install_subdir(
'data/ui',
install_dir: pkgdatadir,
exclude_files: ['Makefile.am']
)
# Gsettings
install_data('data/org.blueman.gschema.xml', install_dir: schemadir)
# Merge translation into policy file
i18n.merge_file(
input: 'data/configs/org.blueman.policy.in',
output: 'org.blueman.policy',
type: 'xml',
po_dir: 'po',
data_dirs: 'data/configs',
install: true,
install_dir: join_paths(polkitdir, 'actions'),
)
# Polkit rules file
install_data('data/configs/blueman.rules', install_dir: join_paths(polkitdir, 'rules.d'), install_mode: 'rw-r--r--')
# Merge translations into desktop files
i18n.merge_file(
input: 'data/blueman.desktop.in',
output: 'blueman.desktop',
type: 'desktop',
po_dir: 'po',
install: true,
install_dir: join_paths([get_option('sysconfdir'), 'xdg', 'autostart']),
)
i18n.merge_file(
input: 'data/blueman-adapters.desktop.in',
output: 'blueman-adapters.desktop',
type: 'desktop',
po_dir: 'po',
install: true,
install_dir: join_paths([datadir,'applications']),
)
i18n.merge_file(
input: 'data/blueman-manager.desktop.in',
output: 'blueman-manager.desktop',
type: 'desktop',
po_dir: 'po',
install: true,
install_dir: join_paths([datadir,'applications']),
)
i18n.merge_file(
input: 'data/thunar-sendto-blueman.desktop.in',
output: 'thunar-sendto-blueman.desktop',
type: 'desktop',
po_dir: 'po',
install: get_option('thunar-sendto'),
install_dir: join_paths([datadir,'Thunar', 'sendto']),
)
# install manpages
install_man(
'data/man/blueman-adapters.1',
'data/man/blueman-applet.1',
'data/man/blueman-manager.1',
'data/man/blueman-sendto.1',
'data/man/blueman-services.1',
'data/man/blueman-tray.1'
)
# Gather all configurable files
configurable_files = [
['blueman/Constants.py.in',
'Constants.py',
join_paths(pythondir, package_name)],
['data/configs/org.blueman.Applet.service.in',
'org.blueman.Applet.service',
join_paths(dbusdir, 'services')],
['data/configs/org.blueman.Manager.service.in',
'org.blueman.Manager.service',
join_paths(dbusdir, 'services')],
['data/configs/org.blueman.Mechanism.service.in',
'org.blueman.Mechanism.service',
join_paths(dbusdir, 'system-services')]
]
systemd_user_dir = get_option('systemduserunitdir')
if systemd_user_dir != ''
systemd_user_path = systemd_user_dir
else
systemd_user_path = join_paths(systemd_base_path, 'user')
endif
configurable_files += [['data/configs/blueman-applet.service.in',
'blueman-applet.service',
systemd_user_path],
['data/configs/blueman-manager.service.in',
'blueman-manager.service',
systemd_user_path]]
systemd_system_dir = get_option('systemdsystemunitdir')
if systemd_system_dir != ''
systemd_system_path = systemd_system_dir
else
systemd_system_path = join_paths(systemd_base_path, 'system',)
endif
configurable_files += [['data/configs/blueman-mechanism.service.in',
'blueman-mechanism.service',
systemd_system_path]]
# Generate all configurable files based on conf_data
foreach conf_file: configurable_files
configure_file(
input: conf_file[0],
output: conf_file[1],
install_dir: conf_file[2],
configuration: conf_data
)
endforeach
install_data(
'data/configs/org.blueman.Mechanism.conf',
install_dir: join_paths(dbusdir, 'system.d')
)
# Install blueman subdir and exclude files based on configure options
blueman_makefiles = [
'Makefile.am',
'bluez/obex/Makefile.am',
'bluez/Makefile.am',
'config/Makefile.am',
'gui/applet/Makefile.am',
'gui/manager/Makefile.am',
'gui/Makefile.am',
'main/applet/Makefile.am',
'main/indicators/Makefile.am',
'main/Makefile.am',
'plugins/applet/Makefile.am',
'plugins/manager/Makefile.am',
'plugins/mechanism/Makefile.am',
'plugins/services/Makefile.am',
'plugins/Makefile.am',
'services/meta/Makefile.am',
'services/Makefile.am'
]
blueman_exclude_files = ['Constants.py.in'] + blueman_makefiles
pulseaudio = get_option('pulseaudio')
if not pulseaudio
blueman_exclude_files += 'plugins/manager/PulseAudioProfile.py'
blueman_exclude_files += 'plugins/applet/PulseAudioProfile.py'
endif
install_subdir(
'blueman',
install_dir: pythondir,
exclude_files: blueman_exclude_files
)
# Install nautilus (plus clones) python plugins for blueman-sendto
foreach name: get_option('sendto-plugins')
dep = dependency('@0@-python'.format(name.to_lower()), required: false)
if not dep.found()
warning('@0@-python not found which is required for @0@_blueman_sendto to work.'.format(name.to_lower()))
endif
sendto_conf = configuration_data()
sendto_conf.set('FILEMANAGER', name)
configure_file(
input: 'sendto/blueman_sendto.py.in',
output: '@0@_blueman_sendto.py'.format(name.to_lower()),
configuration: sendto_conf,
install_dir: join_paths(prefix, datadir, '@0@-python'.format(name.to_lower()), 'extensions')
)
endforeach
# Add data as custom_target does not work in subdirectory
subdir('data')
subdir('po')
subdir('module')