|
44 | 44 | from ..interpreter import Interpreter |
45 | 45 | from ..interpreterbase import TYPE_var, TYPE_kwargs |
46 | 46 | from ..mesonlib import FileOrString |
47 | | - from ..programs import Program |
| 47 | + from ..programs import Program, CommandList, CommandListEntry |
48 | 48 |
|
49 | 49 | class PostInstall(TypedDict): |
50 | 50 | glib_compile_schemas: bool |
@@ -395,7 +395,7 @@ def compile_resources(self, state: 'ModuleState', args: T.Tuple[str, 'FileOrStri |
395 | 395 | glib_version = self._get_native_glib_version(state) |
396 | 396 |
|
397 | 397 | glib_compile_resources = self._find_tool(state, 'glib-compile-resources') |
398 | | - cmd: T.List[T.Union[Program, str]] = [glib_compile_resources, '@INPUT@'] |
| 398 | + cmd: CommandList = [glib_compile_resources, '@INPUT@'] |
399 | 399 |
|
400 | 400 | source_dirs = kwargs['source_dir'] |
401 | 401 | dependencies = kwargs['dependencies'] |
@@ -493,7 +493,7 @@ def compile_resources(self, state: 'ModuleState', args: T.Tuple[str, 'FileOrStri |
493 | 493 | raise MesonException('GResource header is installed yet export is not enabled') |
494 | 494 |
|
495 | 495 | depfile: T.Optional[str] = None |
496 | | - target_cmd: T.List[T.Union[Program, str]] |
| 496 | + target_cmd: CommandList |
497 | 497 | if not mesonlib.version_compare(glib_version, gresource_dep_needed_version): |
498 | 498 | # This will eventually go out of sync if dependencies are added |
499 | 499 | target_cmd = cmd |
@@ -1190,7 +1190,8 @@ def generate_gir(self, state: 'ModuleState', args: T.Tuple[T.List[T.Union[Execut |
1190 | 1190 |
|
1191 | 1191 | gir_inc_dirs: T.List[str] = [] |
1192 | 1192 |
|
1193 | | - scan_command: T.List[T.Union[str, Program, Executable]] = [giscanner] |
| 1193 | + # Executables are passed as indexes other than 0 in this List |
| 1194 | + scan_command: T.List[T.Union[CommandListEntry, Executable]] = [giscanner] |
1194 | 1195 | scan_command += ['--quiet'] |
1195 | 1196 | scan_command += ['--no-libtool'] |
1196 | 1197 | scan_command += ['--namespace=' + ns, '--nsversion=' + nsversion] |
@@ -1264,7 +1265,7 @@ def compile_schemas(self, state: 'ModuleState', args: T.List['TYPE_var'], kwargs |
1264 | 1265 | srcdir = os.path.join(state.build_to_src, state.subdir) |
1265 | 1266 | outdir = state.subdir |
1266 | 1267 |
|
1267 | | - cmd: T.List[T.Union[Program, str]] = [self._find_tool(state, 'glib-compile-schemas'), '--targetdir', outdir, srcdir] |
| 1268 | + cmd: CommandList = [self._find_tool(state, 'glib-compile-schemas'), '--targetdir', outdir, srcdir] |
1268 | 1269 | if state.subdir == '': |
1269 | 1270 | targetname = 'gsettings-compile' |
1270 | 1271 | else: |
@@ -1344,7 +1345,7 @@ def yelp(self, state: 'ModuleState', args: T.Tuple[str, T.List[str]], kwargs: 'Y |
1344 | 1345 |
|
1345 | 1346 | pot_file = os.path.join('@SOURCE_ROOT@', state.subdir, 'C', project_id + '.pot') |
1346 | 1347 | pot_sources = [os.path.join('@SOURCE_ROOT@', state.subdir, 'C', s) for s in sources] |
1347 | | - pot_args: T.List[T.Union[Program, str]] = [itstool, '-o', pot_file] |
| 1348 | + pot_args: CommandList = [itstool, '-o', pot_file] |
1348 | 1349 | pot_args.extend(pot_sources) |
1349 | 1350 | pottarget = build.RunTarget(f'help-{project_id}-pot', pot_args, [], |
1350 | 1351 | os.path.join(state.subdir, 'C'), state.subproject, |
@@ -1376,7 +1377,7 @@ def yelp(self, state: 'ModuleState', args: T.Tuple[str, T.List[str]], kwargs: 'Y |
1376 | 1377 | targets.append(l_data) |
1377 | 1378 |
|
1378 | 1379 | po_file = l + '.po' |
1379 | | - po_args: T.List[T.Union[Program, str]] = [ |
| 1380 | + po_args: CommandList = [ |
1380 | 1381 | msgmerge, '-q', '-o', |
1381 | 1382 | os.path.join('@SOURCE_ROOT@', l_subdir, po_file), |
1382 | 1383 | os.path.join('@SOURCE_ROOT@', l_subdir, po_file), pot_file] |
@@ -1641,7 +1642,7 @@ def gdbus_codegen(self, state: 'ModuleState', args: T.Tuple[str, T.Optional[T.Un |
1641 | 1642 | kwargs: 'GdbusCodegen') -> ModuleReturnValue: |
1642 | 1643 | namebase = args[0] |
1643 | 1644 | xml_files: T.List[T.Union['FileOrString', build.GeneratedTypes]] = [args[1]] if args[1] else [] |
1644 | | - cmd: T.List[T.Union[Program, str]] = [self._find_tool(state, 'gdbus-codegen')] |
| 1645 | + cmd: CommandList = [self._find_tool(state, 'gdbus-codegen')] |
1645 | 1646 | cmd.extend(kwargs['extra_args']) |
1646 | 1647 |
|
1647 | 1648 | # Autocleanup supported? |
@@ -2046,7 +2047,7 @@ def _make_mkenum_impl( |
2046 | 2047 | install_dir: T.Optional[T.Sequence[T.Union[str, bool]]] = None, |
2047 | 2048 | depends: T.Optional[T.Sequence[build.BuildTargetTypes]] = None |
2048 | 2049 | ) -> build.CustomTarget: |
2049 | | - real_cmd: T.List[T.Union[str, Program]] = [self._find_tool(state, 'glib-mkenums')] |
| 2050 | + real_cmd: CommandList = [self._find_tool(state, 'glib-mkenums')] |
2050 | 2051 | real_cmd.extend(cmd) |
2051 | 2052 | _install_dir = install_dir or state.environment.coredata.optstore.get_value_for(OptionKey('includedir')) |
2052 | 2053 | assert isinstance(_install_dir, str), 'for mypy' |
@@ -2092,7 +2093,7 @@ def genmarshal(self, state: 'ModuleState', args: T.Tuple[str], kwargs: 'GenMarsh |
2092 | 2093 |
|
2093 | 2094 | new_genmarshal = mesonlib.version_compare(self._get_native_glib_version(state), '>= 2.53.3') |
2094 | 2095 |
|
2095 | | - cmd: T.List[T.Union[Program, str]] = [self._find_tool(state, 'glib-genmarshal'), '--quiet'] |
| 2096 | + cmd: CommandList = [self._find_tool(state, 'glib-genmarshal'), '--quiet'] |
2096 | 2097 | if kwargs['prefix']: |
2097 | 2098 | cmd.extend(['--prefix', kwargs['prefix']]) |
2098 | 2099 | if kwargs['extra_args']: |
@@ -2239,8 +2240,7 @@ def generate_vapi(self, state: 'ModuleState', args: T.Tuple[str], kwargs: 'Gener |
2239 | 2240 | build_dir = os.path.join(state.environment.get_build_dir(), state.subdir) |
2240 | 2241 | source_dir = os.path.join(state.environment.get_source_dir(), state.subdir) |
2241 | 2242 | pkg_cmd, vapi_depends, vapi_packages, vapi_includes, packages = self._extract_vapi_packages(state, kwargs['packages']) |
2242 | | - cmd: T.List[T.Union[Program, str]] |
2243 | | - cmd = [state.find_program('vapigen'), '--quiet', f'--library={library}', f'--directory={build_dir}'] |
| 2243 | + cmd: CommandList = [state.find_program('vapigen'), '--quiet', f'--library={library}', f'--directory={build_dir}'] |
2244 | 2244 | cmd.extend([f'--vapidir={d}' for d in kwargs['vapi_dirs']]) |
2245 | 2245 | cmd.extend([f'--metadatadir={d}' for d in kwargs['metadata_dirs']]) |
2246 | 2246 | cmd.extend([f'--girdir={d}' for d in kwargs['gir_dirs']]) |
|
0 commit comments