Don't depend on gtk+-3.0 if xmllint is found

When validating the .ui files, we need to determine the path to GTK 4's
relaxng schema. Previously this was erroneously looked up in the prefix
of GTK 3, which malcontent otherwise doesn't depend on.

Define the GTK dependency once, and use that variable everywhere.
This commit is contained in:
Will Thompson 2022-07-22 11:03:07 +01:00
parent 2da5d5597e
commit 1c7fe694fa
3 changed files with 5 additions and 4 deletions

View File

@ -28,7 +28,7 @@ libmalcontent_ui_public_deps = [
dependency('gio-2.0', version: '>= 2.44'),
dependency('glib-2.0', version: '>= 2.54.2'),
dependency('gobject-2.0', version: '>= 2.54'),
dependency('gtk4', version: '>= 4.6'),
gtk_dep,
libadwaita_dep,
libmalcontent_dep,
]
@ -82,7 +82,7 @@ libmalcontent_ui_gir = gnome.generate_gir(libmalcontent_ui,
xmllint = find_program('xmllint', required: false)
if xmllint.found()
gtk_prefix = dependency('gtk+-3.0').get_variable(pkgconfig: 'prefix')
gtk_prefix = gtk_dep.get_variable(pkgconfig: 'prefix')
test(
'validate-ui', xmllint,
args: [

View File

@ -27,7 +27,7 @@ malcontent_control = executable('malcontent-control',
dependency('gio-2.0', version: '>= 2.44'),
dependency('glib-2.0', version: '>= 2.54.2'),
dependency('gobject-2.0', version: '>= 2.54'),
dependency('gtk4', version: '>= 4.6'),
gtk_dep,
dependency('polkit-gobject-1'),
libadwaita_dep,
libmalcontent_dep,
@ -79,7 +79,7 @@ endif
xmllint = find_program('xmllint', required: false)
if xmllint.found()
gtk_prefix = dependency('gtk+-3.0').get_variable(pkgconfig: 'prefix')
gtk_prefix = gtk_dep.get_variable(pkgconfig: 'prefix')
test(
'validate-ui', xmllint,
args: [

View File

@ -134,6 +134,7 @@ else
'Malcontent-' + libmalcontent_api_version + '.typelib']
endif
if get_option('ui').enabled()
gtk_dep = dependency('gtk4', version: '>= 4.6')
libadwaita_dep = dependency(
'libadwaita-1',
version: '>= 1.1',