Skip to content

Commit

Permalink
build: add local patching support to our external dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mbouron committed Mar 4, 2024
1 parent 8def7a5 commit 5a44e91
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def _download_extract(args, dep_item):
logging.info("remove previous %s copy", target)
_rmtree(target)

# Link (or copy)
# Link (or copy) and patch
if not op.exists(target):
logging.info("symlink %s -> %s", target, rel_extract_dir)
try:
Expand All @@ -356,6 +356,11 @@ def _download_extract(args, dep_item):
logging.info("unable to symlink, fallback on copy (%s -> %s)", extract_dir, target)
shutil.copytree(extract_dir, target)

patch_basedir = op.join(_ROOTDIR, "patches", name)
for patch in dep.get("patches", []):
patch_path = op.join(patch_basedir, patch)
run(["patch", "-p1", "-i", patch_path], cwd=target)

return name, target


Expand Down

0 comments on commit 5a44e91

Please sign in to comment.