[PATCH 0/2] meson: Report library versions in the summary

Green pipeline: https://gitlab.com/MichalPrivoznik/libvirt/-/pipelines/1934463449 and if you shod individual builds you can see these in action. Michal Prívozník (2): meson: Convert attr_dep to dependency() meson: Report library versions in the summary meson.build | 77 ++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 39 deletions(-) -- 2.49.1

From: Michal Privoznik <mprivozn@redhat.com> Currently, libattr is detected using cc.find_library() because at historically, the library was lacking pkg-config file. But that changed with libattr-2.4.48 (released 7+ years ago) and even prehistoric distros have it now. Switch to dependency(). Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 08521fe7ea..7fd0e835e9 100644 --- a/meson.build +++ b/meson.build @@ -919,8 +919,7 @@ if not get_option('apparmor_profiles').disabled() endif endif -# FIXME rewrite to use dependency() once we can use 2.4.48 -attr_dep = cc.find_library('attr', required: get_option('attr')) +attr_dep = dependency('libattr', required: get_option('attr')) if attr_dep.found() conf.set('WITH_LIBATTR', 1) endif -- 2.49.1

From: Michal Privoznik <mprivozn@redhat.com> The summary() directive accepts dependency() too [1] in which case it also prints version of the dependency found. This may come handy when reading build process transcripts. 1: https://mesonbuild.com/Reference-manual_functions.html#summary Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- meson.build | 74 ++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/meson.build b/meson.build index 7fd0e835e9..deb4ac952f 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project( 'libvirt', 'c', version: '11.6.0', license: 'LGPLv2+', - meson_version: '>= 0.56.0', + meson_version: '>= 0.57.0', default_options: [ 'buildtype=debugoptimized', 'b_pie=true', @@ -2239,43 +2239,43 @@ drivermod_summary = { summary(drivermod_summary, section: 'Driver Loadable Modules', bool_yn: true) libs_summary = { - 'acl': acl_dep.found(), - 'apparmor': apparmor_dep.found(), - 'attr': attr_dep.found(), - 'audit': audit_dep.found(), - 'bash_completion': bash_completion_dep.found(), - 'blkid': blkid_dep.found(), - 'capng': capng_dep.found(), - 'curl': curl_dep.found(), - 'devmapper': devmapper_dep.found(), - 'dlopen': dlopen_dep.found(), - 'fuse': fuse_dep.found(), - 'glusterfs': glusterfs_dep.found(), - 'json-c': json_c_dep.found(), - 'libbsd': libbsd_dep.found(), - 'libiscsi': libiscsi_dep.found(), - 'libkvm': libkvm_dep.found(), - 'libnbd': libnbd_dep.found(), - 'libnl': libnl_dep.found(), - 'libparted': libparted_dep.found(), - 'libpcap': libpcap_dep.found(), - 'libssh': libssh_dep.found(), - 'libssh2': libssh2_dep.found(), - 'libutil': libutil_dep.found(), - 'netcf': netcf_dep.found(), + 'acl': acl_dep, + 'apparmor': apparmor_dep, + 'attr': attr_dep, + 'audit': audit_dep, + 'bash_completion': bash_completion_dep, + 'blkid': blkid_dep, + 'capng': capng_dep, + 'curl': curl_dep, + 'devmapper': devmapper_dep, + 'dlopen': dlopen_dep, + 'fuse': fuse_dep, + 'glusterfs': glusterfs_dep, + 'json-c': json_c_dep, + 'libbsd': libbsd_dep, + 'libiscsi': libiscsi_dep, + 'libkvm': libkvm_dep, + 'libnbd': libnbd_dep, + 'libnl': libnl_dep, + 'libparted': libparted_dep, + 'libpcap': libpcap_dep, + 'libssh': libssh_dep, + 'libssh2': libssh2_dep, + 'libutil': libutil_dep, + 'netcf': netcf_dep, 'NLS': have_gnu_gettext_tools, - 'numactl': numactl_dep.found(), - 'openwsman': openwsman_dep.found(), - 'parallels-sdk': parallels_sdk_dep.found(), - 'pciaccess': pciaccess_dep.found(), + 'numactl': numactl_dep, + 'openwsman': openwsman_dep, + 'parallels-sdk': parallels_sdk_dep, + 'pciaccess': pciaccess_dep, 'polkit': conf.has('WITH_POLKIT'), - 'rbd': rbd_dep.found(), - 'readline': readline_dep.found(), - 'sanlock': sanlock_dep.found(), - 'sasl': sasl_dep.found(), - 'selinux': selinux_dep.found(), - 'udev': udev_dep.found(), - 'xdr': xdr_dep.found(), + 'rbd': rbd_dep, + 'readline': readline_dep, + 'sanlock': sanlock_dep, + 'sasl': sasl_dep, + 'selinux': selinux_dep, + 'udev': udev_dep, + 'xdr': xdr_dep, } summary(libs_summary, section: 'Libraries', bool_yn: true) @@ -2325,7 +2325,7 @@ endif summary(misc_summary, section: 'Miscellaneous', bool_yn: true, list_sep: ' ') devtools_summary = { - 'wireshark_dissector': wireshark_dep.found(), + 'wireshark_dissector': wireshark_dep, } summary(devtools_summary, section: 'Developer Tools', bool_yn: true) -- 2.49.1

On Fri, Jul 18, 2025 at 03:34:19PM +0200, Michal Privoznik via Devel wrote:
Green pipeline:
https://gitlab.com/MichalPrivoznik/libvirt/-/pipelines/1934463449
and if you shod individual builds you can see these in action.
Nice!
Michal Prívozník (2): meson: Convert attr_dep to dependency() meson: Report library versions in the summary
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
participants (2)
-
Michal Privoznik
-
Pavel Hrdina