-
Notifications
You must be signed in to change notification settings - Fork 61
/
meson.build
143 lines (124 loc) · 3.69 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
project(
'xdg-desktop-portal-wlr',
'c',
version: '0.7.1',
license: 'MIT',
meson_version: '>=0.60.0',
default_options: ['c_std=c11', 'warning_level=2', 'werror=true'],
)
cc = meson.get_compiler('c')
add_project_arguments(cc.get_supported_arguments([
'-Wno-missing-braces',
'-Wno-missing-field-initializers',
'-Wno-unused-parameter',
]), language: 'c')
prefix = get_option('prefix')
sysconfdir = get_option('sysconfdir')
add_project_arguments([
'-D_POSIX_C_SOURCE=200809L',
'-DSYSCONFDIR="@0@"'.format(prefix / sysconfdir),
], language: 'c')
inc = include_directories('include')
rt = cc.find_library('rt')
pipewire = dependency('libpipewire-0.3', version: '>= 0.3.62')
wayland_client = dependency('wayland-client')
wayland_protos = dependency('wayland-protocols', version: '>=1.24')
iniparser = dependency('inih')
gbm = dependency('gbm')
drm = dependency('libdrm')
epoll = dependency('', required: false)
if not cc.has_function('timerfd_create', prefix: '#include <sys/timerfd.h>')
epoll = dependency('epoll-shim')
endif
if get_option('sd-bus-provider') == 'auto'
assert(get_option('auto_features').auto(), 'sd-bus-provider must not be set to auto since auto_features != auto')
sdbus = dependency(['libsystemd', 'libelogind', 'basu'])
else
sdbus = dependency(get_option('sd-bus-provider'))
endif
add_project_arguments('-DHAVE_' + sdbus.name().to_upper() + '=1', language: 'c')
subdir('protocols')
xdpw_files = files(
'src/core/main.c',
'src/core/logger.c',
'src/core/config.c',
'src/core/request.c',
'src/core/session.c',
'src/core/timer.c',
'src/core/timespec_util.c',
'src/screenshot/screenshot.c',
'src/screencast/screencast.c',
'src/screencast/screencast_common.c',
'src/screencast/wlr_screencast.c',
'src/screencast/wlr_screencopy.c',
'src/screencast/pipewire_screencast.c',
'src/screencast/fps_limit.c',
)
executable(
'xdg-desktop-portal-wlr',
[xdpw_files, wl_proto_files],
dependencies: [
wayland_client,
sdbus,
pipewire,
rt,
iniparser,
gbm,
drm,
epoll,
],
include_directories: [inc],
install: true,
install_dir: get_option('libexecdir'),
)
conf_data = configuration_data()
conf_data.set('libexecdir', get_option('prefix') / get_option('libexecdir'))
conf_data.set('systemd_service', '')
systemd = dependency('systemd', required: get_option('systemd'))
if systemd.found()
systemd_service_file = 'xdg-desktop-portal-wlr.service'
user_unit_dir = systemd.get_variable(pkgconfig: 'systemduserunitdir',
pkgconfig_define: ['prefix', get_option('prefix')])
conf_data.set('systemd_service', 'SystemdService=' + systemd_service_file)
configure_file(
configuration: conf_data,
input: 'contrib/systemd/' + systemd_service_file + '.in',
output: '@BASENAME@',
install_dir: user_unit_dir,
)
endif
configure_file(
configuration: conf_data,
input: 'org.freedesktop.impl.portal.desktop.wlr.service.in',
output: '@BASENAME@',
install_dir: get_option('datadir') / 'dbus-1' / 'services',
)
install_data(
'wlr.portal',
install_dir: get_option('datadir') / 'xdg-desktop-portal' / 'portals',
)
scdoc = dependency('scdoc', required: get_option('man-pages'), version: '>= 1.9.7', native: true)
if scdoc.found()
scdoc_prog = find_program(scdoc.get_variable(pkgconfig: 'scdoc'), native: true)
man_pages = ['xdg-desktop-portal-wlr.5.scd']
foreach src : man_pages
topic = src.split('.')[0]
section = src.split('.')[1]
output = topic + '.' + section
custom_target(
output,
input: files(src),
output: output,
command: scdoc_prog,
feed: true,
capture: true,
install: true,
install_dir: get_option('mandir') / ('man' + section),
)
endforeach
endif
summary({
'sd-bus provider': sdbus.name(),
'systemd service': systemd.found(),
'Man pages': scdoc.found(),
}, bool_yn: true)