• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1ir_keytable_sources = files(
2    'ir-encode.c',
3    'ir-encode.h',
4    'keymap.c',
5    'keymap.h',
6    'keytable.c',
7    'parse.h',
8    'toml.c',
9    'toml.h',
10)
11
12ir_keytable_deps = [
13    dep_argp,
14]
15
16ir_keytable_system_dir = udevdir
17ir_keytable_user_dir = get_option('sysconfdir') / 'rc_keymaps'
18
19ir_keytable_c_args = [
20    '-DIR_KEYTABLE_SYSTEM_DIR="@0@"'.format(ir_keytable_system_dir / 'rc_keymaps'),
21    '-DIR_KEYTABLE_USER_DIR="@0@"'.format(ir_keytable_user_dir),
22]
23
24ir_bpf_enabled = prog_clang.found() and dep_libbpf.found() and dep_libelf.found()
25
26if ir_bpf_enabled
27    ir_keytable_sources += files(
28        'bpf_load.c',
29        'bpf_load.h',
30    )
31    ir_keytable_deps += [
32        dep_libbpf,
33        dep_libelf,
34    ]
35    ir_keytable_c_args += [
36        '-DHAVE_BPF',
37    ]
38    subdir('bpf_protocols')
39endif
40
41ir_keytable_incdir = [
42    utils_common_incdir,
43    v4l2_utils_incdir,
44]
45
46ir_keytable = executable('ir-keytable',
47                         sources : ir_keytable_sources,
48                         install : true,
49                         dependencies : ir_keytable_deps,
50                         c_args : ir_keytable_c_args,
51                         include_directories : ir_keytable_incdir)
52
53man_pages += [[ meson.current_source_dir(), 'ir-keytable', 1 ]]
54man_pages += [[ meson.current_source_dir(), 'rc_keymap', 5 ]]
55
56ir_keytable_sysconf_files = files(
57    'rc_maps.cfg',
58)
59install_data(ir_keytable_sysconf_files,
60             install_dir : get_option('sysconfdir'))
61
62subdir('rc_keymaps')
63install_data(ir_keytable_rc_keymaps,
64             install_dir : ir_keytable_system_dir / 'rc_keymaps')
65
66ir_keytable_udev_rules = files(
67    '70-infrared.rules',
68)
69install_data(ir_keytable_udev_rules,
70             install_dir : ir_keytable_system_dir / 'rules.d')
71
72if ir_bpf_enabled
73if dep_systemd.found()
74if have_udevdsyscallfilter
75    ir_keytable_systemd_files = files(
76        '50-rc_keymap.conf',
77    )
78    install_data(ir_keytable_systemd_files,
79                 install_dir : systemd_systemdir / 'systemd-udevd.service.d')
80endif
81endif
82endif
83
84# Install non-existing directory to create empty directory structure
85# See: https://github.com/mesonbuild/meson/issues/2904
86# This should be replaced with install_emptydir() when bumping the minimum meson
87# version to 0.60.0.
88install_subdir('protocols',
89               install_dir : ir_keytable_user_dir)
90