diff options
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r-- | mesonbuild/modules/__init__.py | 6 | ||||
-rw-r--r-- | mesonbuild/modules/gnome.py | 22 | ||||
-rw-r--r-- | mesonbuild/modules/unstable_wayland.py | 4 |
3 files changed, 22 insertions, 10 deletions
diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py index 967c2b3..71536c1 100644 --- a/mesonbuild/modules/__init__.py +++ b/mesonbuild/modules/__init__.py @@ -82,11 +82,9 @@ class ModuleState: def find_program(self, prog: T.Union[str, T.List[str]], required: bool = True, version_func: T.Optional[T.Callable[['ExternalProgram'], str]] = None, wanted: T.Optional[str] = None, silent: bool = False, - for_machine: MachineChoice = MachineChoice.HOST, - depname: T.Optional[str] = None, varname: T.Optional[str] = None) -> 'ExternalProgram': + for_machine: MachineChoice = MachineChoice.HOST) -> 'ExternalProgram': return self._interpreter.find_program_impl(prog, required=required, version_func=version_func, - wanted=wanted, silent=silent, for_machine=for_machine, - depname=depname, varname=varname) + wanted=wanted, silent=silent, for_machine=for_machine) def test(self, args: T.Tuple[str, T.Union[build.Executable, build.Jar, 'ExternalProgram', mesonlib.File]], workdir: T.Optional[str] = None, diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 2e7b2a7..8c63647 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -321,9 +321,25 @@ class GnomeModule(ExtensionModule): def _get_native_binary(self, state: 'ModuleState', name: str, depname: str, varname: str, required: bool = True) -> T.Union[ExternalProgram, OverrideProgram, 'build.Executable']: - return state.find_program(name, for_machine=MachineChoice.BUILD, - required=required, - depname=depname, varname=varname) + # Look in overrides in case glib/gtk/etc are built as subproject + prog = self.interpreter.program_from_overrides([name], []) + if prog is not None: + return prog + + # Look in machine file + prog_list = state.environment.lookup_binary_entry(MachineChoice.HOST, name) + if prog_list is not None: + return ExternalProgram.from_entry(name, prog_list) + + # Check if pkgconfig has a variable + dep = self._get_dep(state, depname, native=True, required=False) + if dep.found() and dep.type_name == 'pkgconfig': + value = dep.get_pkgconfig_variable(varname, [], None) + if value: + return ExternalProgram(name, [value]) + + # Normal program lookup + return state.find_program(name, required=required) @typed_kwargs( 'gnome.post_install', diff --git a/mesonbuild/modules/unstable_wayland.py b/mesonbuild/modules/unstable_wayland.py index 332d938..c3e29f4 100644 --- a/mesonbuild/modules/unstable_wayland.py +++ b/mesonbuild/modules/unstable_wayland.py @@ -45,9 +45,7 @@ class WaylandModule(ExtensionModule): ) def scan_xml(self, state, args, kwargs): if self.scanner_bin is None: - self.scanner_bin = state.find_program('wayland-scanner', - for_machine=MachineChoice.BUILD, - depname='wayland-scanner') + self.scanner_bin = state.find_program('wayland-scanner', for_machine=MachineChoice.BUILD) scope = 'public' if kwargs['public'] else 'private' sides = [i for i in ['client', 'server'] if kwargs[i]] |