gnome module: deprecate passing false to install_dir_gir

Use a proper install option for this. Now `install_<type>` can directly
override `install` instead of passing a boolean to the string kwarg
`install_dir_<type>`.
pull/9666/head
Eli Schwartz 3 years ago
parent bed55a902c
commit bc8c938148
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 12
      mesonbuild/modules/gnome.py
  2. 2
      test cases/frameworks/12 multiple gir/meson.build
  3. 3
      test cases/frameworks/12 multiple gir/mesongir/meson.build
  4. 11
      test cases/frameworks/12 multiple gir/test.json

@ -801,7 +801,9 @@ class GnomeModule(ExtensionModule):
def _make_gir_target(self, state: 'ModuleState', girfile: str, scan_command: T.List[str],
generated_files: T.Sequence[T.Union[str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList]],
depends: T.List[build.Target], kwargs: T.Dict[str, T.Any]) -> GirTarget:
install = kwargs['install']
install = kwargs['install_gir']
if install is None:
install = kwargs['install']
install_dir = kwargs['install_dir_gir']
if install_dir is None:
@ -825,7 +827,9 @@ class GnomeModule(ExtensionModule):
def _make_typelib_target(self, state: 'ModuleState', typelib_output: str, typelib_cmd: T.List[str],
generated_files: T.Sequence[T.Union[str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList]],
kwargs: T.Dict[str, T.Any]) -> TypelibTarget:
install = kwargs['install']
install = kwargs['install_typelib']
if install is None:
install = kwargs['install']
install_dir = kwargs['install_dir_typelib']
if install_dir is None:
@ -916,9 +920,13 @@ class GnomeModule(ExtensionModule):
KwargInfo('identifier_prefix', ContainerTypeInfo(list, str), default=[], listify=True),
KwargInfo('include_directories', ContainerTypeInfo(list, (str, build.IncludeDirs)), default=[], listify=True),
KwargInfo('includes', ContainerTypeInfo(list, (str, GirTarget)), default=[], listify=True),
KwargInfo('install_gir', (bool, NoneType), since='0.61.0'),
KwargInfo('install_dir_gir', (str, bool, NoneType),
deprecated_values={False: ('0.61.0', 'Use install_gir to disable installation')},
validator=lambda x: 'as boolean can only be false' if x is True else None),
KwargInfo('install_typelib', (bool, NoneType), since='0.61.0'),
KwargInfo('install_dir_typelib', (str, bool, NoneType),
deprecated_values={False: ('0.61.0', 'Use install_typelib to disable installation')},
validator=lambda x: 'as boolean can only be false' if x is True else None),
KwargInfo('link_with', ContainerTypeInfo(list, (build.SharedLibrary, build.StaticLibrary)), default=[], listify=True),
KwargInfo('namespace', str, required=True),

@ -1,4 +1,4 @@
project('multiple-gobject-introspection', 'c')
project('multiple-gobject-introspection', 'c', meson_version: '>=0.50.0')
gir = find_program('g-ir-scanner', required: false)
if not gir.found()

@ -24,7 +24,8 @@ girtarget = gnome.generate_gir(
identifier_prefix : 'Meson',
includes : ['GObject-2.0'],
export_packages : 'meson',
install : true
install : true,
install_gir: false,
)
meson_gir = girtarget[0]
meson_typelib = girtarget[1]

@ -5,8 +5,13 @@
{"type": "expr", "file": "usr/lib/?libgirlib.so"},
{"type": "file", "platform": "cygwin", "file": "usr/lib/libgirlib.dll.a"},
{"type": "expr", "file": "usr/lib/?libgirsubproject.so"},
{"type": "file", "platform": "cygwin", "file": "usr/lib/libgirsubproject.dll.a"},
{"type": "file", "file": "usr/share/gir-1.0/Meson-1.0.gir"}
{"type": "file", "platform": "cygwin", "file": "usr/lib/libgirsubproject.dll.a"}
],
"skip_on_jobname": ["azure", "macos", "msys2"]
"skip_on_jobname": ["azure", "macos", "msys2"],
"stdout": [
{
"comment": "This will either match in the future-deprecated notice summary, or match the warning summary",
"line": " * 0.61.0: {'\"gnome.generate_gir\" keyword argument \"install_dir_gir\" value \"False\"'}"
}
]
}

Loading…
Cancel
Save