Files
libtensorflow1-freebsd-port/files/extra-patch-third_party_repo.bzl
Paul Armstrong 8c2b7770c2 Cleanup lint, fix prompting, fix FreeBSD 12 issues
Ran portlint, portclippy and portfmt.
Recreated patches with make makepatch
Add additional required pre-build downloads from github
Add OpenCL Sycl support
Use memory usage reducing flags for bazel. They are all to do with
reducing the time taken for incremental builds, which is not relevant
when building ports.
Add TF_NEED_MPT=0 to stop prompting
Add -march=native -Wno-sign-compare flags for CC
2022-06-08 00:57:32 +10:00

26 lines
977 B
Python

--- third_party/repo.bzl.orig
+++ third_party/repo.bzl
@@ -62,13 +62,15 @@ def _repos_are_siblings():
return Label("@foo//bar").workspace_root.startswith("../")
# Apply a patch_file to the repository root directory
-# Runs 'git apply' on Unix, 'patch -p1' on Windows.
+# Runs 'patch -p1'
def _apply_patch(ctx, patch_file):
- if _is_windows(ctx):
- patch_command = ["patch", "-p1", "-d", ctx.path("."), "-i", ctx.path(patch_file)]
- else:
- patch_command = ["git", "apply", "-v", ctx.path(patch_file)]
- cmd = _wrap_bash_cmd(ctx, patch_command)
+ # Don't check patch on Windows, because patch is only available under bash.
+ if not _is_windows(ctx) and not ctx.which("patch"):
+ fail("patch command is not found, please install it")
+ cmd = _wrap_bash_cmd(
+ ctx,
+ ["patch", "-p1", "-d", ctx.path("."), "-i", ctx.path(patch_file)],
+ )
_execute_and_check_ret_code(ctx, cmd)
def _apply_delete(ctx, paths):