diff options
author | Fabiano Fidêncio <fidencio@redhat.com> | 2019-11-29 17:59:06 +0100 |
---|---|---|
committer | Fabiano Fidêncio <fidencio@redhat.com> | 2019-12-02 13:12:59 +0100 |
commit | e4c9dc6de8cf2fbc79da70ca2b85aeb8db86c821 (patch) | |
tree | 6587505accda268cd8d9dff4b2aadcfa5f747913 | |
parent | cd6bd5253bdfc99bcf17ddaaf32f80026e1361aa (diff) | |
download | libosinfo-e4c9dc6de8cf2fbc79da70ca2b85aeb8db86c821.tar.gz |
build: Install {usb,pci}.ids if not shipped
In case usb.ids and pci.ids are not shipped, let's also install them as
part of libosinfo installation.
install_data() will automatically install the files to the
standards-conforming location.
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
-rw-r--r-- | meson.build | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 75cbfcc..a0abe8e 100644 --- a/meson.build +++ b/meson.build @@ -259,6 +259,8 @@ if pci_ids_path == '' '/usr/local/share/pciids/pci.ids', ] + install_file = meson.is_cross_build() + foreach file: pci_id_files if run_command('[', '-f', file, ']').returncode() == 0 pci_ids_path = file @@ -272,9 +274,14 @@ if pci_ids_path == '' r = run_command(download) if r.returncode() == 0 pci_ids_path = join_paths(meson.build_root(), 'pci.ids') + install_file = true endif endif endif + + if install_file + install_data(pci_ids_path) + endif endif libosinfo_cflags += ['-DPCI_IDS="@0@"'.format(pci_ids_path)] message('Location of pci.ids: "@0@"'.format(pci_ids_path)) @@ -288,6 +295,8 @@ if usb_ids_path == '' '/usr/local/share/usbids/usb.ids', ] + install_file = meson.is_cross_build() + foreach file: usb_id_files if run_command('[', '-f', file, ']').returncode() == 0 usb_ids_path = file @@ -301,9 +310,15 @@ if usb_ids_path == '' r = run_command(download) if r.returncode() == 0 usb_ids_path = join_paths(meson.build_root(), 'usb.ids') + install_file = true endif endif endif + + + if install_file + install_data(usb_ids_path) + endif endif libosinfo_cflags += ['-DUSB_IDS="@0@"'.format(usb_ids_path)] message('Location of usb.ids: "@0@"'.format(usb_ids_path)) |