Make sure 'python3-clang' and 'libclang' have been installed and can work. Also, add 'python3-clang' into libvirt.spec.in and mingw-libvirt.spec.in. Signed-off-by: Shi Lei <shi_lei@xxxxxxxxxxxxxx> --- libvirt.spec.in | 1 + meson.build | 10 ++++++++++ mingw-libvirt.spec.in | 1 + 3 files changed, 12 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index be74964b..4ebd67ce 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -277,6 +277,7 @@ BuildRequires: perl-interpreter BuildRequires: perl %endif BuildRequires: python3 +BuildRequires: python3-clang BuildRequires: systemd-units %if %{with_libxl} BuildRequires: xen-devel diff --git a/meson.build b/meson.build index 837955de..a99be250 100644 --- a/meson.build +++ b/meson.build @@ -2406,3 +2406,13 @@ if conf.has('WITH_QEMU') } summary(priv_summary, section: 'Privileges') endif + +py3_clang = run_command('python3', '-c', 'import clang.cindex;print("ok")') +if py3_clang.returncode() != 0 + error('python3-clang is required.') +endif + +py3_clang_working = run_command('python3', '-c', 'import clang.cindex;clang.cindex.Index.create()') +if py3_clang_working.returncode() != 0 + error('python3-clang is present, but not working. Perhaps libclang is missing?') +endif diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in index 288f533d..00b54d4a 100644 --- a/mingw-libvirt.spec.in +++ b/mingw-libvirt.spec.in @@ -52,6 +52,7 @@ BuildRequires: pkgconfig BuildRequires: gettext BuildRequires: libxslt BuildRequires: python3 +BuildRequires: python3-clang BuildRequires: perl-interpreter BuildRequires: perl(Getopt::Long) BuildRequires: meson -- 2.25.1