Skip to content

Commit

Permalink
python modify
Browse files Browse the repository at this point in the history
  • Loading branch information
hocheung-chromium committed Dec 2, 2024
1 parent 42c6a9b commit afdf068
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 23 deletions.
2 changes: 2 additions & 0 deletions win_scripts/build_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def display_help():

try_run(f'autoninja -C out/thorium thorium_all -j{jobs}')

try_run(f'autoninja -C out/thorium setup mini_installer -j{jobs}')

# Move the installer
installer_src = os.path.normpath(os.path.join(cr_src_dir, 'out', 'thorium', 'mini_installer.exe'))
installer_dest = os.path.normpath(os.path.join(cr_src_dir, 'out', 'thorium', 'thorium_mini_installer.exe'))
Expand Down
38 changes: 17 additions & 21 deletions win_scripts/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def display_help():
'other/fix-policy-templates.patch',
'other/ftp-support-thorium.patch',
'other/thorium-2024-ui.patch',
'other/GPC.patch',
]
for patch in patches:
relative_path = patch.replace('other/', '', 1)
Expand Down Expand Up @@ -164,6 +165,10 @@ def display_help():
os.chdir(cr_src_dir)
try_run(f'git apply --reject ftp-support-thorium.patch')

print( "\nPatching in GPC support\n")
# Change directory to cr_src_dir and run commands
os.chdir(cr_src_dir)
try_run(f'git apply --reject GPC.patch')

print( "\nPatching for Thorium 2024 UI\n")
# Change directory to cr_src_dir and run commands
Expand Down Expand Up @@ -233,11 +238,7 @@ def copy_woa():
def copy_avx512():
print("\nCopying AVX-512 build files\n")
copy_directory(
os.path.normpath(os.path.join(thor_src_dir, 'other', 'AVX512', 'build')),
os.path.normpath(os.path.join(cr_src_dir, 'build'))
)
copy_directory(
os.path.normpath(os.path.join(thor_src_dir, 'other', 'AVX512', 'third_party')),
os.path.normpath(os.path.join(thor_src_dir, 'other', 'AVX2', 'third_party')),
os.path.normpath(os.path.join(cr_src_dir, 'third_party'))
)
copy(
Expand All @@ -264,10 +265,6 @@ def copy_avx512():
# Copy AVX2 build files
def copy_avx2():
print("\nCopying AVX2 build files\n")
copy_directory(
os.path.normpath(os.path.join(thor_src_dir, 'other', 'AVX2', 'build')),
os.path.normpath(os.path.join(cr_src_dir, 'build'))
)
copy_directory(
os.path.normpath(os.path.join(thor_src_dir, 'other', 'AVX2', 'third_party')),
os.path.normpath(os.path.join(cr_src_dir, 'third_party'))
Expand Down Expand Up @@ -296,10 +293,6 @@ def copy_avx2():
# Copy SSE4.1 build files
def copy_sse4():
print("\nCopying SSE4.1 build files\n")
copy_directory(
os.path.normpath(os.path.join(thor_src_dir, 'other', 'SSE4.1', 'build')),
os.path.normpath(os.path.join(cr_src_dir, 'build'))
)
copy(
os.path.normpath(os.path.join(thor_src_dir, 'other', 'SSE4.1', 'thor_ver')),
os.path.normpath(os.path.join(cr_src_dir, 'out', 'thorium'))
Expand All @@ -324,10 +317,6 @@ def copy_sse4():
# Copy SSE3 build files
def copy_sse3():
print("\nCopying SSE3 build files\n")
copy_directory(
os.path.normpath(os.path.join(thor_src_dir, 'other', 'SSE3', 'build')),
os.path.normpath(os.path.join(cr_src_dir, 'build'))
)
copy(
os.path.normpath(os.path.join(thor_src_dir, 'other', 'SSE3', 'thor_ver')),
os.path.normpath(os.path.join(cr_src_dir, 'out', 'thorium'))
Expand Down Expand Up @@ -357,10 +346,6 @@ def copy_sse3():
# Copy SSE2 build files
def copy_sse2():
print("\nCopying SSE2 build files\n")
copy_directory(
os.path.normpath(os.path.join(thor_src_dir, 'other', 'SSE2', 'build')),
os.path.normpath(os.path.join(cr_src_dir, 'build'))
)
copy(
os.path.normpath(os.path.join(thor_src_dir, 'other', 'SSE2', 'thor_ver')),
os.path.normpath(os.path.join(cr_src_dir, 'out', 'thorium'))
Expand All @@ -381,6 +366,17 @@ def copy_sse2():
if '--sse2' in sys.argv:
copy_sse2()

print("\nPatching ANGLE for SSE2\n")
copy(
os.path.normpath(os.path.join(thor_src_dir, 'other', 'SSE2', 'angle-lockfree.patch')),
os.path.normpath(os.path.join(cr_src_dir, 'third_party', 'angle', 'src'))
)

# Change directory to angle_dir and run commands
angle_dir = os.path.join(cr_src_dir, 'third_party', 'angle', 'src')
os.chdir(angle_dir)
try_run(f'git apply --reject angle-lockfree.patch')


print("\nDone!\n")
print("\nEnjoy Thorium!\n")
2 changes: 1 addition & 1 deletion win_scripts/upstream_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def display_help():


# Set cr_ver
cr_ver = "128.0.6613.194"
cr_ver = "130.0.6723.142"


print(f"\nCurrent Chromium version is: {cr_ver}\n")
Expand Down
2 changes: 1 addition & 1 deletion win_scripts/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def display_help():


# Set thor_ver
thor_ver = "128.0.6613.194"
thor_ver = "130.0.6723.142"


print(f"\nCurrent Thorium version is: {thor_ver}\n")
Expand Down

0 comments on commit afdf068

Please sign in to comment.