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