Add python on Linux by mandating zstd

This commit is contained in:
doylet 2024-01-10 11:03:30 +11:00
parent 435f11284e
commit 6923fa271f
3 changed files with 27 additions and 24 deletions

View File

@ -888,31 +888,30 @@ def get_manifest(is_windows):
else:
download_url = f"https://github.com/indygreg/python-build-standalone/releases/download/{date}/cpython-{version}-x86_64_v2-unknown-linux-gnu-pgo+lto-full.tar.zst"
download_checksum = "49f4a8c02efff2debbb258973b1f6efbd568e4be2e5dca07c7dcd754a7bff9cf"
checksum = "none"
exe_path = "bin/python"
checksum = "ee96234460ff4c5163dc0681dbfaf8cf5f4e65972fde796da7b0ee0d5ce077d5"
exe_path = "install/bin/python3"
# TODO: Get ZST somehow on linux
if is_windows:
result.append({
"label": label,
"manifests": [
{
"download_checksum": download_checksum,
"download_url": download_url,
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": exe_path,
"symlink": [],
"add_to_devenv_path": True,
"checksum": checksum,
}
],
"add_to_devenv_script": add_to_devenv_script,
}
],
})
result.append({
"label": label,
"manifests": [
{
"download_checksum": download_checksum,
"download_url": download_url,
"version": version,
"unzip_method": 'default',
"executables": [
{
"path": exe_path,
"symlink": [],
"add_to_devenv_path": True,
"checksum": checksum,
}
],
"add_to_devenv_script": add_to_devenv_script,
}
],
})
# --------------------------------------------------------------------------

View File

@ -520,6 +520,10 @@ def install_app_list(app_list, download_dir, install_dir, is_windows):
validate_app_list_result = validate_app_list(app_list)
app_index = 0
global zstd_exe
if not is_windows:
zstd_exe = "/usr/bin/zstd"
for app in app_list:
manifest_list = app['manifests']
for manifest in manifest_list:
@ -552,7 +556,6 @@ def install_app_list(app_list, download_dir, install_dir, is_windows):
if app_list is internal_app_list:
global zip7_exe
global zip7_bootstrap_exe
global zstd_exe
exe_path = get_exe_install_path(install_dir, label, version, manifest['executables'][0]['path'])
if label == '7zip':
if is_windows or os.name == 'nt':
@ -804,6 +807,7 @@ def run(user_app_list,
devenv_script_buffer += f"export devenver_root=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )\"\n"
devenv_script_buffer += f"PATH=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )/Scripts\":$PATH\n"
devenv_script_buffer += f"PATH=\"$( cd -- $( dirname -- \"${{BASH_SOURCE[0]}}\" ) &> /dev/null && pwd )/Symlinks\":$PATH\n"
devenv_script_buffer += f"PATH=$(echo $PATH | awk -v RS=: -v ORS=: '/^\/mnt\/c/ {{next}} {{print}}')"
devenv_script_name = f"{devenv_script_name}.bat" if is_windows else f"{devenv_script_name}.sh"
devenv_script_path = pathlib.Path(install_dir, devenv_script_name)