From 1c7fe694fa657ed877f1be682b3b9c60658ee9ed Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Fri, 22 Jul 2022 11:03:07 +0100 Subject: [PATCH] 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. --- libmalcontent-ui/meson.build | 4 ++-- malcontent-control/meson.build | 4 ++-- meson.build | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libmalcontent-ui/meson.build b/libmalcontent-ui/meson.build index 6c85393..b19405b 100644 --- a/libmalcontent-ui/meson.build +++ b/libmalcontent-ui/meson.build @@ -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: [ diff --git a/malcontent-control/meson.build b/malcontent-control/meson.build index 515b56b..d7a9071 100644 --- a/malcontent-control/meson.build +++ b/malcontent-control/meson.build @@ -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: [ diff --git a/meson.build b/meson.build index c90c4c5..e83f2e9 100644 --- a/meson.build +++ b/meson.build @@ -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',