diff --git a/.github/actions/build-python/action.yml b/.github/actions/build-python/action.yml index 194c4994..3866656e 100644 --- a/.github/actions/build-python/action.yml +++ b/.github/actions/build-python/action.yml @@ -20,12 +20,12 @@ runs: shell: bash run: | #prerequisites - brew install openssl readline sqlite3 xz tcl-tk@8 libb2 zstd + brew install openssl readline sqlite3 xz tcl-tk@8 libb2 zstd gdbm - if: runner.os == 'Linux' shell: bash run: | #prerequisites - pyenv install-prerequisites + pyenv install-prerequisites --all - shell: bash run: | #build diff --git a/.github/workflows/modified_scripts_build.yml b/.github/workflows/modified_scripts_build.yml index 29b30c94..0c36be62 100644 --- a/.github/workflows/modified_scripts_build.yml +++ b/.github/workflows/modified_scripts_build.yml @@ -108,7 +108,7 @@ jobs: echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH - run: | #prerequisites - brew install openssl readline sqlite3 xz tcl-tk@8 libb2 zstd + brew install openssl readline sqlite3 xz tcl-tk@8 libb2 zstd gdbm if [[ "${{ matrix.python-version }}" =~ pypy.*-(src|dev) ]]; then export PYENV_BOOTSTRAP_VERSION=pypy2.7-7 echo "PYENV_BOOTSTRAP_VERSION=$PYENV_BOOTSTRAP_VERSION" >> $GITHUB_ENV @@ -222,7 +222,7 @@ jobs: echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH - run: | #prerequisites - pyenv install-prerequisites + pyenv install-prerequisites --all if [[ "${{ matrix.python-version }}" =~ pypy.*-(src|dev) ]]; then export PYENV_BOOTSTRAP_VERSION=pypy2.7-7 echo "PYENV_BOOTSTRAP_VERSION=$PYENV_BOOTSTRAP_VERSION" >> $GITHUB_ENV diff --git a/plugins/python-build/bin/pyenv-install b/plugins/python-build/bin/pyenv-install index 4a5e71c1..2fd268fd 100755 --- a/plugins/python-build/bin/pyenv-install +++ b/plugins/python-build/bin/pyenv-install @@ -261,7 +261,7 @@ for i in "${!DEFINITIONS[@]}"; do PYENV_BOOTSTRAP_VERSION="${PYENV_RPYTHON_VERSION}" else for version in $(pyenv-versions --bare | sort -r); do - if [[ "${version}" == "2.7"* ]]; then + if [[ "${version}" =~ ^(2\.7|pypy2\.7) ]]; then PYENV_BOOTSTRAP_VERSION="$version" break fi @@ -275,7 +275,7 @@ for i in "${!DEFINITIONS[@]}"; do fi done else - echo "pyenv-install: $VERSION_NAME: PyPy requires Python 2.7 to build from source." >&2 + echo "pyenv-install: $VERSION_NAME: PyPy requires Python 2.7 to build from source. You can specify the version to use by setting the PYENV_BOOTSTRAP_VERSION environment variable." >&2 exit 1 fi ;; diff --git a/plugins/python-build/share/python-build/pypy2.7-7.3.23 b/plugins/python-build/share/python-build/pypy2.7-7.3.23 new file mode 100644 index 00000000..999c40c9 --- /dev/null +++ b/plugins/python-build/share/python-build/pypy2.7-7.3.23 @@ -0,0 +1,77 @@ +VERSION='7.3.23' +PYVER='2.7' + +# https://www.pypy.org/checksums.html +aarch64_hash=b0bec20c16b6ab2bd46bd4f5d6049b6070a22a53eaed437ee9ac36d842ceda74 +linux32_hash=fa6499281775ec22f4742e9dd7b31c22b8fc6a700c1cf50aebc7ef24f61461c5 +linux64_hash=7833be48244a6f4aa0720c6b98f151428291a52697da849ef6b3ca7d5bf45b96 +osarm64_hash=f83d8fce9695f598dc55187c0f6c06c367dbf76d288d2bca7dbf040e4be15f37 +osx64_hash=edbddb678c00f29c2361dbe6c6ea634f5d62e6854a775a9209c6b789bb0dc00b + +### end of manual settings - following lines same for every download + +function err_no_binary { + local archmsg="${1}" + local ver="pypy${PYVER}-v${VERSION}-src" + local url="https://downloads.python.org/pypy/${ver}.tar.bz2" + { echo + colorize 1 "ERROR" + echo ": The binary distribution of PyPy is not available for ${archmsg}." + echo "try '${url}' to build from source." + echo + } >&2 + exit 1 +} + +function pypy_pkg_data { + # pypy architecture tag + local ARCH="${1}" + + # defaults + local cmd='install_package' # use bz2 + local pkg="${ARCH}" # assume matches + local ext='tar.bz2' + local hash='' # undefined + + # select the hash, fix pkg if not match ARCH + case "${ARCH}" in + 'linux-aarch64' ) + hash="${aarch64_hash}" + pkg='aarch64' + ;; + 'linux' ) + hash="${linux32_hash}" + pkg='linux32' + ;; + 'linux64' ) + hash="${linux64_hash}" + ;; + 'osarm64' ) + hash="${osarm64_hash}" + pkg='macos_arm64' + ;; + 'osx64' ) + if require_osx_version "10.13"; then + hash="${osx64_hash}" + pkg='macos_x86_64' + else + err_no_binary "${ARCH}, OS X < 10.13" + fi + ;; + * ) + err_no_binary "${ARCH}" + ;; + esac + + local basever="pypy${PYVER}-v${VERSION}" + local baseurl="https://downloads.python.org/pypy/${basever}" + + # result - command, package dir, url+hash + echo "${cmd}" "${basever}-${pkg}" "${baseurl}-${pkg}.${ext}#${hash}" +} + +# determine command, package directory, url+hash +declare -a pd="$(pypy_pkg_data "$(pypy_architecture 2>/dev/null || true)")" + +# install +${pd[0]} "${pd[1]}" "${pd[2]}" 'pypy' "verify_py${PYVER//./}" 'ensurepip_lt21' diff --git a/plugins/python-build/share/python-build/pypy2.7-7.3.23-src b/plugins/python-build/share/python-build/pypy2.7-7.3.23-src new file mode 100644 index 00000000..6dc2b016 --- /dev/null +++ b/plugins/python-build/share/python-build/pypy2.7-7.3.23-src @@ -0,0 +1,14 @@ +VERSION='7.3.23' +PYVER='2.7' + +# https://www.pypy.org/checksums.html +hash=7aa8eaf414d25f916fe426365404759c56aa28aea6190e65967c4a45f64dc899 + +### end of manual settings - following lines same for every download + +ver="pypy${PYVER}-v${VERSION}-src" +url="https://downloads.python.org/pypy/${ver}.tar.bz2" + +prefer_openssl11 +install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl +install_package "${ver}" "${url}#${hash}" 'pypy_builder' "verify_py${PYVER//./}" 'ensurepip_lt21' diff --git a/plugins/python-build/share/python-build/pypy3.11-7.3.23 b/plugins/python-build/share/python-build/pypy3.11-7.3.23 new file mode 100644 index 00000000..5c76e45d --- /dev/null +++ b/plugins/python-build/share/python-build/pypy3.11-7.3.23 @@ -0,0 +1,77 @@ +VERSION='7.3.23' +PYVER='3.11' + +# https://www.pypy.org/checksums.html +aarch64_hash=5433ac0ad526aeb35025ef8509bed65cd62ea35cb9e21ac649c69a5eff4eecb6 +linux32_hash=c7e2ffb173dcadbe4708a2e606e0b705474c1c33f25a09a4084f265d538172e4 +linux64_hash=16f9f56e82d1f4ec95a324c1a8cacfd78afc7f0656c0a809a18725ef4391453a +osarm64_hash=4747b3aceba4c1c6104cddc0fe5ea302101d32955f0957347b9ecc4fbd7aed05 +osx64_hash=c95363c4e87235d11a6cec8128239c291b1eb67a752778fbcfe029a71da82b5e + +### end of manual settings - following lines same for every download + +function err_no_binary { + local archmsg="${1}" + local ver="pypy${PYVER}-v${VERSION}-src" + local url="https://downloads.python.org/pypy/${ver}.tar.bz2" + { echo + colorize 1 "ERROR" + echo ": The binary distribution of PyPy is not available for ${archmsg}." + echo "try '${url}' to build from source." + echo + } >&2 + exit 1 +} + +function pypy_pkg_data { + # pypy architecture tag + local ARCH="${1}" + + # defaults + local cmd='install_package' # use bz2 + local pkg="${ARCH}" # assume matches + local ext='tar.bz2' + local hash='' # undefined + + # select the hash, fix pkg if not match ARCH + case "${ARCH}" in + 'linux-aarch64' ) + hash="${aarch64_hash}" + pkg='aarch64' + ;; + 'linux' ) + hash="${linux32_hash}" + pkg='linux32' + ;; + 'linux64' ) + hash="${linux64_hash}" + ;; + 'osarm64' ) + hash="${osarm64_hash}" + pkg='macos_arm64' + ;; + 'osx64' ) + if require_osx_version "10.13"; then + hash="${osx64_hash}" + pkg='macos_x86_64' + else + err_no_binary "${ARCH}, OS X < 10.13" + fi + ;; + * ) + err_no_binary "${ARCH}" + ;; + esac + + local basever="pypy${PYVER}-v${VERSION}" + local baseurl="https://downloads.python.org/pypy/${basever}" + + # result - command, package dir, url+hash + echo "${cmd}" "${basever}-${pkg}" "${baseurl}-${pkg}.${ext}#${hash}" +} + +# determine command, package directory, url+hash +declare -a pd="$(pypy_pkg_data "$(pypy_architecture 2>/dev/null || true)")" + +# install +${pd[0]} "${pd[1]}" "${pd[2]}" 'pypy' "verify_py${PYVER//./}" 'ensurepip' diff --git a/plugins/python-build/share/python-build/pypy3.11-7.3.23-src b/plugins/python-build/share/python-build/pypy3.11-7.3.23-src new file mode 100644 index 00000000..a668eb09 --- /dev/null +++ b/plugins/python-build/share/python-build/pypy3.11-7.3.23-src @@ -0,0 +1,14 @@ +VERSION='7.3.23' +PYVER='3.11' + +# https://www.pypy.org/checksums.html +hash=f15c9c41e03f3f7ecc25228c6c67427b8918f21ef2d694215994b1fade20f69b + +### end of manual settings - following lines same for every download + +ver="pypy${PYVER}-v${VERSION}-src" +url="https://downloads.python.org/pypy/${ver}.tar.bz2" + +prefer_openssl11 +install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl +install_package "${ver}" "${url}#${hash}" 'pypy_builder' "verify_py${PYVER//./}" 'ensurepip'