2016-11-30 17:59:17 +10:00
|
|
|
project('libinput', 'c', 'cpp',
|
2018-06-13 15:45:27 +10:00
|
|
|
version : '1.11.900',
|
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' ],
|
|
|
|
|
meson_version : '>= 0.40.0')
|
|
|
|
|
|
|
|
|
|
libinput_version = meson.project_version().split('.')
|
|
|
|
|
|
|
|
|
|
# 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')
|
|
|
|
|
cppflags = ['-Wno-unused-parameter', '-g', '-fvisibility=hidden']
|
|
|
|
|
cflags = cppflags + ['-Wmissing-prototypes', '-Wstrict-prototypes']
|
2017-06-26 13:51:44 +10:00
|
|
|
add_project_arguments(cflags, language : 'c')
|
|
|
|
|
add_project_arguments(cppflags, language : 'cpp')
|
2016-11-30 17:59:17 +10:00
|
|
|
|
|
|
|
|
config_h = configuration_data()
|
|
|
|
|
config_h.set('_GNU_SOURCE', '1')
|
2018-06-27 13:26:51 +10:00
|
|
|
config_h.set_quoted('MESON_BUILD_ROOT', meson.build_root())
|
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
|
|
|
|
|
|
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')
|
|
|
|
|
dep_libevdev = dependency('libevdev', version : '>= 0.4')
|
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
|
|
|
|
|
dep_libwacom = dependency('libwacom', version : '>= 0.20')
|
|
|
|
|
|
|
|
|
|
code = '''
|
|
|
|
|
#include <libwacom/libwacom.h>
|
|
|
|
|
int main(void) { libwacom_get_paired_device(NULL); }
|
|
|
|
|
'''
|
|
|
|
|
result = cc.links(code,
|
|
|
|
|
name : 'libwacom_get_paired_device check',
|
|
|
|
|
dependencies : dep_libwacom)
|
|
|
|
|
config_h.set10('HAVE_LIBWACOM_GET_PAIRED_DEVICE', result)
|
2017-10-18 13:00:16 +10:00
|
|
|
|
|
|
|
|
code = '''
|
|
|
|
|
#include <libwacom/libwacom.h>
|
|
|
|
|
int main(void) { libwacom_get_button_evdev_code(NULL, 'A'); }
|
|
|
|
|
'''
|
|
|
|
|
result = cc.links(code,
|
|
|
|
|
name : 'libwacom_get_button_evdev_code check',
|
|
|
|
|
dependencies : dep_libwacom)
|
|
|
|
|
config_h.set10('HAVE_LIBWACOM_GET_BUTTON_EVDEV_CODE', result)
|
2017-07-05 09:30:59 +10:00
|
|
|
else
|
|
|
|
|
dep_libwacom = declare_dependency()
|
2016-11-30 17:59:17 +10:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
############ udev bits ############
|
|
|
|
|
|
|
|
|
|
udev_dir = get_option('udev-dir')
|
|
|
|
|
if udev_dir == ''
|
|
|
|
|
udev_dir = join_paths(get_option('prefix'), 'lib', 'udev')
|
|
|
|
|
endif
|
|
|
|
|
udev_rules_dir = join_paths(udev_dir, 'rules.d')
|
|
|
|
|
udev_hwdb_dir = join_paths(udev_dir, 'hwdb.d')
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
install_dir : udev_dir)
|
|
|
|
|
executable('libinput-model-quirks',
|
|
|
|
|
'udev/libinput-model-quirks.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,
|
|
|
|
|
install_dir : udev_dir)
|
|
|
|
|
|
|
|
|
|
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',
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : udev_rules_dir,
|
|
|
|
|
configuration : udev_rules_config)
|
|
|
|
|
|
|
|
|
|
litest_udev_rules_config = configuration_data()
|
2017-05-11 11:47:47 +10:00
|
|
|
litest_udev_rules_config.set('UDEV_TEST_PATH', meson.build_root() + '/')
|
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',
|
|
|
|
|
install : false,
|
|
|
|
|
configuration : litest_udev_rules_config)
|
|
|
|
|
|
|
|
|
|
############ libinput-util.a ############
|
|
|
|
|
src_libinput_util = [
|
|
|
|
|
'src/libinput-util.c',
|
|
|
|
|
'src/libinput-util.h'
|
|
|
|
|
]
|
|
|
|
|
libinput_util = static_library('libinput-util',
|
|
|
|
|
src_libinput_util,
|
2017-08-15 15:42:48 +01:00
|
|
|
dependencies : dep_udev,
|
|
|
|
|
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',
|
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',
|
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',
|
2016-11-30 17:59:17 +10:00
|
|
|
'src/filter.h',
|
|
|
|
|
'src/filter-private.h'
|
|
|
|
|
]
|
2017-12-01 09:27:05 +10:00
|
|
|
libfilter = static_library('filter', src_libfilter,
|
|
|
|
|
dependencies : dep_udev,
|
|
|
|
|
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 #############
|
|
|
|
|
libinput_data_path = join_paths(get_option('prefix'), get_option('datadir'), 'libinput')
|
|
|
|
|
libinput_data_override_path = join_paths(get_option('prefix'),
|
|
|
|
|
get_option('sysconfdir'),
|
|
|
|
|
'libinput',
|
|
|
|
|
'local-overrides.quirks')
|
|
|
|
|
config_h.set_quoted('LIBINPUT_DATA_DIR', libinput_data_path)
|
|
|
|
|
config_h.set_quoted('LIBINPUT_DATA_OVERRIDE_FILE', libinput_data_override_path)
|
|
|
|
|
|
|
|
|
|
quirks_data = [
|
|
|
|
|
'data/10-generic-keyboard.quirks',
|
|
|
|
|
'data/10-generic-lid.quirks',
|
|
|
|
|
'data/10-generic-trackball.quirks',
|
|
|
|
|
'data/30-vendor-aiptek.quirks',
|
|
|
|
|
'data/30-vendor-alps.quirks',
|
|
|
|
|
'data/30-vendor-cyapa.quirks',
|
|
|
|
|
'data/30-vendor-elantech.quirks',
|
|
|
|
|
'data/30-vendor-huion.quirks',
|
|
|
|
|
'data/30-vendor-ibm.quirks',
|
|
|
|
|
'data/30-vendor-logitech.quirks',
|
|
|
|
|
'data/30-vendor-microsoft.quirks',
|
|
|
|
|
'data/30-vendor-razer.quirks',
|
|
|
|
|
'data/30-vendor-synaptics.quirks',
|
|
|
|
|
'data/30-vendor-wacom.quirks',
|
|
|
|
|
'data/50-system-apple.quirks',
|
|
|
|
|
'data/50-system-asus.quirks',
|
|
|
|
|
'data/50-system-chicony.quirks',
|
|
|
|
|
'data/50-system-cyborg.quirks',
|
|
|
|
|
'data/50-system-dell.quirks',
|
|
|
|
|
'data/50-system-google.quirks',
|
|
|
|
|
'data/50-system-hp.quirks',
|
|
|
|
|
'data/50-system-lenovo.quirks',
|
|
|
|
|
'data/50-system-system76.quirks',
|
|
|
|
|
]
|
|
|
|
|
|
2018-05-24 15:36:22 +10:00
|
|
|
config_h.set_quoted('LIBINPUT_DATA_FILES', ':'.join(quirks_data))
|
|
|
|
|
config_h.set_quoted('LIBINPUT_DATA_SRCDIR', join_paths(meson.source_root(), 'data'))
|
|
|
|
|
|
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
|
|
|
install_data(quirks_data, install_dir : libinput_data_path)
|
|
|
|
|
|
|
|
|
|
src_libquirks = [
|
|
|
|
|
'src/quirks.c',
|
|
|
|
|
'src/quirks.h',
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
deps_libquirks = [dep_udev, dep_libinput_util]
|
|
|
|
|
libquirks = static_library('quirks', src_libquirks,
|
|
|
|
|
dependencies : deps_libquirks,
|
|
|
|
|
include_directories : includes_include)
|
|
|
|
|
dep_libquirks = declare_dependency(link_with : libquirks)
|
|
|
|
|
|
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',
|
|
|
|
|
'src/libinput.h',
|
|
|
|
|
'src/libinput-private.h',
|
|
|
|
|
'src/evdev.c',
|
|
|
|
|
'src/evdev.h',
|
2017-11-13 09:33:50 +10:00
|
|
|
'src/evdev-debounce.c',
|
2017-09-19 13:57:50 +10:00
|
|
|
'src/evdev-fallback.c',
|
2017-11-13 09:30:30 +10:00
|
|
|
'src/evdev-fallback.h',
|
2016-11-30 17:59:17 +10:00
|
|
|
'src/evdev-middle-button.c',
|
|
|
|
|
'src/evdev-mt-touchpad.c',
|
|
|
|
|
'src/evdev-mt-touchpad.h',
|
|
|
|
|
'src/evdev-mt-touchpad-tap.c',
|
|
|
|
|
'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.h',
|
|
|
|
|
'src/evdev-tablet-pad.c',
|
|
|
|
|
'src/evdev-tablet-pad.h',
|
|
|
|
|
'src/evdev-tablet-pad-leds.c',
|
|
|
|
|
'src/path-seat.h',
|
|
|
|
|
'src/path-seat.c',
|
|
|
|
|
'src/udev-seat.c',
|
|
|
|
|
'src/udev-seat.h',
|
|
|
|
|
'src/timer.c',
|
|
|
|
|
'src/timer.h',
|
|
|
|
|
'include/linux/input.h'
|
|
|
|
|
]
|
2018-04-10 13:07:19 +10:00
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
deps_libinput = [
|
|
|
|
|
dep_mtdev,
|
|
|
|
|
dep_udev,
|
|
|
|
|
dep_libevdev,
|
|
|
|
|
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,
|
2017-06-26 13:51:44 +10:00
|
|
|
install : false,
|
2016-11-30 17:59:17 +10:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
mapfile = join_paths(meson.source_root(), 'src', 'libinput.sym')
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2018-04-13 14:39:58 +10:00
|
|
|
if meson.version().version_compare('<0.4.3.0')
|
|
|
|
|
# Restore the SELinux context for the libinput.so.a.b.c on install
|
|
|
|
|
# meson bug https://github.com/mesonbuild/meson/issues/1967
|
|
|
|
|
meson.add_install_script('src/libinput-restore-selinux-context.sh',
|
|
|
|
|
join_paths(get_option('prefix'), get_option('libdir')),
|
|
|
|
|
lib_libinput.full_path())
|
|
|
|
|
endif
|
2017-06-21 09:16:06 +10:00
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
############ documentation ############
|
|
|
|
|
|
2017-06-20 11:17:39 +10:00
|
|
|
if get_option('documentation')
|
2018-03-19 14:52:57 +10:00
|
|
|
doxygen = find_program('doxygen', required : false)
|
|
|
|
|
if not doxygen.found()
|
|
|
|
|
error('Program "doxygen" not found or not executable. Try building with -Ddocumentation=false')
|
|
|
|
|
endif
|
|
|
|
|
dot = find_program('dot', required : false)
|
|
|
|
|
if not dot.found()
|
|
|
|
|
error('Program "dot" not found or not executable. Try building with -Ddocumentation=false')
|
|
|
|
|
endif
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
doxygen_version_cmd = run_command(doxygen.path(), '--version')
|
|
|
|
|
if doxygen_version_cmd.returncode() != 0
|
|
|
|
|
error('Command "doxygen --version" failed.')
|
|
|
|
|
endif
|
|
|
|
|
doxygen_version = doxygen_version_cmd.stdout()
|
|
|
|
|
if doxygen_version.version_compare('< 1.8.3')
|
|
|
|
|
error('doxygen needs to be at least version 1.8.3 (have @0@)'.format(doxygen_version))
|
|
|
|
|
endif
|
|
|
|
|
grep = find_program('grep')
|
|
|
|
|
dot_version_cmd = run_command(dot.path(), '-V')
|
|
|
|
|
if dot_version_cmd.returncode() != 0
|
|
|
|
|
error('Command "dot -V" failed.')
|
|
|
|
|
endif
|
|
|
|
|
# dot -V output is (to stderr):
|
|
|
|
|
# dot - graphviz version 2.38.0 (20140413.2041)
|
|
|
|
|
dot_version = dot_version_cmd.stderr().split(' ')[4]
|
|
|
|
|
if dot_version.version_compare('< 2.26')
|
|
|
|
|
error('Graphviz dot needs to be at least version 2.26 (have @0@)'.format(dot_version))
|
|
|
|
|
endif
|
|
|
|
|
|
2018-07-05 12:17:26 +10:00
|
|
|
readme = vcs_tag(command : ['git', 'log', '-1', '--format=%h'],
|
|
|
|
|
fallback : 'unknown',
|
|
|
|
|
input : 'README.md',
|
|
|
|
|
output : 'README.md',
|
|
|
|
|
replace_string: '__GIT_VERSION__')
|
|
|
|
|
|
2018-07-05 13:34:22 +10:00
|
|
|
src_doxygen = files(
|
2016-11-30 17:59:17 +10:00
|
|
|
# source files
|
2018-07-05 13:34:22 +10:00
|
|
|
'src/libinput.h',
|
2016-11-30 17:59:17 +10:00
|
|
|
# written docs
|
2018-07-05 13:34:22 +10:00
|
|
|
'doc/absolute-axes.dox',
|
|
|
|
|
'doc/absolute-coordinate-ranges.dox',
|
|
|
|
|
'doc/architecture.dox',
|
|
|
|
|
'doc/building.dox',
|
|
|
|
|
'doc/button_debouncing.dox',
|
|
|
|
|
'doc/clickpad-softbuttons.dox',
|
|
|
|
|
'doc/contributing.dox',
|
|
|
|
|
'doc/device-configuration-via-udev.dox',
|
|
|
|
|
'doc/device-quirks.dox',
|
|
|
|
|
'doc/faqs.dox',
|
|
|
|
|
'doc/gestures.dox',
|
|
|
|
|
'doc/middle-button-emulation.dox',
|
|
|
|
|
'doc/normalization-of-relative-motion.dox',
|
|
|
|
|
'doc/palm-detection.dox',
|
|
|
|
|
'doc/page-hierarchy.dox',
|
|
|
|
|
'doc/pointer-acceleration.dox',
|
|
|
|
|
'doc/reporting-bugs.dox',
|
|
|
|
|
'doc/scrolling.dox',
|
|
|
|
|
'doc/seats.dox',
|
|
|
|
|
'doc/switches.dox',
|
|
|
|
|
'doc/t440-support.dox',
|
|
|
|
|
'doc/tablet-support.dox',
|
|
|
|
|
'doc/tapping.dox',
|
|
|
|
|
'doc/test-suite.dox',
|
|
|
|
|
'doc/timestamps.dox',
|
|
|
|
|
'doc/tools.dox',
|
|
|
|
|
'doc/touchpad-jumping-cursors.dox',
|
|
|
|
|
'doc/touchpad-pressure.dox',
|
|
|
|
|
'doc/touchpad-jitter.dox',
|
|
|
|
|
'doc/touchpads.dox',
|
|
|
|
|
'doc/trackpoints.dox',
|
|
|
|
|
'doc/what-is-libinput.dox',
|
2016-11-30 17:59:17 +10:00
|
|
|
# dot drawings
|
2018-07-05 13:34:22 +10:00
|
|
|
'doc/dot/seats-sketch.gv',
|
|
|
|
|
'doc/dot/seats-sketch-libinput.gv',
|
|
|
|
|
'doc/dot/libinput-stack-wayland.gv',
|
|
|
|
|
'doc/dot/libinput-stack-xorg.gv',
|
|
|
|
|
'doc/dot/libinput-stack-gnome.gv',
|
|
|
|
|
'doc/dot/evemu.gv',
|
2016-11-30 17:59:17 +10:00
|
|
|
# svgs
|
2018-07-05 13:34:22 +10:00
|
|
|
'doc/svg/button-debouncing-wave-diagram.svg',
|
|
|
|
|
'doc/svg/button-scrolling.svg',
|
|
|
|
|
'doc/svg/clickfinger.svg',
|
|
|
|
|
'doc/svg/clickfinger-distance.svg',
|
|
|
|
|
'doc/svg/edge-scrolling.svg',
|
|
|
|
|
'doc/svg/gesture-2fg-ambiguity.svg',
|
|
|
|
|
'doc/svg/palm-detection.svg',
|
|
|
|
|
'doc/svg/pinch-gestures.svg',
|
|
|
|
|
'doc/svg/pinch-gestures-softbuttons.svg',
|
|
|
|
|
'doc/svg/ptraccel-linear.svg',
|
|
|
|
|
'doc/svg/ptraccel-low-dpi.svg',
|
|
|
|
|
'doc/svg/ptraccel-touchpad.svg',
|
|
|
|
|
'doc/svg/ptraccel-trackpoint.svg',
|
|
|
|
|
'doc/svg/software-buttons.svg',
|
|
|
|
|
'doc/svg/swipe-gestures.svg',
|
|
|
|
|
'doc/svg/tablet-axes.svg',
|
|
|
|
|
'doc/svg/tablet-cintiq24hd-modes.svg',
|
|
|
|
|
'doc/svg/tablet-interfaces.svg',
|
|
|
|
|
'doc/svg/tablet-intuos-modes.svg',
|
|
|
|
|
'doc/svg/tablet-left-handed.svg',
|
|
|
|
|
'doc/svg/tablet-out-of-bounds.svg',
|
|
|
|
|
'doc/svg/tablet.svg',
|
|
|
|
|
'doc/svg/tap-n-drag.svg',
|
|
|
|
|
'doc/svg/thumb-detection.svg',
|
|
|
|
|
'doc/svg/top-software-buttons.svg',
|
|
|
|
|
'doc/svg/touchscreen-gestures.svg',
|
|
|
|
|
'doc/svg/twofinger-scrolling.svg',
|
2016-11-30 17:59:17 +10:00
|
|
|
# style files
|
2018-07-05 13:34:22 +10:00
|
|
|
'doc/style/header.html',
|
|
|
|
|
'doc/style/footer.html',
|
|
|
|
|
'doc/style/customdoxygen.css',
|
|
|
|
|
'doc/style/bootstrap.css',
|
|
|
|
|
'doc/style/libinputdoxygen.css',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# doxygen expects a space-separated list of input files in its
|
|
|
|
|
# doxyfile so we build a new list containing all full paths
|
|
|
|
|
# and merge it with ' '.join() later
|
|
|
|
|
doxy_input_files = []
|
|
|
|
|
foreach f : src_doxygen
|
|
|
|
|
doxy_input_files += [join_paths(meson.source_root(), '@0@'.format(f))]
|
|
|
|
|
endforeach
|
2016-11-30 17:59:17 +10:00
|
|
|
|
2018-07-05 12:17:26 +10:00
|
|
|
doxy_input_files += [readme.full_path()]
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
doc_config = configuration_data()
|
|
|
|
|
doc_config.set('PACKAGE_NAME', meson.project_name())
|
|
|
|
|
doc_config.set('PACKAGE_VERSION', meson.project_version())
|
|
|
|
|
doc_config.set('top_srcdir', meson.source_root())
|
2018-07-05 13:34:22 +10:00
|
|
|
doc_config.set('INPUT', ' '.join(doxy_input_files))
|
2018-07-05 12:17:26 +10:00
|
|
|
doc_config.set('README_MD', readme.full_path())
|
2016-11-30 17:59:17 +10:00
|
|
|
|
|
|
|
|
doxyfile = configure_file(input : 'doc/libinput.doxygen.in',
|
|
|
|
|
output : 'libinput.doxygen',
|
|
|
|
|
configuration : doc_config,
|
|
|
|
|
install : false)
|
2018-07-05 12:17:26 +10:00
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
custom_target('doxygen',
|
2018-07-05 12:17:26 +10:00
|
|
|
input : [ doxyfile, readme ] + src_doxygen,
|
2018-07-03 13:40:45 +10:00
|
|
|
output : [ 'Documentation' ],
|
2016-11-30 17:59:17 +10:00
|
|
|
command : [ doxygen, doxyfile ],
|
|
|
|
|
install : false,
|
|
|
|
|
build_by_default : true)
|
|
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
############ tools ############
|
2017-05-25 10:12:26 +10:00
|
|
|
libinput_tool_path = join_paths(get_option('prefix'), get_option('libexecdir'), 'libinput')
|
|
|
|
|
config_h.set_quoted('LIBINPUT_TOOL_PATH', libinput_tool_path)
|
2016-11-30 17:59:17 +10:00
|
|
|
tools_shared_sources = [ 'tools/shared.c',
|
|
|
|
|
'tools/shared.h' ]
|
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-29 08:40:28 +10:00
|
|
|
man_config = configuration_data()
|
|
|
|
|
man_config.set('LIBINPUT_VERSION', meson.project_version())
|
|
|
|
|
|
2017-06-23 15:13:20 +10:00
|
|
|
deps_tools = [ dep_tools_shared, dep_libinput ]
|
2017-05-25 15:47:19 +10:00
|
|
|
libinput_debug_events_sources = [ 'tools/libinput-debug-events.c' ]
|
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
|
|
|
|
|
)
|
2017-06-29 08:40:28 +10:00
|
|
|
configure_file(input : 'tools/libinput-debug-events.man',
|
|
|
|
|
output : 'libinput-debug-events.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
2016-11-30 17:59:17 +10:00
|
|
|
|
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,
|
|
|
|
|
args: ['validate', '--data-dir=@0@'.format(join_paths(meson.source_root(), 'data'))]
|
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
|
|
|
|
2018-06-26 13:15:13 +10:00
|
|
|
configure_file(input : 'tools/libinput-quirks.man',
|
|
|
|
|
output : 'libinput-quirks.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
|
|
|
|
# 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 : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
|
|
|
|
configure_file(input : 'tools/libinput-quirks.man',
|
|
|
|
|
output : 'libinput-quirks-validate.1',
|
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
|
|
|
configuration : man_config,
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
|
|
|
|
|
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,
|
|
|
|
|
)
|
|
|
|
|
test('list-devices', libinput_list_devices)
|
|
|
|
|
|
2017-06-29 08:40:28 +10:00
|
|
|
configure_file(input : 'tools/libinput-list-devices.man',
|
|
|
|
|
output : 'libinput-list-devices.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
2017-05-11 13:11:23 +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,
|
|
|
|
|
)
|
2017-06-29 08:40:28 +10:00
|
|
|
configure_file(input : 'tools/libinput-measure.man',
|
|
|
|
|
output : 'libinput-measure.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
2018-04-26 11:47:54 +10:00
|
|
|
|
|
|
|
|
install_data('tools/libinput-measure-fuzz',
|
|
|
|
|
install_dir : libinput_tool_path)
|
|
|
|
|
configure_file(input : 'tools/libinput-measure-fuzz.man',
|
|
|
|
|
output : 'libinput-measure-fuzz.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
2017-05-23 15:07:31 +10:00
|
|
|
|
2017-09-06 11:01:49 +10:00
|
|
|
install_data('tools/libinput-measure-touchpad-tap',
|
|
|
|
|
install_dir : libinput_tool_path)
|
2017-06-29 08:40:28 +10:00
|
|
|
configure_file(input : 'tools/libinput-measure-touchpad-tap.man',
|
|
|
|
|
output : 'libinput-measure-touchpad-tap.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
2017-05-23 15:07:31 +10:00
|
|
|
|
2018-06-21 14:38:55 +10:00
|
|
|
config_builddir = configuration_data()
|
|
|
|
|
config_builddir.set('BUILDDIR', meson.build_root())
|
|
|
|
|
# libinput-measure-touchpad-pressure gets built but we install_data the
|
2018-06-26 13:15:13 +10:00
|
|
|
# source instead. The built file is the one that uses the local quirks
|
2018-06-21 14:38:55 +10:00
|
|
|
# and should be used for debugging.
|
2017-06-27 14:16:57 +10:00
|
|
|
install_data('tools/libinput-measure-touchpad-pressure',
|
|
|
|
|
install_dir : libinput_tool_path)
|
2018-06-21 14:38:55 +10:00
|
|
|
configure_file(input: 'tools/libinput-measure-touchpad-pressure',
|
|
|
|
|
output: 'libinput-measure-touchpad-pressure',
|
|
|
|
|
configuration : config_builddir
|
|
|
|
|
)
|
|
|
|
|
|
2017-06-27 14:16:57 +10:00
|
|
|
configure_file(input : 'tools/libinput-measure-touchpad-pressure.man',
|
|
|
|
|
output : 'libinput-measure-touchpad-pressure.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
2018-06-21 14:38:55 +10:00
|
|
|
# libinput-measure-touch-size gets built but we install_data the source
|
2018-06-26 13:15:13 +10:00
|
|
|
# instead. The built file is the one that uses the local quirks and
|
2018-06-21 14:38:55 +10:00
|
|
|
# should be used for debugging.
|
2017-07-05 18:50:52 +10:00
|
|
|
install_data('tools/libinput-measure-touch-size',
|
|
|
|
|
install_dir : libinput_tool_path)
|
2018-06-21 14:38:55 +10:00
|
|
|
configure_file(input: 'tools/libinput-measure-touch-size',
|
|
|
|
|
output: 'libinput-measure-touch-size',
|
|
|
|
|
configuration : config_builddir
|
|
|
|
|
)
|
|
|
|
|
|
2017-07-05 18:50:52 +10:00
|
|
|
configure_file(input : 'tools/libinput-measure-touch-size.man',
|
|
|
|
|
output : 'libinput-measure-touch-size.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
2017-06-27 14:16:57 +10:00
|
|
|
|
2017-05-11 17:17:54 +10:00
|
|
|
install_data('tools/libinput-measure-trackpoint-range',
|
|
|
|
|
install_dir : libinput_tool_path)
|
|
|
|
|
configure_file(input : 'tools/libinput-measure-trackpoint-range.man',
|
|
|
|
|
output : 'libinput-measure-trackpoint-range.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
|
|
|
|
|
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,
|
|
|
|
|
)
|
|
|
|
|
configure_file(input : 'tools/libinput-record.man',
|
|
|
|
|
output : 'libinput-record.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
|
|
|
|
|
2017-11-23 15:31:43 +10:00
|
|
|
install_data('tools/libinput-replay',
|
|
|
|
|
install_dir : libinput_tool_path)
|
|
|
|
|
configure_file(input : 'tools/libinput-replay.man',
|
|
|
|
|
output : 'libinput-replay.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
|
|
|
|
|
2017-05-24 10:36:44 +10:00
|
|
|
if get_option('debug-gui')
|
2017-10-26 16:45:24 +10:00
|
|
|
dep_gtk = dependency('gtk+-3.0', version : '>= 3.20')
|
2016-11-30 17:59:17 +10:00
|
|
|
dep_cairo = dependency('cairo')
|
|
|
|
|
dep_glib = dependency('glib-2.0')
|
|
|
|
|
|
2017-05-25 15:47:19 +10:00
|
|
|
debug_gui_sources = [ 'tools/libinput-debug-gui.c' ]
|
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,
|
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
|
|
|
)
|
2017-06-29 08:40:28 +10:00
|
|
|
configure_file(input : 'tools/libinput-debug-gui.man',
|
|
|
|
|
output : 'libinput-debug-gui.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
2016-11-30 17:59:17 +10:00
|
|
|
endif
|
|
|
|
|
|
2017-05-24 10:36:44 +10:00
|
|
|
libinput_sources = [ 'tools/libinput-tool.c' ]
|
|
|
|
|
|
|
|
|
|
executable('libinput',
|
|
|
|
|
libinput_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-24 10:36:44 +10:00
|
|
|
install : true
|
|
|
|
|
)
|
2017-06-29 08:40:28 +10:00
|
|
|
configure_file(input : 'tools/libinput.man',
|
|
|
|
|
output : 'libinput.1',
|
|
|
|
|
configuration : man_config,
|
|
|
|
|
install : true,
|
|
|
|
|
install_dir : join_paths(get_option('mandir'), 'man1')
|
|
|
|
|
)
|
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-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',
|
|
|
|
|
'tools/test-builddir-lookup.c',
|
|
|
|
|
dependencies : [ dep_tools_shared],
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
install : false)
|
|
|
|
|
test('tools-builddir-lookup',
|
|
|
|
|
test_builddir_lookup,
|
|
|
|
|
args : ['--builddir-is-set'])
|
|
|
|
|
test('tools-builddir-lookup-installed',
|
|
|
|
|
find_program('tools/helper-copy-and-exec-from-tmp.sh'),
|
|
|
|
|
args : [test_builddir_lookup.full_path(), '--builddir-is-null'],
|
|
|
|
|
env : ['LD_LIBRARY_PATH=@0@'.format(meson.build_root())],
|
|
|
|
|
workdir : '/tmp')
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
############ tests ############
|
|
|
|
|
|
2018-06-14 14:48:49 +10:00
|
|
|
test_symbols_leak = find_program('test/symbols-leak-test.in')
|
|
|
|
|
test('symbols-leak-test',
|
|
|
|
|
test_symbols_leak,
|
|
|
|
|
args : [ meson.current_source_dir() ])
|
|
|
|
|
|
|
|
|
|
# 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],
|
|
|
|
|
c_args : ['-std=gnu90', '-Werror'],
|
|
|
|
|
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)
|
|
|
|
|
# test including from C++
|
|
|
|
|
executable('test-build-cxx',
|
|
|
|
|
'test/build-cxx.cc',
|
|
|
|
|
dependencies : [dep_udev],
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
install : false)
|
|
|
|
|
|
|
|
|
|
# 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')
|
|
|
|
|
valgrind = find_program('valgrind')
|
|
|
|
|
addr2line = find_program('addr2line')
|
|
|
|
|
|
|
|
|
|
if addr2line.found()
|
|
|
|
|
config_h.set('HAVE_ADDR2LINE', '1')
|
|
|
|
|
config_h.set_quoted('ADDR2LINE', addr2line.path())
|
|
|
|
|
endif
|
|
|
|
|
|
2018-03-23 10:29:28 +10:00
|
|
|
leftover_rules = find_program('test/check-leftover-udev-rules.sh')
|
|
|
|
|
test('leftover-rules', leftover_rules, is_parallel : false)
|
|
|
|
|
|
2017-06-26 13:51:44 +10:00
|
|
|
dep_libunwind = dependency('libunwind', required : false)
|
2016-11-30 17:59:17 +10:00
|
|
|
config_h.set10('HAVE_LIBUNWIND', dep_libunwind.found())
|
|
|
|
|
|
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())
|
|
|
|
|
|
2016-11-30 17:59:17 +10:00
|
|
|
lib_litest_sources = [
|
|
|
|
|
'test/litest.h',
|
|
|
|
|
'test/litest-int.h',
|
|
|
|
|
'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',
|
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',
|
|
|
|
|
'test/litest-device-elantech-touchpad.c',
|
|
|
|
|
'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',
|
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',
|
|
|
|
|
'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',
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-device-lid-switch.c',
|
|
|
|
|
'test/litest-device-lid-switch-surface3.c',
|
|
|
|
|
'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',
|
|
|
|
|
'test/litest-device-synaptics.c',
|
|
|
|
|
'test/litest-device-synaptics-hover.c',
|
|
|
|
|
'test/litest-device-synaptics-i2c.c',
|
|
|
|
|
'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',
|
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',
|
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',
|
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',
|
|
|
|
|
'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',
|
|
|
|
|
'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',
|
|
|
|
|
'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',
|
|
|
|
|
'test/litest.c'
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
dep_dl = cc.find_library('dl')
|
|
|
|
|
deps_litest = [
|
|
|
|
|
dep_libinput,
|
|
|
|
|
dep_check,
|
|
|
|
|
dep_libunwind,
|
|
|
|
|
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
|
|
|
]
|
|
|
|
|
|
2017-05-17 14:01:02 +10:00
|
|
|
configure_file(input : 'udev/80-libinput-test-device.rules',
|
|
|
|
|
output : '80-libinput-test-device.rules',
|
|
|
|
|
install : false,
|
|
|
|
|
configuration : udev_rules_config)
|
|
|
|
|
|
|
|
|
|
config_h.set_quoted('LIBINPUT_TEST_DEVICE_RULES_FILE',
|
|
|
|
|
join_paths(meson.build_root(), '80-libinput-test-device.rules'))
|
|
|
|
|
config_h.set_quoted('LIBINPUT_DEVICE_GROUPS_RULES_FILE',
|
|
|
|
|
join_paths(meson.build_root(), '80-libinput-device-groups.rules'))
|
2016-11-30 17:59:17 +10:00
|
|
|
lib_litest = static_library('litest',
|
|
|
|
|
lib_litest_sources,
|
2017-08-15 15:42:48 +01:00
|
|
|
include_directories : [includes_src, includes_include],
|
2017-05-17 14:01:02 +10:00
|
|
|
dependencies : deps_litest)
|
2016-11-30 17:59:17 +10:00
|
|
|
dep_litest = declare_dependency(link_with : lib_litest,
|
|
|
|
|
dependencies : deps_litest)
|
|
|
|
|
|
|
|
|
|
def_no_main = '-DLITEST_NO_MAIN'
|
|
|
|
|
def_disable_backtrace = '-DLITEST_DISABLE_BACKTRACE_LOGGING'
|
|
|
|
|
defs_litest_selftest = [
|
|
|
|
|
def_no_main,
|
|
|
|
|
def_disable_backtrace
|
2017-05-17 14:01:02 +10:00
|
|
|
]
|
2017-09-21 09:25:04 +10:00
|
|
|
test_litest_selftest_sources = lib_litest_sources + [
|
2016-11-30 17:59:17 +10:00
|
|
|
'test/litest-selftest.c',
|
|
|
|
|
'test/litest.c',
|
|
|
|
|
'test/litest-int.h',
|
|
|
|
|
'test/litest.h'
|
|
|
|
|
]
|
|
|
|
|
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)
|
|
|
|
|
test('test-litest-selftest', test_litest_selftest)
|
|
|
|
|
|
2017-09-21 09:25:04 +10:00
|
|
|
libinput_test_runner_sources = lib_litest_sources + [
|
2017-07-07 09:47:06 +10:00
|
|
|
'src/libinput-util.h',
|
|
|
|
|
'src/libinput-util.c',
|
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',
|
|
|
|
|
'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
|
|
|
]
|
|
|
|
|
def_LT_VERSION = '-DLIBINPUT_LT_VERSION="@0@:@1@:@2@"'.format(libinput_lt_c, libinput_lt_r, libinput_lt_a)
|
|
|
|
|
libinput_test_runner = executable('libinput-test-suite-runner',
|
|
|
|
|
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,
|
2016-11-30 17:59:17 +10:00
|
|
|
c_args : [ def_LT_VERSION ],
|
|
|
|
|
install : false)
|
|
|
|
|
test('libinput-test-suite-runner',
|
|
|
|
|
libinput_test_runner,
|
2017-06-02 09:35:56 +10:00
|
|
|
timeout : 1200)
|
2016-11-30 17:59:17 +10:00
|
|
|
|
2018-06-21 17:05:30 +10:00
|
|
|
libinput_test_deviceless = executable('libinput-test-deviceless',
|
|
|
|
|
libinput_test_runner_sources,
|
|
|
|
|
include_directories : [includes_src, includes_include],
|
|
|
|
|
dependencies : deps_litest,
|
|
|
|
|
c_args : [ def_LT_VERSION, '-DDISABLE_DEVICE_TESTS=1' ],
|
|
|
|
|
install : false)
|
|
|
|
|
test('libinput-test-deviceless', libinput_test_deviceless)
|
|
|
|
|
|
2017-06-02 09:35:56 +10:00
|
|
|
valgrind_env = environment()
|
|
|
|
|
valgrind_env.set('CK_FORK', 'no')
|
|
|
|
|
valgrind_env.set('USING_VALGRIND', '1')
|
|
|
|
|
valgrind_suppressions_file = join_paths(meson.source_root(), 'test', 'valgrind.suppressions')
|
|
|
|
|
add_test_setup('valgrind',
|
|
|
|
|
exe_wrapper : [ valgrind,
|
|
|
|
|
'--leak-check=full',
|
|
|
|
|
'--error-exitcode=3',
|
|
|
|
|
'--suppressions=' + valgrind_suppressions_file ],
|
|
|
|
|
env : valgrind_env,
|
|
|
|
|
timeout_multiplier : 100)
|
2016-11-30 17:59:17 +10:00
|
|
|
endif
|
|
|
|
|
############ output files ############
|
2017-06-26 13:51:44 +10:00
|
|
|
configure_file(output : 'config.h', install : false, configuration : config_h)
|