@@ -58,6 +58,7 @@ class PostInstall(TypedDict):
5858 gio_querymodules : T .List [str ]
5959 gtk_update_icon_cache : bool
6060 update_desktop_database : bool
61+ update_mime_database : bool
6162
6263 class CompileSchemas (TypedDict ):
6364
@@ -282,6 +283,7 @@ def __init__(self, interpreter: 'Interpreter') -> None:
282283 self .install_gio_querymodules : T .List [str ] = []
283284 self .install_gtk_update_icon_cache = False
284285 self .install_update_desktop_database = False
286+ self .install_update_mime_database = False
285287 self .devenv : T .Optional [build .EnvironmentVariables ] = None
286288 self .native_glib_version : T .Optional [str ] = None
287289 self .methods .update ({
@@ -332,6 +334,7 @@ def _print_gdbus_warning() -> None:
332334 KwargInfo ('gio_querymodules' , ContainerTypeInfo (list , str ), default = [], listify = True ),
333335 KwargInfo ('gtk_update_icon_cache' , bool , default = False ),
334336 KwargInfo ('update_desktop_database' , bool , default = False , since = '0.59.0' ),
337+ KwargInfo ('update_mime_database' , bool , default = False , since = '0.64.0' ),
335338 )
336339 @noPosargs
337340 @FeatureNew ('gnome.post_install' , '0.57.0' )
@@ -370,6 +373,13 @@ def post_install(self, state: 'ModuleState', args: T.List['TYPE_var'], kwargs: '
370373 script = state .backend .get_executable_serialisation ([prog , '-q' , appdir ])
371374 script .skip_if_destdir = True
372375 rv .append (script )
376+ if kwargs ['update_mime_database' ] and not self .install_update_mime_database :
377+ self .install_update_mime_database = True
378+ prog = state .find_program ('update-mime-database' )
379+ appdir = os .path .join (datadir_abs , 'mime' )
380+ script = state .backend .get_executable_serialisation ([prog , appdir ])
381+ script .skip_if_destdir = True
382+ rv .append (script )
373383 return ModuleReturnValue (None , rv )
374384
375385 @typed_pos_args ('gnome.compile_resources' , str , (str , mesonlib .File , build .CustomTarget , build .CustomTargetIndex , build .GeneratedList ))
0 commit comments