-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmeson.build
77 lines (62 loc) · 1.75 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
project(
'xdg-desktop-portal-luminous',
'rust',
version: '0.1.6',
meson_version: '>= 1.1.0',
)
cargo = find_program('cargo', version: '>= 1.80')
find_program('rustc', version: '>= 1.80')
if get_option('debug')
command = [
cargo,
'build',
'&&',
'cp',
meson.global_source_root() / 'target' / 'debug' / meson.project_name(),
'@OUTPUT@',
]
else
command = [
cargo,
'build',
'--release', '&&',
'cp',
meson.global_source_root() / 'target' / 'release' / meson.project_name(),
'@OUTPUT@',
]
endif
prefix = get_option('prefix')
xdg_install_dir = prefix / get_option('libexecdir')
portal_dir = prefix / get_option('datadir') / 'xdg-desktop-portal' / 'portals'
dbus1_dir = prefix / get_option('datadir') / 'dbus-1' / 'services'
system_dir = prefix / get_option('libdir') / 'systemd' / 'user'
global_conf = configuration_data()
global_conf.set('xdg_install_dir', xdg_install_dir)
configure_file(
input: 'misc/xdg-desktop-portal-luminous.service.in',
output: 'xdg-desktop-portal-luminous.service',
configuration: global_conf,
)
configure_file(
input: 'misc/org.freedesktop.impl.portal.desktop.luminous.service.in',
output: 'org.freedesktop.impl.portal.desktop.luminous.service',
configuration: global_conf,
)
custom_target(
'xdg-deskop-portal-luminous',
output: 'xdg-desktop-portal-luminous',
build_by_default: true,
install: true,
install_dir: xdg_install_dir,
console: true,
command: command,
)
install_data('misc/luminous.portal', install_dir: portal_dir)
install_data(
meson.project_build_root() / 'org.freedesktop.impl.portal.desktop.luminous.service',
install_dir: dbus1_dir,
)
install_data(
meson.project_build_root() / 'xdg-desktop-portal-luminous.service',
install_dir: system_dir,
)