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.
This commit is contained in:
Nirbheek Chauhan 2022-12-18 10:11:54 +05:30
parent 53c37cfc17
commit cd77936265
5 changed files with 19 additions and 23 deletions

View File

@ -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',

View File

@ -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
sassc = find_program('sassc', native: true)
sassc_opts = [ '-a', '-M', '-t', 'compact' ]
if sassc.found()
sassc_opts = [ '-a', '-M', '-t', 'compact' ]
subdir('theme/Default')
subdir('theme/Default')
theme_deps += [
default_theme_deps,
]
endif
theme_deps += [
default_theme_deps,
]
endif

View File

@ -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'))

View File

@ -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

View File

@ -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