check for incompatible libgovirt version

The virt-viewer code currently only works with librest 0.7
/ libgovirt < 0.3.9.

Check for this condition in meson to prevent later compile
time errors.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2023-11-27 17:33:24 +00:00 committed by Daniel P. Berrangé
parent 46997b9928
commit ee49623348
2 changed files with 16 additions and 0 deletions

View File

@ -39,6 +39,7 @@ gtk_vnc_min_version='>=0.4.0'
spice_gtk_min_version='>=0.35' spice_gtk_min_version='>=0.35'
spice_protocol_min_version='>=0.12.7' spice_protocol_min_version='>=0.12.7'
govirt_min_version='>=0.3.7' govirt_min_version='>=0.3.7'
govirt_max_version='>=0.3.9'
rest_min_version='>=0.8' rest_min_version='>=0.8'
vte_min_version='>=0.46.0' vte_min_version='>=0.46.0'
bash_completion_version='2.0' bash_completion_version='2.0'
@ -446,6 +447,16 @@ if get_option('ovirt').auto()
rest_dep = dependency('', required: false) rest_dep = dependency('', required: false)
endif endif
endif endif
if govirt_dep.found()
new_govirt_dep = dependency('govirt-1.0', version: govirt_max_version, required: false)
if new_govirt_dep.found()
if get_option('ovirt').auto()
govirt_dep = dependency('', required: false)
else
error('libgovirt >= 0.3.9 (with librest-1.0) not supported')
endif
endif
endif
if govirt_dep.found() if govirt_dep.found()
if cc.has_function('ovirt_storage_domain_get_disks', dependencies: govirt_dep) if cc.has_function('ovirt_storage_domain_get_disks', dependencies: govirt_dep)
conf_data.set('HAVE_OVIRT_STORAGE_DOMAIN_GET_DISKS', '1') conf_data.set('HAVE_OVIRT_STORAGE_DOMAIN_GET_DISKS', '1')

View File

@ -4,7 +4,12 @@
%global with_govirt 0 %global with_govirt 0
%global with_spice 0 %global with_spice 0
%else %else
# Disabled due to incompatible govirt/librest
%if 0%{?fedora} >= 37
%global with_govirt 0
%else
%global with_govirt 1 %global with_govirt 1
%endif
%global with_spice 1 %global with_spice 1
%endif %endif