From: Nirbheek Chauhan Date: Sun, 18 Dec 2022 04:41:54 +0000 (+0530) Subject: meson: Fix find_program and subproject usage X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~9^2~23^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cd77936265e4765a5ffc6e13e0f3afaa68cb058b;p=gtk4.git meson: Fix find_program and subproject usage Dummy dependencies are not required to execute a subproject automatically for providing a program, nor do you need to explicitly call subproject() to do that. A `[provide]` section in the wrap file is enough. --- diff --git a/docs/reference/meson.build b/docs/reference/meson.build index df5e3d9909..0d294137d7 100644 --- a/docs/reference/meson.build +++ b/docs/reference/meson.build @@ -1,7 +1,9 @@ toml_conf = configuration_data() toml_conf.set('version', meson.project_version()) -gidocgen = find_program('gi-docgen', required: get_option('gtk_doc')) +gidocgen = find_program('gi-docgen', + required: get_option('gtk_doc') and get_option('introspection').enabled(), + native: true) gidocgen_common_args = [ '--quiet', diff --git a/gtk/meson.build b/gtk/meson.build index 72e283b71d..61185696dd 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -779,21 +779,14 @@ theme_deps = [] # For git checkouts, but not for tarballs... if not fs.exists('theme/Default/Default-light.css') # ... build the theme files - sassc = find_program('sassc', required: false) - if not sassc.found() - subproject('sassc') - sassc = find_program('sassc', required: true) - endif - - if sassc.found() - sassc_opts = [ '-a', '-M', '-t', 'compact' ] + sassc = find_program('sassc', native: true) + sassc_opts = [ '-a', '-M', '-t', 'compact' ] - subdir('theme/Default') + subdir('theme/Default') - theme_deps += [ - default_theme_deps, - ] - endif + theme_deps += [ + default_theme_deps, + ] endif diff --git a/meson.build b/meson.build index 5a461c0336..d0d3b432c5 100644 --- a/meson.build +++ b/meson.build @@ -406,11 +406,6 @@ xkbdep = dependency('xkbcommon', version: xkbcommon_req, required: wayla graphene_dep = dependency('graphene-gobject-1.0', version: graphene_req, default_options: ['tests=false']) iso_codes_dep = dependency('iso-codes', required: false) - -gidocgen_dep = dependency('gi-docgen', version: '>= 2021.1', - fallback: ['gi-docgen', 'dummy_dep'], - required: get_option('gtk_doc') and get_option('introspection').enabled(), - native: true) gi_dep = dependency('gobject-introspection-1.0', version: introspection_req, required: get_option('introspection').enabled() and get_option('build-tests')) diff --git a/subprojects/gi-docgen.wrap b/subprojects/gi-docgen.wrap index 01606cee4a..85c85da16f 100644 --- a/subprojects/gi-docgen.wrap +++ b/subprojects/gi-docgen.wrap @@ -4,3 +4,6 @@ url = https://gitlab.gnome.org/GNOME/gi-docgen.git push-url = ssh://git@ssh.gitlab.gnome.org:GNOME/gi-docgen.git revision = main depth = 1 + +[provide] +program_names = gi-docgen diff --git a/subprojects/sassc.wrap b/subprojects/sassc.wrap index edd76c61be..2930f5c1a3 100644 --- a/subprojects/sassc.wrap +++ b/subprojects/sassc.wrap @@ -1,5 +1,8 @@ [wrap-git] -directory=sassc -url=https://github.com/lazka/sassc.git -revision=meson -depth=1 +directory = sassc +url = https://github.com/lazka/sassc.git +revision = meson +depth = 1 + +[provide] +program_names = sassc