summaryrefslogtreecommitdiffstats
path: root/hwdb.d/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 13:00:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 13:00:47 +0000
commit2cb7e0aaedad73b076ea18c6900b0e86c5760d79 (patch)
treeda68ca54bb79f4080079bf0828acda937593a4e1 /hwdb.d/meson.build
parentInitial commit. (diff)
downloadsystemd-upstream.tar.xz
systemd-upstream.zip
Adding upstream version 247.3.upstream/247.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'hwdb.d/meson.build')
-rw-r--r--hwdb.d/meson.build72
1 files changed, 72 insertions, 0 deletions
diff --git a/hwdb.d/meson.build b/hwdb.d/meson.build
new file mode 100644
index 0000000..6fcb364
--- /dev/null
+++ b/hwdb.d/meson.build
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+# Those files right now are not supported by the grammar. Also,
+# they are very long but quite repetitive and the parser is not very fast.
+# So we don't "test" them.
+hwdb_files_notest = files('''
+ 20-pci-vendor-model.hwdb
+ 20-pci-classes.hwdb
+ 20-usb-vendor-model.hwdb
+ 20-usb-classes.hwdb
+ 20-sdio-vendor-model.hwdb
+ 20-sdio-classes.hwdb
+ 20-bluetooth-vendor-product.hwdb
+ 20-acpi-vendor.hwdb
+ 20-OUI.hwdb
+ 20-net-ifname.hwdb
+ 20-vmbus-class.hwdb
+'''.split())
+
+hwdb_files_test = files('''
+ 60-autosuspend.hwdb
+ 60-evdev.hwdb
+ 60-input-id.hwdb
+ 60-keyboard.hwdb
+ 60-sensor.hwdb
+ 70-joystick.hwdb
+ 70-mouse.hwdb
+ 70-pointingstick.hwdb
+ 70-touchpad.hwdb
+'''.split())
+
+if conf.get('ENABLE_HWDB') == 1
+ auto_suspend_rules = custom_target(
+ '60-autosuspend-chromiumos.hwdb',
+ output : '60-autosuspend-chromiumos.hwdb',
+ command : make_autosuspend_rules_py,
+ capture : true,
+ install : true,
+ install_dir: udevhwdbdir)
+
+ install_data(hwdb_files_notest,
+ hwdb_files_test,
+ install_dir : udevhwdbdir)
+
+ if install_sysconfdir
+ meson.add_install_script('sh', '-c',
+ mkdir_p.format(join_paths(sysconfdir, 'udev/hwdb.d')))
+
+ meson.add_install_script('sh', '-c',
+ 'test -n "$DESTDIR" || @0@/systemd-hwdb update'
+ .format(rootbindir))
+ endif
+
+ if want_tests != 'false'
+ parse_hwdb_py = find_program('parse_hwdb.py')
+ test('parse-hwdb',
+ parse_hwdb_py,
+ args : [hwdb_files_test,
+ auto_suspend_rules],
+ timeout : 90)
+ endif
+endif
+
+############################################################
+
+run_target(
+ 'hwdb-update',
+ command : [hwdb_update_sh, meson.current_source_dir()])
+
+run_target(
+ 'autosuspend-update',
+ command : [autosuspend_update_sh, project_source_root + '/tools/chromiumos'])