Skip to content

Commit

Permalink
gnome: support using generate_gir from gobject-introspection
Browse files Browse the repository at this point in the history
From gobject-introspection itself the use of gnome.generate_gir is
not possible leading to several hacks that are hard to maintain in
order to support building gobject-introspection with submodules.

This change in combination with https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/380
uses a new `gobject-introspection-no-typelibs` dependency to allow
defining dependency to allow using the GI dependency prior to having
the typelibs generated.
  • Loading branch information
ylatuya committed Jan 23, 2023
1 parent 9c65305 commit ff8efb8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions mesonbuild/modules/gnome.py
Expand Up @@ -789,10 +789,13 @@ def get_devenv(self) -> T.Optional[build.EnvironmentVariables]:

def _get_gir_dep(self, state: 'ModuleState') -> T.Tuple[Dependency, T.Union[build.Executable, 'ExternalProgram', 'OverrideProgram'],
T.Union[build.Executable, 'ExternalProgram', 'OverrideProgram']]:
if not self.gir_dep:
self.gir_dep = state.dependency('gobject-introspection-1.0')
self.giscanner = state.find_tool('g-ir-scanner', 'gobject-introspection-1.0', 'g_ir_scanner')
self.gicompiler = state.find_tool('g-ir-compiler', 'gobject-introspection-1.0', 'g_ir_compiler')
if not self.gir_dep or not self.gir_dep.found():
for (dep, req) in [('gobject-introspection-no-typelibs-1.0', False), ('gobject-introspection-1.0', True)]:
self.gir_dep = state.dependency(dep, required=req)
self.giscanner = state.find_tool('g-ir-scanner', dep, 'g_ir_scanner', required=req)
self.gicompiler = state.find_tool('g-ir-compiler', dep, 'g_ir_compiler', required=req)
if self.gir_dep.found():
break
return self.gir_dep, self.giscanner, self.gicompiler

@functools.lru_cache(maxsize=None)
Expand Down

0 comments on commit ff8efb8

Please sign in to comment.