xwayland: override Meson dependency

This allows developers to setup Xwayland as a subproject of a
Wayland compositor, and have it correctly pick up the features
advertised in the dependency variables.

Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
Simon Ser 2023-01-27 16:10:26 +01:00 committed by Olivier Fourdan
parent c06ba33280
commit 098fcedf57

View File

@ -159,6 +159,22 @@ xwayland_server = executable(
install_dir: xwayland_path install_dir: xwayland_path
) )
xwayland_vars = [
'have_glamor=' + build_glamor.to_string(),
'have_eglstream=' + build_eglstream.to_string(),
'have_initfd=true',
'have_listenfd=true',
'have_verbose=true',
'have_terminate_delay=true',
'have_no_touch_pointer_emulation=true',
'have_force_xrandr_emulation=true',
'have_geometry=true',
'have_fullscreen=true',
'have_host_grab=true',
'have_decorate=' + have_libdecor.to_string(),
'have_byteswappedclients=true',
]
pkgconfig = import('pkgconfig') pkgconfig = import('pkgconfig')
pkgconfig.generate( pkgconfig.generate(
@ -168,20 +184,7 @@ pkgconfig.generate(
variables: [ variables: [
'exec_prefix=${prefix}', 'exec_prefix=${prefix}',
'xwayland=' + xwayland_path + '/Xwayland', 'xwayland=' + xwayland_path + '/Xwayland',
'have_glamor=' + build_glamor.to_string(), ] + xwayland_vars,
'have_eglstream=' + build_eglstream.to_string(),
'have_initfd=true',
'have_listenfd=true',
'have_verbose=true',
'have_terminate_delay=true',
'have_no_touch_pointer_emulation=true',
'have_force_xrandr_emulation=true',
'have_geometry=true',
'have_fullscreen=true',
'have_host_grab=true',
'have_decorate=' + have_libdecor.to_string(),
'have_byteswappedclients=true',
],
) )
xwayland_manpage = configure_file( xwayland_manpage = configure_file(
@ -194,3 +197,13 @@ install_man(xwayland_manpage)
datadir = join_paths(get_option('prefix'), get_option('datadir')) datadir = join_paths(get_option('prefix'), get_option('datadir'))
desktopdir = join_paths(datadir, 'applications') desktopdir = join_paths(datadir, 'applications')
install_data('desktop/org.freedesktop.Xwayland.desktop', install_dir : desktopdir) install_data('desktop/org.freedesktop.Xwayland.desktop', install_dir : desktopdir)
if meson.version().version_compare('>= 0.56.0')
meson.override_find_program('Xwayland', xwayland_server)
meson.override_dependency('xwayland', declare_dependency(
variables: [
'xwayland=' + xwayland_server.full_path(),
] + xwayland_vars,
))
endif