@@ -198,7 +198,7 @@ class MkEnums(_MkEnumsCommon):
198
198
vtail : T .Optional [str ]
199
199
depends : T .List [T .Union [BuildTarget , CustomTarget , CustomTargetIndex ]]
200
200
201
- ToolType : TypeAlias = T .Union [Executable , ExternalProgram , OverrideProgram ]
201
+ ToolType : TypeAlias = T .Union [build . OverrideExecutable , ExternalProgram , OverrideProgram ]
202
202
203
203
204
204
# Differs from the CustomTarget version in that it straight defaults to True
@@ -319,6 +319,7 @@ def _find_tool(state: 'ModuleState', tool: str) -> 'ToolType':
319
319
'glib-mkenums' : 'glib-2.0' ,
320
320
'g-ir-scanner' : 'gobject-introspection-1.0' ,
321
321
'g-ir-compiler' : 'gobject-introspection-1.0' ,
322
+ 'gi-compile-repository' : 'girepository-2.0' ,
322
323
}
323
324
depname = tool_map [tool ]
324
325
varname = tool .replace ('-' , '_' )
@@ -789,12 +790,23 @@ def postconf_hook(self, b: build.Build) -> None:
789
790
if self .devenv is not None :
790
791
b .devenv .append (self .devenv )
791
792
792
- def _get_gir_dep (self , state : 'ModuleState' ) -> T .Tuple [Dependency , T .Union [Executable , 'ExternalProgram' , 'OverrideProgram' ],
793
- T .Union [Executable , 'ExternalProgram' , 'OverrideProgram' ]]:
793
+ def _get_gir_dep (self , state : 'ModuleState' ) -> T .Tuple [Dependency , ToolType , ToolType ]:
794
794
if not self .gir_dep :
795
- self .gir_dep = state .dependency ('gobject-introspection-1.0' )
795
+ # Look first for the compiler's new name. If it is found,
796
+ # girepository-2.0 might not be available yet, in the case we are
797
+ # generating GIR for girepository-2.0 itself.
798
+ self .gicompiler = self ._find_tool (state , 'gi-compile-repository' )
799
+ if self .gicompiler .found ():
800
+ self .gir_dep = state .dependency ('girepository-2.0' , required = False )
801
+ if not self .gir_dep .found ():
802
+ self .gir_dep = InternalDependency (
803
+ self .gicompiler .get_version (),
804
+ [], [], [], [], [], [], [], [], {}, [], [], [],
805
+ 'girepository-2.0' )
806
+ else :
807
+ self .gir_dep = state .dependency ('gobject-introspection-1.0' )
808
+ self .gicompiler = self ._find_tool (state , 'g-ir-compiler' )
796
809
self .giscanner = self ._find_tool (state , 'g-ir-scanner' )
797
- self .gicompiler = self ._find_tool (state , 'g-ir-compiler' )
798
810
return self .gir_dep , self .giscanner , self .gicompiler
799
811
800
812
def _giscanner_version_compare (self , state : 'ModuleState' , cmp : str ) -> bool :
0 commit comments