[+] partially update meson_install
This commit is contained in:
parent
a8f57337ad
commit
43c85ca162
@ -5,6 +5,7 @@ import os
|
||||
import pathlib
|
||||
import logging
|
||||
import sys
|
||||
import pydantic
|
||||
import subprocess
|
||||
import shutil
|
||||
import abc
|
||||
@ -27,6 +28,29 @@ class Project:
|
||||
dest_dir : pathlib.Path
|
||||
meson_path: Optional[pathlib.Path] = None
|
||||
|
||||
class PyProject:
|
||||
class Tool:
|
||||
class Meson:
|
||||
class Args:
|
||||
install: list[str]
|
||||
|
||||
args: Args
|
||||
|
||||
class MesonPython:
|
||||
class Args:
|
||||
install: list[str]
|
||||
|
||||
args: Args
|
||||
|
||||
meson: Optional[Meson] = None
|
||||
|
||||
meson_python: Optional[MesonPython] = pydantic.Field(
|
||||
alias='meson-python',
|
||||
default=None,
|
||||
)
|
||||
|
||||
tool: Optional[Tool] = None
|
||||
|
||||
@dataclasses.dataclass
|
||||
class Dependency:
|
||||
name: str
|
||||
@ -336,14 +360,35 @@ class CLI(abc.ABC):
|
||||
if force and project.dest_dir.exists():
|
||||
shutil.rmtree(project.dest_dir)
|
||||
|
||||
subprocess.check_call([
|
||||
pyproject = cli_bootstrap.pyproject_load(
|
||||
project.source_dir / 'pyproject.toml'
|
||||
)
|
||||
|
||||
pyproject_tool = pydantic.RootModel[
|
||||
PyProject
|
||||
].model_validate(pyproject.module)
|
||||
|
||||
if (
|
||||
pyproject_tool.meson and
|
||||
pyproject_tool.meson.args and
|
||||
pyproject_tool.meson.args.install
|
||||
):
|
||||
argv = pyproject_tool.meson.args.install + argv
|
||||
|
||||
cmd = [
|
||||
shutil_which('meson', True,),
|
||||
'install',
|
||||
'-C',
|
||||
project.build_dir / 'meson',
|
||||
'--destdir', project.dest_dir,
|
||||
*argv,
|
||||
])
|
||||
]
|
||||
|
||||
logger.info(dict(
|
||||
cmd=cmd,
|
||||
))
|
||||
|
||||
subprocess.check_call(cmd)
|
||||
|
||||
for o in glob.glob(
|
||||
str(project.dest_dir / 'lib' / 'pkgconfig' / '*.pc'),
|
||||
|
@ -41,6 +41,7 @@ class PyProject:
|
||||
meson: Optional[pathlib.Path] = None
|
||||
tool: dict[str, Any] = dataclasses.field(default_factory=lambda : dict())
|
||||
|
||||
|
||||
path: pathlib.Path
|
||||
dependencies: dict[str, list[str]]
|
||||
early_features: Optional[list[str]] = None
|
||||
|
Loading…
Reference in New Issue
Block a user