1
0
mirror of https://github.com/systemd/systemd synced 2025-10-06 00:13:24 +02:00
Files
systemd/hwdb.d/meson.build
Zbigniew Jędrzejewski-Szmek c5dcbd073e meson: use files() not find_program() for helper scripts
We went back and forth between 'prog.sh', files('prog.sh'), and
find_program('prog.sh'). We want to use files() or find_program() so that we
get a good error message if the file is missing. Behaviour of meson changed
over time, and in the past not all forms could be used in all places. For
example 0f4c4f3824 added find_program() in many
places to avoid repeated messages. But it seems that all recent meson versions
work fine with files().

find_program prints silly messages:
  Program tools/make-man-index.py found: YES
       (/home/zbyszek/src/systemd/tools/make-man-index.py)
  Program tools/meson-render-jinja2.py found: YES
       (/home/zbyszek/src/systemd/tools/meson-render-jinja2.py)
  ...
We know that those files will be found, they are part of the git checkout.
With files() this is gone and the meson output is easier to read.
2025-07-25 14:04:17 +02:00

84 lines
2.7 KiB
Meson

# 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(
'README',
'20-dmi-id.hwdb',
'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')
hwdb_files_test = files(
'60-autosuspend.hwdb',
'60-autosuspend-fingerprint-reader.hwdb',
'60-evdev.hwdb',
'60-input-id.hwdb',
'60-keyboard.hwdb',
'60-seat.hwdb',
'60-sensor.hwdb',
'70-analyzers.hwdb',
'70-av-production.hwdb',
'70-cameras.hwdb',
'70-hardware-wallets.hwdb',
'70-joystick.hwdb',
'70-maker-tools.hwdb',
'70-mouse.hwdb',
'70-pda.hwdb',
'70-pointingstick.hwdb',
'70-software-radio.hwdb',
'70-sound-card.hwdb',
'70-touchpad.hwdb',
'80-ieee1394-unit-function.hwdb')
if conf.get('ENABLE_HWDB') == 1
auto_suspend_rules = custom_target(
output : '60-autosuspend-chromiumos.hwdb',
command : make_autosuspend_rules_py,
capture : true,
install : true,
install_dir: udevhwdbdir,
install_tag: 'hwdb')
install_data(hwdb_files_notest,
hwdb_files_test,
install_dir : udevhwdbdir,
install_tag: 'hwdb')
if install_sysconfdir
install_emptydir(sysconfdir / 'udev/hwdb.d', install_tag : 'hwdb')
meson.add_install_script(sh, '-c',
'test -n "$DESTDIR" || @0@/systemd-hwdb update'.format(bindir),
install_tag: 'hwdb')
endif
if want_tests != 'false'
test('parse-hwdb',
files('parse_hwdb.py'),
suite : 'dist',
args : [hwdb_files_test,
auto_suspend_rules],
timeout : 90)
endif
endif
############################################################
run_target(
'update-hwdb',
command : [update_hwdb_sh, meson.current_source_dir()])
run_target(
'update-hwdb-autosuspend',
command : [update_hwdb_autosuspend_sh, meson.project_source_root()])