From 30904b985a61fb97bcb6dec723a17b10ad2b11ce Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 11 Oct 2023 17:00:56 -0400 Subject: [PATCH] cargo: Add patch_directory into generated wrap if available --- mesonbuild/wrap/wrap.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index 964ee88e2f29..870b121c6040 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -397,6 +397,7 @@ def wrap_from_crates_io(self, subp_name: str, dep: CargoDependency) -> T.Optiona directory = f'{dep.package}-{version}' filename = f'{directory}.tar.gz' wrap_fname = os.path.join(self.subdir_root, f'{subp_name}.wrap') + patch_directory = os.path.join(self.subdir_root, 'packagefiles', dep.package) os.makedirs(self.subdir_root, exist_ok=True) with open(wrap_fname, 'w', encoding='utf-8') as f: f.write(textwrap.dedent(f'''\ @@ -407,6 +408,8 @@ def wrap_from_crates_io(self, subp_name: str, dep: CargoDependency) -> T.Optiona source_hash = {checksum} method = cargo ''')) + if os.path.exists(patch_directory): + f.write(f'patch_directory = {patch_directory}\n') return wrap_fname return None