2018-12-12 22:29:57 +01:00
|
|
|
project(
|
|
|
|
'xdg-desktop-portal-wlr',
|
|
|
|
'c',
|
2020-05-05 16:18:37 +02:00
|
|
|
version: '0.1.0',
|
2018-12-12 22:29:57 +01:00
|
|
|
license: 'MIT',
|
2020-04-10 10:48:41 +02:00
|
|
|
meson_version: '>=0.47.0',
|
2018-12-12 22:29:57 +01:00
|
|
|
default_options: [
|
|
|
|
'c_std=c11',
|
|
|
|
'warning_level=2',
|
|
|
|
'werror=true',
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2020-03-13 17:53:50 +01:00
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
|
|
|
add_project_arguments(cc.get_supported_arguments([
|
|
|
|
'-Wno-missing-braces',
|
|
|
|
'-Wno-missing-field-initializers',
|
|
|
|
'-Wno-unused-parameter',
|
2020-04-22 21:51:12 +02:00
|
|
|
'-D_POSIX_C_SOURCE=200809L',
|
2020-03-13 17:53:50 +01:00
|
|
|
]), language: 'c')
|
2018-12-12 22:29:57 +01:00
|
|
|
|
2020-01-24 23:31:01 +01:00
|
|
|
inc = include_directories('include')
|
2018-12-12 22:29:57 +01:00
|
|
|
|
2020-01-24 23:31:01 +01:00
|
|
|
rt = cc.find_library('rt')
|
2020-09-19 01:10:37 +02:00
|
|
|
pipewire = dependency('libpipewire-0.3', version: '>= 0.3.2')
|
2018-12-12 22:29:57 +01:00
|
|
|
wayland_client = dependency('wayland-client')
|
|
|
|
wayland_protos = dependency('wayland-protocols', version: '>=1.14')
|
2020-03-06 20:41:53 +01:00
|
|
|
|
|
|
|
logind = dependency('libsystemd', required: false)
|
|
|
|
if logind.found()
|
|
|
|
add_project_arguments('-DHAVE_SYSTEMD=1', language: 'c')
|
|
|
|
else
|
|
|
|
logind = dependency('libelogind')
|
|
|
|
add_project_arguments('-DHAVE_ELOGIND=1', language: 'c')
|
|
|
|
endif
|
2018-12-12 22:29:57 +01:00
|
|
|
|
2020-01-24 23:31:01 +01:00
|
|
|
subdir('protocols')
|
2018-12-12 22:29:57 +01:00
|
|
|
|
|
|
|
executable(
|
|
|
|
'xdg-desktop-portal-wlr',
|
|
|
|
files([
|
2020-01-24 23:31:01 +01:00
|
|
|
'src/core/main.c',
|
2020-02-20 20:59:46 +01:00
|
|
|
'src/core/logger.c',
|
2020-01-24 23:31:01 +01:00
|
|
|
'src/core/request.c',
|
|
|
|
'src/core/session.c',
|
|
|
|
'src/screenshot/screenshot.c',
|
|
|
|
'src/screencast/screencast.c',
|
|
|
|
'src/screencast/screencast_common.c',
|
|
|
|
'src/screencast/wlr_screencast.c',
|
|
|
|
'src/screencast/pipewire_screencast.c',
|
2018-12-12 22:29:57 +01:00
|
|
|
]),
|
|
|
|
dependencies: [
|
|
|
|
wayland_client,
|
2020-01-24 23:31:01 +01:00
|
|
|
wlr_protos,
|
2020-03-06 20:41:53 +01:00
|
|
|
logind,
|
2020-01-24 23:31:01 +01:00
|
|
|
pipewire,
|
2020-03-23 16:49:36 +01:00
|
|
|
rt,
|
2018-12-12 22:29:57 +01:00
|
|
|
],
|
2020-01-24 23:31:01 +01:00
|
|
|
include_directories: [inc],
|
2018-12-12 22:29:57 +01:00
|
|
|
install: true,
|
2020-04-10 10:48:41 +02:00
|
|
|
install_dir: get_option('libexecdir'),
|
|
|
|
)
|
|
|
|
|
|
|
|
conf_data = configuration_data()
|
|
|
|
conf_data.set('libexecdir',
|
|
|
|
join_paths(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_pkgconfig_variable('systemduserunitdir',
|
|
|
|
define_variable: ['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: join_paths(get_option('datadir'), 'dbus-1', 'services'),
|
2018-12-12 22:29:57 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
install_data(
|
|
|
|
'wlr.portal',
|
|
|
|
install_dir: join_paths(get_option('datadir'), 'xdg-desktop-portal', 'portals'),
|
|
|
|
)
|