From 71804e56eb3612eabc51887fe4d46961684a3ecc Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 13 Apr 2020 18:12:43 -0400 Subject: wrap: Add special 'dependency_names' key in [provide] section The value for that key must be a coma separated list of dependecy names provided by that subproject, when no variable name is needed because the subproject uses override_dependency(). --- docs/markdown/Wrap-dependency-system-manual.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'docs/markdown/Wrap-dependency-system-manual.md') diff --git a/docs/markdown/Wrap-dependency-system-manual.md b/docs/markdown/Wrap-dependency-system-manual.md index cb7c6d6..b927944 100644 --- a/docs/markdown/Wrap-dependency-system-manual.md +++ b/docs/markdown/Wrap-dependency-system-manual.md @@ -145,12 +145,15 @@ wrap-git, the repository must contain all Meson build definitions. Wrap files can define the dependencies it provides in the `[provide]` section. When a wrap file provides the dependency `foo` any call do `dependency('foo')` will automatically fallback to that subproject even if no `fallback` keyword -argument is given. Each entry in the format `dependency_name = variable_name`, +argument is given. It is recommended for subprojects to call +`meson.override_dependency('foo', foo_dep)`, dependency name can then be added into +the special `dependency_names` entry which takes coma separated list of dependency +names. For backward compatibility with subprojects that does not call +`meson.override_dependency()`, the variable name can be provided in the wrap file +with entries in the format `dependency_name = variable_name`, where `dependency_name` usually match the corresponding pkg-config name and `variable_name` is the name of a variable defined in the subproject that should -be returned for that dependency. In the case the subproject uses -`meson.override_dependency('foo', foo_dep)` the `variable_name` can be left empty -in the wrap file. +be returned for that dependency. For example `glib.wrap` provides `glib-2.0`, `gobject-2.0` and `gio-2.0`. A wrap file for glib would look like: @@ -165,6 +168,17 @@ gobject-2.0=gobject_dep gio-2.0=gio_dep ``` +Alternatively, when using a recent enough version of glib that uses +`meson.override_dependency()`: +```ini +[wrap-git] +url=https://gitlab.gnome.org/GNOME/glib.git +revision=glib-2-62 + +[provide] +dependency_names = glib-2.0, gobject-2.0, gio-2.0 +``` + With such wrap file, `dependency('glib-2.0')` will automatically fallback to use `glib.wrap` and return `glib_dep` variable from the subproject. -- cgit v1.1