2019-01-12 11:10:46 +01:00
|
|
|
project('libinput', 'c',
|
2024-08-19 09:26:17 +10:00
|
|
|
version : '1.26.2',
|
2017-06-26 13:51:44 +10:00
|
|
|
license : 'MIT/Expat',
|
2016-11-30 17:59:17 +10:00
|
|
|
default_options : [ 'c_std=gnu99', 'warning_level=2' ],
|
2023-09-02 17:57:29 +02:00
|
|
|
meson_version : '>= 0.56.0')
|
2016-11-30 17:59:17 +10:00
|
|
|
|
|
|
|
|
libinput_version = meson.project_version().split('.')
|
|
|
|
|
|
2021-08-03 19:53:36 +02:00
|
|
|
dir_data = get_option('prefix') / get_option('datadir') / 'libinput'
|
|
|
|
|
dir_etc = get_option('prefix') / get_option('sysconfdir')
|
|
|
|
|
dir_overrides = get_option('prefix') / get_option('sysconfdir') / 'libinput'
|
|
|
|
|
dir_libexec = get_option('prefix') / get_option('libexecdir') / 'libinput'
|
|
|
|
|
dir_lib = get_option('prefix') / get_option('libdir')
|
|
|
|
|
dir_man1 = get_option('prefix') / get_option('mandir') / 'man1'
|
|
|
|
|
dir_system_udev = get_option('prefix') / 'lib' / 'udev'
|
|
|
|
|
dir_src_quirks = meson.current_source_dir() / 'quirks'
|
|
|
|
|
dir_src_test = meson.current_source_dir() / 'test'
|
|
|
|
|
dir_src = meson.current_source_dir() / 'src'
|
2022-03-28 10:21:58 +10:00
|
|
|
dir_gitlab_ci = meson.current_source_dir() / '.gitlab-ci'
|
2018-07-11 13:08:51 +10:00
|
|
|
|
|
|
|
|
dir_udev = get_option('udev-dir')
|
|
|
|
|
if dir_udev == ''
|
|
|
|
|
dir_udev = dir_system_udev
|
|
|
|
|
endif
|
|
|
|
|
dir_udev_callouts = dir_udev
|
2021-08-03 19:53:36 +02:00
|
|
|
dir_udev_rules = dir_udev / 'rules.d'
|
2018-07-11 13:08:51 +10:00
|
|
|
|
2021-02-18 09:47:14 +10:00
|
|
|
# Collection of man pages, we'll append to that
|
|
|
|
|
src_man = files()
|
2018-07-11 13:08:51 +10:00
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
# We use libtool-version numbers because it's easier to understand.
|
|
|
|
|
# Before making a release, the libinput_so_*
|
|
|
|
|
# numbers should be modified. The components are of the form C:R:A.
|
|
|
|
|
# a) If binary compatibility has been broken (eg removed or changed interfaces)
|
|
|
|
|
# change to C+1:0:0.
|
|
|
|
|
# b) If interfaces have been changed or added, but binary compatibility has
|
|
|
|
|
# been preserved, change to C+1:0:A+1
|
|
|
|
|
# c) If the interface is the same as the previous version, change to C:R+1:A
|
2017-06-15 18:01:13 +10:00
|
|
|
libinput_lt_c=23
|
|
|
|
|
libinput_lt_r=0
|
|
|
|
|
libinput_lt_a=13
|
2016-11-30 17:59:17 +10:00
|
|
|
|
|
|
|
|
# convert to soname
|
|
|
|
|
libinput_so_version = '@0@.@1@.@2@'.format((libinput_lt_c - libinput_lt_a),
|
|
|
|
|
libinput_lt_a, libinput_lt_r)
|
|
|
|
|
|
|
|
|
|
# Compiler setup
|
|
|
|
|
cc = meson.get_compiler('c')
|
2020-09-09 11:42:17 +10:00
|
|
|
cflags = [
|
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
|
'-Wmissing-prototypes',
|
2020-09-09 11:53:12 +10:00
|
|
|
'-Wstrict-prototypes',
|
|
|
|
|
'-Wundef',
|
|
|
|
|
'-Wlogical-op',
|
|
|
|
|
'-Wpointer-arith',
|
|
|
|
|
'-Wuninitialized',
|
|
|
|
|
'-Winit-self',
|
|
|
|
|
'-Wstrict-prototypes',
|
|
|
|
|
'-Wimplicit-fallthrough',
|
|
|
|
|
'-Wredundant-decls',
|
|
|
|
|
'-Wincompatible-pointer-types',
|
|
|
|
|
'-Wformat=2',
|
2021-07-22 15:16:56 +10:00
|
|
|
'-Wno-missing-field-initializers',
|
2020-09-09 11:53:12 +10:00
|
|
|
'-Wmissing-declarations',
|
2020-09-09 11:42:17 +10:00
|
|
|
|
|
|
|
|
'-fvisibility=hidden',
|
|
|
|
|
]
|
2020-09-09 11:53:12 +10:00
|
|
|
add_project_arguments(cc.get_supported_arguments(cflags), language : 'c')
|
2016-11-30 17:59:17 +10:00
|
|
|
|
2018-07-11 13:08:51 +10:00
|
|
|
# config.h
|
2016-11-30 17:59:17 +10:00
|
|
|
config_h = configuration_data()
|
2019-10-17 13:39:23 +10:00
|
|
|
|
|
|
|
|
doc_url_base = 'https://wayland.freedesktop.org/libinput/doc'
|
|
|
|
|
if libinput_version[2].to_int() >= 90
|
2020-09-09 11:17:12 +10:00
|
|
|
doc_url = '@0@/latest'.format(doc_url_base)
|
2019-10-17 13:39:23 +10:00
|
|
|
else
|
2020-09-09 11:17:12 +10:00
|
|
|
doc_url = '@0@/@1@'.format(doc_url_base, meson.project_version())
|
2019-10-17 13:39:23 +10:00
|
|
|
endif
|
|
|
|
|
config_h.set_quoted('HTTP_DOC_LINK', doc_url)
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
config_h.set('_GNU_SOURCE', '1')
|
2018-06-27 14:24:54 +10:00
|
|
|
if get_option('buildtype') == 'debug' or get_option('buildtype') == 'debugoptimized'
|
2019-10-07 01:04:21 -06:00
|
|
|
config_h.set_quoted('MESON_BUILD_ROOT', meson.current_build_dir())
|
2018-06-27 14:24:54 +10:00
|
|
|
else
|
|
|
|
|
config_h.set_quoted('MESON_BUILD_ROOT', '')
|
|
|
|
|
endif
|
2016-11-30 17:59:17 +10:00
|
|
|
|
|
|
|
|
prefix = '''#define _GNU_SOURCE 1
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
'''
|
|
|
|
|
if cc.get_define('static_assert', prefix : prefix) == ''
|
|
|
|
|
config_h.set('static_assert(...)', '/* */')
|
|
|
|
|
endif
|
|
|
|
|
|
2018-05-11 14:09:40 +10:00
|
|
|
# Coverity breaks because it doesn't define _Float128 correctly, you'll end
|
|
|
|
|
# up with a bunch of messages in the form:
|
|
|
|
|
# "/usr/include/stdlib.h", line 133: error #20: identifier "_Float128" is
|
|
|
|
|
# undefined
|
|
|
|
|
# extern _Float128 strtof128 (const char *__restrict __nptr,
|
|
|
|
|
# ^
|
|
|
|
|
# We don't use float128 ourselves, it gets pulled in from math.h or
|
|
|
|
|
# something, so let's just define it as uint128 and move on.
|
|
|
|
|
# Unfortunately we can't detect the coverity build at meson configure
|
|
|
|
|
# time, we only know it fails at runtime. So make this an option instead, to
|
|
|
|
|
# be removed when coverity fixes this again.
|
|
|
|
|
if get_option('coverity')
|
|
|
|
|
config_h.set('_Float128', '__uint128_t')
|
2018-06-20 10:13:47 +10:00
|
|
|
config_h.set('_Float32', 'int')
|
|
|
|
|
config_h.set('_Float32x', 'int')
|
|
|
|
|
config_h.set('_Float64', 'long')
|
|
|
|
|
config_h.set('_Float64x', 'long')
|
2018-05-11 14:09:40 +10:00
|
|
|
endif
|
|
|
|
|
|
2018-07-10 13:49:26 +03:00
|
|
|
if cc.has_header_symbol('dirent.h', 'versionsort', prefix : prefix)
|
|
|
|
|
config_h.set('HAVE_VERSIONSORT', '1')
|
|
|
|
|
endif
|
|
|
|
|
|
2018-07-10 14:00:11 +03:00
|
|
|
if not cc.has_header_symbol('errno.h', 'program_invocation_short_name', prefix : prefix)
|
|
|
|
|
if cc.has_header_symbol('stdlib.h', 'getprogname')
|
|
|
|
|
config_h.set('program_invocation_short_name', 'getprogname()')
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
2018-07-10 13:56:18 +03:00
|
|
|
if cc.has_header('xlocale.h')
|
|
|
|
|
config_h.set('HAVE_XLOCALE_H', '1')
|
|
|
|
|
endif
|
|
|
|
|
|
2019-02-05 10:04:56 +10:00
|
|
|
code = '''
|
|
|
|
|
#include <locale.h>
|
|
|
|
|
void main(void) { newlocale(LC_NUMERIC_MASK, "C", (locale_t)0); }
|
|
|
|
|
'''
|
|
|
|
|
if cc.links(code, name : 'locale.h')
|
|
|
|
|
config_h.set('HAVE_LOCALE_H', '1')
|
|
|
|
|
endif
|
|
|
|
|
|
2018-07-10 14:01:54 +03:00
|
|
|
if not cc.has_header_symbol('sys/ptrace.h', 'PTRACE_ATTACH', prefix : prefix)
|
|
|
|
|
config_h.set('PTRACE_ATTACH', 'PT_ATTACH')
|
|
|
|
|
config_h.set('PTRACE_CONT', 'PT_CONTINUE')
|
|
|
|
|
config_h.set('PTRACE_DETACH', 'PT_DETACH')
|
|
|
|
|
endif
|
|
|
|
|
|
2022-05-06 10:51:33 +10:00
|
|
|
config_h.set10('HAVE_INSTALLED_TESTS', get_option('install-tests'))
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
# Dependencies
|
|
|
|
|
pkgconfig = import('pkgconfig')
|
|
|
|
|
dep_udev = dependency('libudev')
|
2017-06-26 13:51:44 +10:00
|
|
|
dep_mtdev = dependency('mtdev', version : '>= 1.1.0')
|
2018-12-11 12:37:40 +10:00
|
|
|
dep_libevdev = dependency('libevdev')
|
2020-10-23 10:38:14 +10:00
|
|
|
config_h.set10('HAVE_LIBEVDEV_DISABLE_PROPERTY',
|
|
|
|
|
dep_libevdev.version().version_compare('>= 1.9.902'))
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
dep_lm = cc.find_library('m', required : false)
|
|
|
|
|
dep_rt = cc.find_library('rt', required : false)
|
|
|
|
|
|
2017-08-15 15:42:48 +01:00
|
|
|
# Include directories
|
|
|
|
|
includes_include = include_directories('include')
|
|
|
|
|
includes_src = include_directories('src')
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
############ libwacom configuration ############
|
|
|
|
|
|
|
|
|
|
have_libwacom = get_option('libwacom')
|
|
|
|
|
config_h.set10('HAVE_LIBWACOM', have_libwacom)
|
|
|
|
|
if have_libwacom
|
2020-06-18 14:32:56 +10:00
|
|
|
dep_libwacom = dependency('libwacom', version : '>= 0.27')
|
2017-07-05 09:30:59 +10:00
|
|
|
else
|
|
|
|
|
dep_libwacom = declare_dependency()
|
2016-11-30 17:59:17 +10:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
############ udev bits ############
|
|
|
|
|
|
|
|
|
|
executable('libinput-device-group',
|
|
|
|
|
'udev/libinput-device-group.c',
|
|
|
|
|
dependencies : [dep_udev, dep_libwacom],
|
2017-08-15 15:42:48 +01:00
|
|
|
include_directories : [includes_src, includes_include],
|
2016-11-30 17:59:17 +10:00
|
|
|
install : true,
|
2018-07-11 13:08:51 +10:00
|
|
|
install_dir : dir_udev_callouts)
|
2019-09-04 15:09:13 +10:00
|
|
|
executable('libinput-fuzz-extract',
|
|
|
|
|
'udev/libinput-fuzz-extract.c',
|
|
|
|
|
'src/util-strings.c',
|
|
|
|
|
'src/util-prop-parsers.c',
|
|
|
|
|
dependencies : [dep_udev, dep_libevdev, dep_lm],
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : dir_udev_callouts)
|
|
|
|
|
executable('libinput-fuzz-to-zero',
|
|
|
|
|
'udev/libinput-fuzz-to-zero.c',
|
2018-03-05 13:17:43 +10:00
|
|
|
dependencies : [dep_udev, dep_libevdev],
|
2017-08-15 15:42:48 +01:00
|
|
|
include_directories : [includes_src, includes_include],
|
2016-11-30 17:59:17 +10:00
|
|
|
install : true,
|
2018-07-11 13:08:51 +10:00
|
|
|
install_dir : dir_udev_callouts)
|
2016-11-30 17:59:17 +10:00
|
|
|
|
|
|
|
|
udev_rules_config = configuration_data()
|
|
|
|
|
udev_rules_config.set('UDEV_TEST_PATH', '')
|
|
|
|
|
configure_file(input : 'udev/80-libinput-device-groups.rules.in',
|
|
|
|
|
output : '80-libinput-device-groups.rules',
|
2018-07-11 13:08:51 +10:00
|
|
|
install_dir : dir_udev_rules,
|
2016-11-30 17:59:17 +10:00
|
|
|
configuration : udev_rules_config)
|
2019-06-26 11:29:31 +10:00
|
|
|
configure_file(input : 'udev/90-libinput-fuzz-override.rules.in',
|
|
|
|
|
output : '90-libinput-fuzz-override.rules',
|
|
|
|
|
install_dir : dir_udev_rules,
|
|
|
|
|
configuration : udev_rules_config)
|
2016-11-30 17:59:17 +10:00
|
|
|
|
|
|
|
|
litest_udev_rules_config = configuration_data()
|
2019-10-07 01:04:21 -06:00
|
|
|
litest_udev_rules_config.set('UDEV_TEST_PATH', meson.current_build_dir() + '/')
|
2016-11-30 17:59:17 +10:00
|
|
|
litest_groups_rules_file = configure_file(input : 'udev/80-libinput-device-groups.rules.in',
|
|
|
|
|
output : '80-libinput-device-groups-litest.rules',
|
|
|
|
|
configuration : litest_udev_rules_config)
|
2019-06-26 11:29:31 +10:00
|
|
|
litest_fuzz_override_file = configure_file(input : 'udev/90-libinput-fuzz-override.rules.in',
|
|
|
|
|
output : '90-libinput-fuzz-override-litest.rules',
|
|
|
|
|
configuration : litest_udev_rules_config)
|
2016-11-30 17:59:17 +10:00
|
|
|
|
2019-07-01 12:34:09 +10:00
|
|
|
############ Check for leftover udev rules ########
|
|
|
|
|
|
|
|
|
|
# This test should be defined first so we don't waste time testing anything
|
|
|
|
|
# else if we're about to fail anyway. ninja test will execute tests in the
|
|
|
|
|
# order of them defined in meson.build
|
|
|
|
|
|
|
|
|
|
if get_option('tests')
|
|
|
|
|
test('leftover-rules',
|
|
|
|
|
find_program('test/check-leftover-udev-rules.sh'),
|
|
|
|
|
is_parallel : false,
|
|
|
|
|
suite : ['all'])
|
|
|
|
|
endif
|
|
|
|
|
|
2018-07-16 00:41:05 +03:00
|
|
|
############ libepoll-shim (BSD) ############
|
|
|
|
|
|
|
|
|
|
if cc.has_header_symbol('sys/epoll.h', 'epoll_create1', prefix : prefix)
|
|
|
|
|
# epoll is built-in (Linux, illumos)
|
|
|
|
|
dep_libepoll = declare_dependency()
|
|
|
|
|
else
|
|
|
|
|
# epoll is implemented in userspace by libepoll-shim (FreeBSD)
|
|
|
|
|
dir_libepoll = get_option('epoll-dir')
|
|
|
|
|
if dir_libepoll == ''
|
|
|
|
|
dir_libepoll = get_option('prefix')
|
|
|
|
|
endif
|
2021-08-03 19:53:36 +02:00
|
|
|
includes_epoll = include_directories(dir_libepoll / 'include' / 'libepoll-shim')
|
|
|
|
|
dep_libepoll = cc.find_library('epoll-shim', dirs : dir_libepoll / 'lib')
|
2018-07-16 00:41:05 +03:00
|
|
|
code = '''
|
|
|
|
|
#include <sys/epoll.h>
|
|
|
|
|
int main(void) { epoll_create1(0); }
|
|
|
|
|
'''
|
|
|
|
|
if not cc.links(code,
|
|
|
|
|
name : 'libepoll-shim check',
|
|
|
|
|
dependencies : [dep_libepoll, dep_rt],
|
|
|
|
|
include_directories : includes_epoll) # note: wants an include_directories object
|
|
|
|
|
error('No built-in epoll or libepoll-shim found.')
|
|
|
|
|
endif
|
|
|
|
|
dep_libepoll = declare_dependency(
|
|
|
|
|
include_directories : includes_epoll,
|
|
|
|
|
dependencies : [dep_libepoll, dep_rt])
|
|
|
|
|
endif
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
############ libinput-util.a ############
|
2019-09-04 15:11:45 +10:00
|
|
|
|
|
|
|
|
# Basic compilation test to make sure the headers include and define all the
|
|
|
|
|
# necessary bits.
|
|
|
|
|
util_headers = [
|
2024-10-21 09:16:04 +10:00
|
|
|
'util-backtrace.h',
|
2019-09-04 15:11:45 +10:00
|
|
|
'util-bits.h',
|
2019-11-23 17:23:56 -08:00
|
|
|
'util-input-event.h',
|
2019-09-04 15:11:45 +10:00
|
|
|
'util-list.h',
|
2024-03-14 12:28:39 +10:00
|
|
|
'util-files.h',
|
2019-09-04 15:11:45 +10:00
|
|
|
'util-macros.h',
|
|
|
|
|
'util-matrix.h',
|
|
|
|
|
'util-prop-parsers.h',
|
|
|
|
|
'util-ratelimit.h',
|
|
|
|
|
'util-strings.h',
|
|
|
|
|
'util-time.h',
|
|
|
|
|
]
|
|
|
|
|
foreach h: util_headers
|
|
|
|
|
c = configuration_data()
|
|
|
|
|
c.set_quoted('FILE', h)
|
|
|
|
|
testfile = configure_file(input : 'test/test-util-includes.c',
|
|
|
|
|
output : 'test-util-includes-@0@.c'.format(h),
|
|
|
|
|
configuration : c)
|
|
|
|
|
executable('test-build-@0@'.format(h),
|
2022-06-16 08:20:54 +10:00
|
|
|
testfile,
|
2019-09-04 15:11:45 +10:00
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
install : false)
|
|
|
|
|
endforeach
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
src_libinput_util = [
|
2019-09-04 15:11:45 +10:00
|
|
|
'src/util-list.c',
|
|
|
|
|
'src/util-ratelimit.c',
|
|
|
|
|
'src/util-strings.c',
|
|
|
|
|
'src/util-prop-parsers.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
]
|
|
|
|
|
libinput_util = static_library('libinput-util',
|
|
|
|
|
src_libinput_util,
|
2019-05-27 18:21:09 +10:00
|
|
|
dependencies : [dep_udev, dep_libevdev, dep_libwacom],
|
2017-08-15 15:42:48 +01:00
|
|
|
include_directories : includes_include)
|
2017-06-26 13:51:44 +10:00
|
|
|
dep_libinput_util = declare_dependency(link_with : libinput_util)
|
2016-11-30 17:59:17 +10:00
|
|
|
|
|
|
|
|
############ libfilter.a ############
|
|
|
|
|
src_libfilter = [
|
|
|
|
|
'src/filter.c',
|
Introduce custom acceleration profile
The custom acceleration profile allow the user to define custom
acceleration functions for each movement type per device, giving
full control over accelerations behavior at different speeds.
This commit introduces 2 movement types which corresponds to the
2 profiles currently in use by libinput.
regular filter is Motion type.
constant filter is Fallback type.
This allows possible expansion of new movement types for the
different devices.
The custom pointer acceleration profile gives the user full control over the
acceleration behavior at different speeds.
The user needs to provide a custom acceleration function f(x) where
the x-axis is the device speed and the y-axis is the pointer speed.
The user should take into account the native device dpi and screen dpi in
order to achieve the desired behavior/feel of the acceleration.
The custom acceleration function is defined using n points which are spaced
uniformly along the x-axis, starting from 0 and continuing in constant steps.
There by the points defining the custom function are:
(0 * step, f[0]), (1 * step, f[1]), ..., ((n-1) * step, f[n-1])
where f is a list of n unitless values defining the acceleration
factor for each velocity.
When a velocity value does not lie exactly on those points, a linear
interpolation of the two closest points will be calculated.
When a velocity value is greater than the max point defined, a linear
extrapolation of the two biggest points will be calculated.
Signed-off-by: Yinon Burgansky <51504-Yinon@users.noreply.gitlab.freedesktop.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-12-13 00:23:59 +02:00
|
|
|
'src/filter-custom.c',
|
2018-04-11 10:57:50 +10:00
|
|
|
'src/filter-flat.c',
|
2018-04-11 11:05:12 +10:00
|
|
|
'src/filter-low-dpi.c',
|
2018-04-11 11:41:16 +10:00
|
|
|
'src/filter-mouse.c',
|
2018-04-10 14:21:26 +10:00
|
|
|
'src/filter-touchpad.c',
|
2020-05-22 13:24:34 -04:00
|
|
|
'src/filter-touchpad-flat.c',
|
2018-04-10 13:08:09 +10:00
|
|
|
'src/filter-touchpad-x230.c',
|
2018-04-10 14:01:58 +10:00
|
|
|
'src/filter-tablet.c',
|
2018-04-10 14:09:31 +10:00
|
|
|
'src/filter-trackpoint.c',
|
2022-09-05 11:33:57 +10:00
|
|
|
'src/filter-trackpoint-flat.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
]
|
2017-12-01 09:27:05 +10:00
|
|
|
libfilter = static_library('filter', src_libfilter,
|
2019-05-27 18:21:09 +10:00
|
|
|
dependencies : [dep_udev, dep_libwacom],
|
2017-12-01 09:27:05 +10:00
|
|
|
include_directories : includes_include)
|
2017-06-26 13:51:44 +10:00
|
|
|
dep_libfilter = declare_dependency(link_with : libfilter)
|
2016-11-30 17:59:17 +10:00
|
|
|
|
Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
############ libquirks.a #############
|
2018-07-11 13:08:51 +10:00
|
|
|
libinput_data_path = dir_data
|
2021-08-03 19:53:36 +02:00
|
|
|
libinput_data_override_path = dir_overrides / 'local-overrides.quirks'
|
2018-07-13 12:57:02 +10:00
|
|
|
config_h.set_quoted('LIBINPUT_QUIRKS_DIR', dir_data)
|
|
|
|
|
config_h.set_quoted('LIBINPUT_QUIRKS_OVERRIDE_FILE', libinput_data_override_path)
|
Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
|
2018-07-13 12:57:02 +10:00
|
|
|
config_h.set_quoted('LIBINPUT_QUIRKS_SRCDIR', dir_src_quirks)
|
2020-06-17 09:43:54 +10:00
|
|
|
install_subdir('quirks',
|
|
|
|
|
exclude_files: ['README.md'],
|
2020-07-01 10:52:10 +10:00
|
|
|
install_dir : dir_data,
|
|
|
|
|
strip_directory : true)
|
Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
|
|
|
|
|
src_libquirks = [
|
|
|
|
|
'src/quirks.c',
|
|
|
|
|
]
|
|
|
|
|
|
2019-05-27 18:21:09 +10:00
|
|
|
deps_libquirks = [dep_udev, dep_libwacom, dep_libinput_util]
|
Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
libquirks = static_library('quirks', src_libquirks,
|
|
|
|
|
dependencies : deps_libquirks,
|
|
|
|
|
include_directories : includes_include)
|
|
|
|
|
dep_libquirks = declare_dependency(link_with : libquirks)
|
|
|
|
|
|
2021-02-03 10:19:20 +10:00
|
|
|
# Create /etc/libinput
|
2022-07-03 18:14:15 +03:00
|
|
|
if meson.version().version_compare('>= 0.60')
|
|
|
|
|
install_emptydir(dir_etc / 'libinput')
|
|
|
|
|
else
|
|
|
|
|
install_subdir('libinput', install_dir : dir_etc)
|
|
|
|
|
endif
|
2021-02-03 10:19:20 +10:00
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
############ libinput.so ############
|
|
|
|
|
install_headers('src/libinput.h')
|
2018-04-10 13:07:19 +10:00
|
|
|
src_libinput = src_libfilter + [
|
2016-11-30 17:59:17 +10:00
|
|
|
'src/libinput.c',
|
2021-05-27 19:19:49 +02:00
|
|
|
'src/libinput-private-config.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'src/evdev.c',
|
2017-11-13 09:33:50 +10:00
|
|
|
'src/evdev-debounce.c',
|
2017-09-19 13:57:50 +10:00
|
|
|
'src/evdev-fallback.c',
|
2018-09-14 14:03:09 +10:00
|
|
|
'src/evdev-totem.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'src/evdev-middle-button.c',
|
|
|
|
|
'src/evdev-mt-touchpad.c',
|
|
|
|
|
'src/evdev-mt-touchpad-tap.c',
|
2019-06-18 10:16:33 +10:00
|
|
|
'src/evdev-mt-touchpad-thumb.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'src/evdev-mt-touchpad-buttons.c',
|
|
|
|
|
'src/evdev-mt-touchpad-edge-scroll.c',
|
|
|
|
|
'src/evdev-mt-touchpad-gestures.c',
|
|
|
|
|
'src/evdev-tablet.c',
|
|
|
|
|
'src/evdev-tablet-pad.c',
|
|
|
|
|
'src/evdev-tablet-pad-leds.c',
|
2021-09-26 18:15:51 +02:00
|
|
|
'src/evdev-wheel.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'src/path-seat.c',
|
|
|
|
|
'src/udev-seat.c',
|
|
|
|
|
'src/timer.c',
|
|
|
|
|
]
|
2018-04-10 13:07:19 +10:00
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
deps_libinput = [
|
|
|
|
|
dep_mtdev,
|
|
|
|
|
dep_udev,
|
|
|
|
|
dep_libevdev,
|
2018-07-16 00:41:05 +03:00
|
|
|
dep_libepoll,
|
2016-11-30 17:59:17 +10:00
|
|
|
dep_lm,
|
|
|
|
|
dep_rt,
|
|
|
|
|
dep_libwacom,
|
Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
dep_libinput_util,
|
|
|
|
|
dep_libquirks
|
2016-11-30 17:59:17 +10:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
libinput_version_h_config = configuration_data()
|
|
|
|
|
libinput_version_h_config.set('LIBINPUT_VERSION_MAJOR', libinput_version[0])
|
|
|
|
|
libinput_version_h_config.set('LIBINPUT_VERSION_MINOR', libinput_version[1])
|
|
|
|
|
libinput_version_h_config.set('LIBINPUT_VERSION_MICRO', libinput_version[2])
|
|
|
|
|
libinput_version_h_config.set('LIBINPUT_VERSION', meson.project_version())
|
|
|
|
|
|
|
|
|
|
libinput_version_h = configure_file(
|
|
|
|
|
input : 'src/libinput-version.h.in',
|
|
|
|
|
output : 'libinput-version.h',
|
|
|
|
|
configuration : libinput_version_h_config,
|
|
|
|
|
)
|
|
|
|
|
|
2021-08-03 19:53:36 +02:00
|
|
|
mapfile = dir_src / 'libinput.sym'
|
2016-11-30 17:59:17 +10:00
|
|
|
version_flag = '-Wl,--version-script,@0@'.format(mapfile)
|
|
|
|
|
lib_libinput = shared_library('input',
|
|
|
|
|
src_libinput,
|
2017-08-15 15:42:48 +01:00
|
|
|
include_directories : [include_directories('.'), includes_include],
|
2016-11-30 17:59:17 +10:00
|
|
|
dependencies : deps_libinput,
|
|
|
|
|
version : libinput_so_version,
|
|
|
|
|
link_args : version_flag,
|
|
|
|
|
link_depends : mapfile,
|
|
|
|
|
install : true
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
dep_libinput = declare_dependency(
|
|
|
|
|
link_with : lib_libinput,
|
|
|
|
|
dependencies : deps_libinput)
|
|
|
|
|
|
2022-12-09 11:17:33 +01:00
|
|
|
if meson.version().version_compare('>= 0.54.0')
|
|
|
|
|
meson.override_dependency('libinput', dep_libinput)
|
|
|
|
|
endif
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
pkgconfig.generate(
|
2017-06-26 13:51:44 +10:00
|
|
|
filebase : 'libinput',
|
|
|
|
|
name : 'Libinput',
|
|
|
|
|
description : 'Input device library',
|
|
|
|
|
version : meson.project_version(),
|
|
|
|
|
libraries : lib_libinput
|
2016-11-30 17:59:17 +10:00
|
|
|
)
|
|
|
|
|
|
2018-03-08 08:27:10 +10:00
|
|
|
git_version_h = vcs_tag(command : ['git', 'describe'],
|
|
|
|
|
fallback : 'unknown',
|
2018-03-07 08:48:01 +10:00
|
|
|
input : 'src/libinput-git-version.h.in',
|
|
|
|
|
output :'libinput-git-version.h')
|
2018-02-28 21:29:38 +10:00
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
############ documentation ############
|
|
|
|
|
|
2017-06-20 11:17:39 +10:00
|
|
|
if get_option('documentation')
|
2018-07-10 17:32:35 +10:00
|
|
|
subdir('doc/api')
|
|
|
|
|
subdir('doc/user')
|
2016-11-30 17:59:17 +10:00
|
|
|
endif
|
|
|
|
|
|
2019-08-10 13:51:19 -07:00
|
|
|
############ shell completion #########
|
|
|
|
|
|
|
|
|
|
subdir('completion/zsh')
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
############ tools ############
|
2018-07-11 13:08:51 +10:00
|
|
|
libinput_tool_path = dir_libexec
|
2017-05-25 10:12:26 +10:00
|
|
|
config_h.set_quoted('LIBINPUT_TOOL_PATH', libinput_tool_path)
|
2022-06-16 08:20:54 +10:00
|
|
|
tools_shared_sources = [ 'tools/shared.c' ]
|
2017-05-25 15:47:19 +10:00
|
|
|
deps_tools_shared = [ dep_libinput, dep_libevdev ]
|
|
|
|
|
lib_tools_shared = static_library('tools_shared',
|
|
|
|
|
tools_shared_sources,
|
2017-08-15 15:42:48 +01:00
|
|
|
include_directories : [includes_src, includes_include],
|
2017-05-25 15:47:19 +10:00
|
|
|
dependencies : deps_tools_shared)
|
|
|
|
|
dep_tools_shared = declare_dependency(link_with : lib_tools_shared,
|
|
|
|
|
dependencies : deps_tools_shared)
|
|
|
|
|
|
2017-06-23 15:13:20 +10:00
|
|
|
deps_tools = [ dep_tools_shared, dep_libinput ]
|
2019-11-27 10:55:14 +10:00
|
|
|
libinput_debug_events_sources = [
|
|
|
|
|
'tools/libinput-debug-events.c',
|
|
|
|
|
libinput_version_h,
|
|
|
|
|
]
|
2016-11-30 17:59:17 +10:00
|
|
|
executable('libinput-debug-events',
|
|
|
|
|
libinput_debug_events_sources,
|
2017-05-25 15:47:19 +10:00
|
|
|
dependencies : deps_tools,
|
2017-08-15 15:42:48 +01:00
|
|
|
include_directories : [includes_src, includes_include],
|
2017-05-25 10:12:26 +10:00
|
|
|
install_dir : libinput_tool_path,
|
2016-11-30 17:59:17 +10:00
|
|
|
install : true
|
|
|
|
|
)
|
|
|
|
|
|
2019-11-05 16:17:01 +10:00
|
|
|
libinput_debug_tablet_sources = [ 'tools/libinput-debug-tablet.c' ]
|
|
|
|
|
executable('libinput-debug-tablet',
|
|
|
|
|
libinput_debug_tablet_sources,
|
|
|
|
|
dependencies : deps_tools,
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
install_dir : libinput_tool_path,
|
|
|
|
|
install : true)
|
|
|
|
|
|
|
|
|
|
|
2018-06-26 13:15:13 +10:00
|
|
|
libinput_quirks_sources = [ 'tools/libinput-quirks.c' ]
|
|
|
|
|
libinput_quirks = executable('libinput-quirks',
|
|
|
|
|
libinput_quirks_sources,
|
|
|
|
|
dependencies : [dep_libquirks, dep_tools_shared, dep_libinput],
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
install_dir : libinput_tool_path,
|
|
|
|
|
install : true
|
|
|
|
|
)
|
2018-06-06 14:39:39 +10:00
|
|
|
test('validate-quirks',
|
2018-06-26 13:15:13 +10:00
|
|
|
libinput_quirks,
|
2019-04-12 09:24:49 +10:00
|
|
|
args: ['validate', '--data-dir=@0@'.format(dir_src_quirks)],
|
|
|
|
|
suite : ['all']
|
2018-06-06 14:39:39 +10:00
|
|
|
)
|
Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
|
2023-03-20 09:17:39 +10:00
|
|
|
quirks_file_tester = find_program('test/test_quirks_files.py')
|
|
|
|
|
test('validate-quirks-files',
|
|
|
|
|
quirks_file_tester,
|
|
|
|
|
suite : ['all'],
|
|
|
|
|
env: ['MESON_SOURCE_ROOT=@0@'.format(meson.project_source_root())],
|
|
|
|
|
)
|
|
|
|
|
|
2017-05-25 15:47:19 +10:00
|
|
|
libinput_list_devices_sources = [ 'tools/libinput-list-devices.c' ]
|
2018-06-20 08:15:14 +10:00
|
|
|
libinput_list_devices = executable('libinput-list-devices',
|
|
|
|
|
libinput_list_devices_sources,
|
|
|
|
|
dependencies : deps_tools,
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
install_dir : libinput_tool_path,
|
|
|
|
|
install : true,
|
|
|
|
|
)
|
2019-04-12 09:24:49 +10:00
|
|
|
test('list-devices',
|
|
|
|
|
libinput_list_devices,
|
|
|
|
|
suite : ['all', 'root', 'hardware'])
|
2018-06-20 08:15:14 +10:00
|
|
|
|
2017-05-23 15:07:31 +10:00
|
|
|
libinput_measure_sources = [ 'tools/libinput-measure.c' ]
|
|
|
|
|
executable('libinput-measure',
|
|
|
|
|
libinput_measure_sources,
|
|
|
|
|
dependencies : deps_tools,
|
2017-08-15 15:42:48 +01:00
|
|
|
include_directories : [includes_src, includes_include],
|
2017-05-23 15:07:31 +10:00
|
|
|
install_dir : libinput_tool_path,
|
|
|
|
|
install : true,
|
|
|
|
|
)
|
2018-04-26 11:47:54 +10:00
|
|
|
|
2020-03-12 11:53:22 +10:00
|
|
|
libinput_analyze_sources = [ 'tools/libinput-analyze.c' ]
|
|
|
|
|
executable('libinput-analyze',
|
|
|
|
|
libinput_analyze_sources,
|
|
|
|
|
dependencies : deps_tools,
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
install_dir : libinput_tool_path,
|
|
|
|
|
install : true,
|
|
|
|
|
)
|
|
|
|
|
|
2018-08-08 11:21:12 +10:00
|
|
|
src_python_tools = files(
|
2024-06-12 10:05:54 +10:00
|
|
|
'tools/libinput-analyze-buttons.py',
|
2020-03-12 11:53:22 +10:00
|
|
|
'tools/libinput-analyze-per-slot-delta.py',
|
2021-02-01 14:23:06 +10:00
|
|
|
'tools/libinput-analyze-recording.py',
|
2021-01-25 08:17:21 +10:00
|
|
|
'tools/libinput-analyze-touch-down-state.py',
|
2022-12-08 09:41:14 +10:00
|
|
|
'tools/libinput-list-kernel-devices.py',
|
2018-08-08 11:21:12 +10:00
|
|
|
'tools/libinput-measure-fuzz.py',
|
2020-03-28 13:26:17 +10:00
|
|
|
'tools/libinput-measure-touchpad-size.py',
|
2018-08-08 11:21:12 +10:00
|
|
|
'tools/libinput-measure-touchpad-tap.py',
|
|
|
|
|
'tools/libinput-measure-touchpad-pressure.py',
|
|
|
|
|
'tools/libinput-measure-touch-size.py',
|
2021-02-23 13:30:13 +10:00
|
|
|
'tools/libinput-replay.py'
|
2018-08-08 11:21:12 +10:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
foreach t : src_python_tools
|
|
|
|
|
configure_file(input: t,
|
|
|
|
|
output: '@BASENAME@',
|
2021-02-18 09:39:46 +10:00
|
|
|
copy: true,
|
2018-08-08 11:21:12 +10:00
|
|
|
install_dir : libinput_tool_path
|
|
|
|
|
)
|
|
|
|
|
endforeach
|
|
|
|
|
|
2018-03-07 08:48:01 +10:00
|
|
|
libinput_record_sources = [ 'tools/libinput-record.c', git_version_h ]
|
2017-11-23 11:01:45 +10:00
|
|
|
executable('libinput-record',
|
|
|
|
|
libinput_record_sources,
|
2018-03-08 09:31:02 +10:00
|
|
|
dependencies : deps_tools + [dep_udev],
|
2017-11-23 11:01:45 +10:00
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
install_dir : libinput_tool_path,
|
|
|
|
|
install : true,
|
|
|
|
|
)
|
|
|
|
|
|
2022-10-10 08:27:05 +02:00
|
|
|
config_h.set10('HAVE_DEBUG_GUI', get_option('debug-gui'))
|
2017-05-24 10:36:44 +10:00
|
|
|
if get_option('debug-gui')
|
2021-07-29 18:07:32 +02:00
|
|
|
dep_gtk = dependency('gtk4', version : '>= 4.0', required : false)
|
|
|
|
|
config_h.set10('HAVE_GTK4', dep_gtk.found())
|
|
|
|
|
if not dep_gtk.found()
|
|
|
|
|
dep_gtk = dependency('gtk+-3.0', version : '>= 3.20')
|
|
|
|
|
config_h.set10('HAVE_GTK3', dep_gtk.found())
|
|
|
|
|
endif
|
|
|
|
|
|
2023-01-06 13:19:15 +10:00
|
|
|
if meson.version().version_compare('>= 0.58')
|
|
|
|
|
gtk_targets = dep_gtk.get_variable('targets')
|
|
|
|
|
else
|
|
|
|
|
gtk_targets = dep_gtk.get_pkgconfig_variable('targets')
|
|
|
|
|
endif
|
|
|
|
|
|
2022-06-10 10:31:37 +10:00
|
|
|
have_gtk_wayland = gtk_targets.contains('wayland')
|
|
|
|
|
have_gtk_x11 = gtk_targets.contains('x11')
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
dep_cairo = dependency('cairo')
|
|
|
|
|
dep_glib = dependency('glib-2.0')
|
2021-07-29 19:01:44 +02:00
|
|
|
dep_x11 = dependency('x11', required : false)
|
2022-06-27 09:47:41 +10:00
|
|
|
dep_wayland_client = dependency('wayland-client', required : false)
|
|
|
|
|
dep_wayland_protocols = dependency('wayland-protocols', required : false)
|
|
|
|
|
|
2022-06-10 10:31:37 +10:00
|
|
|
config_h.set10('HAVE_GTK_X11', have_gtk_x11 and dep_x11.found())
|
2022-10-09 20:07:59 +02:00
|
|
|
config_h.set10('HAVE_GTK_WAYLAND', false)
|
2016-11-30 17:59:17 +10:00
|
|
|
|
2017-05-25 15:47:19 +10:00
|
|
|
debug_gui_sources = [ 'tools/libinput-debug-gui.c' ]
|
2021-06-16 22:53:45 +02:00
|
|
|
|
2022-06-27 09:47:41 +10:00
|
|
|
if have_gtk_wayland and dep_wayland_client.found() and dep_wayland_protocols.found()
|
|
|
|
|
wayland_scanner = find_program('wayland-scanner')
|
2023-01-06 13:19:15 +10:00
|
|
|
if meson.version().version_compare('>= 0.58')
|
|
|
|
|
wlproto_dir = dep_wayland_protocols.get_variable('pkgdatadir')
|
|
|
|
|
else
|
|
|
|
|
wlproto_dir = dep_wayland_protocols.get_pkgconfig_variable('pkgdatadir')
|
|
|
|
|
endif
|
2022-06-27 09:47:41 +10:00
|
|
|
|
|
|
|
|
proto_name = 'pointer-constraints-unstable-v1'
|
|
|
|
|
input = files(wlproto_dir / 'unstable' / 'pointer-constraints' / '@0@.xml'.format(proto_name))
|
|
|
|
|
|
|
|
|
|
wayland_headers = custom_target('@0@ client header'.format(proto_name),
|
|
|
|
|
input: input,
|
|
|
|
|
output: '@0@-client-protocol.h'.format(proto_name),
|
|
|
|
|
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
wayland_sources = custom_target('@0@ source'.format(proto_name),
|
|
|
|
|
input: input,
|
|
|
|
|
output: '@0@-protocol.c'.format(proto_name),
|
|
|
|
|
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
debug_gui_sources += [ wayland_headers, wayland_sources ]
|
|
|
|
|
config_h.set10('HAVE_GTK_WAYLAND', true)
|
2021-06-16 22:53:45 +02:00
|
|
|
endif
|
|
|
|
|
|
2017-05-24 10:36:44 +10:00
|
|
|
deps_debug_gui = [
|
2016-11-30 17:59:17 +10:00
|
|
|
dep_gtk,
|
|
|
|
|
dep_cairo,
|
|
|
|
|
dep_glib,
|
2021-06-16 22:53:45 +02:00
|
|
|
dep_wayland_client,
|
|
|
|
|
dep_wayland_protocols,
|
2021-07-29 19:01:44 +02:00
|
|
|
dep_x11,
|
2017-05-25 15:47:19 +10:00
|
|
|
] + deps_tools
|
2017-05-24 10:36:44 +10:00
|
|
|
executable('libinput-debug-gui',
|
|
|
|
|
debug_gui_sources,
|
|
|
|
|
dependencies : deps_debug_gui,
|
2017-08-15 15:42:48 +01:00
|
|
|
include_directories : [includes_src, includes_include],
|
2017-05-24 10:36:44 +10:00
|
|
|
install_dir : libinput_tool_path,
|
2017-06-27 16:59:01 +10:00
|
|
|
install : true
|
2016-11-30 17:59:17 +10:00
|
|
|
)
|
2021-02-18 09:47:14 +10:00
|
|
|
src_man += files('tools/libinput-debug-gui.man')
|
2016-11-30 17:59:17 +10:00
|
|
|
endif
|
|
|
|
|
|
2017-05-24 10:36:44 +10:00
|
|
|
libinput_sources = [ 'tools/libinput-tool.c' ]
|
|
|
|
|
|
2018-11-01 09:16:03 +10:00
|
|
|
libinput_tool = executable('libinput',
|
|
|
|
|
libinput_sources,
|
|
|
|
|
dependencies : deps_tools,
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
install : true
|
|
|
|
|
)
|
2017-05-24 10:36:44 +10:00
|
|
|
|
|
|
|
|
ptraccel_debug_sources = [ 'tools/ptraccel-debug.c' ]
|
|
|
|
|
executable('ptraccel-debug',
|
|
|
|
|
ptraccel_debug_sources,
|
|
|
|
|
dependencies : [ dep_libfilter, dep_libinput ],
|
2017-08-15 15:42:48 +01:00
|
|
|
include_directories : [includes_src, includes_include],
|
2017-05-24 10:36:44 +10:00
|
|
|
install : false
|
|
|
|
|
)
|
|
|
|
|
|
2018-11-01 09:16:03 +10:00
|
|
|
# Don't run the test during a release build because we rely on the magic
|
|
|
|
|
# subtool lookup
|
|
|
|
|
if get_option('buildtype') == 'debug' or get_option('buildtype') == 'debugoptimized'
|
2019-06-25 09:37:25 +10:00
|
|
|
config_tool_option_test = configuration_data()
|
2020-03-16 13:13:41 +10:00
|
|
|
config_tool_option_test.set('DISABLE_WARNING', 'yes')
|
2019-06-25 09:37:25 +10:00
|
|
|
config_tool_option_test.set('MESON_ENABLED_DEBUG_GUI', get_option('debug-gui'))
|
2020-03-16 13:13:41 +10:00
|
|
|
config_tool_option_test.set('MESON_BUILD_ROOT', meson.current_build_dir())
|
|
|
|
|
config_tool_option_test.set('TOOL_PATH', libinput_tool.full_path())
|
|
|
|
|
tool_option_test = configure_file(input: 'tools/test_tool_option_parsing.py',
|
|
|
|
|
output: '@PLAINNAME@',
|
2019-08-02 22:45:16 +10:00
|
|
|
configuration : config_tool_option_test)
|
2018-11-01 09:16:03 +10:00
|
|
|
test('tool-option-parsing',
|
2019-06-25 09:37:25 +10:00
|
|
|
tool_option_test,
|
2023-03-20 10:08:23 +10:00
|
|
|
args : [tool_option_test],
|
2019-04-12 09:24:49 +10:00
|
|
|
suite : ['all', 'root'],
|
2019-04-05 11:02:46 +10:00
|
|
|
timeout : 240)
|
2018-11-01 09:16:03 +10:00
|
|
|
endif
|
|
|
|
|
|
2018-06-27 13:26:51 +10:00
|
|
|
# the libinput tools check whether we execute from the builddir, this is
|
|
|
|
|
# the test to verify that lookup. We test twice, once as normal test
|
|
|
|
|
# run from the builddir, once after copying to /tmp
|
|
|
|
|
test_builddir_lookup = executable('test-builddir-lookup',
|
2019-03-06 20:16:41 +10:00
|
|
|
'test/test-builddir-lookup.c',
|
2018-06-27 13:26:51 +10:00
|
|
|
dependencies : [ dep_tools_shared],
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
install : false)
|
|
|
|
|
test('tools-builddir-lookup',
|
|
|
|
|
test_builddir_lookup,
|
2019-04-12 09:24:49 +10:00
|
|
|
args : ['--builddir-is-set'],
|
|
|
|
|
suite : ['all'])
|
2018-06-27 13:26:51 +10:00
|
|
|
test('tools-builddir-lookup-installed',
|
2019-03-06 20:16:41 +10:00
|
|
|
find_program('test/helper-copy-and-exec-from-tmp.sh'),
|
2018-06-27 13:26:51 +10:00
|
|
|
args : [test_builddir_lookup.full_path(), '--builddir-is-null'],
|
2019-10-07 01:04:21 -06:00
|
|
|
env : ['LD_LIBRARY_PATH=@0@'.format(meson.current_build_dir())],
|
2019-04-12 09:24:49 +10:00
|
|
|
suite : ['all'],
|
2018-06-27 13:26:51 +10:00
|
|
|
workdir : '/tmp')
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
############ tests ############
|
|
|
|
|
|
2018-06-14 14:48:49 +10:00
|
|
|
test('symbols-leak-test',
|
2018-07-12 08:42:53 +10:00
|
|
|
find_program('test/symbols-leak-test'),
|
2021-08-03 19:53:36 +02:00
|
|
|
args : [ dir_src / 'libinput.sym', dir_src],
|
2019-04-12 09:24:49 +10:00
|
|
|
suite : ['all'])
|
2018-06-14 14:48:49 +10:00
|
|
|
|
|
|
|
|
# build-test only
|
|
|
|
|
executable('test-build-pedantic',
|
|
|
|
|
'test/build-pedantic.c',
|
|
|
|
|
dependencies : [dep_udev],
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
c_args : ['-std=c99', '-pedantic', '-Werror'],
|
|
|
|
|
install : false)
|
|
|
|
|
# build-test only
|
|
|
|
|
executable('test-build-std-gnuc90',
|
|
|
|
|
'test/build-pedantic.c',
|
|
|
|
|
dependencies : [dep_udev],
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
2019-02-03 09:27:33 +00:00
|
|
|
c_args : ['-std=gnu89', '-Werror'],
|
2018-06-14 14:48:49 +10:00
|
|
|
install : false)
|
|
|
|
|
# test for linking with the minimal linker flags
|
|
|
|
|
executable('test-build-linker',
|
|
|
|
|
'test/build-pedantic.c',
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
dependencies : [ dep_libinput, dep_libinput_util ],
|
|
|
|
|
install : false)
|
2019-01-12 11:10:46 +01:00
|
|
|
# test including from C++ (in case CPP compiler is available)
|
2023-09-02 17:58:07 +02:00
|
|
|
if add_languages('cpp', native: false, required: false)
|
2019-01-12 11:10:46 +01:00
|
|
|
executable('test-build-cxx',
|
|
|
|
|
'test/build-cxx.cc',
|
|
|
|
|
dependencies : [dep_udev],
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
install : false)
|
|
|
|
|
endif
|
2018-06-14 14:48:49 +10:00
|
|
|
|
2022-05-06 10:51:33 +10:00
|
|
|
libinput_test_sources = [ 'tools/libinput-test.c' ]
|
|
|
|
|
executable('libinput-test',
|
|
|
|
|
libinput_test_sources,
|
|
|
|
|
dependencies : deps_tools,
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
install_dir : libinput_tool_path,
|
|
|
|
|
install : true,
|
|
|
|
|
)
|
|
|
|
|
|
2018-06-14 14:48:49 +10:00
|
|
|
# This is the test suite runner, we allow disabling that one because of
|
|
|
|
|
# dependencies
|
2017-06-20 11:14:25 +10:00
|
|
|
if get_option('tests')
|
2016-11-30 17:59:17 +10:00
|
|
|
dep_check = dependency('check', version : '>= 0.9.10')
|
|
|
|
|
|
2018-08-08 16:32:06 +10:00
|
|
|
gstack = find_program('gstack', required : false)
|
|
|
|
|
config_h.set10('HAVE_GSTACK', gstack.found())
|
2016-11-30 17:59:17 +10:00
|
|
|
|
2018-02-01 14:23:41 +10:00
|
|
|
# for inhibit support during test run
|
2018-02-21 13:56:08 +10:00
|
|
|
dep_libsystemd = dependency('libsystemd', version : '>= 221', required : false)
|
2018-02-01 14:23:41 +10:00
|
|
|
config_h.set10('HAVE_LIBSYSTEMD', dep_libsystemd.found())
|
|
|
|
|
|
2018-08-08 14:02:15 +10:00
|
|
|
litest_sources = [
|
2021-05-27 19:19:49 +02:00
|
|
|
'src/libinput-private-config.c',
|
2020-02-12 18:04:41 +10:00
|
|
|
'test/litest-device-absinfo-override.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-acer-hawaii-keyboard.c',
|
|
|
|
|
'test/litest-device-acer-hawaii-touchpad.c',
|
2018-02-05 10:08:47 +10:00
|
|
|
'test/litest-device-aiptek-tablet.c',
|
2020-01-09 10:10:31 +10:00
|
|
|
'test/litest-device-alps-3fg.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-alps-semi-mt.c',
|
|
|
|
|
'test/litest-device-alps-dualpoint.c',
|
|
|
|
|
'test/litest-device-anker-mouse-kbd.c',
|
|
|
|
|
'test/litest-device-apple-appletouch.c',
|
|
|
|
|
'test/litest-device-apple-internal-keyboard.c',
|
|
|
|
|
'test/litest-device-apple-magicmouse.c',
|
|
|
|
|
'test/litest-device-asus-rog-gladius.c',
|
|
|
|
|
'test/litest-device-atmel-hover.c',
|
|
|
|
|
'test/litest-device-bcm5974.c',
|
|
|
|
|
'test/litest-device-calibrated-touchscreen.c',
|
|
|
|
|
'test/litest-device-cyborg-rat-5.c',
|
2018-09-14 14:03:09 +10:00
|
|
|
'test/litest-device-dell-canvas-totem.c',
|
|
|
|
|
'test/litest-device-dell-canvas-totem-touch.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-elantech-touchpad.c',
|
2020-01-31 12:12:59 +10:00
|
|
|
'test/litest-device-elan-tablet.c',
|
evdev: strip the device name of format directives
This fixes a format string vulnerabilty.
evdev_log_message() composes a format string consisting of a fixed
prefix (including the rendered device name) and the passed-in format
buffer. This format string is then passed with the arguments to the
actual log handler, which usually and eventually ends up being printf.
If the device name contains a printf-style format directive, these ended
up in the format string and thus get interpreted correctly, e.g. for a
device "Foo%sBar" the log message vs printf invocation ends up being:
evdev_log_message(device, "some message %s", "some argument");
printf("event9 - Foo%sBar: some message %s", "some argument");
This can enable an attacker to execute malicious code with the
privileges of the process using libinput.
To exploit this, an attacker needs to be able to create a kernel device
with a malicious name, e.g. through /dev/uinput or a Bluetooth device.
To fix this, convert any potential format directives in the device name
by duplicating percentages.
Pre-rendering the device to avoid the issue altogether would be nicer
but the current log level hooks do not easily allow for this. The device
name is the only user-controlled part of the format string.
A second potential issue is the sysname of the device which is also
sanitized.
This issue was found by Albin Eldstål-Ahrens and Benjamin Svensson from
Assured AB, and independently by Lukas Lamster.
Fixes #752
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-03-30 09:25:22 +10:00
|
|
|
'test/litest-device-format-string.c',
|
2021-02-05 08:35:10 +10:00
|
|
|
'test/litest-device-generic-pressurepad.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-generic-singletouch.c',
|
2017-07-25 09:38:46 +10:00
|
|
|
'test/litest-device-gpio-keys.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-huion-pentablet.c',
|
2024-01-30 14:43:59 +10:00
|
|
|
'test/litest-device-huion-q620m-dial.c',
|
2017-11-06 15:28:04 +10:00
|
|
|
'test/litest-device-hp-wmi-hotkeys.c',
|
2017-08-17 01:25:24 +02:00
|
|
|
'test/litest-device-ignored-mouse.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-keyboard.c',
|
|
|
|
|
'test/litest-device-keyboard-all-codes.c',
|
2020-10-23 09:14:33 +10:00
|
|
|
'test/litest-device-keyboard-quirked.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-keyboard-razer-blackwidow.c',
|
2017-09-19 10:10:22 +10:00
|
|
|
'test/litest-device-keyboard-razer-blade-stealth.c',
|
|
|
|
|
'test/litest-device-keyboard-razer-blade-stealth-videoswitch.c',
|
2022-06-06 20:24:16 +02:00
|
|
|
'test/litest-device-lenovo-scrollpoint.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-lid-switch.c',
|
|
|
|
|
'test/litest-device-lid-switch-surface3.c',
|
2020-08-13 09:37:30 +10:00
|
|
|
'test/litest-device-logitech-media-keyboard-elite.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-logitech-trackball.c',
|
|
|
|
|
'test/litest-device-nexus4-touch-screen.c',
|
|
|
|
|
'test/litest-device-magic-trackpad.c',
|
|
|
|
|
'test/litest-device-mouse.c',
|
|
|
|
|
'test/litest-device-mouse-wheel-tilt.c',
|
|
|
|
|
'test/litest-device-mouse-roccat.c',
|
|
|
|
|
'test/litest-device-mouse-low-dpi.c',
|
|
|
|
|
'test/litest-device-mouse-wheel-click-angle.c',
|
|
|
|
|
'test/litest-device-mouse-wheel-click-count.c',
|
2018-01-31 16:18:15 +10:00
|
|
|
'test/litest-device-ms-nano-transceiver-mouse.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-ms-surface-cover.c',
|
|
|
|
|
'test/litest-device-protocol-a-touch-screen.c',
|
|
|
|
|
'test/litest-device-qemu-usb-tablet.c',
|
2020-08-13 09:37:30 +10:00
|
|
|
'test/litest-device-sony-vaio-keys.c',
|
2018-08-07 09:56:54 +10:00
|
|
|
'test/litest-device-synaptics-x220.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-synaptics-hover.c',
|
|
|
|
|
'test/litest-device-synaptics-i2c.c',
|
2021-01-14 12:55:30 +10:00
|
|
|
'test/litest-device-synaptics-pressurepad.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-synaptics-rmi4.c',
|
|
|
|
|
'test/litest-device-synaptics-st.c',
|
|
|
|
|
'test/litest-device-synaptics-t440.c',
|
|
|
|
|
'test/litest-device-synaptics-x1-carbon-3rd.c',
|
2023-04-11 02:00:52 +00:00
|
|
|
'test/litest-device-synaptics-phantomclicks.c',
|
2024-01-30 14:43:59 +10:00
|
|
|
'test/litest-device-tablet-doubledial.c',
|
2020-05-28 14:13:43 +10:00
|
|
|
'test/litest-device-tablet-mode-switch.c',
|
2024-01-30 14:43:59 +10:00
|
|
|
'test/litest-device-tablet-rel-dial.c',
|
2017-04-21 17:52:37 +10:00
|
|
|
'test/litest-device-thinkpad-extrabuttons.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-trackpoint.c',
|
|
|
|
|
'test/litest-device-touch-screen.c',
|
2023-09-27 09:41:21 +10:00
|
|
|
'test/litest-device-touchpad-palm-threshold-zero.c',
|
2018-04-13 14:00:05 +10:00
|
|
|
'test/litest-device-touchscreen-invalid-range.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-touchscreen-fuzz.c',
|
2018-07-13 16:08:54 +10:00
|
|
|
'test/litest-device-touchscreen-mt-tool.c',
|
2017-09-11 10:32:42 +10:00
|
|
|
'test/litest-device-uclogic-tablet.c',
|
2017-10-20 10:39:37 +10:00
|
|
|
'test/litest-device-wacom-bamboo-2fg-finger.c',
|
|
|
|
|
'test/litest-device-wacom-bamboo-2fg-pad.c',
|
|
|
|
|
'test/litest-device-wacom-bamboo-2fg-pen.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-wacom-bamboo-16fg-pen.c',
|
2023-05-11 14:30:38 +10:00
|
|
|
'test/litest-device-wacom-calibrated-tablet.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-wacom-cintiq-12wx-pen.c',
|
|
|
|
|
'test/litest-device-wacom-cintiq-13hdt-finger.c',
|
|
|
|
|
'test/litest-device-wacom-cintiq-13hdt-pad.c',
|
|
|
|
|
'test/litest-device-wacom-cintiq-13hdt-pen.c',
|
|
|
|
|
'test/litest-device-wacom-cintiq-24hd-pen.c',
|
|
|
|
|
'test/litest-device-wacom-cintiq-24hdt-pad.c',
|
2019-01-04 12:35:22 +10:00
|
|
|
'test/litest-device-wacom-cintiq-pro-16-finger.c',
|
|
|
|
|
'test/litest-device-wacom-cintiq-pro-16-pad.c',
|
|
|
|
|
'test/litest-device-wacom-cintiq-pro-16-pen.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-wacom-ekr.c',
|
|
|
|
|
'test/litest-device-wacom-hid4800-pen.c',
|
|
|
|
|
'test/litest-device-wacom-intuos3-pad.c',
|
|
|
|
|
'test/litest-device-wacom-intuos5-finger.c',
|
|
|
|
|
'test/litest-device-wacom-intuos5-pad.c',
|
|
|
|
|
'test/litest-device-wacom-intuos5-pen.c',
|
2019-06-17 13:25:59 +10:00
|
|
|
'test/litest-device-wacom-isdv4-4200-pen.c',
|
2021-11-17 14:29:35 +10:00
|
|
|
'test/litest-device-wacom-isdv4-524c-pen.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-wacom-isdv4-e6-pen.c',
|
|
|
|
|
'test/litest-device-wacom-isdv4-e6-finger.c',
|
2017-08-18 05:32:02 +10:00
|
|
|
'test/litest-device-wacom-mobilestudio-pro-pad.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-waltop-tablet.c',
|
|
|
|
|
'test/litest-device-wheel-only.c',
|
|
|
|
|
'test/litest-device-xen-virtual-pointer.c',
|
|
|
|
|
'test/litest-device-vmware-virtual-usb-mouse.c',
|
|
|
|
|
'test/litest-device-yubikey.c',
|
2019-04-30 13:10:42 +10:00
|
|
|
'test/litest.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
dep_dl = cc.find_library('dl')
|
|
|
|
|
deps_litest = [
|
|
|
|
|
dep_libinput,
|
|
|
|
|
dep_check,
|
|
|
|
|
dep_udev,
|
|
|
|
|
dep_libevdev,
|
|
|
|
|
dep_dl,
|
2018-02-01 14:23:41 +10:00
|
|
|
dep_lm,
|
|
|
|
|
dep_libsystemd,
|
Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
dep_libquirks,
|
2016-11-30 17:59:17 +10:00
|
|
|
]
|
|
|
|
|
|
2019-03-06 13:43:00 +10:00
|
|
|
litest_config_h = configuration_data()
|
|
|
|
|
litest_config_h.set_quoted('LIBINPUT_DEVICE_GROUPS_RULES_FILE',
|
2021-08-03 19:53:36 +02:00
|
|
|
meson.current_build_dir() /
|
|
|
|
|
'80-libinput-device-groups-litest.rules')
|
2019-06-26 11:29:31 +10:00
|
|
|
litest_config_h.set_quoted('LIBINPUT_FUZZ_OVERRIDE_UDEV_RULES_FILE',
|
2021-08-03 19:53:36 +02:00
|
|
|
meson.current_build_dir() /
|
|
|
|
|
'90-libinput-fuzz-override-litest.rules')
|
2016-11-30 17:59:17 +10:00
|
|
|
|
|
|
|
|
def_no_main = '-DLITEST_NO_MAIN'
|
|
|
|
|
def_disable_backtrace = '-DLITEST_DISABLE_BACKTRACE_LOGGING'
|
|
|
|
|
defs_litest_selftest = [
|
|
|
|
|
def_no_main,
|
2021-12-23 08:18:06 +10:00
|
|
|
def_disable_backtrace,
|
|
|
|
|
'-Wno-unused',
|
2017-05-17 14:01:02 +10:00
|
|
|
]
|
2018-08-10 11:54:24 +10:00
|
|
|
test_litest_selftest_sources = [
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-selftest.c',
|
|
|
|
|
'test/litest.c',
|
|
|
|
|
]
|
|
|
|
|
test_litest_selftest = executable('test-litest-selftest',
|
|
|
|
|
test_litest_selftest_sources,
|
2017-08-15 15:42:48 +01:00
|
|
|
include_directories : [includes_src, includes_include],
|
2017-09-21 09:25:04 +10:00
|
|
|
dependencies : deps_litest,
|
2016-11-30 17:59:17 +10:00
|
|
|
c_args : defs_litest_selftest,
|
|
|
|
|
install : false)
|
2019-04-12 09:24:49 +10:00
|
|
|
test('test-litest-selftest',
|
|
|
|
|
test_litest_selftest,
|
2019-06-26 17:05:41 +10:00
|
|
|
suite : ['all'],
|
|
|
|
|
timeout : 100)
|
2016-11-30 17:59:17 +10:00
|
|
|
|
2019-03-06 13:56:01 +10:00
|
|
|
def_LT_VERSION = '-DLIBINPUT_LT_VERSION="@0@:@1@:@2@"'.format(libinput_lt_c, libinput_lt_r, libinput_lt_a)
|
|
|
|
|
test_library_version = executable('test-library-version',
|
|
|
|
|
['test/test-library-version.c'],
|
|
|
|
|
c_args : [ def_LT_VERSION ],
|
|
|
|
|
install : false)
|
2019-04-12 09:24:49 +10:00
|
|
|
test('test-library-version',
|
|
|
|
|
test_library_version,
|
|
|
|
|
suite : ['all'])
|
2019-03-06 13:56:01 +10:00
|
|
|
|
2019-03-06 14:19:08 +10:00
|
|
|
test_utils_sources = [
|
|
|
|
|
'test/test-utils.c',
|
|
|
|
|
]
|
2022-05-06 11:00:59 +10:00
|
|
|
test_utils = executable('libinput-test-utils',
|
2019-03-06 14:19:08 +10:00
|
|
|
test_utils_sources,
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
dependencies : deps_litest,
|
2022-05-06 11:00:59 +10:00
|
|
|
install_dir : libinput_tool_path,
|
|
|
|
|
install : get_option('install-tests'))
|
2019-04-12 09:24:49 +10:00
|
|
|
test('test-utils',
|
|
|
|
|
test_utils,
|
|
|
|
|
suite : ['all'])
|
2019-03-06 14:19:08 +10:00
|
|
|
|
2021-02-05 14:51:02 +10:00
|
|
|
tests_sources = [
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/test-udev.c',
|
|
|
|
|
'test/test-path.c',
|
|
|
|
|
'test/test-pointer.c',
|
|
|
|
|
'test/test-touch.c',
|
|
|
|
|
'test/test-log.c',
|
|
|
|
|
'test/test-tablet.c',
|
2018-09-14 14:03:09 +10:00
|
|
|
'test/test-totem.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/test-pad.c',
|
|
|
|
|
'test/test-touchpad.c',
|
|
|
|
|
'test/test-touchpad-tap.c',
|
|
|
|
|
'test/test-touchpad-buttons.c',
|
|
|
|
|
'test/test-trackpoint.c',
|
|
|
|
|
'test/test-trackball.c',
|
|
|
|
|
'test/test-misc.c',
|
|
|
|
|
'test/test-keyboard.c',
|
|
|
|
|
'test/test-device.c',
|
|
|
|
|
'test/test-gestures.c',
|
Implement a quirks system to replace the udev property parsing
Previously, we had all extra device information ("This is an Apple Touchpad",
"This touchpad causes pointer jumps", etc.) in the udev hwdb. The problem with
the hwdb is that updating it is nontrivial for the average user and debugging
when things go wrong is even harder. Plus, the hwdb has a matching scheme that
is unpredictable unless one is familiar with the implementation.
This patch set moves the hwdb entries into .ini style text files, with a
simple line-based parser. A new libinput list-quirks tool can list the quirks
applied to any given device, in --verbose mode it prints all matches as they
apply or not apply.
The data files are currently unused by libinput, that comes in a later patch.
They're installed though, the defaults point to the /usr/share/libinput
directory and for *temporary* local overrides the single file
/etc/libinput/local-overrides.quirks.
Failure to parse any file is a hard failure for the quirks system, but if the
local override file doesn't exist that's fine.
THIS IS NOT A CONFIGURATION INTERFACE! None of these settings are exposed via
the libinput_device_config_* calls. There is no API guarantee for these files,
think of them as source code.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-21 14:28:53 +10:00
|
|
|
'test/test-switch.c',
|
|
|
|
|
'test/test-quirks.c',
|
2016-11-30 17:59:17 +10:00
|
|
|
]
|
2022-06-16 08:20:54 +10:00
|
|
|
libinput_test_runner_sources = litest_sources + tests_sources
|
2019-03-05 15:51:06 +10:00
|
|
|
libinput_test_runner = executable('libinput-test-suite',
|
2016-11-30 17:59:17 +10:00
|
|
|
libinput_test_runner_sources,
|
2017-08-18 09:13:33 +01:00
|
|
|
include_directories : [includes_src, includes_include],
|
2017-09-21 09:25:04 +10:00
|
|
|
dependencies : deps_litest,
|
2019-03-05 15:51:06 +10:00
|
|
|
install_dir : libinput_tool_path,
|
|
|
|
|
install : get_option('install-tests'))
|
2021-02-18 09:47:14 +10:00
|
|
|
|
|
|
|
|
src_man += 'test/libinput-test-suite.man'
|
2019-03-05 15:51:06 +10:00
|
|
|
|
2024-10-17 19:34:11 +10:00
|
|
|
# When adding new TEST_COLLECTION() macros, add to this list and the CI
|
|
|
|
|
# $ git grep TEST_COLLECTION test/test-* | sed -e "s|.*TEST_COLLECTION(\(.*\))|\t\t'\1',|" | sort
|
|
|
|
|
collections = [
|
|
|
|
|
'device',
|
|
|
|
|
'gestures',
|
|
|
|
|
'keyboard',
|
|
|
|
|
'log',
|
|
|
|
|
'misc',
|
|
|
|
|
'pad',
|
|
|
|
|
'path',
|
|
|
|
|
'pointer',
|
|
|
|
|
'quirks',
|
|
|
|
|
'switch',
|
|
|
|
|
'tablet',
|
2024-10-18 09:30:12 +10:00
|
|
|
'tablet_left_handed',
|
2024-10-17 19:34:11 +10:00
|
|
|
'totem',
|
|
|
|
|
'touch',
|
|
|
|
|
'touchpad',
|
|
|
|
|
'touchpad_buttons',
|
2024-10-18 09:42:11 +10:00
|
|
|
'touchpad_dwt',
|
|
|
|
|
'touchpad_palm',
|
2024-10-17 19:34:11 +10:00
|
|
|
'touchpad_tap',
|
2024-10-17 19:35:16 +10:00
|
|
|
'touchpad_tap_drag',
|
|
|
|
|
'touchpad_tap_palm',
|
2024-10-17 19:34:11 +10:00
|
|
|
'trackball',
|
|
|
|
|
'trackpoint',
|
|
|
|
|
'udev',
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
foreach group : collections
|
2019-06-27 08:31:01 +10:00
|
|
|
test('libinput-test-suite-@0@'.format(group),
|
|
|
|
|
libinput_test_runner,
|
|
|
|
|
suite : ['all', 'valgrind', 'root', 'hardware'],
|
2021-02-05 14:51:02 +10:00
|
|
|
args : ['--filter-group=@0@'.format(group),
|
2019-11-27 07:28:27 +10:00
|
|
|
'--xml-output=junit-@0@-XXXXXX.xml'.format(group)],
|
2019-06-27 08:31:01 +10:00
|
|
|
is_parallel : false,
|
|
|
|
|
timeout : 1200)
|
|
|
|
|
endforeach
|
2016-11-30 17:59:17 +10:00
|
|
|
|
2018-08-10 11:39:04 +10:00
|
|
|
test('libinput-test-deviceless',
|
|
|
|
|
libinput_test_runner,
|
2019-04-12 09:24:49 +10:00
|
|
|
suite : ['all', 'valgrind'],
|
2019-11-27 07:28:27 +10:00
|
|
|
args: ['--filter-deviceless',
|
|
|
|
|
'--xml-output=junit-deviceless-XXXXXX.xml'])
|
2018-06-21 17:05:30 +10:00
|
|
|
|
2019-03-15 10:23:25 +10:00
|
|
|
valgrind = find_program('valgrind', required : false)
|
|
|
|
|
if valgrind.found()
|
2019-05-27 14:28:24 +10:00
|
|
|
valgrind_env = environment()
|
2021-08-03 19:53:36 +02:00
|
|
|
valgrind_suppressions_file = dir_src_test / 'valgrind.suppressions'
|
2019-03-15 10:23:25 +10:00
|
|
|
add_test_setup('valgrind',
|
|
|
|
|
exe_wrapper : [ valgrind,
|
|
|
|
|
'--leak-check=full',
|
|
|
|
|
'--gen-suppressions=all',
|
|
|
|
|
'--error-exitcode=3',
|
|
|
|
|
'--suppressions=' + valgrind_suppressions_file ],
|
2019-05-27 14:28:24 +10:00
|
|
|
env : valgrind_env,
|
2019-03-15 10:23:25 +10:00
|
|
|
timeout_multiplier : 100)
|
|
|
|
|
else
|
|
|
|
|
message('valgrind not found, disabling valgrind test suite')
|
|
|
|
|
endif
|
2019-03-06 13:43:00 +10:00
|
|
|
configure_file(output : 'litest-config.h',
|
|
|
|
|
configuration : litest_config_h)
|
2016-11-30 17:59:17 +10:00
|
|
|
endif
|
2021-02-18 09:47:14 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
############ man pages ############
|
|
|
|
|
man_config = configuration_data()
|
|
|
|
|
man_config.set('LIBINPUT_VERSION', meson.project_version())
|
|
|
|
|
man_config.set('LIBINPUT_DATA_DIR', dir_data)
|
2022-05-06 10:51:33 +10:00
|
|
|
if get_option('install-tests')
|
|
|
|
|
man_config.set('HAVE_INSTALLED_TESTS', '.\"')
|
|
|
|
|
else
|
|
|
|
|
man_config.set('HAVE_INSTALLED_TESTS', '')
|
|
|
|
|
endif
|
2023-06-09 12:50:57 +10:00
|
|
|
if get_option('debug-gui')
|
|
|
|
|
man_config.set('HAVE_DEBUG_GUI', '')
|
|
|
|
|
else
|
|
|
|
|
man_config.set('HAVE_DEBUG_GUI', '.\"')
|
|
|
|
|
endif
|
|
|
|
|
|
2021-02-18 09:47:14 +10:00
|
|
|
src_man += files(
|
|
|
|
|
'tools/libinput.man',
|
|
|
|
|
'tools/libinput-analyze.man',
|
2024-06-12 10:05:54 +10:00
|
|
|
'tools/libinput-analyze-buttons.man',
|
2021-02-18 09:47:14 +10:00
|
|
|
'tools/libinput-analyze-per-slot-delta.man',
|
2021-02-01 14:23:06 +10:00
|
|
|
'tools/libinput-analyze-recording.man',
|
2021-02-18 09:47:14 +10:00
|
|
|
'tools/libinput-analyze-touch-down-state.man',
|
|
|
|
|
'tools/libinput-debug-events.man',
|
|
|
|
|
'tools/libinput-debug-tablet.man',
|
|
|
|
|
'tools/libinput-list-devices.man',
|
2022-12-08 09:41:14 +10:00
|
|
|
'tools/libinput-list-kernel-devices.man',
|
2021-02-18 09:47:14 +10:00
|
|
|
'tools/libinput-measure.man',
|
|
|
|
|
'tools/libinput-measure-fuzz.man',
|
|
|
|
|
'tools/libinput-measure-touchpad-size.man',
|
|
|
|
|
'tools/libinput-measure-touchpad-tap.man',
|
|
|
|
|
'tools/libinput-measure-touchpad-pressure.man',
|
|
|
|
|
'tools/libinput-measure-touch-size.man',
|
|
|
|
|
'tools/libinput-quirks.man',
|
|
|
|
|
'tools/libinput-record.man',
|
|
|
|
|
'tools/libinput-replay.man',
|
2022-05-06 10:51:33 +10:00
|
|
|
'tools/libinput-test.man',
|
2021-02-18 09:47:14 +10:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
foreach m : src_man
|
|
|
|
|
configure_file(input : m,
|
|
|
|
|
output : '@BASENAME@.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install_dir : dir_man1)
|
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
|
|
# Same man page for the subtools to stay consistent with the other tools
|
|
|
|
|
configure_file(input : 'tools/libinput-quirks.man',
|
|
|
|
|
output : 'libinput-quirks-list.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install_dir : dir_man1,
|
|
|
|
|
)
|
|
|
|
|
configure_file(input : 'tools/libinput-quirks.man',
|
|
|
|
|
output : 'libinput-quirks-validate.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install_dir : dir_man1,
|
|
|
|
|
)
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
############ output files ############
|
2019-08-02 22:45:16 +10:00
|
|
|
configure_file(output : 'config.h', configuration : config_h)
|