Skip to content
Snippets Groups Projects
Commit 27b355c7 authored by Olivier Fourdan's avatar Olivier Fourdan :tools:
Browse files

wayland-info: Add meson build and man page

parent 31349f35
No related branches found
No related tags found
No related merge requests found
COPYING 0 → 100644
Copyright © 2012 Philipp Brüschweiler
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
---
The above is the version of the MIT "Expat" License used by X.org:
http://cgit.freedesktop.org/xorg/xserver/tree/COPYING
wayland-info
============
Because `weston-info` is a generally useful tool, even outside of weston,
and gives interesting information on any Wayland compositor, this is basically
a standalone version of `weston-info` as found in
[weston](https://gitlab.freedesktop.org/wayland/weston/) repository.
Building
========
Just like `weston` itself, `wayland-info` is built using
[Meson](https://mesonbuild.com/) and depends
on [Wayland](https://gitlab.freedesktop.org/wayland/wayland) and
[wayland-protocols](https://cgit.freedesktop.org/wayland/wayland-protocols).
$ git clone https://gitlab.freedesktop.org/ofourdan/wayland-utils.git
$ cd wayland-info
$ meson build/ --prefix=...
$ ninja -C build/ install
$ cd ..
Running
=======
`wayland-info` does not accepts any command line option.
$ wayland-info
Credit
======
The code base of `wayland-info` is identical to `weston-info` and therefore
all credits for `wayland-info` go to the author and contributors of `weston-info`.
man_conf = configuration_data()
man_conf.set('version', meson.project_version())
configure_file(
input: 'wayland-info.man',
output: 'wayland-info.1',
install_dir: join_paths(dir_man, 'man1'),
configuration: man_conf
)
.TH WAYLAND-INFO 1 "2020-07-08" "@version@"
.SH NAME
wayland-info \- display information utility for Wayland.
.SH SYNOPSIS
.B wayland-info
.
.\" ***************************************************************
.SH DESCRIPTION
.B wayland-info
is a utility for displaying information about the Wayland protocols supported
by a Wayland compositor.
It is used to check which Wayland protocols and versions are advertised
by the Wayland compositor.
.B wayland-info
also provides additional information for a subset of Wayland protocols it
knows about, namely Linux DMABUF, presentation time, tablet and XDG output
protocols.
.
.\" ***************************************************************
.SH OPTIONS
.
.B wayland-info
does not accept any command line option.
.
.\" ***************************************************************
.SH ENVIRONMENT
.
.TP
.B WAYLAND_DISPLAY
The name of the display (socket) of an already running Wayland server, without
the path. The directory path is always taken from
.BR XDG_RUNTIME_DIR .
If
.B WAYLAND_DISPLAY
is not set, the socket name is "wayland-0".
.
.\" ***************************************************************
.SH "SEE ALSO"
.BR weston (1)
project('wayland-info',
'c',
version: '0.0.1',
default_options: [
'warning_level=3',
'c_std=gnu99',
'b_lundef=true',
],
meson_version: '>= 0.47',
license: 'MIT/Expat',
)
dir_prefix = get_option('prefix')
dir_bin = join_paths(dir_prefix, get_option('bindir'))
dir_man = join_paths(dir_prefix, get_option('mandir'))
dir_inc = include_directories('.')
pkgconfig = import('pkgconfig')
cc = meson.get_compiler('c')
dep_wayland_server = dependency('wayland-server', version: '>= 1.17.0')
dep_wayland_client = dependency('wayland-client', version: '>= 1.17.0')
config_h = configuration_data()
config_h.set('_GNU_SOURCE', '1')
config_h.set('_ALL_SOURCE', '1')
configure_file(output: 'config.h', configuration: config_h)
subdir('wayland-info')
subdir('man')
dep_scanner = dependency('wayland-scanner', native: true)
prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner'))
dep_wp = dependency('wayland-protocols', version: '>= 1.18')
dir_wp_base = dep_wp.get_pkgconfig_variable('pkgdatadir')
generated_protocols = [
[ 'linux-dmabuf', 'v1' ],
[ 'presentation-time', 'stable' ],
[ 'tablet', 'v2' ],
[ 'xdg-output', 'v1' ],
]
foreach proto: generated_protocols
proto_name = proto[0]
if proto[1] == 'stable'
base_file = proto_name
xml_path = '@0@/stable/@1@/@2@.xml'.format(dir_wp_base, proto_name, base_file)
else
base_file = '@0@-unstable-@1@'.format(proto_name, proto[1])
xml_path = '@0@/unstable/@1@/@2@.xml'.format(dir_wp_base, proto_name, base_file)
endif
foreach output_type: [ 'client-header', 'private-code' ]
if output_type == 'client-header'
output_file = '@0@-client-protocol.h'.format(base_file)
else
output_file = '@0@-protocol.c'.format(base_file)
if dep_scanner.version().version_compare('< 1.14.91')
output_type = 'code'
endif
endif
var_name = output_file.underscorify()
target = custom_target(
'@0@ @1@'.format(base_file, output_type),
command: [ prog_scanner, output_type, '@INPUT@', '@OUTPUT@' ],
input: xml_path,
output: output_file,
)
set_variable(var_name, target)
endforeach
endforeach
wayland_info_src = [
'wayland-info.c',
linux_dmabuf_unstable_v1_client_protocol_h,
linux_dmabuf_unstable_v1_protocol_c,
presentation_time_client_protocol_h,
presentation_time_protocol_c,
tablet_unstable_v2_client_protocol_h,
tablet_unstable_v2_protocol_c,
xdg_output_unstable_v1_client_protocol_h,
xdg_output_unstable_v1_protocol_c]
executable('wayland-info',
wayland_info_src,
include_directories: dir_inc,
dependencies: dep_wayland_client,
install : true)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment