From a0d51ec32ef0c9d5a3daedbfb7f0e0ac691037fa Mon Sep 17 00:00:00 2001 From: Pierre Neter Date: Wed, 10 Feb 2021 11:58:23 +0700 Subject: [PATCH 1/2] add .DS_Store to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5867e46..16a4373 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /pyenv /pyenv_last_update +.DS_Store From 225091e2eec76a911bfa778adc826c603c51644b Mon Sep 17 00:00:00 2001 From: Pierre Neter Date: Wed, 10 Feb 2021 11:59:05 +0700 Subject: [PATCH 2/2] enable install with patch URL --- README.md | 14 +++++++++++++- bin/install | 8 ++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1c6bb64..7badb74 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,19 @@ Python plugin for [asdf](https://github.com/asdf-vm/asdf) version manager 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 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) 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 A common request for Python is being able to use the `python2` and `python3` commands without needing to switch version. diff --git a/bin/install b/bin/install index f9aaf97..51fe2ed 100755 --- a/bin/install +++ b/bin/install @@ -16,8 +16,12 @@ install_python() { fi install_or_update_python_build - local patch_file=${ASDF_PYTHON_PATCHES_DIRECTORY}/${version}.patch - if [ -f "$patch_file" ]; then + 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 echo "python-build $version $install_path -p < $patch_file" $(python_build_path) "$version" "$install_path" -p < $patch_file else