Skip to content

Commit

Permalink
Patch icu and remove patch.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed Dec 24, 2023
1 parent 5c0e260 commit 1017301
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
31 changes: 26 additions & 5 deletions deps/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,31 @@
v8_enable_verify_heap=false
"""

def patch_icu(file_path= os.path.join(v8_path, "third_party/icu/BUILD.gn"), replace_str="\"standard__\""):
print (file_path)
try:
# Read the content of the file
with open(file_path, 'r') as file:
file_content = file.read()

# Replace the specified string
file_content = file_content.replace("\"standard\"", replace_str)

# Write the modified content back to the file
with open(file_path, 'w') as file:
file.write(file_content)

# Remove the specified directory
git_dir = os.path.join(v8_path, "third_party/icu/.git")
print (git_dir)
if os.path.exists(git_dir):
os.system(f"rm -rf {git_dir}")

print("Patch icu success")

except Exception as e:
print(f"Error patching icu: {e}")

def v8deps():
spec = "solutions = %s" % gclient_sln
env = os.environ.copy()
Expand All @@ -86,11 +111,7 @@ def v8deps():
# if arch is arm64 and os is linux apply patch
# fix aarch64-linux-gnu-gcc: error: unrecognized command-line option ‘-mmark-bti-property’
if args.arch == "arm64" and is_linux:
patch_script_path = "./patch.sh"
subprocess.check_call(cmd([patch_script_path]),
cwd=deps_path,
env=env)

patch_icu()

def cmd(args):
return ["cmd", "/c"] + args if is_windows else args
Expand Down
6 changes: 0 additions & 6 deletions deps/patch.sh

This file was deleted.

0 comments on commit 1017301

Please sign in to comment.