enable install with patch URL

This commit is contained in:
Pierre Neter 2021-02-10 11:59:05 +07:00
parent a0d51ec32e
commit 225091e2ee
2 changed files with 19 additions and 3 deletions

View file

@ -10,6 +10,19 @@ Python plugin for [asdf](https://github.com/asdf-vm/asdf) version manager
asdf plugin-add python asdf plugin-add python
``` ```
### Install with `--patch`
> Enable to fix macOS 11 issues
You can use environment variable `ASDF_PYTHON_PATCH_URL` to install with `--patch` like that:
```
export ASDF_PYTHON_PATCH_URL="https://github.com/python/cpython/commit/8ea6353.patch?full_index=1"
asdf install python 3.6.12
```
or use environment variable `ASDF_PYTHON_PATCHES_DIRECTORY`.
## Use ## Use
Check [asdf](https://github.com/asdf-vm/asdf) readme for instructions on how to install & manage versions of Python. Check [asdf](https://github.com/asdf-vm/asdf) readme for instructions on how to install & manage versions of Python.
@ -19,7 +32,6 @@ Under the hood, asdf-python uses [python-build](https://github.com/yyuu/pyenv/tr
to build and install Python, check its [README](https://github.com/yyuu/pyenv/tree/master/plugins/python-build) to build and install Python, check its [README](https://github.com/yyuu/pyenv/tree/master/plugins/python-build)
for more information about build options and the [common build problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems) wiki page for any issues encountered during installation of python versions. for more information about build options and the [common build problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems) wiki page for any issues encountered during installation of python versions.
## Using multiple versions of Python ## Using multiple versions of Python
A common request for Python is being able to use the `python2` and `python3` commands without needing to switch version. A common request for Python is being able to use the `python2` and `python3` commands without needing to switch version.

View file

@ -16,8 +16,12 @@ install_python() {
fi fi
install_or_update_python_build install_or_update_python_build
if [[ -n "${ASDF_PYTHON_PATCH_URL:-}" ]]; then
echo "python-build --patch $version $install_path"
echo "with patch file from: $ASDF_PYTHON_PATCH_URL"
$(python_build_path) --patch "$version" "$install_path" < <(curl -sSL "$ASDF_PYTHON_PATCH_URL")
elif [[ -n "${ASDF_PYTHON_PATCHES_DIRECTORY:-}" ]]; then
local patch_file=${ASDF_PYTHON_PATCHES_DIRECTORY}/${version}.patch local patch_file=${ASDF_PYTHON_PATCHES_DIRECTORY}/${version}.patch
if [ -f "$patch_file" ]; then
echo "python-build $version $install_path -p < $patch_file" echo "python-build $version $install_path -p < $patch_file"
$(python_build_path) "$version" "$install_path" -p < $patch_file $(python_build_path) "$version" "$install_path" -p < $patch_file
else else