modules/gnome: use envconfig for VAPIGEN

we have a mechanism for doing "this could be an environment variable"
let's use that.
pull/9506/head
Dylan Baker 3 years ago
parent 35bc0ad22f
commit ba85c71750
  1. 1
      mesonbuild/envconfig.py
  2. 5
      mesonbuild/modules/gnome.py

@ -118,6 +118,7 @@ ENV_VAR_PROG_MAP: T.Mapping[str, str] = {
'qmake': 'QMAKE', 'qmake': 'QMAKE',
'pkgconfig': 'PKG_CONFIG', 'pkgconfig': 'PKG_CONFIG',
'make': 'MAKE', 'make': 'MAKE',
'vapigen': 'VAPIGEN',
} }
# Deprecated environment variables mapped from the new variable to the old one # Deprecated environment variables mapped from the new variable to the old one

@ -1788,10 +1788,7 @@ G_END_DECLS'''
source_dir = os.path.join(state.environment.get_source_dir(), state.subdir) source_dir = os.path.join(state.environment.get_source_dir(), state.subdir)
pkg_cmd, vapi_depends, vapi_packages, vapi_includes = self._extract_vapi_packages(state, kwargs) pkg_cmd, vapi_depends, vapi_packages, vapi_includes = self._extract_vapi_packages(state, kwargs)
cmd: T.List[T.Union[str, 'ExternalProgram']] cmd: T.List[T.Union[str, 'ExternalProgram']]
if 'VAPIGEN' in os.environ: cmd = [state.find_program('vapigen')]
cmd = [state.find_program(os.environ['VAPIGEN'])]
else:
cmd = [state.find_program('vapigen')]
cmd += ['--quiet', '--library=' + library, '--directory=' + build_dir] cmd += ['--quiet', '--library=' + library, '--directory=' + build_dir]
cmd += self._vapi_args_to_command('--vapidir=', 'vapi_dirs', kwargs) cmd += self._vapi_args_to_command('--vapidir=', 'vapi_dirs', kwargs)
cmd += self._vapi_args_to_command('--metadatadir=', 'metadata_dirs', kwargs) cmd += self._vapi_args_to_command('--metadatadir=', 'metadata_dirs', kwargs)

Loading…
Cancel
Save