mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-08 11:33:49 -05:00
Compare commits
120 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc4c0ac52d | ||
|
|
579c34e570 | ||
|
|
2369ac2a08 | ||
|
|
25c974d59a | ||
|
|
2ea797e226 | ||
|
|
7d7f8b94ae | ||
|
|
e715e03be0 | ||
|
|
b3a5b5eee3 | ||
|
|
894bcd8717 | ||
|
|
03ee3ffd32 | ||
|
|
3d83bcdbef | ||
|
|
f897c50202 | ||
|
|
773c65416b | ||
|
|
ca1593c80e | ||
|
|
cb5da5e831 | ||
|
|
31f372034d | ||
|
|
ff93c58bab | ||
|
|
2bb59169db | ||
|
|
f9e519611a | ||
|
|
ae04877154 | ||
|
|
e82e12739c | ||
|
|
6b9795728e | ||
|
|
23576296ae | ||
|
|
2128b4f27d | ||
|
|
9ba6124833 | ||
|
|
6c63e086e9 | ||
|
|
540c94bdb1 | ||
|
|
18f62f266d | ||
|
|
49cc88094a | ||
|
|
cad18bb332 | ||
|
|
79fdf1e3bb | ||
|
|
03bba03291 | ||
|
|
cf50e2a2db | ||
|
|
b3d52b05d2 | ||
|
|
73dc5547fc | ||
|
|
3f0dd1962f | ||
|
|
48b0224aaf | ||
|
|
8cfa967d74 | ||
|
|
a57106c932 | ||
|
|
189e73e5e8 | ||
|
|
8680247381 | ||
|
|
606ff454a1 | ||
|
|
b05d15f673 | ||
|
|
881ba40ff4 | ||
|
|
58bbbf8880 | ||
|
|
c1674cd552 | ||
|
|
74f923b5fc | ||
|
|
59c560893a | ||
|
|
4971d9e35e | ||
|
|
6d13db992f | ||
|
|
13d8568620 | ||
|
|
cc56f76733 | ||
|
|
4c261e6ea1 | ||
|
|
31355676f0 | ||
|
|
c162dcd932 | ||
|
|
0b6320d371 | ||
|
|
3bfaa33c1b | ||
|
|
cd2858aa17 | ||
|
|
19359de7b8 | ||
|
|
8dd46e3915 | ||
|
|
ed1083ec27 | ||
|
|
904fe964b0 | ||
|
|
036fd63bbd | ||
|
|
1250d7dd30 | ||
|
|
ad6a950734 | ||
|
|
6da0e89207 | ||
|
|
e03118235a | ||
|
|
a8f921ce4d | ||
|
|
4a031504db | ||
|
|
75022d5d7c | ||
|
|
a12f947cc3 | ||
|
|
0b5e16add3 | ||
|
|
5b0ac41dec | ||
|
|
44510a68f1 | ||
|
|
16c4924f22 | ||
|
|
ac30d5f4e4 | ||
|
|
9f5dcbffd4 | ||
|
|
faceb4b79c | ||
|
|
d7389c10ee | ||
|
|
0726e02e3a | ||
|
|
03a5d65387 | ||
|
|
776f6ff9fa | ||
|
|
bb0f2ae1a7 | ||
|
|
ea6085e3f3 | ||
|
|
2c2619a49e | ||
|
|
1f526edbdd | ||
|
|
8b226c9679 | ||
|
|
f3521e88be | ||
|
|
5b08a6492b | ||
|
|
d722f059a0 | ||
|
|
093d0b3a49 | ||
|
|
73d4f3102a | ||
|
|
aa07a3a37c | ||
|
|
e6446555f3 | ||
|
|
c5e0d2cd94 | ||
|
|
cfe684ef42 | ||
|
|
1d28067353 | ||
|
|
0740fdf910 | ||
|
|
75fc9f6fd4 | ||
|
|
a0fbdad292 | ||
|
|
6a104f68d0 | ||
|
|
f6f1803ac9 | ||
|
|
23559ee6d1 | ||
|
|
4e31668c21 | ||
|
|
2b22145670 | ||
|
|
7c1c180551 | ||
|
|
a648682ed6 | ||
|
|
47b0ce77c0 | ||
|
|
fdabd14c2b | ||
|
|
e52ad61389 | ||
|
|
2e5983b004 | ||
|
|
27b5f62dfb | ||
|
|
7c1e3a710c | ||
|
|
13f273188d | ||
|
|
c89a69a6ed | ||
|
|
a8afc61146 | ||
|
|
e4a0c12b1b | ||
|
|
afeb971fa2 | ||
|
|
965421d5d4 | ||
|
|
ae22c69505 |
11
.editorconfig
Normal file
11
.editorconfig
Normal file
@@ -0,0 +1,11 @@
|
||||
# Editor configuration, see https://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
|
||||
# Makefiles always use tabs for indentation
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
indent_size = unset # Allow user-defined tab width
|
||||
17
.github/workflows/macos_build.yml
vendored
17
.github/workflows/macos_build.yml
vendored
@@ -1,16 +1,21 @@
|
||||
name: macos_build
|
||||
on: [pull_request, push]
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
macos_build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version:
|
||||
- 3.7.10
|
||||
- 3.8.10
|
||||
- 3.9.5
|
||||
- 3.10.0
|
||||
runs-on: macos-10.15
|
||||
- "3.7"
|
||||
- "3.8"
|
||||
- "3.9"
|
||||
- "3.10"
|
||||
- "3.11"
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
# Normally, we would use the superbly maintained...
|
||||
@@ -27,7 +32,7 @@ jobs:
|
||||
run: |
|
||||
echo $PYENV_ROOT
|
||||
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
|
||||
bin/pyenv install ${{ matrix.python-version }}
|
||||
bin/pyenv install -v ${{ matrix.python-version }}
|
||||
bin/pyenv global ${{ matrix.python-version }}
|
||||
bin/pyenv rehash
|
||||
- run: python --version
|
||||
|
||||
113
.github/workflows/modified_scripts_build.yml
vendored
113
.github/workflows/modified_scripts_build.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
run: >
|
||||
versions=$(git diff "origin/$GITHUB_BASE_REF" --name-only -z
|
||||
| perl -ne 'BEGIN {$\="\n";$/="\0";} chomp;
|
||||
if (/^plugins\/python-build\/share\/python-build\/(?:([^\/]+)|patches\/([^\/]+)\/.*)$/)
|
||||
if (/^plugins\/python-build\/share\/python-build\/(?:([^\/]+)|patches\/([^\/]+)\/.*)$/ and -e $& )
|
||||
{ print $1.$2; }' \
|
||||
| sort -u);
|
||||
echo -e "versions<<!\\n$versions\\n!" >> $GITHUB_ENV
|
||||
@@ -27,33 +27,54 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ${{fromJson(needs.discover_modified_scripts.outputs.versions)}}
|
||||
os: ["macos-10.15", "macos-11"]
|
||||
os: ["macos-11", "macos-12"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
brew install openssl openssl@1.1 readline sqlite3 xz zlib
|
||||
- run: |
|
||||
#envvars
|
||||
export PYENV_ROOT="$GITHUB_WORKSPACE"
|
||||
echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV
|
||||
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
|
||||
- run: |
|
||||
pyenv install ${{ matrix.python-version }}
|
||||
pyenv global ${{ matrix.python-version }}
|
||||
#prerequisites
|
||||
brew install openssl openssl@1.1 readline sqlite3 xz zlib
|
||||
if [[ "${{ matrix.python-version }}" =~ pypy.*-(src|dev) ]]; then
|
||||
export PYENV_BOOTSTRAP_VERSION=pypy2.7-7
|
||||
echo "PYENV_BOOTSTRAP_VERSION=$PYENV_BOOTSTRAP_VERSION" >> $GITHUB_ENV
|
||||
pyenv install $PYENV_BOOTSTRAP_VERSION
|
||||
fi
|
||||
- run: |
|
||||
python --version
|
||||
python -m pip --version
|
||||
- shell: python # Prove that actual Python == expected Python
|
||||
env:
|
||||
#build
|
||||
pyenv install -v ${{ matrix.python-version }}
|
||||
pyenv global ${{ matrix.python-version }}
|
||||
# Micropython doesn't support --version
|
||||
- run: |
|
||||
#print version
|
||||
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
|
||||
python -c 'import sys; print(sys.version)'
|
||||
else
|
||||
python --version
|
||||
python -m pip --version
|
||||
fi
|
||||
# Micropython doesn't support sys.executable, os.path, older versions even os
|
||||
- env:
|
||||
EXPECTED_PYTHON: ${{ matrix.python-version }}
|
||||
run: |
|
||||
import os, sys, os.path
|
||||
correct_dir = os.path.join(
|
||||
os.environ['PYENV_ROOT'],
|
||||
'versions',
|
||||
os.environ['EXPECTED_PYTHON'],
|
||||
'bin')
|
||||
assert os.path.dirname(sys.executable) == correct_dir
|
||||
#check
|
||||
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
|
||||
[[ $(pyenv which python) == "${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}/bin/python" ]] || exit 1
|
||||
python -c 'import sys; assert sys.implementation.name == "micropython"'
|
||||
else
|
||||
python -c 'if True:
|
||||
import os, sys, os.path
|
||||
correct_dir = os.path.join(
|
||||
os.environ["PYENV_ROOT"],
|
||||
"versions",
|
||||
os.environ["EXPECTED_PYTHON"],
|
||||
"bin")
|
||||
assert os.path.dirname(sys.executable) == correct_dir'
|
||||
fi
|
||||
# bundled executables in some Anaconda releases cause the post-run step to hang in MacOS
|
||||
- run: |
|
||||
pyenv global system
|
||||
@@ -66,32 +87,54 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ${{fromJson(needs.discover_modified_scripts.outputs.versions)}}
|
||||
os: ["ubuntu-18.04", "ubuntu-20.04"]
|
||||
os: ["ubuntu-20.04", "ubuntu-22.04"]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
sudo apt-get update -q; sudo apt-get install -yq build-essential \
|
||||
libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev \
|
||||
wget curl llvm libncurses5-dev libncursesw5-dev \
|
||||
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
|
||||
- run: |
|
||||
#envvars
|
||||
export PYENV_ROOT="$GITHUB_WORKSPACE"
|
||||
echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV
|
||||
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
|
||||
- run: |
|
||||
pyenv install ${{ matrix.python-version }}
|
||||
#prerequisites
|
||||
sudo apt-get update -q; sudo apt-get install -yq make build-essential \
|
||||
libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev \
|
||||
curl llvm libncurses5-dev libncursesw5-dev \
|
||||
xz-utils tk-dev libffi-dev liblzma-dev
|
||||
if [[ "${{ matrix.python-version }}" =~ pypy.*-(src|dev) ]]; then
|
||||
export PYENV_BOOTSTRAP_VERSION=pypy2.7-7
|
||||
echo "PYENV_BOOTSTRAP_VERSION=$PYENV_BOOTSTRAP_VERSION" >> $GITHUB_ENV
|
||||
pyenv install $PYENV_BOOTSTRAP_VERSION
|
||||
fi
|
||||
- run: |
|
||||
#build
|
||||
pyenv install -v ${{ matrix.python-version }}
|
||||
pyenv global ${{ matrix.python-version }}
|
||||
- run: python --version
|
||||
- run: python -m pip --version
|
||||
- shell: python # Prove that actual Python == expected Python
|
||||
env:
|
||||
# Micropython doesn't support --version
|
||||
- run: |
|
||||
#print version
|
||||
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
|
||||
python -c 'import sys; print(sys.version)'
|
||||
else
|
||||
python --version
|
||||
python -m pip --version
|
||||
fi
|
||||
# Micropython doesn't support sys.executable, os.path, older versions even os
|
||||
- env:
|
||||
EXPECTED_PYTHON: ${{ matrix.python-version }}
|
||||
run: |
|
||||
import os, sys, os.path
|
||||
correct_dir = os.path.join(
|
||||
os.environ['PYENV_ROOT'],
|
||||
'versions',
|
||||
os.environ['EXPECTED_PYTHON'],
|
||||
'bin')
|
||||
assert os.path.dirname(sys.executable) == correct_dir
|
||||
#check
|
||||
if [[ "${{ matrix.python-version }}" == "micropython-"* ]]; then
|
||||
[[ $(pyenv which python) == "${{ env.PYENV_ROOT }}/versions/${{ matrix.python-version }}/bin/python" ]] || exit 1
|
||||
python -c 'import sys; assert sys.implementation.name == "micropython"'
|
||||
else
|
||||
python -c 'if True:
|
||||
import os, sys, os.path
|
||||
correct_dir = os.path.join(
|
||||
os.environ["PYENV_ROOT"],
|
||||
"versions",
|
||||
os.environ["EXPECTED_PYTHON"],
|
||||
"bin")
|
||||
assert os.path.dirname(sys.executable) == correct_dir'
|
||||
fi
|
||||
|
||||
56
.github/workflows/no-response.yml
vendored
56
.github/workflows/no-response.yml
vendored
@@ -1,26 +1,30 @@
|
||||
name: No Response
|
||||
|
||||
# Both `issue_comment` and `scheduled` event types are required for this Action
|
||||
# to work properly.
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
schedule:
|
||||
# Schedule for ten minutes after the hour, every hour
|
||||
- cron: '10 * * * *'
|
||||
|
||||
jobs:
|
||||
noResponse:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: lee-dohm/no-response@v0.5.0
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
daysUntilClose: 30
|
||||
responseRequiredLabel: need-feedback
|
||||
closeComment: >
|
||||
This issue has been automatically closed because there has been no response
|
||||
to our request for more information from the original author. With only the
|
||||
information that is currently in the issue, we don't have enough information
|
||||
to take action. Please reach out if you have or find the answers we need so
|
||||
that we can investigate further.
|
||||
name: No Response
|
||||
|
||||
# Both `issue_comment` and `scheduled` event types are required for this Action
|
||||
# to work properly.
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
schedule:
|
||||
# Schedule for ten minutes after the hour, every hour
|
||||
- cron: '10 * * * *'
|
||||
|
||||
permissions: {}
|
||||
jobs:
|
||||
noResponse:
|
||||
permissions:
|
||||
issues: write # to update issues (lee-dohm/no-response)
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: lee-dohm/no-response@v0.5.0
|
||||
with:
|
||||
token: ${{ github.token }}
|
||||
daysUntilClose: 30
|
||||
responseRequiredLabel: need-feedback
|
||||
closeComment: >
|
||||
This issue has been automatically closed because there has been no response
|
||||
to our request for more information from the original author. With only the
|
||||
information that is currently in the issue, we don't have enough information
|
||||
to take action. Please reach out if you have or find the answers we need so
|
||||
that we can investigate further.
|
||||
|
||||
8
.github/workflows/pyenv_tests.yml
vendored
8
.github/workflows/pyenv_tests.yml
vendored
@@ -1,15 +1,19 @@
|
||||
name: pyenv_tests
|
||||
on: [pull_request, push]
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
pyenv_tests:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-22.04
|
||||
- ubuntu-20.04
|
||||
- ubuntu-18.04
|
||||
- macos-12
|
||||
- macos-11
|
||||
- macos-10.15
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
23
.github/workflows/ubuntu_build.yml
vendored
23
.github/workflows/ubuntu_build.yml
vendored
@@ -1,16 +1,21 @@
|
||||
name: ubuntu_build
|
||||
on: [pull_request, push]
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
ubuntu_build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version:
|
||||
- 3.7.10
|
||||
- 3.8.10
|
||||
- 3.9.5
|
||||
- 3.10.0
|
||||
runs-on: Ubuntu-20.04
|
||||
- "3.7"
|
||||
- "3.8"
|
||||
- "3.9"
|
||||
- "3.10"
|
||||
- "3.11"
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
# Normally, we would use the superbly maintained...
|
||||
@@ -19,9 +24,9 @@ jobs:
|
||||
# python-version: ${{ matrix.python-version }}
|
||||
# ... but in the repo, we want to test pyenv builds on Ubuntu
|
||||
- run: |
|
||||
sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
|
||||
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
|
||||
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
|
||||
sudo apt-get install -yq make build-essential libssl-dev zlib1g-dev \
|
||||
libbz2-dev libreadline-dev libsqlite3-dev curl \
|
||||
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
|
||||
# https://github.com/pyenv/pyenv#installation
|
||||
- run: pwd
|
||||
- env:
|
||||
@@ -29,7 +34,7 @@ jobs:
|
||||
run: |
|
||||
echo $PYENV_ROOT
|
||||
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
|
||||
bin/pyenv install ${{ matrix.python-version }}
|
||||
bin/pyenv install -v ${{ matrix.python-version }}
|
||||
bin/pyenv global ${{ matrix.python-version }}
|
||||
bin/pyenv rehash
|
||||
- run: python --version
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -8,3 +8,5 @@
|
||||
/src/*.o
|
||||
/bats/
|
||||
/default-packages
|
||||
.idea
|
||||
*.un~
|
||||
|
||||
83
.travis.yml
83
.travis.yml
@@ -1,83 +0,0 @@
|
||||
# Two types of tests:
|
||||
#
|
||||
# 1. shell tests run using bats
|
||||
# 2. build tests also run using bats
|
||||
#
|
||||
# Shell tests are run unconditionally on Linux (see jobs.include).
|
||||
#
|
||||
# Build tests can be skipped by starting the commit message with
|
||||
# '[skip build]'.
|
||||
#
|
||||
# Build tests are run on platforms generated from all combinations
|
||||
# of keys below.
|
||||
language: c
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
dist:
|
||||
- focal
|
||||
|
||||
# https://docs.travis-ci.com/user/reference/osx/#macos-version
|
||||
osx_image:
|
||||
- xcode9.4.1 # macOS 10.13.6
|
||||
- xcode10.3 # macOS 10.14.4
|
||||
- xcode11.6 # macOS 10.15.7
|
||||
- xcode12.2 # macOS 10.15.7
|
||||
|
||||
env:
|
||||
- PYTHON_BUILD_VERSION=3.9.1
|
||||
- PYTHON_BUILD_VERSION=3.7.5
|
||||
|
||||
before_install:
|
||||
- date +%Y-%m-%dT%H:%M:%S
|
||||
|
||||
install: git clone --depth 1 --branch v1.2.0 https://github.com/bats-core/bats-core.git bats
|
||||
|
||||
# Default for auto-generated jobs.
|
||||
script: make test-build
|
||||
|
||||
jobs:
|
||||
include:
|
||||
# Shell-based tests should execute every time.
|
||||
- stage: test shell
|
||||
script: make test
|
||||
env: PYENV_NATIVE_EXT=1
|
||||
after_script: []
|
||||
os: linux
|
||||
- stage: test shell
|
||||
script: make test
|
||||
env: PYENV_NATIVE_EXT=
|
||||
after_script: []
|
||||
os: linux
|
||||
|
||||
exclude:
|
||||
# For each osx_image but one there should be an entry in the exclude
|
||||
# list, to prevent duplicate Linux builds.
|
||||
- os: linux
|
||||
osx_image: xcode9.4
|
||||
- os: linux
|
||||
osx_image: xcode10
|
||||
|
||||
allow_failures:
|
||||
- env: PYTHON_BUILD_VERSION=3.9.1
|
||||
|
||||
stages:
|
||||
- test shell
|
||||
- name: test
|
||||
if: NOT (commit_message =~ /^\[skip build\]/)
|
||||
|
||||
# Default
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: never
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: FLWevL09KYp7V1SjJUNEdWzuomuocXwNvPr1DSAFH7mmrjKTtjzwrjINAthSqzjlDrs5B//P47l1VLyHp5byEzy673W+bOmEg8swmqc7E9FrHLRyEByd/yca3DzkZgXEXgGdY/cl7tHhM4V2fYKEgAIWbFV+takmTFMK4WkEtNg=
|
||||
on:
|
||||
repo: pyenv/pyenv
|
||||
tags: true
|
||||
86
CHANGELOG.md
86
CHANGELOG.md
@@ -1,4 +1,88 @@
|
||||
## Version History
|
||||
# Version History
|
||||
|
||||
## Release 2.3.10
|
||||
|
||||
* Remove stray newline after python-build installation by @tklauser in https://github.com/pyenv/pyenv/pull/2566
|
||||
* Allow multiple versions for pyenv-install by @rockandska in https://github.com/pyenv/pyenv/pull/2568
|
||||
* --enable-shared by default by @anton-petrov in https://github.com/pyenv/pyenv/pull/2554
|
||||
* Fix non-bash output while detecting shell by @ianchen-tw in https://github.com/pyenv/pyenv/pull/2561
|
||||
* add pypy 7.3.11 release by @dand-oss in https://github.com/pyenv/pyenv/pull/2576
|
||||
* Mention how to build for maximum performance by @hauntsaninja in https://github.com/pyenv/pyenv/pull/2579
|
||||
* Add miniconda 22.11.1-1 by @aphedges in https://github.com/pyenv/pyenv/pull/2583
|
||||
* Add Fig as autocomplete suggestion by @brendanfalk in https://github.com/pyenv/pyenv/pull/2574
|
||||
* Fix using dependencies from Ports in BSD with no pkg-config by @native-api in https://github.com/pyenv/pyenv/pull/2586
|
||||
|
||||
## Release 2.3.9
|
||||
|
||||
* Add -latest suffix to miniforge3 by @nwh in https://github.com/pyenv/pyenv/pull/2551
|
||||
* Add PyPy 7.3.10 by @dand-oss in https://github.com/pyenv/pyenv/pull/2553
|
||||
* Add miniforge3 and mambaforge 22.9.0-2 by @smcgivern in https://github.com/pyenv/pyenv/pull/2559
|
||||
* Fix compilation error when building OpenSSL 1.1.1q in MacOS 11+ for 3.9.16 by @lisbethw1130 in https://github.com/pyenv/pyenv/pull/2558
|
||||
* Add `openssl` patches for 3.7.15, 3.7.16, and 3.8.16 by @samdoran in https://github.com/pyenv/pyenv/pull/2564
|
||||
* Add support for Anaconda3-2022.10 by @huypn12 in https://github.com/pyenv/pyenv/pull/2565
|
||||
|
||||
## Release 2.3.8
|
||||
|
||||
* Export detected shell environment in pyenv-init by @ianchen-tw in https://github.com/pyenv/pyenv/pull/2540
|
||||
* Add CPython 3.12.0a3 by @saaketp in https://github.com/pyenv/pyenv/pull/2545
|
||||
* Add CPython 3.11.1 by @anton-petrov in https://github.com/pyenv/pyenv/pull/2549
|
||||
* Add CPython 3.10.9 by @rudisimo in https://github.com/pyenv/pyenv/pull/2544
|
||||
* Add 3.7.16, 3.8.16, 3.9.16 by @chadac in https://github.com/pyenv/pyenv/pull/2550
|
||||
|
||||
## Release 2.3.7
|
||||
|
||||
* Add Python version 3.11 to the macOS build by @jbkkd in https://github.com/pyenv/pyenv/pull/2510
|
||||
* Don't use Zlib from XCode SDK if a custom compiler is used by @native-api in https://github.com/pyenv/pyenv/pull/2516
|
||||
* Change line endings from CRLF to LF by @hoang-himself in https://github.com/pyenv/pyenv/pull/2517
|
||||
* Fix resolution of a name that's a prefix of another name by @native-api in https://github.com/pyenv/pyenv/pull/2521
|
||||
* GitHub Workflows security hardening by @sashashura in https://github.com/pyenv/pyenv/pull/2511
|
||||
* Add nushell to activate list by @theref in https://github.com/pyenv/pyenv/pull/2524
|
||||
* Fix compilation error when building OpenSSL 1.1.1q in MacOS 11+ for 3.9.15 and 3.8.15 by @twangboy in https://github.com/pyenv/pyenv/pull/2520
|
||||
* Add simple `.editorconfig` file by @aphedges in https://github.com/pyenv/pyenv/pull/2518
|
||||
* Support `aria2c` being a snap by @native-api in https://github.com/pyenv/pyenv/pull/2528
|
||||
* Add CPython 3.12.0a2 by @saaketp in https://github.com/pyenv/pyenv/pull/2527
|
||||
* Add --no-push-path option by @isaacl in https://github.com/pyenv/pyenv/pull/2526
|
||||
* Fix typo in README.md by @weensy in https://github.com/pyenv/pyenv/pull/2535
|
||||
* Copy auto installer oneliner to readme by @spookyuser in https://github.com/pyenv/pyenv/pull/2538
|
||||
|
||||
## Release 2.3.6
|
||||
|
||||
* Add CPython 3.10.8 (#2480)
|
||||
* Add CPython 3.7.15, 3.8.15, and 3.9.15 (#2482)
|
||||
* Add CPython 3.11.0 (#2493)
|
||||
* Add CPython 3.12.0a1 (#2495)
|
||||
* Add graalpy-22.3.0 (#2497)
|
||||
* Auto-resolve prefixes to the latest version (#2487)
|
||||
* It must be a full prefix -- the actual searched prefix is `<prefix>[-.]`
|
||||
* Other flavors are likely sorted incorrectly atm
|
||||
* Prereleases and versions with some suffixes (`-dev`, `-src`, `-latest`) are not searched
|
||||
* `pyenv uninstall` has been excluded from the resolution feature: deleting a dynamically selected installation could be problematic
|
||||
* Fix OpenSSL 1.1.1q compilation error in MacOS 11+ (#2500)
|
||||
* Link to Tcl/Tk from Homebrew via pkgconfig for 3.11+ (#2501)
|
||||
* Fix syntax error in `pyenv init -` if PYENV_ROOT has spaces (#2506)
|
||||
|
||||
## Release 2.3.5
|
||||
|
||||
* Add CPython 3.10.7 (#2454)
|
||||
* Docs: update Fish PATH update (#2449)
|
||||
* Add CPython 3.7.14, 3.8.14 and 3.9.14 (#2456)
|
||||
* Update miniconda3-3.9-4.12.0 (#2460)
|
||||
* Add CPython 3.11.0rc2 (#2459)
|
||||
* Add patches for 3.7.14 to support Apple Silicon (#2463)
|
||||
* Add ability to skip all use of Homebrew (#2464)
|
||||
* Drop Travis integration (#2468)
|
||||
* Build CPython 3.12+ with --with-dsymutil in MacOS (#2471)
|
||||
* Add Pyston 2.3.5 (#2476)
|
||||
|
||||
## Release 2.3.4
|
||||
|
||||
* Add CPython 3.11.0rc1 (#2434)
|
||||
* Add support for multiple versions in `pyenv uninstall` (#2432)
|
||||
* Add micropython 1.18 and 1.19.1 (#2443)
|
||||
* CI: support Micropython, deleted scripts; build with -v (#2447)
|
||||
* Re-allow paths in .python-version while still preventing CVE-2022-35861 (#2442)
|
||||
* CI: Bump OS versions (#2448)
|
||||
* Add Cinder 3.8 (#2433)
|
||||
|
||||
## Release 2.3.3
|
||||
|
||||
|
||||
29
COMMANDS.md
29
COMMANDS.md
@@ -20,6 +20,7 @@ The most common subcommands are:
|
||||
* [`pyenv exec`](#pyenv-exec)
|
||||
* [`pyenv root`](#pyenv-root)
|
||||
* [`pyenv prefix`](#pyenv-prefix)
|
||||
* [`pyenv latest`](#pyenv-latest)
|
||||
* [`pyenv hooks`](#pyenv-hooks)
|
||||
* [`pyenv shims`](#pyenv-shims)
|
||||
* [`pyenv init`](#pyenv-init)
|
||||
@@ -228,7 +229,13 @@ Then install the desired versions:
|
||||
2.6.8
|
||||
* 2.7.6 (set by /home/yyuu/.pyenv/version)
|
||||
|
||||
To install the latest version of Python without giving a specific version use the `:latest` syntax. For example, to install the latest patch version for Python 3.8 you could do:
|
||||
You can also install the latest version of Python in a specific version line by supplying a prefix instead of a complete name:
|
||||
|
||||
$ pyenv install 3.10
|
||||
|
||||
See the [`pyenv latest` documentation](#pyenv-latest) for details on prefix resolution.
|
||||
|
||||
An older option is to use the `:latest` syntax. For example, to install the latest patch version for Python 3.8 you could do:
|
||||
|
||||
pyenv install 3.8:latest
|
||||
|
||||
@@ -238,9 +245,9 @@ To install the latest major release for Python 3 try:
|
||||
|
||||
## `pyenv uninstall`
|
||||
|
||||
Uninstall a specific Python version.
|
||||
Uninstall Python versions.
|
||||
|
||||
Usage: pyenv uninstall [-f|--force] <version>
|
||||
Usage: pyenv uninstall [-f|--force] <version> ...
|
||||
|
||||
-f Attempt to remove the specified version without prompting
|
||||
for confirmation. If the version does not exist, do not
|
||||
@@ -330,6 +337,19 @@ locations of the currently selected versions.
|
||||
$ pyenv prefix 3.9.7
|
||||
/home/user/.pyenv/versions/3.9.7
|
||||
|
||||
## `pyenv latest`
|
||||
|
||||
Displays the latest installed or known version with the given prefix
|
||||
|
||||
Usage: pyenv latest [-k|--known] [-q|--quiet] <prefix>
|
||||
|
||||
-k/--known Select from all known versions instead of installed
|
||||
-q/--quiet Do not print an error message on resolution failure
|
||||
|
||||
Only full prefixes are searched: in the actual name, the given prefix must be followed by a dot or a dash.
|
||||
|
||||
Prereleases and versions with specific suffixes (e.g. `-src`) are ignored.
|
||||
|
||||
## `pyenv hooks`
|
||||
|
||||
Lists installed hook scripts for a given pyenv command.
|
||||
@@ -366,11 +386,12 @@ List existing pyenv shims.
|
||||
|
||||
Configure the shell environment for pyenv
|
||||
|
||||
Usage: eval "$(pyenv init [-|--path] [--no-rehash] [<shell>])"
|
||||
Usage: eval "$(pyenv init [-|--path] [--no-push-path] [--no-rehash] [<shell>])"
|
||||
|
||||
- Initialize shims directory, print PYENV_SHELL variable, completions path
|
||||
and shell function
|
||||
--path Print shims path
|
||||
--no-push-path Do not push shim to the start of PATH if they're already there
|
||||
--no-rehash Add no rehash command to output
|
||||
|
||||
## `pyenv completions`
|
||||
|
||||
215
CONTRIBUTING.md
215
CONTRIBUTING.md
@@ -1,106 +1,109 @@
|
||||
General guidance
|
||||
================
|
||||
|
||||
* The usual principles of respecting existing conventions and making sure that your changes
|
||||
are in line with the overall product design apply when contributing code to Pyenv.
|
||||
|
||||
* We are limited to Bash 3.2 features
|
||||
|
||||
That's because that's the version shipped with MacOS.
|
||||
(They didn't upgrade past it and switched to Zsh because later versions
|
||||
are covered by GPLv3 which has additional restrictions unacceptable for Apple.)
|
||||
|
||||
* Be extra careful when submitting logic specific for the Apple Silicon platform
|
||||
|
||||
As of this writing, Github Actions do not support it and only one team member has the necessary hardware.
|
||||
So we may be unable to test your changes and may have to take your word for it.
|
||||
|
||||
|
||||
Formatting PRs
|
||||
==============
|
||||
|
||||
We strive to keep commit history one-concern-per-commit to keep it meaningful and easy to follow.
|
||||
If a pull request (PR) addresses a single concern (the typical case), we usually squash commits
|
||||
from it together when merging so its commit history doesn't matter.
|
||||
If however a PR addresses multiple separate concerns, each of them should be presented as a separate commit.
|
||||
Adding multiple new Python releases of the same flavor is okay with either a single or multiple commits.
|
||||
|
||||
|
||||
Authoring installation scripts
|
||||
==============================
|
||||
|
||||
Adding new Python release support
|
||||
---------------------------------
|
||||
|
||||
The easiest way to add support for a new Python release is to copy the script from the previous one
|
||||
and adjust it as necessary. In many cases, just changing version numbers, URLs and hashes is enough.
|
||||
Do pay attention to other "magic numbers" that may be present in a script --
|
||||
e.g. the set of architectures and OS versions supported by a release -- since those change from time to time, too.
|
||||
|
||||
Make sure to also copy any patches for the previous release that still apply to the new one.
|
||||
Typically, a patch no longer applies if it addresses a problem that's already fixed in the new release.
|
||||
|
||||
For prereleases, we only create an entry for the latest prerelease in a specific version line.
|
||||
When submitting a newer prerelease, replace the older one.
|
||||
|
||||
|
||||
Adding version-specific fixes/patches
|
||||
-------------------------------------
|
||||
|
||||
We accept fixes to issues in specific Python releases that prevent users from using them with Pyenv.
|
||||
|
||||
In the default configuration for a Python release, we strive to provide as close to vanilla experience as practical,
|
||||
to maintain [the principle of the least surprise](https://en.wikipedia.org/wiki/Principle_of_least_astonishment).
|
||||
As such, any such fixes:
|
||||
|
||||
* Must not break or degrade (e.g. disable features) the build in any of the environments that the release officially supports
|
||||
* Must not introduce incompatibilities with the vanilla release (including binary incompatibilities)
|
||||
* Should not patch things unnecessarily, to minimize the risk of the aforementioned undesirable side effects.
|
||||
* E.g. if the fix is for a specific environment, its logic ought to only fire in this specific environment and not touch execution paths for other environments.
|
||||
* As such, it's advisable to briefly explain in the PR what each added patch does and why it is necessary to fix the declared problem
|
||||
|
||||
Generally, version-specific fixes belong in the scripts for the affected releases and/or patches for them -- this guarantees that their effect is limited to only those releases.
|
||||
|
||||
<h3>Backporting upstream patches</h3>
|
||||
|
||||
Usually, this is the easiest way to backport a fix for a problem that is fixed in a newer release.
|
||||
|
||||
* Clone Python, check out the tag for the appropriate release and create a branch
|
||||
* Apply existing patches if there are any (with either `patch` or `git am`) and commit
|
||||
* Cherry-pick the upstream commit that fixes the problem in a newer release
|
||||
* Commit and `git format-patch`
|
||||
* Commit the generated patch file into Pyenv, test your changes and submit a PR
|
||||
|
||||
|
||||
Deprecation policy
|
||||
------------------
|
||||
|
||||
We do not provide official support for EOL releases and environments or otherwise provide any kind of extended support for old Python releases.
|
||||
|
||||
We do however accept fixes from interested parties that would allow running older, including EOL, releases in newer environments.
|
||||
In addition to the above requirements for release-specific fixes,
|
||||
|
||||
* Such a fix must not add maintenance burden (e.g. add new logic to `python-build` that has to be kept there indefinitely)
|
||||
* Unless the added logic is useful for both EOL and non-EOL releases. In this case, it will be considered as being primarily an improvement for non-EOL releases.
|
||||
* Support is provided on a "best effort" basis: we do not maintain these fixes but won't actively break them, either, and accept any corrections.
|
||||
Since old releases never change, it's pretty safe to assume that the fixes will continue to work until a later version
|
||||
of an environment introduces further incompatible changes.
|
||||
|
||||
|
||||
Advanced changes / adding new Python flavor support
|
||||
---------------------------------------------------
|
||||
|
||||
An installation script is sourced from `python-build`. All installation scripts are based on the same logic:
|
||||
|
||||
1. Select the source to download and other variable parameters as needed.
|
||||
|
||||
This includes showing an error if the user's environment (OS, architecture) is not supported by the release.
|
||||
Binary releases that only officially support specific distro(s) typically show a warning in other distros instead.
|
||||
|
||||
2. Run one of the `install_*` shell functions
|
||||
|
||||
`install_*` shell functions defined in `python-build` install Python from different kinds of sources -- compressed package (binary or source), upstream installation script, VCS checkout. Pick one that's the most appropriate for your packaging.
|
||||
|
||||
Each of them accepts a couple of function-specific arguments which are followed by arguments that constitute the build sequence. Each `<argument>` in the build sequence corresponds to the `install_*_<argument>` function in `python-build`. Check what's available and add any functions with logic specific to your flavor if needed.
|
||||
|
||||
We strive to keep out of `python-build` parts of build logic that are release-specific and/or tend to change abruptly between releases -- e.g. sets of supported architectures and other software's versions. This results in logic duplication between installation scripts -- but since old releases never change once released, this doesn't really add to the maintenance burden. As a rule of thumb, `python-build` can host parts of logic that are expected to stay the same for an indefinite amount of time -- for an entire Python flavor or release line.
|
||||
General guidance
|
||||
================
|
||||
|
||||
* The usual principles of respecting existing conventions and making sure that your changes
|
||||
are in line with the overall product design apply when contributing code to Pyenv.
|
||||
|
||||
* We are limited to Bash 3.2 features
|
||||
|
||||
That's because that's the version shipped with MacOS.
|
||||
(They didn't upgrade past it and switched to Zsh because later versions
|
||||
are covered by GPLv3 which has additional restrictions unacceptable for Apple.)
|
||||
|
||||
You can still add performance optimizations etc that take advantage of newer Bash features
|
||||
as long as there is a fallback execution route for Bash 3.
|
||||
|
||||
* Be extra careful when submitting logic specific for the Apple Silicon platform
|
||||
|
||||
As of this writing, Github Actions do not support it and only one team member has the necessary hardware.
|
||||
So we may be unable to test your changes and may have to take your word for it.
|
||||
|
||||
|
||||
Formatting PRs
|
||||
==============
|
||||
|
||||
We strive to keep commit history one-concern-per-commit to keep it meaningful and easy to follow.
|
||||
If a pull request (PR) addresses a single concern (the typical case), we usually squash commits
|
||||
from it together when merging so its commit history doesn't matter.
|
||||
If however a PR addresses multiple separate concerns, each of them should be presented as a separate commit.
|
||||
Adding multiple new Python releases of the same flavor is okay with either a single or multiple commits.
|
||||
|
||||
|
||||
Authoring installation scripts
|
||||
==============================
|
||||
|
||||
Adding new Python release support
|
||||
---------------------------------
|
||||
|
||||
The easiest way to add support for a new Python release is to copy the script from the previous one
|
||||
and adjust it as necessary. In many cases, just changing version numbers, URLs and hashes is enough.
|
||||
Do pay attention to other "magic numbers" that may be present in a script --
|
||||
e.g. the set of architectures and OS versions supported by a release -- since those change from time to time, too.
|
||||
|
||||
Make sure to also copy any patches for the previous release that still apply to the new one.
|
||||
Typically, a patch no longer applies if it addresses a problem that's already fixed in the new release.
|
||||
|
||||
For prereleases, we only create an entry for the latest prerelease in a specific version line.
|
||||
When submitting a newer prerelease, replace the older one.
|
||||
|
||||
|
||||
Adding version-specific fixes/patches
|
||||
-------------------------------------
|
||||
|
||||
We accept fixes to issues in specific Python releases that prevent users from using them with Pyenv.
|
||||
|
||||
In the default configuration for a Python release, we strive to provide as close to vanilla experience as practical,
|
||||
to maintain [the principle of the least surprise](https://en.wikipedia.org/wiki/Principle_of_least_astonishment).
|
||||
As such, any such fixes:
|
||||
|
||||
* Must not break or degrade (e.g. disable features) the build in any of the environments that the release officially supports
|
||||
* Must not introduce incompatibilities with the vanilla release (including binary incompatibilities)
|
||||
* Should not patch things unnecessarily, to minimize the risk of the aforementioned undesirable side effects.
|
||||
* E.g. if the fix is for a specific environment, its logic ought to only fire in this specific environment and not touch execution paths for other environments.
|
||||
* As such, it's advisable to briefly explain in the PR what each added patch does and why it is necessary to fix the declared problem
|
||||
|
||||
Generally, version-specific fixes belong in the scripts for the affected releases and/or patches for them -- this guarantees that their effect is limited to only those releases.
|
||||
|
||||
<h3>Backporting upstream patches</h3>
|
||||
|
||||
Usually, this is the easiest way to backport a fix for a problem that is fixed in a newer release.
|
||||
|
||||
* Clone Python, check out the tag for the appropriate release and create a branch
|
||||
* Apply existing patches if there are any (with either `patch` or `git am`) and commit
|
||||
* Cherry-pick the upstream commit that fixes the problem in a newer release
|
||||
* Commit and `git format-patch`
|
||||
* Commit the generated patch file into Pyenv, test your changes and submit a PR
|
||||
|
||||
|
||||
Deprecation policy
|
||||
------------------
|
||||
|
||||
We do not provide official support for EOL releases and environments or otherwise provide any kind of extended support for old Python releases.
|
||||
|
||||
We do however accept fixes from interested parties that would allow running older, including EOL, releases in newer environments.
|
||||
In addition to the above requirements for release-specific fixes,
|
||||
|
||||
* Such a fix must not add maintenance burden (e.g. add new logic to `python-build` that has to be kept there indefinitely)
|
||||
* Unless the added logic is useful for both EOL and non-EOL releases. In this case, it will be considered as being primarily an improvement for non-EOL releases.
|
||||
* Support is provided on a "best effort" basis: we do not maintain these fixes but won't actively break them, either, and accept any corrections.
|
||||
Since old releases never change, it's pretty safe to assume that the fixes will continue to work until a later version
|
||||
of an environment introduces further incompatible changes.
|
||||
|
||||
|
||||
Advanced changes / adding new Python flavor support
|
||||
---------------------------------------------------
|
||||
|
||||
An installation script is sourced from `python-build`. All installation scripts are based on the same logic:
|
||||
|
||||
1. Select the source to download and other variable parameters as needed.
|
||||
|
||||
This includes showing an error if the user's environment (OS, architecture) is not supported by the release.
|
||||
Binary releases that only officially support specific distro(s) typically show a warning in other distros instead.
|
||||
|
||||
2. Run one of the `install_*` shell functions
|
||||
|
||||
`install_*` shell functions defined in `python-build` install Python from different kinds of sources -- compressed package (binary or source), upstream installation script, VCS checkout. Pick one that's the most appropriate for your packaging.
|
||||
|
||||
Each of them accepts a couple of function-specific arguments which are followed by arguments that constitute the build sequence. Each `<argument>` in the build sequence corresponds to the `install_*_<argument>` function in `python-build`. Check what's available and add any functions with logic specific to your flavor if needed.
|
||||
|
||||
We strive to keep out of `python-build` parts of build logic that are release-specific and/or tend to change abruptly between releases -- e.g. sets of supported architectures and other software's versions. This results in logic duplication between installation scripts -- but since old releases never change once released, this doesn't really add to the maintenance burden. As a rule of thumb, `python-build` can host parts of logic that are expected to stay the same for an indefinite amount of time -- for an entire Python flavor or release line.
|
||||
|
||||
15
MAINTENANCE.md
Normal file
15
MAINTENANCE.md
Normal file
@@ -0,0 +1,15 @@
|
||||
Creating a release
|
||||
==================
|
||||
|
||||
The release of the new version of Pyenv is done via GitHub Releases.
|
||||
|
||||
Release checklist:
|
||||
* Start [drafting a new release on GitHub](https://github.com/pyenv/pyenv/releases) to generate a summary of changes. Save the summary locally.
|
||||
* The summary may need editing. E.g. rephrase entries, delete/merge entries that are too minor or irrelevant to the users (e.g. typo fixes, CI)
|
||||
* Push the version number in `libexec/pyenv---version`
|
||||
* Minor version is pushed if there are significant functional changes (not e.g. bugfixes/formula adaptations/supporting niche use cases).
|
||||
* Major version is pushed if there are breaking changes
|
||||
* Update `CHANGELOG.md` with the new version number and the edited summary (only the changes section), reformatting it like the rest of the changelog sections
|
||||
* Commit the changes locally into `master`
|
||||
* Create a new tag with the new version number and push the changes including the tag
|
||||
* Create a new release on GitHub based on the tag, using the saved summary
|
||||
8
Makefile
8
Makefile
@@ -1,11 +1,15 @@
|
||||
.PHONY: test test-build
|
||||
.PHONY: test test-build test-unit test-plugin
|
||||
|
||||
# Do not pass in user flags to build tests.
|
||||
unexport PYTHON_CFLAGS
|
||||
unexport PYTHON_CONFIGURE_OPTS
|
||||
|
||||
test: bats
|
||||
test: test-unit test-plugin
|
||||
|
||||
test-unit: bats
|
||||
PATH="./bats/bin:$$PATH" test/run
|
||||
|
||||
test-plugin: bats
|
||||
cd plugins/python-build && $(PWD)/bats/bin/bats $${CI:+--tap} test
|
||||
|
||||
PYTHON_BUILD_ROOT := $(CURDIR)/plugins/python-build
|
||||
|
||||
91
README.md
91
README.md
@@ -53,17 +53,20 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
|
||||
* [Install Python build dependencies](#install-python-build-dependencies)
|
||||
* **[Usage](#usage)**
|
||||
* [Install additional Python versions](#install-additional-python-versions)
|
||||
* [Prefix auto-resolution](#prefix-auto-resolution)
|
||||
* [Python versions with extended support](#python-versions-with-extended-support)
|
||||
* [Switch between Python versions](#switch-between-python-versions)
|
||||
* [Uninstall Python versions](#uninstall-python-versions)
|
||||
* [Other operations](#other-operations)
|
||||
* [Upgrading](#upgrading)
|
||||
* [Upgrading with Homebrew](#upgrading-with-homebrew)
|
||||
* [Upgrading with Installer or Git checkout](#upgrading-with-installer-or-git-checkout)
|
||||
* [Uninstalling pyenv](#uninstalling-pyenv)
|
||||
* [Advanced Configuration](#advanced-configuration)
|
||||
* [Using Pyenv without shims](#using-pyenv-without-shims)
|
||||
* [Environment variables](#environment-variables)
|
||||
* **[Development](#development)**
|
||||
* [Contributing](#contributing)**
|
||||
* [Contributing](#contributing)
|
||||
* [Version History](#version-history)
|
||||
* [License](#license)
|
||||
|
||||
@@ -244,7 +247,9 @@ which does install native Windows Python versions.
|
||||
|
||||
#### Automatic installer
|
||||
|
||||
Visit our other project:
|
||||
`curl https://pyenv.run | bash`
|
||||
|
||||
For more details visit our other project:
|
||||
https://github.com/pyenv/pyenv-installer
|
||||
|
||||
|
||||
@@ -255,14 +260,14 @@ easy to fork and contribute any changes back upstream.
|
||||
|
||||
* **Check out Pyenv where you want it installed.**
|
||||
A good place to choose is `$HOME/.pyenv` (but you can install it somewhere else):
|
||||
|
||||
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
|
||||
|
||||
```
|
||||
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
|
||||
```
|
||||
* Optionally, try to compile a dynamic Bash extension to speed up Pyenv. Don't
|
||||
worry if it fails; Pyenv will still work normally:
|
||||
|
||||
cd ~/.pyenv && src/configure && make -C src
|
||||
|
||||
```
|
||||
cd ~/.pyenv && src/configure && make -C src
|
||||
```
|
||||
|
||||
### Set up your shell environment for Pyenv
|
||||
|
||||
@@ -288,7 +293,7 @@ See [Advanced configuration](#advanced-configuration) for details and more confi
|
||||
configuration commands to both `.bashrc` (for interactive shells)
|
||||
and the profile file that Bash would use (for login shells).
|
||||
|
||||
First, add the commands to `~/.bashrc`:
|
||||
First, add the commands to `~/.bashrc` by running the following in your terminal:
|
||||
|
||||
~~~ bash
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
|
||||
@@ -324,14 +329,21 @@ See [Advanced configuration](#advanced-configuration) for details and more confi
|
||||
|
||||
- For **Fish shell**:
|
||||
|
||||
Execute this interactively:
|
||||
If you have Fish 3.2.0 or newer, execute this interactively:
|
||||
|
||||
~~~ fish
|
||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
||||
fish_add_path $PYENV_ROOT/bin
|
||||
~~~
|
||||
|
||||
Otherwise, execute the snippet below:
|
||||
|
||||
~~~ fish
|
||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
||||
set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
|
||||
~~~
|
||||
|
||||
And add this to `~/.config/fish/config.fish`:
|
||||
Now, add this to `~/.config/fish/config.fish`:
|
||||
|
||||
~~~ fish
|
||||
pyenv init - | source
|
||||
@@ -345,6 +357,11 @@ See [Advanced configuration](#advanced-configuration) for details and more confi
|
||||
|
||||
**Proxy note**: If you use a proxy, export `http_proxy` and `https_proxy`, too.
|
||||
|
||||
In MacOS, you might also want to install [Fig](https://fig.io/) which
|
||||
provides alternative shell completions for many command line tools with an
|
||||
IDE-like popup interface in the terminal window.
|
||||
(Note that their completions are independent from Pyenv's codebase
|
||||
so they might be slightly out of sync for bleeding-edge interface changes.)
|
||||
|
||||
### Restart your shell
|
||||
|
||||
@@ -376,12 +393,17 @@ For example, to download and install Python 3.10.4, run:
|
||||
pyenv install 3.10.4
|
||||
```
|
||||
|
||||
Running `pyenv install -l` gives the list of all available versions.
|
||||
|
||||
**NOTE:** Most Pyenv-provided Python releases are source releases and are built
|
||||
from source as part of installation (that's why you need Python build dependencies preinstalled).
|
||||
You can pass options to Python's `configure` and compiler flags to customize the build,
|
||||
see [_Special environment variables_ in Python-Build's README](plugins/python-build/README.md#special-environment-variables)
|
||||
for details.
|
||||
|
||||
**NOTE:** If you'd like a faster interpreter at the cost of longer build times,
|
||||
see [_Building for maximum performance_ in Python-Build's README](plugins/python-build/README.md#building-for-maximum-performance).
|
||||
|
||||
**NOTE:** If you want to use proxy for download, please set the `http_proxy` and `https_proxy`
|
||||
environment variables.
|
||||
|
||||
@@ -390,6 +412,25 @@ please visit the wiki page about
|
||||
[Common Build Problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems).
|
||||
|
||||
|
||||
#### Prefix auto-resolution
|
||||
|
||||
All Pyenv subcommands except `uninstall` automatically resolve full prefixes to the latest version in the corresponding version line.
|
||||
|
||||
`pyenv install` picks the latest known version while other subcommands -- the latest installed version.
|
||||
|
||||
E.g. to install and then switch to the latest 3.10 release:
|
||||
|
||||
```sh
|
||||
pyenv install 3.10
|
||||
pyenv global 3.10
|
||||
```
|
||||
|
||||
You can run [`pyenv latest <prefix>`](COMMANDS.md#pyenv-latest) to see
|
||||
what a specific prefix would be resolved to.
|
||||
|
||||
See the [`pyenv latest` documentation](COMMANDS.md#pyenv-latest) for details.
|
||||
|
||||
|
||||
#### Python versions with extended support
|
||||
|
||||
For the following Python releases, Pyenv applies user-provided patches that add support for some newer environments.
|
||||
@@ -397,7 +438,7 @@ Though we don't actively maintain those patches, since existing releases never c
|
||||
it's safe to assume that they will continue working until there are further incompatible changes
|
||||
in a later version of those environments.
|
||||
|
||||
* *3.7.8-3.7.13, 3.8.4-3.8.12, 3.9.0-3.9.7* : XCode 13.3
|
||||
* *3.7.8-3.7.15, 3.8.4-3.8.12, 3.9.0-3.9.7* : XCode 13.3
|
||||
* *3.6.15* : MacOS 11+ and XCode 13.3
|
||||
* *2.7.18* : MacOS 10.15+ and Apple Silicon
|
||||
|
||||
@@ -432,7 +473,7 @@ for more details on how the selection works and more information on its usage.
|
||||
As time goes on, you will accumulate Python versions in your
|
||||
`$(pyenv root)/versions` directory.
|
||||
|
||||
To remove old Python versions, use [`pyenv uninstall <version>`](COMMANDS.md#pyenv-uninstall).
|
||||
To remove old Python versions, use [`pyenv uninstall <versions>`](COMMANDS.md#pyenv-uninstall).
|
||||
|
||||
Alternatively, you can simply `rm -rf` the directory of the version you want
|
||||
to remove. You can find the directory of a particular Python version
|
||||
@@ -452,12 +493,34 @@ Note that Pyenv plugins that you install may add their own subcommands.
|
||||
|
||||
## Upgrading
|
||||
|
||||
### Upgrading with Homebrew
|
||||
|
||||
If you've installed Pyenv using Homebrew, upgrade using:
|
||||
```sh
|
||||
brew upgrade pyenv
|
||||
```
|
||||
|
||||
If you've installed Pyenv using Pyenv-installer or Git checkout, you can
|
||||
To switch from a release to the latest development version of Pyenv, use:
|
||||
|
||||
```sh
|
||||
brew uninstall pyenv
|
||||
brew install pyenv --head
|
||||
```
|
||||
|
||||
then you can upgrade it with `brew upgrade pyenv` as usual.
|
||||
|
||||
|
||||
### Upgrading with Installer or Git checkout
|
||||
|
||||
If you've installed Pyenv with Pyenv-installer, you likely have the
|
||||
[Pyenv-Update](https://github.com/pyenv/pyenv-update) plugin that would
|
||||
upgrade Pyenv and all installed plugins:
|
||||
|
||||
```sh
|
||||
pyenv update
|
||||
```
|
||||
|
||||
If you've installed Pyenv using Pyenv-installer or Git checkout, you can also
|
||||
upgrade your installation at any time using Git.
|
||||
|
||||
To upgrade to the latest development version of pyenv, use `git pull`:
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
version="2.3.3"
|
||||
version="2.3.10"
|
||||
git_revision=""
|
||||
|
||||
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q pyenv; then
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Summary: Configure the shell environment for pyenv
|
||||
# Usage: eval "$(pyenv init [-|--path] [--no-rehash] [<shell>])"
|
||||
# Usage: eval "$(pyenv init [-|--path] [--no-push-path] [--detect-shell] [--no-rehash] [<shell>])"
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
@@ -9,7 +9,9 @@ set -e
|
||||
if [ "$1" = "--complete" ]; then
|
||||
echo -
|
||||
echo --path
|
||||
echo --no-push-path
|
||||
echo --no-rehash
|
||||
echo --detect-shell
|
||||
echo bash
|
||||
echo fish
|
||||
echo ksh
|
||||
@@ -19,6 +21,7 @@ fi
|
||||
|
||||
mode="help"
|
||||
no_rehash=""
|
||||
no_push_path=""
|
||||
for args in "$@"
|
||||
do
|
||||
if [ "$args" = "-" ]; then
|
||||
@@ -30,6 +33,16 @@ do
|
||||
mode="path"
|
||||
shift
|
||||
fi
|
||||
|
||||
if [ "$args" = "--detect-shell" ]; then
|
||||
mode="detect-shell"
|
||||
shift
|
||||
fi
|
||||
|
||||
if [ "$args" = "--no-push-path" ]; then
|
||||
no_push_path=1
|
||||
shift
|
||||
fi
|
||||
|
||||
if [ "$args" = "--no-rehash" ]; then
|
||||
no_rehash=1
|
||||
@@ -69,12 +82,19 @@ function main() {
|
||||
print_shell_function
|
||||
exit 0
|
||||
;;
|
||||
"detect-shell")
|
||||
detect_profile 1
|
||||
print_detect_shell
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
# should never get here
|
||||
exit 2
|
||||
}
|
||||
|
||||
function help_() {
|
||||
function detect_profile() {
|
||||
local detect_for_detect_shell="$1"
|
||||
|
||||
case "$shell" in
|
||||
bash )
|
||||
if [ -e '~/.bash_profile' ]; then
|
||||
@@ -94,11 +114,25 @@ function help_() {
|
||||
rc='~/.profile'
|
||||
;;
|
||||
* )
|
||||
profile='your shell'\''s login startup file'
|
||||
rc='your shell'\''s interactive startup file'
|
||||
if [ -n "$detect_for_detect_shell" ]; then
|
||||
profile=
|
||||
rc=
|
||||
else
|
||||
profile='your shell'\''s login startup file'
|
||||
rc='your shell'\''s interactive startup file'
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function print_detect_shell() {
|
||||
echo "PYENV_SHELL_DETECT=$shell"
|
||||
echo "PYENV_PROFILE_DETECT=$profile"
|
||||
echo "PYENV_RC_DETECT=$rc"
|
||||
}
|
||||
|
||||
function help_() {
|
||||
detect_profile
|
||||
{
|
||||
case "$shell" in
|
||||
fish )
|
||||
@@ -141,24 +175,56 @@ function init_dirs() {
|
||||
}
|
||||
|
||||
function print_path() {
|
||||
case "$shell" in
|
||||
fish )
|
||||
echo 'while set index (contains -i -- '\'"${PYENV_ROOT}/shims"\'' $PATH)'
|
||||
echo 'set -eg PATH[$index]; end; set -e index'
|
||||
echo 'set -gx PATH '\'"${PYENV_ROOT}/shims"\'' $PATH'
|
||||
;;
|
||||
* )
|
||||
# Some distros (notably Debian-based) set Bash's SSH_SOURCE_BASHRC compilation option
|
||||
# that makes it source `bashrc` under SSH even when not interactive.
|
||||
# This is inhibited by a guard in Debian's stock `bashrc` but some people remove it
|
||||
# in order to get proper environment for noninteractive remote commands
|
||||
# (SSH provides /etc/ssh/sshrc and ~/.ssh/rc for that but no-one seems to use them for some reason).
|
||||
# This has caused an infinite `bashrc` execution loop for those people in the below nested Bash invocation (#2367).
|
||||
# --norc negates this behavior of such a customized Bash.
|
||||
echo 'PATH="$(bash --norc -ec '\''IFS=:; paths=($PATH); for i in ${!paths[@]}; do if [[ ${paths[i]} == "'\'"${PYENV_ROOT}/shims"\''" ]]; then unset '\'\\\'\''paths[i]'\'\\\'\''; fi; done; echo "${paths[*]}"'\'')"'
|
||||
echo 'export PATH="'"${PYENV_ROOT}"'/shims:${PATH}"'
|
||||
;;
|
||||
esac
|
||||
# if no_push_path is set, guard the PATH manipulation with a check on whether
|
||||
# the shim is already in the PATH.
|
||||
if [ -n "$no_push_path" ]; then
|
||||
case "$shell" in
|
||||
fish )
|
||||
echo 'if not contains -- "'"${PYENV_ROOT}/shims"'" $PATH'
|
||||
print_path_prepend_shims
|
||||
echo 'end'
|
||||
;;
|
||||
* )
|
||||
echo 'if [[ ":$PATH:" != *'\':"${PYENV_ROOT}"/shims:\''* ]]; then'
|
||||
print_path_prepend_shims
|
||||
echo 'fi'
|
||||
;;
|
||||
esac
|
||||
else
|
||||
case "$shell" in
|
||||
fish )
|
||||
echo 'while set pyenv_index (contains -i -- "'"${PYENV_ROOT}/shims"'" $PATH)'
|
||||
echo 'set -eg PATH[$pyenv_index]; end; set -e pyenv_index'
|
||||
print_path_prepend_shims
|
||||
;;
|
||||
* )
|
||||
# Some distros (notably Debian-based) set Bash's SSH_SOURCE_BASHRC compilation option
|
||||
# that makes it source `bashrc` under SSH even when not interactive.
|
||||
# This is inhibited by a guard in Debian's stock `bashrc` but some people remove it
|
||||
# in order to get proper environment for noninteractive remote commands
|
||||
# (SSH provides /etc/ssh/sshrc and ~/.ssh/rc for that but no-one seems to use them for some reason).
|
||||
# This has caused an infinite `bashrc` execution loop for those people in the below nested Bash invocation (#2367).
|
||||
# --norc negates this behavior of such a customized Bash.
|
||||
echo 'PATH="$(bash --norc -ec '\''IFS=:; paths=($PATH); '
|
||||
echo 'for i in ${!paths[@]}; do '
|
||||
echo 'if [[ ${paths[i]} == "'\'\'"${PYENV_ROOT}/shims"\'\''" ]]; then unset '\'\\\'\''paths[i]'\'\\\'\''; '
|
||||
echo 'fi; done; '
|
||||
echo 'echo "${paths[*]}"'\'')"'
|
||||
print_path_prepend_shims
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
function print_path_prepend_shims() {
|
||||
case "$shell" in
|
||||
fish )
|
||||
echo 'set -gx PATH '\'"${PYENV_ROOT}/shims"\'' $PATH'
|
||||
;;
|
||||
* )
|
||||
echo 'export PATH="'"${PYENV_ROOT}"'/shims:${PATH}"'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function print_env() {
|
||||
|
||||
80
libexec/pyenv-latest
Executable file
80
libexec/pyenv-latest
Executable file
@@ -0,0 +1,80 @@
|
||||
#!/usr/bin/env bash
|
||||
# Summary: Print the latest installed or known version with the given prefix
|
||||
# Usage: pyenv latest [-k|--known] [-q|--quiet] <prefix>
|
||||
#
|
||||
# -k/--known Select from all known versions instead of installed
|
||||
# -q/--quiet Do not print an error message on resolution failure
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
case "$1" in
|
||||
-k|--known)
|
||||
FROM_KNOWN=1
|
||||
shift
|
||||
;;
|
||||
-q|--quiet)
|
||||
QUIET=1
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
prefix=$1
|
||||
exitcode=0
|
||||
|
||||
IFS=$'\n'
|
||||
|
||||
if [[ -z $FROM_KNOWN ]]; then
|
||||
DEFINITION_CANDIDATES=( $(pyenv-versions --bare) )
|
||||
else
|
||||
DEFINITION_CANDIDATES=( $(python-build --definitions ) )
|
||||
fi
|
||||
|
||||
if printf '%s\n' "${DEFINITION_CANDIDATES[@]}" | grep -qxFe "$prefix"; then
|
||||
echo "$prefix"
|
||||
exit $exitcode;
|
||||
fi
|
||||
|
||||
# https://stackoverflow.com/questions/11856054/is-there-an-easy-way-to-pass-a-raw-string-to-grep/63483807#63483807
|
||||
prefix_re="$(sed 's/[^\^]/[&]/g;s/[\^]/\\&/g' <<< "$prefix")"
|
||||
# FIXME: more reliable and readable would probably be to loop over them and transform in pure Bash
|
||||
DEFINITION_CANDIDATES=(\
|
||||
$(printf '%s\n' "${DEFINITION_CANDIDATES[@]}" | \
|
||||
grep -Ee "^$prefix_re[-.]" || true))
|
||||
|
||||
DEFINITION_CANDIDATES=(\
|
||||
$(printf '%s\n' "${DEFINITION_CANDIDATES[@]}" | \
|
||||
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/-latest$/d' -e '/(b|rc)[0-9]+$/d'));
|
||||
|
||||
# Compose a sorting key, followed by | and original value
|
||||
DEFINITION_CANDIDATES=(\
|
||||
$(printf '%s\n' "${DEFINITION_CANDIDATES[@]}" | \
|
||||
awk \
|
||||
'{ if (match($0,"^[[:alnum:]]+-"))
|
||||
{ print substr($0,0,RLENGTH-1) "." substr($0,RLENGTH+1) "..|" $0; }
|
||||
else
|
||||
{ print $0 "...|" $0; }
|
||||
}'))
|
||||
DEFINITION_CANDIDATES=(\
|
||||
$(printf '%s\n' "${DEFINITION_CANDIDATES[@]}" \
|
||||
| sort -t. -k1,1r -k 2,2nr -k 3,3nr -k4,4nr \
|
||||
| cut -f2 -d $'|' \
|
||||
|| true))
|
||||
DEFINITION="${DEFINITION_CANDIDATES[0]}"
|
||||
|
||||
if [[ -n "$DEFINITION" ]]; then
|
||||
echo "$DEFINITION"
|
||||
else
|
||||
if [[ -z $QUIET ]]; then
|
||||
echo "pyenv: no $([[ -z $FROM_KNOWN ]] && echo installed || echo known) versions match the prefix \`$prefix'" >&2
|
||||
fi
|
||||
exitcode=1
|
||||
fi
|
||||
|
||||
exit $exitcode
|
||||
@@ -42,6 +42,7 @@ OLDIFS="$IFS"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
version="$(pyenv-latest -q "$version" || echo "$version")"
|
||||
PYENV_PREFIX_PATH="${PYENV_ROOT}/versions/${version}"
|
||||
fi
|
||||
if [ -d "$PYENV_PREFIX_PATH" ]; then
|
||||
|
||||
@@ -5,18 +5,33 @@ set -e
|
||||
|
||||
VERSION_FILE="$1"
|
||||
|
||||
function is_version_safe() {
|
||||
# As needed, check that the constructed path exists as a child path of PYENV_ROOT/versions
|
||||
version="$1"
|
||||
if [[ "$version" == ".." || "$version" == */* ]]; then
|
||||
# Sanity check the value of version to prevent malicious path-traversal
|
||||
(
|
||||
cd "$PYENV_ROOT/versions/$version" &>/dev/null || exit 1
|
||||
[[ "$PWD" == "$PYENV_ROOT/versions/"* ]]
|
||||
)
|
||||
return $?
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -s "$VERSION_FILE" ]; then
|
||||
# Read the first non-whitespace word from the specified version file.
|
||||
# Be careful not to load it whole in case there's something crazy in it.
|
||||
IFS="${IFS}"$'\r'
|
||||
IFS="$IFS"$'\r'
|
||||
sep=
|
||||
while read -n 1024 -r version _ || [[ $version ]]; do
|
||||
if [[ -z $version || $version == \#* ]]; then
|
||||
if [[ -z "$version" || "$version" == \#* ]]; then
|
||||
# Skip empty lines and comments
|
||||
continue
|
||||
elif [ "$version" = ".." ] || [[ $version == */* ]]; then
|
||||
# The version string is used to construct a path and we skip dubious values.
|
||||
# This prevents issues such as path traversal (CVE-2022-35861).
|
||||
elif ! is_version_safe "$version"; then
|
||||
# CVE-2022-35861 allowed arbitrary code execution in some contexts and is mitigated by is_version_safe.
|
||||
echo "pyenv: invalid version \`$version' ignored in \`$VERSION_FILE'" >&2
|
||||
continue
|
||||
fi
|
||||
printf "%s%s" "$sep" "$version"
|
||||
|
||||
@@ -34,6 +34,8 @@ OLDIFS="$IFS"
|
||||
versions=("${versions[@]}" "${version}")
|
||||
elif version_exists "${version#python-}"; then
|
||||
versions=("${versions[@]}" "${version#python-}")
|
||||
elif resolved_version="$(pyenv-latest -q "$version")"; then
|
||||
versions=("${versions[@]}" "${resolved_version}")
|
||||
else
|
||||
echo "pyenv: version \`$version' is not installed (set by $(pyenv-version-origin))" >&2
|
||||
any_not_installed=1
|
||||
|
||||
@@ -106,7 +106,7 @@ Set or show the shell\-specific Python version
|
||||
List existing pyenv shims
|
||||
.TP
|
||||
.B uninstall
|
||||
Uninstall a specific Python version
|
||||
Uninstall Python versions
|
||||
.TP
|
||||
.B version
|
||||
Show the current Python version(s) and its origin
|
||||
@@ -452,10 +452,10 @@ $ pyenv versions
|
||||
.fi
|
||||
.IP "" 0
|
||||
.SS "pyenv uninstall"
|
||||
Uninstall a specific Python version\.
|
||||
Uninstall Python versions\.
|
||||
.IP "" 4
|
||||
.nf
|
||||
Usage: pyenv uninstall [\-f|\-\-force] <version>
|
||||
Usage: pyenv uninstall [\-f|\-\-force] <version> ...
|
||||
|
||||
\-f Attempt to remove the specified version without prompting
|
||||
for confirmation\. If the version does not exist, do not
|
||||
|
||||
@@ -113,6 +113,7 @@ You can set certain environment variables to control the build process.
|
||||
checksum of the file to the mirror URL.
|
||||
* `PYTHON_BUILD_SKIP_MIRROR`, if set, forces python-build to download packages from
|
||||
their original source URLs instead of using a mirror.
|
||||
* `PYTHON_BUILD_SKIP_HOMEBREW`, if set, will not search for libraries installed by Homebrew on macOS.
|
||||
* `PYTHON_BUILD_ROOT` overrides the default location from where build definitions
|
||||
in `share/python-build/` are looked up.
|
||||
* `PYTHON_BUILD_DEFINITIONS` can be a list of colon-separated paths that get
|
||||
@@ -163,6 +164,21 @@ the version(s) installed with `--enable-shared`.
|
||||
$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 2.7.9
|
||||
```
|
||||
|
||||
### Building for maximum performance
|
||||
|
||||
Building CPython with `--enable-optimizations` will result in a faster
|
||||
interpreter at the cost of significantly longer build times. Most notably, this
|
||||
enables PGO (profile guided optimization). While your mileage may vary, it is
|
||||
common for performance improvement from this to be in the ballpark of 30%.
|
||||
|
||||
```sh
|
||||
env PYTHON_CONFIGURE_OPTS='--enable-optimizations --with-lto' PYTHON_CFLAGS='-march=native -mtune=native' pyenv install 3.6.0
|
||||
```
|
||||
|
||||
You can also customize the task used for profile guided optimization by setting
|
||||
the `PROFILE_TASK` environment variable, for instance, `PROFILE_TASK='-m
|
||||
test.regrtest --pgo -j0'` will run much faster than the default task.
|
||||
|
||||
### Checksum verification
|
||||
|
||||
If you have the `shasum`, `openssl`, or `sha256sum` tool installed, python-build will
|
||||
@@ -231,7 +247,7 @@ the full build log for build failures.
|
||||
|
||||
### Testing new python versions
|
||||
|
||||
If you are contributing a new python version for python-build,
|
||||
If you are contributing a new python version for python-build,
|
||||
you can test the build in a [docker](https://www.docker.com/) container based on Ubuntu 18.04.
|
||||
|
||||
With docker installed:
|
||||
@@ -249,7 +265,7 @@ docker run -it my_container
|
||||
```
|
||||
|
||||
The container will need to be rebuilt whenever you change the repo,
|
||||
but after the first build, this will be very fast,
|
||||
but after the first build, this will be very fast,
|
||||
as the layer including the build dependencies will be cached.
|
||||
|
||||
Changes made inside the container will not be persisted.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# Summary: Install a Python version using python-build
|
||||
#
|
||||
# Usage: pyenv install [-f] [-kvp] <version>
|
||||
# Usage: pyenv install [-f] [-kvp] <version>...
|
||||
# pyenv install [-f] [-kvp] <definition-file>
|
||||
# pyenv install -l|--list
|
||||
# pyenv install --version
|
||||
@@ -113,17 +113,15 @@ for option in "${OPTIONS[@]}"; do
|
||||
esac
|
||||
done
|
||||
|
||||
[ "${#ARGUMENTS[@]}" -le 1 ] || usage 1 >&2
|
||||
|
||||
unset VERSION_NAME
|
||||
|
||||
# The first argument contains the definition to install. If the
|
||||
# argument is missing, try to install whatever local app-specific
|
||||
# version is specified by pyenv. Show usage instructions if a local
|
||||
# version is not specified.
|
||||
DEFINITION="${ARGUMENTS[0]}"
|
||||
[ -n "$DEFINITION" ] || DEFINITION="$(pyenv-local 2>/dev/null || true)"
|
||||
[ -n "$DEFINITION" ] || usage 1 >&2
|
||||
DEFINITIONS=("${ARGUMENTS[@]}")
|
||||
[ -n "${DEFINITIONS[*]}" ] || DEFINITIONS=($(pyenv-local 2>/dev/null || true))
|
||||
[ -n "${DEFINITIONS[*]}" ] || usage 1 >&2
|
||||
|
||||
# Define `before_install` and `after_install` functions that allow
|
||||
# plugin hooks to register a string of code for execution before or
|
||||
@@ -140,102 +138,6 @@ after_install() {
|
||||
after_hooks["${#after_hooks[@]}"]="$hook"
|
||||
}
|
||||
|
||||
OLDIFS="$IFS"
|
||||
IFS=$'\n' scripts=(`pyenv-hooks install`)
|
||||
IFS="$OLDIFS"
|
||||
for script in "${scripts[@]}"; do source "$script"; done
|
||||
|
||||
|
||||
# Set VERSION_NAME from $DEFINITION, if it is not already set. Then
|
||||
# compute the installation prefix.
|
||||
[ -n "$VERSION_NAME" ] || VERSION_NAME="${DEFINITION##*/}"
|
||||
[ -n "$DEBUG" ] && VERSION_NAME="${VERSION_NAME}-debug"
|
||||
PREFIX="${PYENV_ROOT}/versions/${VERSION_NAME}"
|
||||
|
||||
[ -d "${PREFIX}" ] && PREFIX_EXISTS=1
|
||||
|
||||
# If the installation prefix exists, prompt for confirmation unless
|
||||
# the --force option was specified.
|
||||
if [ -d "${PREFIX}/bin" ]; then
|
||||
if [ -z "$FORCE" ] && [ -z "$SKIP_EXISTING" ]; then
|
||||
echo "pyenv: $PREFIX already exists" >&2
|
||||
read -p "continue with installation? (y/N) "
|
||||
|
||||
case "$REPLY" in
|
||||
y | Y | yes | YES ) ;;
|
||||
* ) exit 1 ;;
|
||||
esac
|
||||
elif [ -n "$SKIP_EXISTING" ]; then
|
||||
# Since we know the python version is already installed, and are opting to
|
||||
# not force installation of existing versions, we just `exit 0` here to
|
||||
# leave things happy
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# If PYENV_BUILD_ROOT is set, always pass keep options to python-build.
|
||||
if [ -n "${PYENV_BUILD_ROOT}" ]; then
|
||||
export PYTHON_BUILD_BUILD_PATH="${PYENV_BUILD_ROOT}/${VERSION_NAME}"
|
||||
KEEP="-k"
|
||||
fi
|
||||
|
||||
# Set PYTHON_BUILD_CACHE_PATH to $PYENV_ROOT/cache, if the directory
|
||||
# exists and the variable is not already set.
|
||||
if [ -z "${PYTHON_BUILD_CACHE_PATH}" ] && [ -d "${PYENV_ROOT}/cache" ]; then
|
||||
export PYTHON_BUILD_CACHE_PATH="${PYENV_ROOT}/cache"
|
||||
fi
|
||||
|
||||
if [ -z "${PYENV_BOOTSTRAP_VERSION}" ]; then
|
||||
case "${VERSION_NAME}" in
|
||||
[23]"."* )
|
||||
# Default PYENV_VERSION to the friendly Python version. (The
|
||||
# CPython installer requires an existing Python installation to run. An
|
||||
# unsatisfied local .python-version file can cause the installer to
|
||||
# fail.)
|
||||
for version_info in "${VERSION_NAME%-dev}" "${VERSION_NAME%.*}" "${VERSION_NAME%%.*}"; do
|
||||
# Anaconda's `curl` doesn't work on platform where `/etc/pki/tls/certs/ca-bundle.crt` isn't available (e.g. Debian)
|
||||
for version in $(pyenv-whence "python${version_info}" 2>/dev/null || true); do
|
||||
if [[ "${version}" != "anaconda"* ]] && [[ "${version}" != "miniconda"* ]]; then
|
||||
PYENV_BOOTSTRAP_VERSION="${version}"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
;;
|
||||
"pypy"*"-dev" | "pypy"*"-src" )
|
||||
# PyPy/PyPy3 requires existing Python 2.7 to build
|
||||
if [ -n "${PYENV_RPYTHON_VERSION}" ]; then
|
||||
PYENV_BOOTSTRAP_VERSION="${PYENV_RPYTHON_VERSION}"
|
||||
else
|
||||
for version in $(pyenv-versions --bare | sort -r); do
|
||||
if [[ "${version}" == "2.7"* ]]; then
|
||||
PYENV_BOOTSTRAP_VERSION="$version"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [ -n "$PYENV_BOOTSTRAP_VERSION" ]; then
|
||||
for dep in curses genc pycparser; do
|
||||
if ! PYENV_VERSION="$PYENV_BOOTSTRAP_VERSION" pyenv-exec python -c "import ${dep}" 1>/dev/null 2>&1; then
|
||||
echo "pyenv-install: $VERSION_NAME: PyPy requires \`${dep}' in $PYENV_BOOTSTRAP_VERSION to build from source." >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "pyenv-install: $VERSION_NAME: PyPy requires Python 2.7 to build from source." >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ -n "${PYENV_BOOTSTRAP_VERSION}" ]; then
|
||||
export PYENV_VERSION="${PYENV_BOOTSTRAP_VERSION}"
|
||||
fi
|
||||
|
||||
# Execute `before_install` hooks.
|
||||
for hook in "${before_hooks[@]}"; do eval "$hook"; done
|
||||
|
||||
# Plan cleanup on unsuccessful installation.
|
||||
cleanup() {
|
||||
[ -z "${PREFIX_EXISTS}" ] && rm -rf "$PREFIX"
|
||||
@@ -243,43 +145,147 @@ cleanup() {
|
||||
|
||||
trap cleanup SIGINT
|
||||
|
||||
# Invoke `python-build` and record the exit status in $STATUS.
|
||||
STATUS=0
|
||||
python-build $KEEP $VERBOSE $HAS_PATCH $DEBUG "$DEFINITION" "$PREFIX" || STATUS="$?"
|
||||
|
||||
# Display a more helpful message if the definition wasn't found.
|
||||
if [ "$STATUS" == "2" ]; then
|
||||
{ candidates="$(definitions "$DEFINITION")"
|
||||
here="$(dirname "${0%/*}")/../.."
|
||||
if [ -n "$candidates" ]; then
|
||||
OLDIFS="$IFS"
|
||||
IFS=$'\n' scripts=(`pyenv-hooks install`)
|
||||
IFS="$OLDIFS"
|
||||
for script in "${scripts[@]}"; do source "$script"; done
|
||||
|
||||
for DEFINITION in "${DEFINITIONS[@]}";do
|
||||
# Try to resolve a prefix if user indeed gave a prefix.
|
||||
# We install the version under the resolved name
|
||||
# and hooks also see the resolved name
|
||||
DEFINITION="$(pyenv-latest -q -k "$DEFINITION" || echo "$DEFINITION")"
|
||||
|
||||
# Set VERSION_NAME from $DEFINITION. Then compute the installation prefix.
|
||||
VERSION_NAME="${DEFINITION##*/}"
|
||||
[ -n "$DEBUG" ] && VERSION_NAME="${VERSION_NAME}-debug"
|
||||
PREFIX="${PYENV_ROOT}/versions/${VERSION_NAME}"
|
||||
|
||||
[ -d "${PREFIX}" ] && PREFIX_EXISTS=1
|
||||
|
||||
# If the installation prefix exists, prompt for confirmation unless
|
||||
# the --force option was specified.
|
||||
if [ -d "${PREFIX}/bin" ]; then
|
||||
if [ -z "$FORCE" ] && [ -z "$SKIP_EXISTING" ]; then
|
||||
echo "pyenv: $PREFIX already exists" >&2
|
||||
read -p "continue with installation? (y/N) "
|
||||
|
||||
case "$REPLY" in
|
||||
y | Y | yes | YES ) ;;
|
||||
* ) exit 1 ;;
|
||||
esac
|
||||
elif [ -n "$SKIP_EXISTING" ]; then
|
||||
# Since we know the python version is already installed, and are opting to
|
||||
# not force installation of existing versions, we just `exit 0` here to
|
||||
# leave things happy
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
# If PYENV_BUILD_ROOT is set, always pass keep options to python-build.
|
||||
if [ -n "${PYENV_BUILD_ROOT}" ]; then
|
||||
export PYTHON_BUILD_BUILD_PATH="${PYENV_BUILD_ROOT}/${VERSION_NAME}"
|
||||
KEEP="-k"
|
||||
fi
|
||||
|
||||
# Set PYTHON_BUILD_CACHE_PATH to $PYENV_ROOT/cache, if the directory
|
||||
# exists and the variable is not already set.
|
||||
if [ -z "${PYTHON_BUILD_CACHE_PATH}" ] && [ -d "${PYENV_ROOT}/cache" ]; then
|
||||
export PYTHON_BUILD_CACHE_PATH="${PYENV_ROOT}/cache"
|
||||
fi
|
||||
|
||||
if [ -z "${PYENV_BOOTSTRAP_VERSION}" ]; then
|
||||
case "${VERSION_NAME}" in
|
||||
[23]"."* )
|
||||
# Default PYENV_VERSION to the friendly Python version. (The
|
||||
# CPython installer requires an existing Python installation to run. An
|
||||
# unsatisfied local .python-version file can cause the installer to
|
||||
# fail.)
|
||||
for version_info in "${VERSION_NAME%-dev}" "${VERSION_NAME%.*}" "${VERSION_NAME%%.*}"; do
|
||||
# Anaconda's `curl` doesn't work on platform where `/etc/pki/tls/certs/ca-bundle.crt` isn't available (e.g. Debian)
|
||||
for version in $(pyenv-whence "python${version_info}" 2>/dev/null || true); do
|
||||
if [[ "${version}" != "anaconda"* ]] && [[ "${version}" != "miniconda"* ]]; then
|
||||
PYENV_BOOTSTRAP_VERSION="${version}"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
;;
|
||||
"pypy"*"-dev" | "pypy"*"-src" )
|
||||
# PyPy/PyPy3 requires existing Python 2.7 to build
|
||||
if [ -n "${PYENV_RPYTHON_VERSION}" ]; then
|
||||
PYENV_BOOTSTRAP_VERSION="${PYENV_RPYTHON_VERSION}"
|
||||
else
|
||||
for version in $(pyenv-versions --bare | sort -r); do
|
||||
if [[ "${version}" == "2.7"* ]]; then
|
||||
PYENV_BOOTSTRAP_VERSION="$version"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [ -n "$PYENV_BOOTSTRAP_VERSION" ]; then
|
||||
for dep in pycparser; do
|
||||
if ! PYENV_VERSION="$PYENV_BOOTSTRAP_VERSION" pyenv-exec python -c "import ${dep}" 1>/dev/null 2>&1; then
|
||||
echo "pyenv-install: $VERSION_NAME: PyPy requires \`${dep}' in $PYENV_BOOTSTRAP_VERSION to build from source." >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "pyenv-install: $VERSION_NAME: PyPy requires Python 2.7 to build from source." >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ -n "${PYENV_BOOTSTRAP_VERSION}" ]; then
|
||||
export PYENV_VERSION="${PYENV_BOOTSTRAP_VERSION}"
|
||||
fi
|
||||
|
||||
# Execute `before_install` hooks.
|
||||
for hook in "${before_hooks[@]}"; do eval "$hook"; done
|
||||
|
||||
# Invoke `python-build` and record the exit status in $STATUS.
|
||||
STATUS=0
|
||||
python-build $KEEP $VERBOSE $HAS_PATCH $DEBUG "$DEFINITION" "$PREFIX" || STATUS="$?"
|
||||
|
||||
# Display a more helpful message if the definition wasn't found.
|
||||
if [ "$STATUS" == "2" ]; then
|
||||
{ candidates="$(definitions "$DEFINITION")"
|
||||
here="$(dirname "${0%/*}")/../.."
|
||||
if [ -n "$candidates" ]; then
|
||||
echo
|
||||
echo "The following versions contain \`$DEFINITION' in the name:"
|
||||
echo "$candidates" | indent
|
||||
fi
|
||||
echo
|
||||
echo "The following versions contain \`$DEFINITION' in the name:"
|
||||
echo "$candidates" | indent
|
||||
fi
|
||||
echo
|
||||
echo "See all available versions with \`pyenv install --list'."
|
||||
echo
|
||||
echo -n "If the version you need is missing, try upgrading pyenv"
|
||||
if [ "$here" != "${here#$(brew --prefix 2>/dev/null)}" ]; then
|
||||
printf ":\n\n"
|
||||
echo " brew update && brew upgrade pyenv"
|
||||
elif [ -d "${here}/.git" ]; then
|
||||
printf ":\n\n"
|
||||
echo " cd ${here} && git pull && cd -"
|
||||
else
|
||||
printf ".\n"
|
||||
fi
|
||||
} >&2
|
||||
fi
|
||||
echo "See all available versions with \`pyenv install --list'."
|
||||
echo
|
||||
echo -n "If the version you need is missing, try upgrading pyenv"
|
||||
if [ "$here" != "${here#$(brew --prefix 2>/dev/null)}" ]; then
|
||||
printf ":\n\n"
|
||||
echo " brew update && brew upgrade pyenv"
|
||||
elif [ -d "${here}/.git" ]; then
|
||||
printf ":\n\n"
|
||||
echo " cd ${here} && git pull && cd -"
|
||||
else
|
||||
printf ".\n"
|
||||
fi
|
||||
} >&2
|
||||
fi
|
||||
|
||||
# Execute `after_install` hooks.
|
||||
for hook in "${after_hooks[@]}"; do eval "$hook"; done
|
||||
# Execute `after_install` hooks.
|
||||
for hook in "${after_hooks[@]}"; do eval "$hook"; done
|
||||
|
||||
# Run `pyenv-rehash` after a successful installation.
|
||||
if [ "$STATUS" == "0" ]; then
|
||||
pyenv-rehash
|
||||
else
|
||||
cleanup
|
||||
fi
|
||||
# Run `pyenv-rehash` after a successful installation.
|
||||
if [ "$STATUS" == "0" ]; then
|
||||
pyenv-rehash
|
||||
else
|
||||
break
|
||||
cleanup
|
||||
fi
|
||||
|
||||
exit "$STATUS"
|
||||
done
|
||||
|
||||
exit "${STATUS:-0}"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Summary: Uninstall a specific Python version
|
||||
# Summary: Uninstall Python versions
|
||||
#
|
||||
# Usage: pyenv uninstall [-f|--force] <version>
|
||||
# Usage: pyenv uninstall [-f|--force] <version> ...
|
||||
#
|
||||
# -f Attempt to remove the specified version without prompting
|
||||
# for confirmation. If the version does not exist, do not
|
||||
@@ -33,14 +33,17 @@ if [ "$1" = "-f" ] || [ "$1" = "--force" ]; then
|
||||
shift
|
||||
fi
|
||||
|
||||
[ "$#" -eq 1 ] || usage 1 >&2
|
||||
[ "$#" -gt 0 ] || usage 1 >&2
|
||||
|
||||
DEFINITION="$1"
|
||||
case "$DEFINITION" in
|
||||
"" | -* )
|
||||
usage 1 >&2
|
||||
;;
|
||||
esac
|
||||
versions=("$@")
|
||||
|
||||
for version in "${versions[@]}"; do
|
||||
case "$version" in
|
||||
"" | -* )
|
||||
usage 1 >&2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
declare -a before_hooks after_hooks
|
||||
|
||||
@@ -59,29 +62,36 @@ IFS=$'\n' scripts=(`pyenv-hooks uninstall`)
|
||||
IFS="$OLDIFS"
|
||||
for script in "${scripts[@]}"; do source "$script"; done
|
||||
|
||||
uninstall-python() {
|
||||
local DEFINITION="$1"
|
||||
|
||||
VERSION_NAME="${DEFINITION##*/}"
|
||||
PREFIX="${PYENV_ROOT}/versions/${VERSION_NAME}"
|
||||
local VERSION_NAME="${DEFINITION##*/}"
|
||||
local PREFIX="${PYENV_ROOT}/versions/${VERSION_NAME}"
|
||||
|
||||
if [ -z "$FORCE" ]; then
|
||||
if [ ! -d "$PREFIX" ]; then
|
||||
echo "pyenv: version \`$VERSION_NAME' not installed" >&2
|
||||
exit 1
|
||||
if [ -z "$FORCE" ]; then
|
||||
if [ ! -d "$PREFIX" ]; then
|
||||
echo "pyenv: version \`$VERSION_NAME' not installed" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
read -p "pyenv: remove $PREFIX? [y|N] "
|
||||
case "$REPLY" in
|
||||
y | Y | yes | YES ) ;;
|
||||
* ) exit 1 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
read -p "pyenv: remove $PREFIX? [y|N] "
|
||||
case "$REPLY" in
|
||||
y | Y | yes | YES ) ;;
|
||||
* ) exit 1 ;;
|
||||
esac
|
||||
fi
|
||||
for hook in "${before_hooks[@]}"; do eval "$hook"; done
|
||||
|
||||
for hook in "${before_hooks[@]}"; do eval "$hook"; done
|
||||
if [ -d "$PREFIX" ]; then
|
||||
rm -rf "$PREFIX"
|
||||
pyenv-rehash
|
||||
echo "pyenv: $VERSION_NAME uninstalled"
|
||||
fi
|
||||
|
||||
if [ -d "$PREFIX" ]; then
|
||||
rm -rf "$PREFIX"
|
||||
pyenv-rehash
|
||||
echo "pyenv: $VERSION_NAME uninstalled"
|
||||
fi
|
||||
for hook in "${after_hooks[@]}"; do eval "$hook"; done
|
||||
}
|
||||
|
||||
for hook in "${after_hooks[@]}"; do eval "$hook"; done
|
||||
for version in "${versions[@]}"; do
|
||||
uninstall-python "$version"
|
||||
done
|
||||
|
||||
@@ -112,6 +112,11 @@ is_mac() {
|
||||
[ $# -eq 0 ] || [ "$(osx_version)" "$@" ]
|
||||
}
|
||||
|
||||
can_use_homebrew() {
|
||||
[ -z "$PYTHON_BUILD_SKIP_HOMEBREW" ] || return 1
|
||||
is_mac || return 1
|
||||
}
|
||||
|
||||
# 9.1 -> 901
|
||||
# 10.9 -> 1009
|
||||
# 10.10 -> 1010
|
||||
@@ -228,9 +233,7 @@ install_package_using() {
|
||||
make_package "${make_args[@]}"
|
||||
popd >&4
|
||||
|
||||
{ echo "Installed ${package_name} to ${PREFIX_PATH}"
|
||||
echo
|
||||
} >&2
|
||||
echo "Installed ${package_name} to ${PREFIX_PATH}" >&2
|
||||
}
|
||||
|
||||
make_package() {
|
||||
@@ -355,12 +358,38 @@ http_head_aria2c() {
|
||||
}
|
||||
|
||||
http_get_aria2c() {
|
||||
local out="${2:-$(mktemp "out.XXXXXX")}"
|
||||
if aria2c --allow-overwrite=true --no-conf=true -o "${out}" ${ARIA2_OPTS} "$1" >&4; then
|
||||
# aria2c always treats -o argument as a relative path
|
||||
local out dir_out;
|
||||
if [[ -n "$2" ]]; then
|
||||
out="$(basename $2)";
|
||||
dir_out="$(dirname $2)";
|
||||
else
|
||||
out="$(mktemp "out.XXXXXX")";
|
||||
dir_out="$TMPDIR";
|
||||
fi
|
||||
|
||||
# In Ubuntu, aria2c is only available as a snap. Snaps cannot read or write /tmp
|
||||
# (files cannot be found, any write result is silently discarded).
|
||||
local aria2c_is_snap;
|
||||
if [[ $(command -v aria2c) == "/snap/"* ]]; then aria2c_is_snap=1; fi
|
||||
|
||||
if [[ -n $aria2c_is_snap ]]; then
|
||||
local real_dir_out="$dir_out"
|
||||
# presumably, snaps can always write to under $HOME
|
||||
dir_out="$HOME"
|
||||
fi
|
||||
|
||||
if aria2c --allow-overwrite=true --no-conf=true -d "${dir_out}" -o "${out}" ${ARIA2_OPTS} "$1" >&4; then
|
||||
[ -n "$2" ] || cat "${out}"
|
||||
else
|
||||
false
|
||||
fi
|
||||
ret=$?
|
||||
|
||||
if [[ -n "$2" && -n $aria2c_is_snap ]]; then
|
||||
mv "$dir_out/$out" "$real_dir_out/$out"
|
||||
fi
|
||||
return "$ret"
|
||||
}
|
||||
|
||||
http_head_curl() {
|
||||
@@ -709,7 +738,7 @@ build_package() {
|
||||
|
||||
echo "Installing ${package_name}..." >&2
|
||||
|
||||
[ -n "$HAS_PATCH" ] && apply_python_patch "$package_name"
|
||||
[ -n "$HAS_PATCH" ] && apply_patch "$package_name" <(cat "${package_name}.patch")
|
||||
|
||||
for command in $commands; do
|
||||
"build_package_${command}" "$package_name"
|
||||
@@ -774,6 +803,7 @@ build_package_standard_build() {
|
||||
else
|
||||
use_homebrew_zlib || true
|
||||
fi
|
||||
use_dsymutil || true
|
||||
fi
|
||||
|
||||
( if [ "${CFLAGS+defined}" ] || [ "${!PACKAGE_CFLAGS+defined}" ]; then
|
||||
@@ -899,7 +929,7 @@ build_package_micropython() {
|
||||
"$MAKE" $MAKE_OPTS
|
||||
cd ../ports/unix
|
||||
"$MAKE" $MAKE_OPTS axtls
|
||||
"$MAKE" $MAKE_OPTS CFLAGS_EXTRA="-DMICROPY_PY_SYS_PATH_DEFAULT='\"${PREFIX_PATH}/lib/micropython\"' $CFLAGS_EXTRA"
|
||||
"$MAKE" $MAKE_OPTS CFLAGS_EXTRA="-DMICROPY_PY_SYS_PATH_DEFAULT='\".frozen:${PREFIX_PATH}/lib/micropython\"' $CFLAGS_EXTRA"
|
||||
"$MAKE" install $MAKE_INSTALL_OPTS PREFIX="${PREFIX_PATH}"
|
||||
ln -fs micropython "${PREFIX_PATH}/bin/python"
|
||||
mkdir -p "${PREFIX_PATH}/lib/micropython"
|
||||
@@ -908,7 +938,13 @@ build_package_micropython() {
|
||||
|
||||
pypy_architecture() {
|
||||
case "$(uname -s)" in
|
||||
"Darwin" ) echo "osx64" ;;
|
||||
"Darwin" )
|
||||
case "$(uname -m)" in
|
||||
"arm64" ) echo "osarm64" ;;
|
||||
"x86_64" ) echo "osx64" ;;
|
||||
* ) return 1 ;;
|
||||
esac
|
||||
;;
|
||||
"Linux" )
|
||||
case "$(uname -m)" in
|
||||
"armel" ) echo "linux-armel" ;;
|
||||
@@ -932,10 +968,30 @@ pypy_architecture() {
|
||||
esac
|
||||
}
|
||||
|
||||
graalpy_architecture() {
|
||||
case "$(uname -s)" in
|
||||
"Darwin" )
|
||||
case "$(uname -m)" in
|
||||
"x86_64" ) echo "macos-amd64" ;;
|
||||
"arm64" ) echo "macos-aarch64" ;;
|
||||
* ) return 1 ;;
|
||||
esac
|
||||
;;
|
||||
"Linux" )
|
||||
case "$(uname -m)" in
|
||||
"x86_64" ) echo "linux-amd64" ;;
|
||||
"aarch64" ) echo "linux-aarch64" ;;
|
||||
* ) return 1 ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
pyston_architecture() {
|
||||
pypy_architecture
|
||||
}
|
||||
|
||||
# Note: not used by graalpy >= 23.3.0 anymore
|
||||
build_package_graalpython() {
|
||||
build_package_copy
|
||||
ln -fs "${PREFIX_PATH}/bin/graalpython" "${PREFIX_PATH}/bin/python"
|
||||
@@ -1065,13 +1121,13 @@ setup_builtin_patches() {
|
||||
local package_name="$1"
|
||||
local package_patch_path="${DEFINITION_PATH%/*}/patches/${DEFINITION_PATH##*/}/${package_name}"
|
||||
|
||||
ORIG_HAS_PATCH="$HAS_PATCH"
|
||||
# Apply built-in patches if patch was not given from stdin
|
||||
if [ -z "$HAS_PATCH" ] && [ -d "${package_patch_path}" ]; then
|
||||
if [[ -n "$HAS_STDIN_PATCH" ]] && package_is_python "${package_name}"; then
|
||||
cat >"${package_name}.patch"
|
||||
HAS_PATCH=true
|
||||
elif [[ -d "${package_patch_path}" ]]; then
|
||||
{ find "${package_patch_path}" -maxdepth 1 -type f
|
||||
} 2>/dev/null | sort | xargs cat 1>"${package_name}.patch"
|
||||
exec <&-
|
||||
exec <"${package_name}.patch"
|
||||
HAS_PATCH=true
|
||||
fi
|
||||
}
|
||||
@@ -1079,7 +1135,7 @@ setup_builtin_patches() {
|
||||
cleanup_builtin_patches() {
|
||||
local package_name="$1"
|
||||
rm -f "${package_name}.patch"
|
||||
HAS_PATCH="$ORIG_HAS_PATCH"
|
||||
unset HAS_PATCH
|
||||
}
|
||||
|
||||
fix_directory_permissions() {
|
||||
@@ -1322,10 +1378,10 @@ configured_with_package_dir() {
|
||||
}
|
||||
|
||||
use_homebrew() {
|
||||
is_mac || return 1
|
||||
can_use_homebrew || return 1
|
||||
# unless Homebrew is at the default /usr/local, need to add its paths to
|
||||
# compiler search to be able to use non-keg-only deps from there
|
||||
if is_mac && command -v brew &>/dev/null; then
|
||||
if command -v brew &>/dev/null; then
|
||||
local brew_prefix="$(brew --prefix 2>/dev/null || true)"
|
||||
# /usr/local/lib:/usr/lib is the default library search path
|
||||
if [[ -n $brew_prefix && $brew_prefix != "/usr" && $brew_prefix != "/usr/local" ]]; then
|
||||
@@ -1344,7 +1400,7 @@ needs_yaml() {
|
||||
}
|
||||
|
||||
use_homebrew_yaml() {
|
||||
is_mac || return 1
|
||||
can_use_homebrew || return 1
|
||||
local libdir="$(brew --prefix libyaml 2>/dev/null || true)"
|
||||
if [ -d "$libdir" ]; then
|
||||
echo "python-build: use libyaml from homebrew"
|
||||
@@ -1360,20 +1416,17 @@ use_freebsd_pkg() {
|
||||
if [ "FreeBSD" = "$(uname -s)" ]; then
|
||||
# use openssl if installed from Ports Collection
|
||||
if [ -f /usr/local/include/openssl/ssl.h ]; then
|
||||
package_option ruby configure --with-openssl-dir="/usr/local"
|
||||
package_option python configure --with-openssl="/usr/local"
|
||||
fi
|
||||
|
||||
# check if 11-R or later
|
||||
release="$(uname -r)"
|
||||
if [ "${release%%.*}" -ge 11 ]; then
|
||||
# prefers readline to compile most of ruby versions
|
||||
if pkg info -e readline > /dev/null; then
|
||||
if pkg info -e readline > /dev/null && ! command -v pkg-config > /dev/null ; then
|
||||
# use readline from Ports Collection
|
||||
package_option ruby configure --with-readline-dir="/usr/local"
|
||||
elif pkg info -e libedit > /dev/null; then
|
||||
# use libedit from Ports Collection
|
||||
package_option ruby configure --enable-libedit
|
||||
package_option ruby configure --with-libedit-dir="/usr/local"
|
||||
# unlike Linux, BSD's cc does not look in /usr/local by default
|
||||
export CPPFLAGS="${CPPFLAGS:+${CPPFLAGS% } }-I/usr/local/include"
|
||||
export LDFLAGS="${LDFLAGS:+${LDFLAGS% } }-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -1388,7 +1441,7 @@ has_broken_mac_readline() {
|
||||
}
|
||||
|
||||
use_homebrew_readline() {
|
||||
is_mac || return 1
|
||||
can_use_homebrew || return 1
|
||||
if ! configured_with_package_dir "python" "readline/rlconf.h"; then
|
||||
local libdir="$(brew --prefix readline 2>/dev/null || true)"
|
||||
if [ -d "$libdir" ]; then
|
||||
@@ -1429,7 +1482,7 @@ has_broken_mac_openssl() {
|
||||
}
|
||||
|
||||
use_homebrew_openssl() {
|
||||
is_mac || return 1
|
||||
can_use_homebrew || return 1
|
||||
command -v brew >/dev/null || return 1
|
||||
for openssl in ${PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA:-openssl}; do
|
||||
local ssldir="$(brew --prefix "${openssl}" || true)"
|
||||
@@ -1529,7 +1582,7 @@ build_package_verify_openssl() {
|
||||
}
|
||||
|
||||
use_homebrew_zlib() {
|
||||
is_mac || return 1
|
||||
can_use_homebrew || return 1
|
||||
local brew_zlib="$(brew --prefix zlib 2>/dev/null || true)"
|
||||
if [ -d "$brew_zlib" ]; then
|
||||
echo "python-build: use zlib from homebrew"
|
||||
@@ -1538,6 +1591,8 @@ use_homebrew_zlib() {
|
||||
}
|
||||
|
||||
use_xcode_sdk_zlib() {
|
||||
# If a custom compiler is used, including XCode SDK will likely break it
|
||||
[[ "${CC:-clang}" != "clang" || "$(command -v clang 2>/dev/null || true)" != "/usr/bin/clang" ]] && return 1
|
||||
local xc_sdk_path="$(xcrun --show-sdk-path 2>/dev/null || true)"
|
||||
if [ -d "$xc_sdk_path" ]; then
|
||||
echo "python-build: use zlib from xcode sdk"
|
||||
@@ -1549,14 +1604,17 @@ use_xcode_sdk_zlib() {
|
||||
}
|
||||
|
||||
use_homebrew_tcltk() {
|
||||
is_mac || return 1
|
||||
can_use_homebrew || return 1
|
||||
# get the version from the folder that homebrew versions
|
||||
local tcltk_libdir="$(brew --prefix tcl-tk 2>/dev/null || true)"
|
||||
if [ -d "$tcltk_libdir" ]; then
|
||||
echo "python-build: use tcl-tk from homebrew"
|
||||
local tcltk_version="$(sh -c '. '"$tcltk_libdir"'/lib/tclConfig.sh; echo $TCL_VERSION')"
|
||||
package_option python configure --with-tcltk-libs="-L$tcltk_libdir/lib -ltcl$tcltk_version -ltk$tcltk_version"
|
||||
package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include"
|
||||
if [[ -z "$PYTHON_BUILD_TCLTK_USE_PKGCONFIG" ]]; then
|
||||
local tcltk_version="$(sh -c '. '"$tcltk_libdir"'/lib/tclConfig.sh; echo $TCL_VERSION')"
|
||||
package_option python configure --with-tcltk-libs="-L$tcltk_libdir/lib -ltcl$tcltk_version -ltk$tcltk_version"
|
||||
package_option python configure --with-tcltk-includes="-I$tcltk_libdir/include"
|
||||
fi
|
||||
export PKG_CONFIG_PATH="${tcltk_libdir}/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1591,13 +1649,13 @@ use_custom_tcltk() {
|
||||
get_tcltk_flag_from() {
|
||||
IFS=$'\n'
|
||||
# parse input string into array
|
||||
local opts_arr=( $(xargs -n1 <<<"$1") )
|
||||
local opts_arr=( $(xargs -n1 <<<"$1") )
|
||||
|
||||
# iterate through `opts_arr`, break if `--with-tcltk-libs=` was found.
|
||||
for opts in ${opts_arr[@]}; do
|
||||
# `--with-tcltk-libs=` must be the prefix.
|
||||
if [[ "$opts" == "--with-tcltk-libs="* ]]; then
|
||||
# return
|
||||
# return
|
||||
echo "$opts"
|
||||
break
|
||||
fi
|
||||
@@ -1607,7 +1665,7 @@ get_tcltk_flag_from() {
|
||||
}
|
||||
|
||||
use_tcltk() {
|
||||
if is_mac; then
|
||||
if can_use_homebrew; then
|
||||
local tcltk_libdir="$(brew --prefix tcl-tk 2>/dev/null || true)"
|
||||
fi
|
||||
local tcl_tk_libs="$(get_tcltk_flag_from "$PYTHON_CONFIGURE_OPTS")"
|
||||
@@ -1621,6 +1679,16 @@ use_tcltk() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Since 3.12, CPython can add DWARF debug information in MacOS
|
||||
# using Apple's nonstandard way, `dsymutil', that creates a "dSYM bundle"
|
||||
# that's supposed to be installed alongside executables
|
||||
# (https://github.com/python/cpython/issues/95973).
|
||||
use_dsymutil() {
|
||||
if [[ -n "$PYTHON_BUILD_CONFIGURE_WITH_DSYMUTIL" ]] && is_mac; then
|
||||
package_option python configure --with-dsymutil
|
||||
fi
|
||||
}
|
||||
|
||||
build_package_enable_shared() {
|
||||
package_option python configure --enable-shared
|
||||
}
|
||||
@@ -1637,31 +1705,33 @@ build_package_auto_tcltk() {
|
||||
fi
|
||||
}
|
||||
|
||||
# extglob must be set at parse time, not at runtime
|
||||
# extglob must be set at both parse time and runtime
|
||||
# https://stackoverflow.com/questions/49283740/bash-script-throws-syntax-errors-when-the-extglob-option-is-set-inside-a-subsh
|
||||
#
|
||||
# The function is *parsed* with "extglob" only if an outer `shopt -s exglob`
|
||||
# exists; at *runtime* you still need to activate it *within* the function.
|
||||
#
|
||||
shopt -s extglob
|
||||
apply_python_patch() {
|
||||
local patchfile
|
||||
# needed at runtime
|
||||
package_is_python() {
|
||||
shopt -s extglob
|
||||
case "$1" in
|
||||
Python-* | jython-* | pypy-* | pypy[0-9].+([0-9])-* | stackless-* )
|
||||
patchfile="$(mktemp "${TMP}/python-patch.XXXXXX")"
|
||||
cat "${2:--}" >"$patchfile"
|
||||
|
||||
local striplevel=0
|
||||
grep -q '^diff --git a/' "$patchfile" && striplevel=1
|
||||
patch -p$striplevel --force -i "$patchfile"
|
||||
;;
|
||||
Python-* | jython-* | pypy-* | pypy[0-9].+([0-9])-* | stackless-* )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
return 1
|
||||
shopt -u extglob
|
||||
}
|
||||
shopt -u extglob
|
||||
|
||||
apply_patch() {
|
||||
local package_name="$1"
|
||||
local patchfile
|
||||
patchfile="$(mktemp "${TMP}/python-patch.XXXXXX")"
|
||||
cat "${2:--}" >"$patchfile"
|
||||
|
||||
local striplevel=0
|
||||
grep -q '^diff --git a/' "$patchfile" && striplevel=1
|
||||
patch -p$striplevel --force -i "$patchfile"
|
||||
}
|
||||
|
||||
|
||||
build_package_symlink_version_suffix() {
|
||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
||||
if [ -e "${PREFIX_PATH}/bin" ]; then
|
||||
@@ -1719,7 +1789,7 @@ verify_python() {
|
||||
}
|
||||
|
||||
try_python_module() {
|
||||
if ! "$PYTHON_BIN" -c "import $1" 1>/dev/null 2>&1; then
|
||||
if ! "$PYTHON_BIN" -c "import $1"; then
|
||||
{ colorize 1 "WARNING"
|
||||
echo ": The Python $1 extension was not compiled${3:+ $3}. Missing the ${2:-$1}?"
|
||||
return 0
|
||||
@@ -1728,7 +1798,7 @@ try_python_module() {
|
||||
}
|
||||
|
||||
verify_python_module() {
|
||||
if ! "$PYTHON_BIN" -c "import $1" 1>/dev/null 2>&1; then
|
||||
if ! "$PYTHON_BIN" -c "import $1"; then
|
||||
{ colorize 1 "ERROR"
|
||||
echo ": The Python $1 extension was not compiled. Missing the ${2:-$1}?"
|
||||
echo
|
||||
@@ -2000,7 +2070,7 @@ for option in "${OPTIONS[@]}"; do
|
||||
VERBOSE=true
|
||||
;;
|
||||
"p" | "patch" )
|
||||
HAS_PATCH=true
|
||||
HAS_STDIN_PATCH=true
|
||||
;;
|
||||
"g" | "debug" )
|
||||
DEBUG=true
|
||||
@@ -2119,11 +2189,15 @@ if [ -n "$DEBUG" ]; then
|
||||
package_option python configure --with-pydebug
|
||||
fi
|
||||
|
||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" != *"--enable-framework"* ]]; then
|
||||
package_option python configure --enable-shared
|
||||
fi
|
||||
|
||||
# python-build: Specify `--libdir` on configure to fix build on openSUSE (#36)
|
||||
package_option python configure --libdir="${PREFIX_PATH}/lib"
|
||||
|
||||
# python-build: Set `RPATH` if `--enable-shared` was given (#65, #66, #82)
|
||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-shared"* ]]; then
|
||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS ${PYTHON_CONFIGURE_OPTS_ARRAY[@]}" == *"--enable-shared"* ]]; then
|
||||
# The ld on Darwin embeds the full paths to each dylib by default
|
||||
if [[ "$LDFLAGS" != *"-rpath="* ]] && ! is_mac; then
|
||||
export LDFLAGS="-Wl,-rpath=${PREFIX_PATH}/lib ${LDFLAGS}"
|
||||
@@ -2138,7 +2212,7 @@ fi
|
||||
# Add support for framework installation (`--enable-framework`) of CPython (#55, #99)
|
||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
||||
if ! is_mac; then
|
||||
echo "python-build: framework installation is not supported." >&2
|
||||
echo "python-build: framework installation is not supported outside of MacOS." >&2
|
||||
exit 1
|
||||
fi
|
||||
create_framework_dirs() {
|
||||
@@ -2159,7 +2233,7 @@ fi
|
||||
# Build against universal SDK
|
||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-universalsdk"* ]]; then
|
||||
if ! is_mac; then
|
||||
echo "python-build: universal installation is not supported." >&2
|
||||
echo "python-build: universal installation is not supported outside of MacOS." >&2
|
||||
exit 1
|
||||
fi
|
||||
package_option python configure --enable-universalsdk=/
|
||||
|
||||
@@ -108,6 +108,7 @@ class PyVersion(StrEnum):
|
||||
PY37 = "py37"
|
||||
PY38 = "py38"
|
||||
PY39 = "py39"
|
||||
PY310 = "py310"
|
||||
|
||||
def version(self):
|
||||
first, *others = self.value[2:]
|
||||
@@ -120,7 +121,7 @@ class PyVersion(StrEnum):
|
||||
@total_ordering
|
||||
class VersionStr(str):
|
||||
def info(self):
|
||||
return tuple(int(n) for n in self.split("."))
|
||||
return tuple(int(n) for n in self.replace("-", ".").split("."))
|
||||
|
||||
def __eq__(self, other):
|
||||
return str(self) == str(other)
|
||||
@@ -213,7 +214,10 @@ class CondaSpec(NamedTuple):
|
||||
|
||||
@classmethod
|
||||
def from_filestem(cls, stem, md5, repo, py_version=None):
|
||||
miniconda_n, ver, os, arch = stem.split("-")
|
||||
# The `*vers` captures the new trailing `-1` in some file names (a build number?)
|
||||
# so they can be processed properly.
|
||||
miniconda_n, *vers, os, arch = stem.split("-")
|
||||
ver = "-".join(vers)
|
||||
suffix = miniconda_n[-1]
|
||||
if suffix in string.digits:
|
||||
tflavor = miniconda_n[:-1]
|
||||
@@ -371,7 +375,7 @@ if __name__ == "__main__":
|
||||
reason = "already exists"
|
||||
elif key.version_str.info() <= (4, 3, 30):
|
||||
reason = "too old"
|
||||
elif len(key.version_str.info()) >= 4:
|
||||
elif len(key.version_str.info()) >= 4 and "-" not in key.version_str:
|
||||
reason = "ignoring hotfix releases"
|
||||
|
||||
if reason:
|
||||
|
||||
9
plugins/python-build/share/python-build/3.10.7
Normal file
9
plugins/python-build/share/python-build/3.10.7
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1o" "https://www.openssl.org/source/openssl-1.1.1o.tar.gz#9384a2b0570dd80358841464677115df785edb941c71211f75076d72fe6b438f" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.10.7" "https://www.python.org/ftp/python/3.10.7/Python-3.10.7.tar.xz#6eed8415b7516fb2f260906db5d48dd4c06acc0cb24a7d6cc15296a604dcdc48" standard verify_py310 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.10.7" "https://www.python.org/ftp/python/3.10.7/Python-3.10.7.tgz#1b2e4e2df697c52d36731666979e648beeda5941d0f95740aafbf4163e5cc126" standard verify_py310 copy_python_gdb ensurepip
|
||||
fi
|
||||
9
plugins/python-build/share/python-build/3.10.8
Normal file
9
plugins/python-build/share/python-build/3.10.8
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1o" "https://www.openssl.org/source/openssl-1.1.1o.tar.gz#9384a2b0570dd80358841464677115df785edb941c71211f75076d72fe6b438f" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.10.8" "https://www.python.org/ftp/python/3.10.8/Python-3.10.8.tar.xz#6a30ecde59c47048013eb5a658c9b5dec277203d2793667f578df7671f7f03f3" standard verify_py310 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.10.8" "https://www.python.org/ftp/python/3.10.8/Python-3.10.8.tgz#f400c3fb394b8bef1292f6dc1292c5fadc3533039a5bc0c3e885f3e16738029a" standard verify_py310 copy_python_gdb ensurepip
|
||||
fi
|
||||
9
plugins/python-build/share/python-build/3.10.9
Normal file
9
plugins/python-build/share/python-build/3.10.9
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1o" "https://www.openssl.org/source/openssl-1.1.1o.tar.gz#9384a2b0570dd80358841464677115df785edb941c71211f75076d72fe6b438f" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.10.9" "https://www.python.org/ftp/python/3.10.9/Python-3.10.9.tar.xz#5ae03e308260164baba39921fdb4dbf8e6d03d8235a939d4582b33f0b5e46a83" standard verify_py310 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.10.9" "https://www.python.org/ftp/python/3.10.9/Python-3.10.9.tgz#4ccd7e46c8898f4c7862910a1703aa0e63525913a519abb2f55e26220a914d88" standard verify_py310 copy_python_gdb ensurepip
|
||||
fi
|
||||
@@ -1,5 +1,6 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
export PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
|
||||
install_package "openssl-1.1.1k" "https://www.openssl.org/source/openssl-1.1.1k.tar.gz#892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||
install_git "Python-3.11-dev" "https://github.com/python/cpython" 3.11 standard verify_py311 copy_python_gdb ensurepip
|
||||
|
||||
10
plugins/python-build/share/python-build/3.11.0
Normal file
10
plugins/python-build/share/python-build/3.11.0
Normal file
@@ -0,0 +1,10 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
export PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
|
||||
install_package "openssl-1.1.1q" "https://www.openssl.org/source/openssl-1.1.1q.tar.gz#d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.11.0" "https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tar.xz#a57dc82d77358617ba65b9841cee1e3b441f386c3789ddc0676eca077f2951c3" standard verify_py311 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.11.0" "https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz#64424e96e2457abbac899b90f9530985b51eef2905951febd935f0e73414caeb" standard verify_py311 copy_python_gdb ensurepip
|
||||
fi
|
||||
@@ -1,9 +0,0 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.11.0b5" "https://www.python.org/ftp/python/3.11.0/Python-3.11.0b5.tar.xz#3810bd22f7dc34a99c2a2eb4b85264a4df4f05ef59c4e0ccc2ea82ee9c491698" standard verify_py311 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.11.0b5" "https://www.python.org/ftp/python/3.11.0/Python-3.11.0b5.tgz#3f7d1a4ab0e64425f4ffd92d49de192ad2ee1c62bc52e3877e9f7b254c702e60" standard verify_py311 copy_python_gdb ensurepip
|
||||
fi
|
||||
10
plugins/python-build/share/python-build/3.11.1
Normal file
10
plugins/python-build/share/python-build/3.11.1
Normal file
@@ -0,0 +1,10 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
export PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
|
||||
install_package "openssl-1.1.1s" "https://www.openssl.org/source/openssl-1.1.1s.tar.gz#c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.11.1" "https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tar.xz#85879192f2cffd56cb16c092905949ebf3e5e394b7f764723529637901dfb58f" standard verify_py311 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.11.1" "https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tgz#baed518e26b337d4d8105679caf68c5c32630d702614fc174e98cb95c46bdfa4" standard verify_py311 copy_python_gdb ensurepip
|
||||
fi
|
||||
@@ -1,5 +1,7 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
export PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_DSYMUTIL=1
|
||||
install_package "openssl-1.1.1k" "https://www.openssl.org/source/openssl-1.1.1k.tar.gz#892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||
install_git "Python-3.12-dev" "https://github.com/python/cpython" main standard verify_py312 copy_python_gdb ensurepip
|
||||
|
||||
9
plugins/python-build/share/python-build/3.12.0a3
Normal file
9
plugins/python-build/share/python-build/3.12.0a3
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1s" "https://www.openssl.org/source/openssl-1.1.1s.tar.gz#c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.12.0a3" "https://www.python.org/ftp/python/3.12.0/Python-3.12.0a3.tar.xz#1b64b3075e0a9241974e580e09b09c9117a1c4e2be698039201ef1d8a73453d1" standard verify_py312 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.12.0a3" "https://www.python.org/ftp/python/3.12.0/Python-3.12.0a3.tgz#fd414e6b6520171f5cefc5cba1067265187a322417f7bdec8d024db7fc8fbe96" standard verify_py312 copy_python_gdb ensurepip
|
||||
fi
|
||||
9
plugins/python-build/share/python-build/3.7.14
Normal file
9
plugins/python-build/share/python-build/3.7.14
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.7.14" "https://www.python.org/ftp/python/3.7.14/Python-3.7.14.tar.xz#4157ae31eb81af19e81c36882610491b0fb8f50e00fa8a17b095c88908b9c45c" standard verify_py37 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.7.14" "https://www.python.org/ftp/python/3.7.14/Python-3.7.14.tgz#82b2abf8978caa61a9011d166eede831b32de9cbebc0db8162900fa23437b709" standard verify_py37 copy_python_gdb ensurepip
|
||||
fi
|
||||
9
plugins/python-build/share/python-build/3.7.15
Normal file
9
plugins/python-build/share/python-build/3.7.15
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1q" "https://www.openssl.org/source/openssl-1.1.1q.tar.gz#d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.7.15" "https://www.python.org/ftp/python/3.7.15/Python-3.7.15.tar.xz#5911475a07ac2b53d746e88a0716af6d2b4734941919136ea0d33fb9c75b9714" standard verify_py37 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.7.15" "https://www.python.org/ftp/python/3.7.15/Python-3.7.15.tgz#cf2993798ae8430f3af3a00d96d9fdf320719f4042f039380dca79967c25e436" standard verify_py37 copy_python_gdb ensurepip
|
||||
fi
|
||||
9
plugins/python-build/share/python-build/3.7.16
Normal file
9
plugins/python-build/share/python-build/3.7.16
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1q" "https://www.openssl.org/source/openssl-1.1.1q.tar.gz#d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.7.16" "https://www.python.org/ftp/python/3.7.16/Python-3.7.16.tar.xz#8338f0c2222d847e904c955369155dc1beeeed806e8d5ef04b00ef4787238bfd" standard verify_py37 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.7.16" "https://www.python.org/ftp/python/3.7.16/Python-3.7.16.tgz#0cf2da07fa464636755215415909e22eb1d058817af4824bc15af8390d05fb38" standard verify_py37 copy_python_gdb ensurepip
|
||||
fi
|
||||
9
plugins/python-build/share/python-build/3.8.14
Normal file
9
plugins/python-build/share/python-build/3.8.14
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.8.14" "https://www.python.org/ftp/python/3.8.14/Python-3.8.14.tar.xz#5d77e278271ba803e9909a41a4f3baca006181c93ada682a5e5fe8dc4a24c5f3" standard verify_py38 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.8.14" "https://www.python.org/ftp/python/3.8.14/Python-3.8.14.tgz#41f959c480c59211feb55d5a28851a56c7e22d02ef91035606ebb21011723c31" standard verify_py38 copy_python_gdb ensurepip
|
||||
fi
|
||||
9
plugins/python-build/share/python-build/3.8.15
Normal file
9
plugins/python-build/share/python-build/3.8.15
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1q" "https://www.openssl.org/source/openssl-1.1.1q.tar.gz#d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.8.15" "https://www.python.org/ftp/python/3.8.15/Python-3.8.15.tar.xz#5114fc7918a2a5e20eb5aac696b30c36f412c6ef24b13f5c9eb9e056982d9550" standard verify_py38 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.8.15" "https://www.python.org/ftp/python/3.8.15/Python-3.8.15.tgz#924d46999df82aa2eaa1de5ca51d6800ffb56b4bf52486a28f40634e3362abc4" standard verify_py38 copy_python_gdb ensurepip
|
||||
fi
|
||||
9
plugins/python-build/share/python-build/3.8.16
Normal file
9
plugins/python-build/share/python-build/3.8.16
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1q" "https://www.openssl.org/source/openssl-1.1.1q.tar.gz#d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.8.16" "https://www.python.org/ftp/python/3.8.16/Python-3.8.16.tar.xz#d85dbb3774132473d8081dcb158f34a10ccad7a90b96c7e50ea4bb61f5ce4562" standard verify_py38 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.8.16" "https://www.python.org/ftp/python/3.8.16/Python-3.8.16.tgz#71ca9d935637ed2feb59e90a368361dc91eca472a90acb1d344a2e8178ccaf10" standard verify_py38 copy_python_gdb ensurepip
|
||||
fi
|
||||
9
plugins/python-build/share/python-build/3.9.14
Normal file
9
plugins/python-build/share/python-build/3.9.14
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1n" "https://www.openssl.org/source/openssl-1.1.1n.tar.gz#40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.9.14" "https://www.python.org/ftp/python/3.9.14/Python-3.9.14.tar.xz#651304d216c8203fe0adf1a80af472d8e92c3b0e0a7892222ae4d9f3ae4debcf" standard verify_py39 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.9.14" "https://www.python.org/ftp/python/3.9.14/Python-3.9.14.tgz#9201836e2c16361b2b7408680502393737d44f227333fe2e5729c7d5f6041675" standard verify_py39 copy_python_gdb ensurepip
|
||||
fi
|
||||
9
plugins/python-build/share/python-build/3.9.15
Normal file
9
plugins/python-build/share/python-build/3.9.15
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1q" "https://www.openssl.org/source/openssl-1.1.1q.tar.gz#d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.9.15" "https://www.python.org/ftp/python/3.9.15/Python-3.9.15.tar.xz#12daff6809528d9f6154216950423c9e30f0e47336cb57c6aa0b4387dd5eb4b2" standard verify_py39 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.9.15" "https://www.python.org/ftp/python/3.9.15/Python-3.9.15.tgz#48d1ccb29d5fbaf1fb8f912271d09f7450e426d4dfe95978ef6aaada70ece4d8" standard verify_py39 copy_python_gdb ensurepip
|
||||
fi
|
||||
9
plugins/python-build/share/python-build/3.9.16
Normal file
9
plugins/python-build/share/python-build/3.9.16
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1q" "https://www.openssl.org/source/openssl-1.1.1q.tar.gz#d7939ce614029cdff0b6c20f0e2e5703158a489a72b2507b8bd51bf8c8fd10ca" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.1" "https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz#f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.9.16" "https://www.python.org/ftp/python/3.9.16/Python-3.9.16.tar.xz#22dddc099246dd2760665561e8adb7394ea0cc43a72684c6480f9380f7786439" standard verify_py39 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.9.16" "https://www.python.org/ftp/python/3.9.16/Python-3.9.16.tgz#1ad539e9dbd2b42df714b69726e0693bc6b9d2d2c8e91c2e43204026605140c5" standard verify_py39 copy_python_gdb ensurepip
|
||||
fi
|
||||
28
plugins/python-build/share/python-build/anaconda3-2022.10
Normal file
28
plugins/python-build/share/python-build/anaconda3-2022.10
Normal file
@@ -0,0 +1,28 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-aarch64" )
|
||||
install_script "Anaconda3-2022.10-Linux-aarch64" "https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-aarch64.sh#dac187c9fa6cae4ad663937f0ef79c8f" "anaconda" verify_py39
|
||||
;;
|
||||
"Linux-ppc64le" )
|
||||
install_script "Anaconda3-2022.10-Linux-ppc64le" "https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-ppc64le.sh#8dee159ac42f80eca8ce99ddbfd94099" "anaconda" verify_py39
|
||||
;;
|
||||
"Linux-s390x" )
|
||||
install_script "Anaconda3-2022.10-Linux-s390x" "https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-s390x.sh#ef2a6accc4d0d77756130198cb481358" "anaconda" verify_py39
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Anaconda3-2022.10-Linux-x86_64" "https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh#80256bd7a55509665c4179fd61516745" "anaconda" verify_py39
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Anaconda3-2022.10-MacOSX-arm64" "https://repo.anaconda.com/archive/Anaconda3-2022.10-MacOSX-arm64.sh#3a5d726f90e11270990e520905cf8466" "anaconda" verify_py39
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Anaconda3-2022.10-MacOSX-x86_64" "https://repo.anaconda.com/archive/Anaconda3-2022.10-MacOSX-x86_64.sh#83fe2cbd4b32eeb63e99c3e15d72be85" "anaconda" verify_py39
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of Anaconda is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
31
plugins/python-build/share/python-build/cinder-3.8-dev
Normal file
31
plugins/python-build/share/python-build/cinder-3.8-dev
Normal file
@@ -0,0 +1,31 @@
|
||||
require_distro Fedora 32 &>/dev/null || \
|
||||
{ echo
|
||||
colorize 1 "WARNING"
|
||||
cat >&2 <<!
|
||||
: The Cinder compiler only officially supports
|
||||
Facebook's Docker images which are Fedora 32 - based.
|
||||
It may fail to build on a system
|
||||
with a different GCC and/or Glibc version.
|
||||
!
|
||||
echo
|
||||
}
|
||||
|
||||
[[ $(${CC:-gcc} -dumpversion 2>/dev/null) == 10 ]] || \
|
||||
{ command -v "gcc-10" >/dev/null && \
|
||||
export CC="gcc-10" && \
|
||||
echo "python-build: setting the compiler to \`gcc-10'"; } || \
|
||||
{
|
||||
echo
|
||||
colorize 1 WARNING
|
||||
cat >&2 <<!
|
||||
: GCC 10 is not found on PATH.
|
||||
The build may fail.
|
||||
!
|
||||
echo
|
||||
}
|
||||
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1k" "https://www.openssl.org/source/openssl-1.1.1k.tar.gz#892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.0" "https://ftpmirror.gnu.org/readline/readline-8.0.tar.gz#e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461" mac_readline --if has_broken_mac_readline
|
||||
install_git "Cinder-3.8-dev" "https://github.com/facebookincubator/cinder" "cinder/3.8" standard verify_py38 copy_python_gdb ensurepip
|
||||
54
plugins/python-build/share/python-build/graalpy-22.3.0
Normal file
54
plugins/python-build/share/python-build/graalpy-22.3.0
Normal file
@@ -0,0 +1,54 @@
|
||||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
# this software and associated documentation files (the "Software"), to deal in
|
||||
# the Software without restriction, including without limitation the rights to
|
||||
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
# of the Software, and to permit persons to whom the Software is furnished to do
|
||||
# so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
VERSION='22.3.0'
|
||||
BUILD=''
|
||||
|
||||
graalpy_arch="$(graalpy_architecture 2>/dev/null || true)"
|
||||
|
||||
case "$graalpy_arch" in
|
||||
"linux-amd64" )
|
||||
checksum="9853036fcde0b115026d8802a4f671b62d7a17fccb269c1e8b5fbf80cef10e23"
|
||||
;;
|
||||
"linux-aarch64" )
|
||||
checksum="c48c5d9ff5699046c0629181a40a3116172e1c508c851f0993dcca45d86349c0"
|
||||
;;
|
||||
"macos-amd64" )
|
||||
checksum="cc8454f460b5730e778d5b8f79385cf92c39321fbf27d44bb9ca90584670f921"
|
||||
;;
|
||||
"macos-aarch64" )
|
||||
checksum="9a388834f28fbb86ff9588d9a150a4d26e9bec28be06c3d60ebe20079f855e41"
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": No binary distribution of GraalPy is available for $(uname -sm)."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "${BUILD}" ]; then
|
||||
urlprefix="https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/${VERSION}-${BUILD}"
|
||||
else
|
||||
urlprefix="https://github.com/oracle/graalpython/releases/download/vm-${VERSION}"
|
||||
fi
|
||||
|
||||
install_package "graalpy-${VERSION}${BUILD}" "${urlprefix}/graalpy-${VERSION}-${graalpy_arch}.tar.gz#${checksum}" "copy" ensurepip
|
||||
25
plugins/python-build/share/python-build/mambaforge-22.9.0-2
Normal file
25
plugins/python-build/share/python-build/mambaforge-22.9.0-2
Normal file
@@ -0,0 +1,25 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-aarch64" )
|
||||
install_script "Mambaforge-22.9.0-2-Linux-aarch64.sh" "https://github.com/conda-forge/miniforge/releases/download/22.9.0-2/Mambaforge-22.9.0-2-Linux-aarch64.sh#26cf4a5cd3a3b9085f75911b459b969d6ff8ab426ef9a8e7ce3b47cc683ead86" "miniconda" verify_py310
|
||||
;;
|
||||
"Linux-ppc64le" )
|
||||
install_script "Mambaforge-22.9.0-2-Linux-ppc64le.sh" "https://github.com/conda-forge/miniforge/releases/download/22.9.0-2/Mambaforge-22.9.0-2-Linux-ppc64le.sh#e13044cdbce8542896dd8b7128a00b691c119e7ad6e872c7de93ec9954b4775d" "miniconda" verify_py310
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Mambaforge-22.9.0-2-Linux-x86_64.sh" "https://github.com/conda-forge/miniforge/releases/download/22.9.0-2/Mambaforge-22.9.0-2-Linux-x86_64.sh#d2bb6c33f2373131fc71283baae9eb81a279708d007e55d627d85abe30c2d0eb" "miniconda" verify_py310
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Mambaforge-22.9.0-2-MacOSX-arm64.sh" "https://github.com/conda-forge/miniforge/releases/download/22.9.0-2/Mambaforge-22.9.0-2-MacOSX-arm64.sh#21959f1a17a662b3f260e8b04fe2dfe82f1246746875a72f513d39159d8b816b" "miniconda" verify_py310
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Mambaforge-22.9.0-2-MacOSX-x86_64.sh" "https://github.com/conda-forge/miniforge/releases/download/22.9.0-2/Mambaforge-22.9.0-2-MacOSX-x86_64.sh#844fc1ac61967990f0cfb9e516e8b0704ac2e500854588fd9851d2790d817bab" "miniconda" verify_py310
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of Mambaforge is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
4
plugins/python-build/share/python-build/micropython-1.18
Normal file
4
plugins/python-build/share/python-build/micropython-1.18
Normal file
@@ -0,0 +1,4 @@
|
||||
has_tar_xz_support \
|
||||
&& { install=install_package; src="https://micropython.org/resources/source/micropython-1.18.tar.xz#96fc71b42ed331c64e1adc5a830ec4f29f2975c23e8751109c03f32b80fa3eb4"; } \
|
||||
|| { install=install_zip; src="https://micropython.org/resources/source/micropython-1.18.zip#90fa8049cf275310638b9e9c77121f6042f7250b814ef622f9522befde009f57"; }
|
||||
$install micropython-1.18 "$src" micropython
|
||||
@@ -0,0 +1,4 @@
|
||||
has_tar_xz_support \
|
||||
&& { install=install_package; src="https://micropython.org/resources/source/micropython-1.19.1.tar.xz#940e3815e8c425c6eaed3a2aa30d320220cc012a2654b6e086e1b6f0567df350"; } \
|
||||
|| { install=install_zip; src="https://micropython.org/resources/source/micropython-1.19.1.zip#7047ce208627457c6881850527edb78189a1855a974aa34e2d929c9a3b3c5cc3"; }
|
||||
$install micropython-1.19.1 "$src" micropython
|
||||
@@ -0,0 +1,28 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-aarch64" )
|
||||
install_script "Miniconda3-py310_22.11.1-1-Linux-aarch64" "https://repo.anaconda.com/miniconda/Miniconda3-py310_22.11.1-1-Linux-aarch64.sh#48a96df9ff56f7421b6dd7f9f71d548023847ba918c3826059918c08326c2017" "miniconda" verify_py310
|
||||
;;
|
||||
"Linux-ppc64le" )
|
||||
install_script "Miniconda3-py310_22.11.1-1-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py310_22.11.1-1-Linux-ppc64le.sh#4c86c3383bb27b44f7059336c3a46c34922df42824577b93eadecefbf7423836" "miniconda" verify_py310
|
||||
;;
|
||||
"Linux-s390x" )
|
||||
install_script "Miniconda3-py310_22.11.1-1-Linux-s390x" "https://repo.anaconda.com/miniconda/Miniconda3-py310_22.11.1-1-Linux-s390x.sh#a150511e7fd19d07b770f278fb5dd2df4bc24a8f55f06d6274774f209a36c766" "miniconda" verify_py310
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-py310_22.11.1-1-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py310_22.11.1-1-Linux-x86_64.sh#00938c3534750a0e4069499baf8f4e6dc1c2e471c86a59caa0dd03f4a9269db6" "miniconda" verify_py310
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Miniconda3-py310_22.11.1-1-MacOSX-arm64" "https://repo.anaconda.com/miniconda/Miniconda3-py310_22.11.1-1-MacOSX-arm64.sh#22eec9b7d3add25ac3f9b60621d8f3d8df3e63d4aa0ae5eb846b558d7ba68333" "miniconda" verify_py310
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py310_22.11.1-1-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py310_22.11.1-1-MacOSX-x86_64.sh#7406579393427eaf9bc0e094dcd3c66d1e1b93ee9db4e7686d0a72ea5d7c0ce5" "miniconda" verify_py310
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,25 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-aarch64" )
|
||||
install_script "Miniconda3-py37_22.11.1-1-Linux-aarch64" "https://repo.anaconda.com/miniconda/Miniconda3-py37_22.11.1-1-Linux-aarch64.sh#ebba2f7e33ce5594c50e6422477106e6bb327310838fbac3db89d2eaebcde943" "miniconda" verify_py37
|
||||
;;
|
||||
"Linux-ppc64le" )
|
||||
install_script "Miniconda3-py37_22.11.1-1-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py37_22.11.1-1-Linux-ppc64le.sh#dda16ae14992697e3c90b56fe9de819f5f3b1dcb3ac7a31d24ab5736ccd5f129" "miniconda" verify_py37
|
||||
;;
|
||||
"Linux-s390x" )
|
||||
install_script "Miniconda3-py37_22.11.1-1-Linux-s390x" "https://repo.anaconda.com/miniconda/Miniconda3-py37_22.11.1-1-Linux-s390x.sh#3c71628865164c3f8b461f8e4b2a353ff1367eed61c83b9c3e14fc201608b1a7" "miniconda" verify_py37
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-py37_22.11.1-1-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py37_22.11.1-1-Linux-x86_64.sh#22b14d52265b4e609c6ce78e2f2884b277d976b83b5f9c8a83423e3eba2ccfbe" "miniconda" verify_py37
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py37_22.11.1-1-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py37_22.11.1-1-MacOSX-x86_64.sh#e51d459aae45bb6b86c2716738b778b788785e6e1ea4b2ed244a0fdd754feb19" "miniconda" verify_py37
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,28 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-aarch64" )
|
||||
install_script "Miniconda3-py38_22.11.1-1-Linux-aarch64" "https://repo.anaconda.com/miniconda/Miniconda3-py38_22.11.1-1-Linux-aarch64.sh#ff65684bce7a7ad7abb698ff649195816ee0f47a4f17cb9632a44abf69357ea5" "miniconda" verify_py38
|
||||
;;
|
||||
"Linux-ppc64le" )
|
||||
install_script "Miniconda3-py38_22.11.1-1-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py38_22.11.1-1-Linux-ppc64le.sh#59fd0901f9fa1ba6b07e734adff4d6c5215e9d7f13ad37f0044af22e9b72194a" "miniconda" verify_py38
|
||||
;;
|
||||
"Linux-s390x" )
|
||||
install_script "Miniconda3-py38_22.11.1-1-Linux-s390x" "https://repo.anaconda.com/miniconda/Miniconda3-py38_22.11.1-1-Linux-s390x.sh#5bdc6ead307c098b32ba8473b7cbbe87eb80f8eca9adba03f47848bcb34a9b38" "miniconda" verify_py38
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-py38_22.11.1-1-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py38_22.11.1-1-Linux-x86_64.sh#473e5ecc8e078e9ef89355fbca21f8eefa5f9081544befca99867c7beac3150d" "miniconda" verify_py38
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Miniconda3-py38_22.11.1-1-MacOSX-arm64" "https://repo.anaconda.com/miniconda/Miniconda3-py38_22.11.1-1-MacOSX-arm64.sh#bf75dbf193db6895c62b2bb963cab2534a8bbdf0ac956f270da8d7a19f4d1b54" "miniconda" verify_py38
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py38_22.11.1-1-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py38_22.11.1-1-MacOSX-x86_64.sh#6c4cea3c355326f503d15ae97e5126437529a595499e3ce304cd0f247e935da8" "miniconda" verify_py38
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,28 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-aarch64" )
|
||||
install_script "Miniconda3-py39_22.11.1-1-Linux-aarch64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_22.11.1-1-Linux-aarch64.sh#031b6c52060bb75e930846c0a66baa91db8196f0d97fd32f3822c54db6b7c76a" "miniconda" verify_py39
|
||||
;;
|
||||
"Linux-ppc64le" )
|
||||
install_script "Miniconda3-py39_22.11.1-1-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py39_22.11.1-1-Linux-ppc64le.sh#16cc2d74644cf838d2761723c01172e0b704674317630480902ef429af29bd0b" "miniconda" verify_py39
|
||||
;;
|
||||
"Linux-s390x" )
|
||||
install_script "Miniconda3-py39_22.11.1-1-Linux-s390x" "https://repo.anaconda.com/miniconda/Miniconda3-py39_22.11.1-1-Linux-s390x.sh#ed6176aa6b52e22d939ea5c0c38f9f3cf52d2519a5d0dcb414936287893a31f9" "miniconda" verify_py39
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-py39_22.11.1-1-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_22.11.1-1-Linux-x86_64.sh#e685005710679914a909bfb9c52183b3ccc56ad7bb84acc861d596fcbe5d28bb" "miniconda" verify_py39
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Miniconda3-py39_22.11.1-1-MacOSX-arm64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_22.11.1-1-MacOSX-arm64.sh#eca5e241faea19d4b352aba819f99f42e2336fdbeecb04f5bc89c9ca786ea798" "miniconda" verify_py39
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py39_22.11.1-1-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_22.11.1-1-MacOSX-x86_64.sh#9a537f3a1b472098754c59a30b94822f1e9458405af831172aaa8f8124e9df88" "miniconda" verify_py39
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of Miniconda is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -12,7 +12,7 @@ case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
install_script "Miniconda3-py39_4.12.0-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Linux-x86_64.sh#7843dd7d0a2c53b0df37ca8189672992" "miniconda" verify_py39
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Miniconda3-py39_4.12.0-MacOSX-arm64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-MacOSX-arm64.sh#31251793539cf952ee99c18e34c30c7f" "miniconda" verify_py39
|
||||
install_script "Miniconda3-py39_4.12.0-MacOSX-arm64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-MacOSX-arm64.sh#f7448cfeb278f2a84ed903db02d5525c" "miniconda" verify_py39
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py39_4.12.0-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-MacOSX-x86_64.sh#143b9bb03b6e4865be4ebbf40b108772" "miniconda" verify_py39
|
||||
|
||||
25
plugins/python-build/share/python-build/miniforge3-22.9.0-2
Normal file
25
plugins/python-build/share/python-build/miniforge3-22.9.0-2
Normal file
@@ -0,0 +1,25 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-aarch64" )
|
||||
install_script "Miniforge3-22.9.0-2-Linux-aarch64.sh" "https://github.com/conda-forge/miniforge/releases/download/22.9.0-2/Miniforge3-22.9.0-2-Linux-aarch64.sh#3d75758c4d98181946b29d391323209752c5a111530738b5e36eba77e8e026aa" "miniconda" verify_py310
|
||||
;;
|
||||
"Linux-ppc64le" )
|
||||
install_script "Miniforge3-22.9.0-2-Linux-ppc64le.sh" "https://github.com/conda-forge/miniforge/releases/download/22.9.0-2/Miniforge3-22.9.0-2-Linux-ppc64le.sh#e84ffc9f018d5b23601106f299fefd25a75afb6fdd3416037ce4b561781156fc" "miniconda" verify_py310
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniforge3-22.9.0-2-Linux-x86_64.sh" "https://github.com/conda-forge/miniforge/releases/download/22.9.0-2/Miniforge3-22.9.0-2-Linux-x86_64.sh#180aefcbcf8a9f24123adb9e64e16c9bb16bc3f129bd79a5912ff44f295cc405" "miniconda" verify_py310
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Miniforge3-22.9.0-2-MacOSX-arm64.sh" "https://github.com/conda-forge/miniforge/releases/download/22.9.0-2/Miniforge3-22.9.0-2-MacOSX-arm64.sh#6ac610dabf9a64574ec83b158b2eb6023bc3de0de9a0c528d4fa876df2a27d13" "miniconda" verify_py310
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniforge3-22.9.0-2-MacOSX-x86_64.sh" "https://github.com/conda-forge/miniforge/releases/download/22.9.0-2/Miniforge3-22.9.0-2-MacOSX-x86_64.sh#d7f50abd340f63515b2059ed462548f5d395e2f9d7847a98c5428998504f5bff" "miniconda" verify_py310
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of Miniforge is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/test/v3ext.c b/test/v3ext.c
|
||||
index 7a240cd706..6cec6f1a9b 100644
|
||||
--- a/test/v3ext.c
|
||||
+++ b/test/v3ext.c
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <openssl/err.h>
|
||||
#include "internal/nelem.h"
|
||||
|
||||
+#include <string.h>
|
||||
#include "testutil.h"
|
||||
|
||||
static const char *infile;
|
||||
@@ -0,0 +1,310 @@
|
||||
From: Christian Hammond <christian@beanbaginc.com>
|
||||
Date: Wed, 15 Dec 2021 23:12:36 -0800
|
||||
Subject: Port ctypes and system libffi patches for arm64/macOS 10.15+ to Python 3.7.12
|
||||
|
||||
This ports the following ctypes and libffi pyenv patches for Python
|
||||
2.7.18 to Python 3.7.12:
|
||||
|
||||
* `0004-Use-system-libffi-for-Mac-OS-10.15-and-up.patch`
|
||||
* `0005-ctypes-use-the-correct-ABI-for-variadic-functions.patch`
|
||||
* `0006-ctypes-probe-libffi-for-ffi_closure_alloc-and-ffi_pr.patch`
|
||||
|
||||
These patches enable use of system libffi (fixing a broken `ctypes`
|
||||
module on arm64 targets) and enable calling variadic functions on arm64.
|
||||
They've been combined from patches port from Homebrew to pyenv by Takumi
|
||||
Sueda, updated to work on the Python 3.7.12 codebase.
|
||||
|
||||
The Homebrew patches are themselves backports of changes in Python 3.9
|
||||
and 3.10. That patch can be found at:
|
||||
|
||||
https://github.com/Homebrew/formula-patches/blob/master/python/3.8.7.patch
|
||||
|
||||
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
|
||||
index 715d595b24..7743144978 100644
|
||||
--- a/Doc/library/ctypes.rst
|
||||
+++ b/Doc/library/ctypes.rst
|
||||
@@ -1551,6 +1551,13 @@ They are instances of a private class:
|
||||
value usable as argument (integer, string, ctypes instance). This allows
|
||||
defining adapters that can adapt custom objects as function parameters.
|
||||
|
||||
+ .. attribute:: variadic
|
||||
+
|
||||
+ Assign a boolean to specify that the function takes a variable number of
|
||||
+ arguments. This does not matter on most platforms, but for Apple arm64
|
||||
+ platforms variadic functions have a different calling convention than
|
||||
+ normal functions.
|
||||
+
|
||||
.. attribute:: errcheck
|
||||
|
||||
Assign a Python function or another callable to this attribute. The
|
||||
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
|
||||
index 4ebd82d3e0..7b73c190b6 100644
|
||||
--- a/Lib/test/test_unicode.py
|
||||
+++ b/Lib/test/test_unicode.py
|
||||
@@ -2458,11 +2458,14 @@ class CAPITest(unittest.TestCase):
|
||||
def test_from_format(self):
|
||||
support.import_module('ctypes')
|
||||
from ctypes import (
|
||||
+ c_char_p,
|
||||
pythonapi, py_object, sizeof,
|
||||
c_int, c_long, c_longlong, c_ssize_t,
|
||||
c_uint, c_ulong, c_ulonglong, c_size_t, c_void_p)
|
||||
name = "PyUnicode_FromFormat"
|
||||
_PyUnicode_FromFormat = getattr(pythonapi, name)
|
||||
+ _PyUnicode_FromFormat.argtypes = (c_char_p,)
|
||||
+ _PyUnicode_FromFormat.variadic = True
|
||||
_PyUnicode_FromFormat.restype = py_object
|
||||
|
||||
def PyUnicode_FromFormat(format, *args):
|
||||
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
|
||||
index dd0c61fd8a..79137e1dc7 100644
|
||||
--- a/Modules/_ctypes/_ctypes.c
|
||||
+++ b/Modules/_ctypes/_ctypes.c
|
||||
@@ -3174,6 +3174,34 @@ PyCFuncPtr_get_restype(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
|
||||
}
|
||||
}
|
||||
|
||||
+static int
|
||||
+PyCFuncPtr_set_variadic(PyCFuncPtrObject *self, PyObject *ob)
|
||||
+{
|
||||
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
|
||||
+ assert(dict);
|
||||
+ int r = PyObject_IsTrue(ob);
|
||||
+ if (r == 1) {
|
||||
+ dict->flags |= FUNCFLAG_VARIADIC;
|
||||
+ return 0;
|
||||
+ } else if (r == 0) {
|
||||
+ dict->flags &= ~FUNCFLAG_VARIADIC;
|
||||
+ return 0;
|
||||
+ } else {
|
||||
+ return -1;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static PyObject *
|
||||
+PyCFuncPtr_get_variadic(PyCFuncPtrObject *self)
|
||||
+{
|
||||
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
|
||||
+ assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
|
||||
+ if (dict->flags & FUNCFLAG_VARIADIC)
|
||||
+ Py_RETURN_TRUE;
|
||||
+ else
|
||||
+ Py_RETURN_FALSE;
|
||||
+}
|
||||
+
|
||||
static int
|
||||
PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
|
||||
{
|
||||
@@ -3219,6 +3247,8 @@ static PyGetSetDef PyCFuncPtr_getsets[] = {
|
||||
{ "argtypes", (getter)PyCFuncPtr_get_argtypes,
|
||||
(setter)PyCFuncPtr_set_argtypes,
|
||||
"specify the argument types", NULL },
|
||||
+ { "variadic", (getter)PyCFuncPtr_get_variadic, (setter)PyCFuncPtr_set_variadic,
|
||||
+ "specify if function takes variable number of arguments", NULL },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -5632,6 +5662,7 @@ PyInit__ctypes(void)
|
||||
PyModule_AddObject(m, "FUNCFLAG_USE_ERRNO", PyLong_FromLong(FUNCFLAG_USE_ERRNO));
|
||||
PyModule_AddObject(m, "FUNCFLAG_USE_LASTERROR", PyLong_FromLong(FUNCFLAG_USE_LASTERROR));
|
||||
PyModule_AddObject(m, "FUNCFLAG_PYTHONAPI", PyLong_FromLong(FUNCFLAG_PYTHONAPI));
|
||||
+ PyModule_AddObject(m, "FUNCFLAG_VARIADIC", PyLong_FromLong(FUNCFLAG_VARIADIC));
|
||||
PyModule_AddStringConstant(m, "__version__", "1.1.0");
|
||||
|
||||
PyModule_AddObject(m, "_memmove_addr", PyLong_FromVoidPtr(memmove));
|
||||
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
|
||||
index 9cbf9801ad..e7fe11176b 100644
|
||||
--- a/Modules/_ctypes/callproc.c
|
||||
+++ b/Modules/_ctypes/callproc.c
|
||||
@@ -754,7 +756,8 @@ static int _call_function_pointer(int flags,
|
||||
ffi_type **atypes,
|
||||
ffi_type *restype,
|
||||
void *resmem,
|
||||
- int argcount)
|
||||
+ int argcount,
|
||||
+ int argtypecount)
|
||||
{
|
||||
PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
|
||||
PyObject *error_object = NULL;
|
||||
@@ -780,15 +783,39 @@ static int _call_function_pointer(int flags,
|
||||
if ((flags & FUNCFLAG_CDECL) == 0)
|
||||
cc = FFI_STDCALL;
|
||||
#endif
|
||||
- if (FFI_OK != ffi_prep_cif(&cif,
|
||||
- cc,
|
||||
- argcount,
|
||||
- restype,
|
||||
- atypes)) {
|
||||
- PyErr_SetString(PyExc_RuntimeError,
|
||||
- "ffi_prep_cif failed");
|
||||
- return -1;
|
||||
+
|
||||
+#if HAVE_FFI_PREP_CIF_VAR
|
||||
+ /* Everyone SHOULD set f.variadic=True on variadic function pointers, but
|
||||
+ * lots of existing code will not. If there's at least one arg and more
|
||||
+ * args are passed than are defined in the prototype, then it must be a
|
||||
+ * variadic function. */
|
||||
+ if ((flags & FUNCFLAG_VARIADIC) ||
|
||||
+ (argtypecount != 0 && argcount > argtypecount))
|
||||
+ {
|
||||
+ if (FFI_OK != ffi_prep_cif_var(&cif,
|
||||
+ cc,
|
||||
+ argtypecount,
|
||||
+ argcount,
|
||||
+ restype,
|
||||
+ atypes)) {
|
||||
+ PyErr_SetString(PyExc_RuntimeError,
|
||||
+ "ffi_prep_cif_var failed");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ } else {
|
||||
+#endif
|
||||
+ if (FFI_OK != ffi_prep_cif(&cif,
|
||||
+ cc,
|
||||
+ argcount,
|
||||
+ restype,
|
||||
+ atypes)) {
|
||||
+ PyErr_SetString(PyExc_RuntimeError,
|
||||
+ "ffi_prep_cif failed");
|
||||
+ return -1;
|
||||
+ }
|
||||
+#if HAVE_FFI_PREP_CIF_VAR
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
|
||||
error_object = _ctypes_get_errobj(&space);
|
||||
@@ -1187,9 +1214,8 @@ PyObject *_ctypes_callproc(PPROC pProc,
|
||||
|
||||
if (-1 == _call_function_pointer(flags, pProc, avalues, atypes,
|
||||
rtype, resbuf,
|
||||
- Py_SAFE_DOWNCAST(argcount,
|
||||
- Py_ssize_t,
|
||||
- int)))
|
||||
+ Py_SAFE_DOWNCAST(argcount, Py_ssize_t, int),
|
||||
+ Py_SAFE_DOWNCAST(argtype_count, Py_ssize_t, int)))
|
||||
goto cleanup;
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
diff --git a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h
|
||||
index e58f85233c..e45975f6ad 100644
|
||||
--- a/Modules/_ctypes/ctypes.h
|
||||
+++ b/Modules/_ctypes/ctypes.h
|
||||
@@ -285,6 +285,7 @@ PyObject *_ctypes_callproc(PPROC pProc,
|
||||
#define FUNCFLAG_PYTHONAPI 0x4
|
||||
#define FUNCFLAG_USE_ERRNO 0x8
|
||||
#define FUNCFLAG_USE_LASTERROR 0x10
|
||||
+#define FUNCFLAG_VARIADIC 0x20
|
||||
|
||||
#define TYPEFLAG_ISPOINTER 0x100
|
||||
#define TYPEFLAG_HASPOINTER 0x200
|
||||
diff --git a/setup.py b/setup.py
|
||||
index bf90600eaa..48ff120e9a 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -142,6 +142,13 @@ def macosx_sdk_root():
|
||||
|
||||
return MACOS_SDK_ROOT
|
||||
|
||||
+def is_macosx_at_least(vers):
|
||||
+ if host_platform == 'darwin':
|
||||
+ dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
|
||||
+ if dep_target:
|
||||
+ return tuple(map(int, str(dep_target).split('.'))) >= vers
|
||||
+ return False
|
||||
+
|
||||
def is_macosx_sdk_path(path):
|
||||
"""
|
||||
Returns True if 'path' can be located in an OSX SDK
|
||||
@@ -150,6 +157,13 @@ def is_macosx_sdk_path(path):
|
||||
or path.startswith('/System/')
|
||||
or path.startswith('/Library/') )
|
||||
|
||||
+def grep_headers_for(function, headers):
|
||||
+ for header in headers:
|
||||
+ with open(header, 'r') as f:
|
||||
+ if function in f.read():
|
||||
+ return True
|
||||
+ return False
|
||||
+
|
||||
def find_file(filename, std_dirs, paths):
|
||||
"""Searches for the directory where a given file is located,
|
||||
and returns a possibly-empty list of additional directories, or None
|
||||
@@ -1972,7 +1986,11 @@ class PyBuildExt(build_ext):
|
||||
return True
|
||||
|
||||
def detect_ctypes(self, inc_dirs, lib_dirs):
|
||||
- self.use_system_libffi = False
|
||||
+ if not sysconfig.get_config_var("LIBFFI_INCLUDEDIR") and is_macosx_at_least((10,15)):
|
||||
+ self.use_system_libffi = True
|
||||
+ else:
|
||||
+ self.use_system_libffi = '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS")
|
||||
+
|
||||
include_dirs = []
|
||||
extra_compile_args = []
|
||||
extra_link_args = []
|
||||
@@ -2018,30 +2036,47 @@ class PyBuildExt(build_ext):
|
||||
libraries=['m'])
|
||||
self.extensions.extend([ext, ext_test])
|
||||
|
||||
+ ffi_inc = sysconfig.get_config_var("LIBFFI_INCLUDEDIR")
|
||||
+ ffi_lib = None
|
||||
+
|
||||
if host_platform == 'darwin':
|
||||
- if '--with-system-ffi' not in sysconfig.get_config_var("CONFIG_ARGS"):
|
||||
+ if not self.use_system_libffi:
|
||||
return
|
||||
- # OS X 10.5 comes with libffi.dylib; the include files are
|
||||
- # in /usr/include/ffi
|
||||
- inc_dirs.append('/usr/include/ffi')
|
||||
-
|
||||
- ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
|
||||
- if not ffi_inc or ffi_inc[0] == '':
|
||||
- ffi_inc = find_file('ffi.h', [], inc_dirs)
|
||||
- if ffi_inc is not None:
|
||||
- ffi_h = ffi_inc[0] + '/ffi.h'
|
||||
+ ffi_in_sdk = os.path.join(macosx_sdk_root(), "usr/include/ffi")
|
||||
+ if os.path.exists(ffi_in_sdk):
|
||||
+ ffi_inc = ffi_in_sdk
|
||||
+ ffi_lib = 'ffi'
|
||||
+ else:
|
||||
+ # OS X 10.5 comes with libffi.dylib; the include files are
|
||||
+ # in /usr/include/ffi
|
||||
+ inc_dirs.append('/usr/include/ffi')
|
||||
+
|
||||
+ if not ffi_inc:
|
||||
+ found = find_file('ffi.h', [], inc_dirs)
|
||||
+ if found:
|
||||
+ ffi_inc = found[0]
|
||||
+ if ffi_inc:
|
||||
+ ffi_h = ffi_inc + '/ffi.h'
|
||||
if not os.path.exists(ffi_h):
|
||||
ffi_inc = None
|
||||
print('Header file {} does not exist'.format(ffi_h))
|
||||
- ffi_lib = None
|
||||
- if ffi_inc is not None:
|
||||
- for lib_name in ('ffi', 'ffi_pic'):
|
||||
+
|
||||
+ if ffi_lib is None and ffi_inc:
|
||||
+ for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
|
||||
if (self.compiler.find_library_file(lib_dirs, lib_name)):
|
||||
ffi_lib = lib_name
|
||||
break
|
||||
|
||||
if ffi_inc and ffi_lib:
|
||||
- ext.include_dirs.extend(ffi_inc)
|
||||
+ ffi_headers = glob(os.path.join(ffi_inc, '*.h'))
|
||||
+ if grep_headers_for('ffi_closure_alloc', ffi_headers):
|
||||
+ try:
|
||||
+ sources.remove('_ctypes/malloc_closure.c')
|
||||
+ except ValueError:
|
||||
+ pass
|
||||
+ if grep_headers_for('ffi_prep_cif_var', ffi_headers):
|
||||
+ ext.extra_compile_args.append("-DHAVE_FFI_PREP_CIF_VAR=1")
|
||||
+ ext.include_dirs.append(ffi_inc)
|
||||
ext.libraries.append(ffi_lib)
|
||||
self.use_system_libffi = True
|
||||
|
||||
--
|
||||
2.30.1 (Apple Git-130)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From f2595c038ed7bfd182d9d05d83786106ebd02ca0 Mon Sep 17 00:00:00 2001
|
||||
From: Lawrence D'Anna <64555057+lawrence-danna-apple@users.noreply.github.com>
|
||||
Date: Tue, 30 Jun 2020 02:15:46 -0700
|
||||
Subject: [PATCH] bpo-41100: fix _decimal for arm64 Mac OS (GH-21228)
|
||||
|
||||
Patch by Lawrence Danna.
|
||||
---
|
||||
.../Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst | 1 +
|
||||
Modules/_decimal/libmpdec/mpdecimal.h | 3 +++
|
||||
2 files changed, 4 insertions(+)
|
||||
create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst
|
||||
new file mode 100644
|
||||
index 0000000000..d6176d69f0
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst
|
||||
@@ -0,0 +1 @@
|
||||
+add arm64 to the allowable Mac OS arches in mpdecimal.h
|
||||
\ No newline at end of file
|
||||
diff --git a/Modules/_decimal/libmpdec/mpdecimal.h b/Modules/_decimal/libmpdec/mpdecimal.h
|
||||
index a67dd9bc12..3e9c8185c3 100644
|
||||
--- a/Modules/_decimal/libmpdec/mpdecimal.h
|
||||
+++ b/Modules/_decimal/libmpdec/mpdecimal.h
|
||||
@@ -135,6 +135,9 @@ const char *mpd_version(void);
|
||||
#elif defined(__x86_64__)
|
||||
#define CONFIG_64
|
||||
#define ASM
|
||||
+ #elif defined(__arm64__)
|
||||
+ #define CONFIG_64
|
||||
+ #define ANSI
|
||||
#else
|
||||
#error "unknown architecture for universal build."
|
||||
#endif
|
||||
--
|
||||
2.37.3
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From 245427d207ee88a4ba26a66c3de350bcbcc036f2 Mon Sep 17 00:00:00 2001
|
||||
From: Ronald Oussoren <ronaldoussoren@mac.com>
|
||||
Date: Sat, 14 Nov 2020 16:07:47 +0100
|
||||
Subject: [PATCH] bpo-42351: Avoid error when opening header with non-UTF8
|
||||
encoding (GH-23279)
|
||||
|
||||
grep_headers_for() would error out when a header contained
|
||||
text that cannot be interpreted as UTF-8.
|
||||
|
||||
cherry-picked from 7a27c7ed4b by Pedro Fonini <fonini@ip.tv>
|
||||
---
|
||||
setup.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index f211989aac..467362813d 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -159,7 +159,7 @@ def is_macosx_sdk_path(path):
|
||||
|
||||
def grep_headers_for(function, headers):
|
||||
for header in headers:
|
||||
- with open(header, 'r') as f:
|
||||
+ with open(header, 'r', errors='surrogateescape') as f:
|
||||
if function in f.read():
|
||||
return True
|
||||
return False
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,310 @@
|
||||
From: Christian Hammond <christian@beanbaginc.com>
|
||||
Date: Wed, 15 Dec 2021 23:12:36 -0800
|
||||
Subject: Port ctypes and system libffi patches for arm64/macOS 10.15+ to Python 3.7.12
|
||||
|
||||
This ports the following ctypes and libffi pyenv patches for Python
|
||||
2.7.18 to Python 3.7.12:
|
||||
|
||||
* `0004-Use-system-libffi-for-Mac-OS-10.15-and-up.patch`
|
||||
* `0005-ctypes-use-the-correct-ABI-for-variadic-functions.patch`
|
||||
* `0006-ctypes-probe-libffi-for-ffi_closure_alloc-and-ffi_pr.patch`
|
||||
|
||||
These patches enable use of system libffi (fixing a broken `ctypes`
|
||||
module on arm64 targets) and enable calling variadic functions on arm64.
|
||||
They've been combined from patches port from Homebrew to pyenv by Takumi
|
||||
Sueda, updated to work on the Python 3.7.12 codebase.
|
||||
|
||||
The Homebrew patches are themselves backports of changes in Python 3.9
|
||||
and 3.10. That patch can be found at:
|
||||
|
||||
https://github.com/Homebrew/formula-patches/blob/master/python/3.8.7.patch
|
||||
|
||||
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
|
||||
index 715d595b24..7743144978 100644
|
||||
--- a/Doc/library/ctypes.rst
|
||||
+++ b/Doc/library/ctypes.rst
|
||||
@@ -1551,6 +1551,13 @@ They are instances of a private class:
|
||||
value usable as argument (integer, string, ctypes instance). This allows
|
||||
defining adapters that can adapt custom objects as function parameters.
|
||||
|
||||
+ .. attribute:: variadic
|
||||
+
|
||||
+ Assign a boolean to specify that the function takes a variable number of
|
||||
+ arguments. This does not matter on most platforms, but for Apple arm64
|
||||
+ platforms variadic functions have a different calling convention than
|
||||
+ normal functions.
|
||||
+
|
||||
.. attribute:: errcheck
|
||||
|
||||
Assign a Python function or another callable to this attribute. The
|
||||
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
|
||||
index 4ebd82d3e0..7b73c190b6 100644
|
||||
--- a/Lib/test/test_unicode.py
|
||||
+++ b/Lib/test/test_unicode.py
|
||||
@@ -2458,11 +2458,14 @@ class CAPITest(unittest.TestCase):
|
||||
def test_from_format(self):
|
||||
support.import_module('ctypes')
|
||||
from ctypes import (
|
||||
+ c_char_p,
|
||||
pythonapi, py_object, sizeof,
|
||||
c_int, c_long, c_longlong, c_ssize_t,
|
||||
c_uint, c_ulong, c_ulonglong, c_size_t, c_void_p)
|
||||
name = "PyUnicode_FromFormat"
|
||||
_PyUnicode_FromFormat = getattr(pythonapi, name)
|
||||
+ _PyUnicode_FromFormat.argtypes = (c_char_p,)
|
||||
+ _PyUnicode_FromFormat.variadic = True
|
||||
_PyUnicode_FromFormat.restype = py_object
|
||||
|
||||
def PyUnicode_FromFormat(format, *args):
|
||||
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
|
||||
index dd0c61fd8a..79137e1dc7 100644
|
||||
--- a/Modules/_ctypes/_ctypes.c
|
||||
+++ b/Modules/_ctypes/_ctypes.c
|
||||
@@ -3174,6 +3174,34 @@ PyCFuncPtr_get_restype(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
|
||||
}
|
||||
}
|
||||
|
||||
+static int
|
||||
+PyCFuncPtr_set_variadic(PyCFuncPtrObject *self, PyObject *ob)
|
||||
+{
|
||||
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
|
||||
+ assert(dict);
|
||||
+ int r = PyObject_IsTrue(ob);
|
||||
+ if (r == 1) {
|
||||
+ dict->flags |= FUNCFLAG_VARIADIC;
|
||||
+ return 0;
|
||||
+ } else if (r == 0) {
|
||||
+ dict->flags &= ~FUNCFLAG_VARIADIC;
|
||||
+ return 0;
|
||||
+ } else {
|
||||
+ return -1;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static PyObject *
|
||||
+PyCFuncPtr_get_variadic(PyCFuncPtrObject *self)
|
||||
+{
|
||||
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
|
||||
+ assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
|
||||
+ if (dict->flags & FUNCFLAG_VARIADIC)
|
||||
+ Py_RETURN_TRUE;
|
||||
+ else
|
||||
+ Py_RETURN_FALSE;
|
||||
+}
|
||||
+
|
||||
static int
|
||||
PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
|
||||
{
|
||||
@@ -3219,6 +3247,8 @@ static PyGetSetDef PyCFuncPtr_getsets[] = {
|
||||
{ "argtypes", (getter)PyCFuncPtr_get_argtypes,
|
||||
(setter)PyCFuncPtr_set_argtypes,
|
||||
"specify the argument types", NULL },
|
||||
+ { "variadic", (getter)PyCFuncPtr_get_variadic, (setter)PyCFuncPtr_set_variadic,
|
||||
+ "specify if function takes variable number of arguments", NULL },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -5632,6 +5662,7 @@ PyInit__ctypes(void)
|
||||
PyModule_AddObject(m, "FUNCFLAG_USE_ERRNO", PyLong_FromLong(FUNCFLAG_USE_ERRNO));
|
||||
PyModule_AddObject(m, "FUNCFLAG_USE_LASTERROR", PyLong_FromLong(FUNCFLAG_USE_LASTERROR));
|
||||
PyModule_AddObject(m, "FUNCFLAG_PYTHONAPI", PyLong_FromLong(FUNCFLAG_PYTHONAPI));
|
||||
+ PyModule_AddObject(m, "FUNCFLAG_VARIADIC", PyLong_FromLong(FUNCFLAG_VARIADIC));
|
||||
PyModule_AddStringConstant(m, "__version__", "1.1.0");
|
||||
|
||||
PyModule_AddObject(m, "_memmove_addr", PyLong_FromVoidPtr(memmove));
|
||||
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
|
||||
index 9cbf9801ad..e7fe11176b 100644
|
||||
--- a/Modules/_ctypes/callproc.c
|
||||
+++ b/Modules/_ctypes/callproc.c
|
||||
@@ -754,7 +756,8 @@ static int _call_function_pointer(int flags,
|
||||
ffi_type **atypes,
|
||||
ffi_type *restype,
|
||||
void *resmem,
|
||||
- int argcount)
|
||||
+ int argcount,
|
||||
+ int argtypecount)
|
||||
{
|
||||
PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
|
||||
PyObject *error_object = NULL;
|
||||
@@ -780,15 +783,39 @@ static int _call_function_pointer(int flags,
|
||||
if ((flags & FUNCFLAG_CDECL) == 0)
|
||||
cc = FFI_STDCALL;
|
||||
#endif
|
||||
- if (FFI_OK != ffi_prep_cif(&cif,
|
||||
- cc,
|
||||
- argcount,
|
||||
- restype,
|
||||
- atypes)) {
|
||||
- PyErr_SetString(PyExc_RuntimeError,
|
||||
- "ffi_prep_cif failed");
|
||||
- return -1;
|
||||
+
|
||||
+#if HAVE_FFI_PREP_CIF_VAR
|
||||
+ /* Everyone SHOULD set f.variadic=True on variadic function pointers, but
|
||||
+ * lots of existing code will not. If there's at least one arg and more
|
||||
+ * args are passed than are defined in the prototype, then it must be a
|
||||
+ * variadic function. */
|
||||
+ if ((flags & FUNCFLAG_VARIADIC) ||
|
||||
+ (argtypecount != 0 && argcount > argtypecount))
|
||||
+ {
|
||||
+ if (FFI_OK != ffi_prep_cif_var(&cif,
|
||||
+ cc,
|
||||
+ argtypecount,
|
||||
+ argcount,
|
||||
+ restype,
|
||||
+ atypes)) {
|
||||
+ PyErr_SetString(PyExc_RuntimeError,
|
||||
+ "ffi_prep_cif_var failed");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ } else {
|
||||
+#endif
|
||||
+ if (FFI_OK != ffi_prep_cif(&cif,
|
||||
+ cc,
|
||||
+ argcount,
|
||||
+ restype,
|
||||
+ atypes)) {
|
||||
+ PyErr_SetString(PyExc_RuntimeError,
|
||||
+ "ffi_prep_cif failed");
|
||||
+ return -1;
|
||||
+ }
|
||||
+#if HAVE_FFI_PREP_CIF_VAR
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
|
||||
error_object = _ctypes_get_errobj(&space);
|
||||
@@ -1187,9 +1214,8 @@ PyObject *_ctypes_callproc(PPROC pProc,
|
||||
|
||||
if (-1 == _call_function_pointer(flags, pProc, avalues, atypes,
|
||||
rtype, resbuf,
|
||||
- Py_SAFE_DOWNCAST(argcount,
|
||||
- Py_ssize_t,
|
||||
- int)))
|
||||
+ Py_SAFE_DOWNCAST(argcount, Py_ssize_t, int),
|
||||
+ Py_SAFE_DOWNCAST(argtype_count, Py_ssize_t, int)))
|
||||
goto cleanup;
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
diff --git a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h
|
||||
index e58f85233c..e45975f6ad 100644
|
||||
--- a/Modules/_ctypes/ctypes.h
|
||||
+++ b/Modules/_ctypes/ctypes.h
|
||||
@@ -285,6 +285,7 @@ PyObject *_ctypes_callproc(PPROC pProc,
|
||||
#define FUNCFLAG_PYTHONAPI 0x4
|
||||
#define FUNCFLAG_USE_ERRNO 0x8
|
||||
#define FUNCFLAG_USE_LASTERROR 0x10
|
||||
+#define FUNCFLAG_VARIADIC 0x20
|
||||
|
||||
#define TYPEFLAG_ISPOINTER 0x100
|
||||
#define TYPEFLAG_HASPOINTER 0x200
|
||||
diff --git a/setup.py b/setup.py
|
||||
index bf90600eaa..48ff120e9a 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -142,6 +142,13 @@ def macosx_sdk_root():
|
||||
|
||||
return MACOS_SDK_ROOT
|
||||
|
||||
+def is_macosx_at_least(vers):
|
||||
+ if host_platform == 'darwin':
|
||||
+ dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
|
||||
+ if dep_target:
|
||||
+ return tuple(map(int, str(dep_target).split('.'))) >= vers
|
||||
+ return False
|
||||
+
|
||||
def is_macosx_sdk_path(path):
|
||||
"""
|
||||
Returns True if 'path' can be located in an OSX SDK
|
||||
@@ -150,6 +157,13 @@ def is_macosx_sdk_path(path):
|
||||
or path.startswith('/System/')
|
||||
or path.startswith('/Library/') )
|
||||
|
||||
+def grep_headers_for(function, headers):
|
||||
+ for header in headers:
|
||||
+ with open(header, 'r') as f:
|
||||
+ if function in f.read():
|
||||
+ return True
|
||||
+ return False
|
||||
+
|
||||
def find_file(filename, std_dirs, paths):
|
||||
"""Searches for the directory where a given file is located,
|
||||
and returns a possibly-empty list of additional directories, or None
|
||||
@@ -1972,7 +1986,11 @@ class PyBuildExt(build_ext):
|
||||
return True
|
||||
|
||||
def detect_ctypes(self, inc_dirs, lib_dirs):
|
||||
- self.use_system_libffi = False
|
||||
+ if not sysconfig.get_config_var("LIBFFI_INCLUDEDIR") and is_macosx_at_least((10,15)):
|
||||
+ self.use_system_libffi = True
|
||||
+ else:
|
||||
+ self.use_system_libffi = '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS")
|
||||
+
|
||||
include_dirs = []
|
||||
extra_compile_args = []
|
||||
extra_link_args = []
|
||||
@@ -2018,30 +2036,47 @@ class PyBuildExt(build_ext):
|
||||
libraries=['m'])
|
||||
self.extensions.extend([ext, ext_test])
|
||||
|
||||
+ ffi_inc = sysconfig.get_config_var("LIBFFI_INCLUDEDIR")
|
||||
+ ffi_lib = None
|
||||
+
|
||||
if host_platform == 'darwin':
|
||||
- if '--with-system-ffi' not in sysconfig.get_config_var("CONFIG_ARGS"):
|
||||
+ if not self.use_system_libffi:
|
||||
return
|
||||
- # OS X 10.5 comes with libffi.dylib; the include files are
|
||||
- # in /usr/include/ffi
|
||||
- inc_dirs.append('/usr/include/ffi')
|
||||
-
|
||||
- ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
|
||||
- if not ffi_inc or ffi_inc[0] == '':
|
||||
- ffi_inc = find_file('ffi.h', [], inc_dirs)
|
||||
- if ffi_inc is not None:
|
||||
- ffi_h = ffi_inc[0] + '/ffi.h'
|
||||
+ ffi_in_sdk = os.path.join(macosx_sdk_root(), "usr/include/ffi")
|
||||
+ if os.path.exists(ffi_in_sdk):
|
||||
+ ffi_inc = ffi_in_sdk
|
||||
+ ffi_lib = 'ffi'
|
||||
+ else:
|
||||
+ # OS X 10.5 comes with libffi.dylib; the include files are
|
||||
+ # in /usr/include/ffi
|
||||
+ inc_dirs.append('/usr/include/ffi')
|
||||
+
|
||||
+ if not ffi_inc:
|
||||
+ found = find_file('ffi.h', [], inc_dirs)
|
||||
+ if found:
|
||||
+ ffi_inc = found[0]
|
||||
+ if ffi_inc:
|
||||
+ ffi_h = ffi_inc + '/ffi.h'
|
||||
if not os.path.exists(ffi_h):
|
||||
ffi_inc = None
|
||||
print('Header file {} does not exist'.format(ffi_h))
|
||||
- ffi_lib = None
|
||||
- if ffi_inc is not None:
|
||||
- for lib_name in ('ffi', 'ffi_pic'):
|
||||
+
|
||||
+ if ffi_lib is None and ffi_inc:
|
||||
+ for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
|
||||
if (self.compiler.find_library_file(lib_dirs, lib_name)):
|
||||
ffi_lib = lib_name
|
||||
break
|
||||
|
||||
if ffi_inc and ffi_lib:
|
||||
- ext.include_dirs.extend(ffi_inc)
|
||||
+ ffi_headers = glob(os.path.join(ffi_inc, '*.h'))
|
||||
+ if grep_headers_for('ffi_closure_alloc', ffi_headers):
|
||||
+ try:
|
||||
+ sources.remove('_ctypes/malloc_closure.c')
|
||||
+ except ValueError:
|
||||
+ pass
|
||||
+ if grep_headers_for('ffi_prep_cif_var', ffi_headers):
|
||||
+ ext.extra_compile_args.append("-DHAVE_FFI_PREP_CIF_VAR=1")
|
||||
+ ext.include_dirs.append(ffi_inc)
|
||||
ext.libraries.append(ffi_lib)
|
||||
self.use_system_libffi = True
|
||||
|
||||
--
|
||||
2.30.1 (Apple Git-130)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From f2595c038ed7bfd182d9d05d83786106ebd02ca0 Mon Sep 17 00:00:00 2001
|
||||
From: Lawrence D'Anna <64555057+lawrence-danna-apple@users.noreply.github.com>
|
||||
Date: Tue, 30 Jun 2020 02:15:46 -0700
|
||||
Subject: [PATCH] bpo-41100: fix _decimal for arm64 Mac OS (GH-21228)
|
||||
|
||||
Patch by Lawrence Danna.
|
||||
---
|
||||
.../Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst | 1 +
|
||||
Modules/_decimal/libmpdec/mpdecimal.h | 3 +++
|
||||
2 files changed, 4 insertions(+)
|
||||
create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst
|
||||
new file mode 100644
|
||||
index 0000000000..d6176d69f0
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst
|
||||
@@ -0,0 +1 @@
|
||||
+add arm64 to the allowable Mac OS arches in mpdecimal.h
|
||||
\ No newline at end of file
|
||||
diff --git a/Modules/_decimal/libmpdec/mpdecimal.h b/Modules/_decimal/libmpdec/mpdecimal.h
|
||||
index a67dd9bc12..3e9c8185c3 100644
|
||||
--- a/Modules/_decimal/libmpdec/mpdecimal.h
|
||||
+++ b/Modules/_decimal/libmpdec/mpdecimal.h
|
||||
@@ -135,6 +135,9 @@ const char *mpd_version(void);
|
||||
#elif defined(__x86_64__)
|
||||
#define CONFIG_64
|
||||
#define ASM
|
||||
+ #elif defined(__arm64__)
|
||||
+ #define CONFIG_64
|
||||
+ #define ANSI
|
||||
#else
|
||||
#error "unknown architecture for universal build."
|
||||
#endif
|
||||
--
|
||||
2.37.3
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From 245427d207ee88a4ba26a66c3de350bcbcc036f2 Mon Sep 17 00:00:00 2001
|
||||
From: Ronald Oussoren <ronaldoussoren@mac.com>
|
||||
Date: Sat, 14 Nov 2020 16:07:47 +0100
|
||||
Subject: [PATCH] bpo-42351: Avoid error when opening header with non-UTF8
|
||||
encoding (GH-23279)
|
||||
|
||||
grep_headers_for() would error out when a header contained
|
||||
text that cannot be interpreted as UTF-8.
|
||||
|
||||
cherry-picked from 7a27c7ed4b by Pedro Fonini <fonini@ip.tv>
|
||||
---
|
||||
setup.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index f211989aac..467362813d 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -159,7 +159,7 @@ def is_macosx_sdk_path(path):
|
||||
|
||||
def grep_headers_for(function, headers):
|
||||
for header in headers:
|
||||
- with open(header, 'r') as f:
|
||||
+ with open(header, 'r', errors='surrogateescape') as f:
|
||||
if function in f.read():
|
||||
return True
|
||||
return False
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/test/v3ext.c b/test/v3ext.c
|
||||
index 7a240cd706..6cec6f1a9b 100644
|
||||
--- a/test/v3ext.c
|
||||
+++ b/test/v3ext.c
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <openssl/err.h>
|
||||
#include "internal/nelem.h"
|
||||
|
||||
+#include <string.h>
|
||||
#include "testutil.h"
|
||||
|
||||
static const char *infile;
|
||||
@@ -0,0 +1,310 @@
|
||||
From: Christian Hammond <christian@beanbaginc.com>
|
||||
Date: Wed, 15 Dec 2021 23:12:36 -0800
|
||||
Subject: Port ctypes and system libffi patches for arm64/macOS 10.15+ to Python 3.7.12
|
||||
|
||||
This ports the following ctypes and libffi pyenv patches for Python
|
||||
2.7.18 to Python 3.7.12:
|
||||
|
||||
* `0004-Use-system-libffi-for-Mac-OS-10.15-and-up.patch`
|
||||
* `0005-ctypes-use-the-correct-ABI-for-variadic-functions.patch`
|
||||
* `0006-ctypes-probe-libffi-for-ffi_closure_alloc-and-ffi_pr.patch`
|
||||
|
||||
These patches enable use of system libffi (fixing a broken `ctypes`
|
||||
module on arm64 targets) and enable calling variadic functions on arm64.
|
||||
They've been combined from patches port from Homebrew to pyenv by Takumi
|
||||
Sueda, updated to work on the Python 3.7.12 codebase.
|
||||
|
||||
The Homebrew patches are themselves backports of changes in Python 3.9
|
||||
and 3.10. That patch can be found at:
|
||||
|
||||
https://github.com/Homebrew/formula-patches/blob/master/python/3.8.7.patch
|
||||
|
||||
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
|
||||
index 715d595b24..7743144978 100644
|
||||
--- a/Doc/library/ctypes.rst
|
||||
+++ b/Doc/library/ctypes.rst
|
||||
@@ -1551,6 +1551,13 @@ They are instances of a private class:
|
||||
value usable as argument (integer, string, ctypes instance). This allows
|
||||
defining adapters that can adapt custom objects as function parameters.
|
||||
|
||||
+ .. attribute:: variadic
|
||||
+
|
||||
+ Assign a boolean to specify that the function takes a variable number of
|
||||
+ arguments. This does not matter on most platforms, but for Apple arm64
|
||||
+ platforms variadic functions have a different calling convention than
|
||||
+ normal functions.
|
||||
+
|
||||
.. attribute:: errcheck
|
||||
|
||||
Assign a Python function or another callable to this attribute. The
|
||||
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
|
||||
index 4ebd82d3e0..7b73c190b6 100644
|
||||
--- a/Lib/test/test_unicode.py
|
||||
+++ b/Lib/test/test_unicode.py
|
||||
@@ -2458,11 +2458,14 @@ class CAPITest(unittest.TestCase):
|
||||
def test_from_format(self):
|
||||
support.import_module('ctypes')
|
||||
from ctypes import (
|
||||
+ c_char_p,
|
||||
pythonapi, py_object, sizeof,
|
||||
c_int, c_long, c_longlong, c_ssize_t,
|
||||
c_uint, c_ulong, c_ulonglong, c_size_t, c_void_p)
|
||||
name = "PyUnicode_FromFormat"
|
||||
_PyUnicode_FromFormat = getattr(pythonapi, name)
|
||||
+ _PyUnicode_FromFormat.argtypes = (c_char_p,)
|
||||
+ _PyUnicode_FromFormat.variadic = True
|
||||
_PyUnicode_FromFormat.restype = py_object
|
||||
|
||||
def PyUnicode_FromFormat(format, *args):
|
||||
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
|
||||
index dd0c61fd8a..79137e1dc7 100644
|
||||
--- a/Modules/_ctypes/_ctypes.c
|
||||
+++ b/Modules/_ctypes/_ctypes.c
|
||||
@@ -3174,6 +3174,34 @@ PyCFuncPtr_get_restype(PyCFuncPtrObject *self, void *Py_UNUSED(ignored))
|
||||
}
|
||||
}
|
||||
|
||||
+static int
|
||||
+PyCFuncPtr_set_variadic(PyCFuncPtrObject *self, PyObject *ob)
|
||||
+{
|
||||
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
|
||||
+ assert(dict);
|
||||
+ int r = PyObject_IsTrue(ob);
|
||||
+ if (r == 1) {
|
||||
+ dict->flags |= FUNCFLAG_VARIADIC;
|
||||
+ return 0;
|
||||
+ } else if (r == 0) {
|
||||
+ dict->flags &= ~FUNCFLAG_VARIADIC;
|
||||
+ return 0;
|
||||
+ } else {
|
||||
+ return -1;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static PyObject *
|
||||
+PyCFuncPtr_get_variadic(PyCFuncPtrObject *self)
|
||||
+{
|
||||
+ StgDictObject *dict = PyObject_stgdict((PyObject *)self);
|
||||
+ assert(dict); /* Cannot be NULL for PyCFuncPtrObject instances */
|
||||
+ if (dict->flags & FUNCFLAG_VARIADIC)
|
||||
+ Py_RETURN_TRUE;
|
||||
+ else
|
||||
+ Py_RETURN_FALSE;
|
||||
+}
|
||||
+
|
||||
static int
|
||||
PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
|
||||
{
|
||||
@@ -3219,6 +3247,8 @@ static PyGetSetDef PyCFuncPtr_getsets[] = {
|
||||
{ "argtypes", (getter)PyCFuncPtr_get_argtypes,
|
||||
(setter)PyCFuncPtr_set_argtypes,
|
||||
"specify the argument types", NULL },
|
||||
+ { "variadic", (getter)PyCFuncPtr_get_variadic, (setter)PyCFuncPtr_set_variadic,
|
||||
+ "specify if function takes variable number of arguments", NULL },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -5632,6 +5662,7 @@ PyInit__ctypes(void)
|
||||
PyModule_AddObject(m, "FUNCFLAG_USE_ERRNO", PyLong_FromLong(FUNCFLAG_USE_ERRNO));
|
||||
PyModule_AddObject(m, "FUNCFLAG_USE_LASTERROR", PyLong_FromLong(FUNCFLAG_USE_LASTERROR));
|
||||
PyModule_AddObject(m, "FUNCFLAG_PYTHONAPI", PyLong_FromLong(FUNCFLAG_PYTHONAPI));
|
||||
+ PyModule_AddObject(m, "FUNCFLAG_VARIADIC", PyLong_FromLong(FUNCFLAG_VARIADIC));
|
||||
PyModule_AddStringConstant(m, "__version__", "1.1.0");
|
||||
|
||||
PyModule_AddObject(m, "_memmove_addr", PyLong_FromVoidPtr(memmove));
|
||||
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
|
||||
index 9cbf9801ad..e7fe11176b 100644
|
||||
--- a/Modules/_ctypes/callproc.c
|
||||
+++ b/Modules/_ctypes/callproc.c
|
||||
@@ -754,7 +756,8 @@ static int _call_function_pointer(int flags,
|
||||
ffi_type **atypes,
|
||||
ffi_type *restype,
|
||||
void *resmem,
|
||||
- int argcount)
|
||||
+ int argcount,
|
||||
+ int argtypecount)
|
||||
{
|
||||
PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
|
||||
PyObject *error_object = NULL;
|
||||
@@ -780,15 +783,39 @@ static int _call_function_pointer(int flags,
|
||||
if ((flags & FUNCFLAG_CDECL) == 0)
|
||||
cc = FFI_STDCALL;
|
||||
#endif
|
||||
- if (FFI_OK != ffi_prep_cif(&cif,
|
||||
- cc,
|
||||
- argcount,
|
||||
- restype,
|
||||
- atypes)) {
|
||||
- PyErr_SetString(PyExc_RuntimeError,
|
||||
- "ffi_prep_cif failed");
|
||||
- return -1;
|
||||
+
|
||||
+#if HAVE_FFI_PREP_CIF_VAR
|
||||
+ /* Everyone SHOULD set f.variadic=True on variadic function pointers, but
|
||||
+ * lots of existing code will not. If there's at least one arg and more
|
||||
+ * args are passed than are defined in the prototype, then it must be a
|
||||
+ * variadic function. */
|
||||
+ if ((flags & FUNCFLAG_VARIADIC) ||
|
||||
+ (argtypecount != 0 && argcount > argtypecount))
|
||||
+ {
|
||||
+ if (FFI_OK != ffi_prep_cif_var(&cif,
|
||||
+ cc,
|
||||
+ argtypecount,
|
||||
+ argcount,
|
||||
+ restype,
|
||||
+ atypes)) {
|
||||
+ PyErr_SetString(PyExc_RuntimeError,
|
||||
+ "ffi_prep_cif_var failed");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ } else {
|
||||
+#endif
|
||||
+ if (FFI_OK != ffi_prep_cif(&cif,
|
||||
+ cc,
|
||||
+ argcount,
|
||||
+ restype,
|
||||
+ atypes)) {
|
||||
+ PyErr_SetString(PyExc_RuntimeError,
|
||||
+ "ffi_prep_cif failed");
|
||||
+ return -1;
|
||||
+ }
|
||||
+#if HAVE_FFI_PREP_CIF_VAR
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (flags & (FUNCFLAG_USE_ERRNO | FUNCFLAG_USE_LASTERROR)) {
|
||||
error_object = _ctypes_get_errobj(&space);
|
||||
@@ -1187,9 +1214,8 @@ PyObject *_ctypes_callproc(PPROC pProc,
|
||||
|
||||
if (-1 == _call_function_pointer(flags, pProc, avalues, atypes,
|
||||
rtype, resbuf,
|
||||
- Py_SAFE_DOWNCAST(argcount,
|
||||
- Py_ssize_t,
|
||||
- int)))
|
||||
+ Py_SAFE_DOWNCAST(argcount, Py_ssize_t, int),
|
||||
+ Py_SAFE_DOWNCAST(argtype_count, Py_ssize_t, int)))
|
||||
goto cleanup;
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
diff --git a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h
|
||||
index e58f85233c..e45975f6ad 100644
|
||||
--- a/Modules/_ctypes/ctypes.h
|
||||
+++ b/Modules/_ctypes/ctypes.h
|
||||
@@ -285,6 +285,7 @@ PyObject *_ctypes_callproc(PPROC pProc,
|
||||
#define FUNCFLAG_PYTHONAPI 0x4
|
||||
#define FUNCFLAG_USE_ERRNO 0x8
|
||||
#define FUNCFLAG_USE_LASTERROR 0x10
|
||||
+#define FUNCFLAG_VARIADIC 0x20
|
||||
|
||||
#define TYPEFLAG_ISPOINTER 0x100
|
||||
#define TYPEFLAG_HASPOINTER 0x200
|
||||
diff --git a/setup.py b/setup.py
|
||||
index bf90600eaa..48ff120e9a 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -142,6 +142,13 @@ def macosx_sdk_root():
|
||||
|
||||
return MACOS_SDK_ROOT
|
||||
|
||||
+def is_macosx_at_least(vers):
|
||||
+ if host_platform == 'darwin':
|
||||
+ dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
|
||||
+ if dep_target:
|
||||
+ return tuple(map(int, str(dep_target).split('.'))) >= vers
|
||||
+ return False
|
||||
+
|
||||
def is_macosx_sdk_path(path):
|
||||
"""
|
||||
Returns True if 'path' can be located in an OSX SDK
|
||||
@@ -150,6 +157,13 @@ def is_macosx_sdk_path(path):
|
||||
or path.startswith('/System/')
|
||||
or path.startswith('/Library/') )
|
||||
|
||||
+def grep_headers_for(function, headers):
|
||||
+ for header in headers:
|
||||
+ with open(header, 'r') as f:
|
||||
+ if function in f.read():
|
||||
+ return True
|
||||
+ return False
|
||||
+
|
||||
def find_file(filename, std_dirs, paths):
|
||||
"""Searches for the directory where a given file is located,
|
||||
and returns a possibly-empty list of additional directories, or None
|
||||
@@ -1972,7 +1986,11 @@ class PyBuildExt(build_ext):
|
||||
return True
|
||||
|
||||
def detect_ctypes(self, inc_dirs, lib_dirs):
|
||||
- self.use_system_libffi = False
|
||||
+ if not sysconfig.get_config_var("LIBFFI_INCLUDEDIR") and is_macosx_at_least((10,15)):
|
||||
+ self.use_system_libffi = True
|
||||
+ else:
|
||||
+ self.use_system_libffi = '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS")
|
||||
+
|
||||
include_dirs = []
|
||||
extra_compile_args = []
|
||||
extra_link_args = []
|
||||
@@ -2018,30 +2036,47 @@ class PyBuildExt(build_ext):
|
||||
libraries=['m'])
|
||||
self.extensions.extend([ext, ext_test])
|
||||
|
||||
+ ffi_inc = sysconfig.get_config_var("LIBFFI_INCLUDEDIR")
|
||||
+ ffi_lib = None
|
||||
+
|
||||
if host_platform == 'darwin':
|
||||
- if '--with-system-ffi' not in sysconfig.get_config_var("CONFIG_ARGS"):
|
||||
+ if not self.use_system_libffi:
|
||||
return
|
||||
- # OS X 10.5 comes with libffi.dylib; the include files are
|
||||
- # in /usr/include/ffi
|
||||
- inc_dirs.append('/usr/include/ffi')
|
||||
-
|
||||
- ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
|
||||
- if not ffi_inc or ffi_inc[0] == '':
|
||||
- ffi_inc = find_file('ffi.h', [], inc_dirs)
|
||||
- if ffi_inc is not None:
|
||||
- ffi_h = ffi_inc[0] + '/ffi.h'
|
||||
+ ffi_in_sdk = os.path.join(macosx_sdk_root(), "usr/include/ffi")
|
||||
+ if os.path.exists(ffi_in_sdk):
|
||||
+ ffi_inc = ffi_in_sdk
|
||||
+ ffi_lib = 'ffi'
|
||||
+ else:
|
||||
+ # OS X 10.5 comes with libffi.dylib; the include files are
|
||||
+ # in /usr/include/ffi
|
||||
+ inc_dirs.append('/usr/include/ffi')
|
||||
+
|
||||
+ if not ffi_inc:
|
||||
+ found = find_file('ffi.h', [], inc_dirs)
|
||||
+ if found:
|
||||
+ ffi_inc = found[0]
|
||||
+ if ffi_inc:
|
||||
+ ffi_h = ffi_inc + '/ffi.h'
|
||||
if not os.path.exists(ffi_h):
|
||||
ffi_inc = None
|
||||
print('Header file {} does not exist'.format(ffi_h))
|
||||
- ffi_lib = None
|
||||
- if ffi_inc is not None:
|
||||
- for lib_name in ('ffi', 'ffi_pic'):
|
||||
+
|
||||
+ if ffi_lib is None and ffi_inc:
|
||||
+ for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
|
||||
if (self.compiler.find_library_file(lib_dirs, lib_name)):
|
||||
ffi_lib = lib_name
|
||||
break
|
||||
|
||||
if ffi_inc and ffi_lib:
|
||||
- ext.include_dirs.extend(ffi_inc)
|
||||
+ ffi_headers = glob(os.path.join(ffi_inc, '*.h'))
|
||||
+ if grep_headers_for('ffi_closure_alloc', ffi_headers):
|
||||
+ try:
|
||||
+ sources.remove('_ctypes/malloc_closure.c')
|
||||
+ except ValueError:
|
||||
+ pass
|
||||
+ if grep_headers_for('ffi_prep_cif_var', ffi_headers):
|
||||
+ ext.extra_compile_args.append("-DHAVE_FFI_PREP_CIF_VAR=1")
|
||||
+ ext.include_dirs.append(ffi_inc)
|
||||
ext.libraries.append(ffi_lib)
|
||||
self.use_system_libffi = True
|
||||
|
||||
--
|
||||
2.30.1 (Apple Git-130)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From f2595c038ed7bfd182d9d05d83786106ebd02ca0 Mon Sep 17 00:00:00 2001
|
||||
From: Lawrence D'Anna <64555057+lawrence-danna-apple@users.noreply.github.com>
|
||||
Date: Tue, 30 Jun 2020 02:15:46 -0700
|
||||
Subject: [PATCH] bpo-41100: fix _decimal for arm64 Mac OS (GH-21228)
|
||||
|
||||
Patch by Lawrence Danna.
|
||||
---
|
||||
.../Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst | 1 +
|
||||
Modules/_decimal/libmpdec/mpdecimal.h | 3 +++
|
||||
2 files changed, 4 insertions(+)
|
||||
create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst
|
||||
new file mode 100644
|
||||
index 0000000000..d6176d69f0
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-06-30-04-44-29.bpo-41100.PJwA6F.rst
|
||||
@@ -0,0 +1 @@
|
||||
+add arm64 to the allowable Mac OS arches in mpdecimal.h
|
||||
\ No newline at end of file
|
||||
diff --git a/Modules/_decimal/libmpdec/mpdecimal.h b/Modules/_decimal/libmpdec/mpdecimal.h
|
||||
index a67dd9bc12..3e9c8185c3 100644
|
||||
--- a/Modules/_decimal/libmpdec/mpdecimal.h
|
||||
+++ b/Modules/_decimal/libmpdec/mpdecimal.h
|
||||
@@ -135,6 +135,9 @@ const char *mpd_version(void);
|
||||
#elif defined(__x86_64__)
|
||||
#define CONFIG_64
|
||||
#define ASM
|
||||
+ #elif defined(__arm64__)
|
||||
+ #define CONFIG_64
|
||||
+ #define ANSI
|
||||
#else
|
||||
#error "unknown architecture for universal build."
|
||||
#endif
|
||||
--
|
||||
2.37.3
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From 245427d207ee88a4ba26a66c3de350bcbcc036f2 Mon Sep 17 00:00:00 2001
|
||||
From: Ronald Oussoren <ronaldoussoren@mac.com>
|
||||
Date: Sat, 14 Nov 2020 16:07:47 +0100
|
||||
Subject: [PATCH] bpo-42351: Avoid error when opening header with non-UTF8
|
||||
encoding (GH-23279)
|
||||
|
||||
grep_headers_for() would error out when a header contained
|
||||
text that cannot be interpreted as UTF-8.
|
||||
|
||||
cherry-picked from 7a27c7ed4b by Pedro Fonini <fonini@ip.tv>
|
||||
---
|
||||
setup.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index f211989aac..467362813d 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -159,7 +159,7 @@ def is_macosx_sdk_path(path):
|
||||
|
||||
def grep_headers_for(function, headers):
|
||||
for header in headers:
|
||||
- with open(header, 'r') as f:
|
||||
+ with open(header, 'r', errors='surrogateescape') as f:
|
||||
if function in f.read():
|
||||
return True
|
||||
return False
|
||||
--
|
||||
2.34.1
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/test/v3ext.c b/test/v3ext.c
|
||||
index 7a240cd706..6cec6f1a9b 100644
|
||||
--- a/test/v3ext.c
|
||||
+++ b/test/v3ext.c
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <openssl/err.h>
|
||||
#include "internal/nelem.h"
|
||||
|
||||
+#include <string.h>
|
||||
#include "testutil.h"
|
||||
|
||||
static const char *infile;
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/test/v3ext.c b/test/v3ext.c
|
||||
index 7a240cd706..6cec6f1a9b 100644
|
||||
--- a/test/v3ext.c
|
||||
+++ b/test/v3ext.c
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <openssl/err.h>
|
||||
#include "internal/nelem.h"
|
||||
|
||||
+#include <string.h>
|
||||
#include "testutil.h"
|
||||
|
||||
static const char *infile;
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/test/v3ext.c b/test/v3ext.c
|
||||
index 7a240cd706..6cec6f1a9b 100644
|
||||
--- a/test/v3ext.c
|
||||
+++ b/test/v3ext.c
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <openssl/err.h>
|
||||
#include "internal/nelem.h"
|
||||
|
||||
+#include <string.h>
|
||||
#include "testutil.h"
|
||||
|
||||
static const char *infile;
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/test/v3ext.c b/test/v3ext.c
|
||||
index 7a240cd706..6cec6f1a9b 100644
|
||||
--- a/test/v3ext.c
|
||||
+++ b/test/v3ext.c
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <openssl/err.h>
|
||||
#include "internal/nelem.h"
|
||||
|
||||
+#include <string.h>
|
||||
#include "testutil.h"
|
||||
|
||||
static const char *infile;
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/test/v3ext.c b/test/v3ext.c
|
||||
index 7a240cd706..6cec6f1a9b 100644
|
||||
--- a/test/v3ext.c
|
||||
+++ b/test/v3ext.c
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <openssl/err.h>
|
||||
#include "internal/nelem.h"
|
||||
|
||||
+#include <string.h>
|
||||
#include "testutil.h"
|
||||
|
||||
static const char *infile;
|
||||
81
plugins/python-build/share/python-build/pypy2.7-7.3.10
Normal file
81
plugins/python-build/share/python-build/pypy2.7-7.3.10
Normal file
@@ -0,0 +1,81 @@
|
||||
VERSION='7.3.10'
|
||||
PYVER='2.7'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
aarch64_hash=274342f0e75e99d60ba7a0cfb0e13792e7664163e01450d2f7f2f7825603a0ae
|
||||
linux32_hash=0b17132f62d2a0c3c4572c57eb53820f25611afad71f3d6a310202942baed6e1
|
||||
linux64_hash=461fb6df524208af9e94ffb16989f628b585bdb4b9e97d81e668899fc3a064a3
|
||||
osarm64_hash=14b178f005603e3df6db7574b77b9c65ae79feda1a629214cafcb4eee7da679d
|
||||
osx64_hash=188551185ee945d5e42a3a619205d02ac31db77bdd5d98b6c11469e125c3bdb5
|
||||
s390x_hash=0fac1ec1e05c70941f758be05d40ce7ffe6a42c0416e70b55d40a7523e3e70ae
|
||||
|
||||
### 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
|
||||
;;
|
||||
's390x' )
|
||||
hash="${s390x_hash}"
|
||||
;;
|
||||
* )
|
||||
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'
|
||||
14
plugins/python-build/share/python-build/pypy2.7-7.3.10-src
Normal file
14
plugins/python-build/share/python-build/pypy2.7-7.3.10-src
Normal file
@@ -0,0 +1,14 @@
|
||||
VERSION='7.3.10'
|
||||
PYVER='2.7'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
hash=35e2cf4519cb51c4d5ffb4493ee24f0c7f42b4b04944903ca4b33981a04a3bc5
|
||||
|
||||
### 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'
|
||||
81
plugins/python-build/share/python-build/pypy2.7-7.3.11
Normal file
81
plugins/python-build/share/python-build/pypy2.7-7.3.11
Normal file
@@ -0,0 +1,81 @@
|
||||
VERSION='7.3.11'
|
||||
PYVER='2.7'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
aarch64_hash=ea924da1defe9325ef760e288b04f984614e405580f5321eb6a5c8f539bd415a
|
||||
linux32_hash=30fd245fab7068c96a75b9ff1323ac55174c64fc8c4751cceb4b7a9bedc1851e
|
||||
linux64_hash=ba8ed958a905c0735a4cfff2875c25089954dc020e087d982b0ffa5b9da316cd
|
||||
osarm64_hash=cc5696ab4f93cd3481c1e4990b5dedd7ba60ac0602fa1890d368889a6c5bf771
|
||||
osx64_hash=56deee9c22640f5686c35b9d64fdb1ce3abd044583e4078f0b171ca2fd2a198e
|
||||
s390x_hash=8fe9481c473178e53266983678684a70fe0c42bafc95f1807bf3ef28770316d4
|
||||
|
||||
### 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
|
||||
;;
|
||||
's390x' )
|
||||
hash="${s390x_hash}"
|
||||
;;
|
||||
* )
|
||||
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'
|
||||
14
plugins/python-build/share/python-build/pypy2.7-7.3.11-src
Normal file
14
plugins/python-build/share/python-build/pypy2.7-7.3.11-src
Normal file
@@ -0,0 +1,14 @@
|
||||
VERSION='7.3.11'
|
||||
PYVER='2.7'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
hash=1117afb66831da4ea6f39d8d2084787a74689fd0229de0be301f9ed9b255093c
|
||||
|
||||
### 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'
|
||||
@@ -11,29 +11,38 @@ win64_hash=ca7b0f4c576995b388cfb4c796e3f6f20b037e5314571bf267daa068a3a2af31
|
||||
|
||||
### end of manual settings - following lines same for every download
|
||||
|
||||
function pypy_pkg_data {
|
||||
# pypy architecture
|
||||
local ARCH="${1}"
|
||||
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
|
||||
}
|
||||
|
||||
local basesrc="pypy${PYVER}-${VERSION}-src"
|
||||
local basever="pypy${PYVER}-v${VERSION}"
|
||||
local baseurl="https://downloads.python.org/pypy/${basever}"
|
||||
function pypy_pkg_data {
|
||||
# pypy architecture tag
|
||||
local ARCH="${1}"
|
||||
|
||||
# defaults
|
||||
local cmd='install_package' # use bz2
|
||||
local pkg="${ARCH}" # assume matches
|
||||
local url="${baseurl}-${pkg}.tar.bz2" # use bz2
|
||||
local ext='tar.bz2' # windows is always diff...
|
||||
local hash='' # undefined
|
||||
|
||||
case "${pkg}" in
|
||||
# select the hash, fix pkg if not match ARCH, windows has ext of zip
|
||||
case "${ARCH}" in
|
||||
'linux-aarch64' )
|
||||
hash="${aarch64_hash}"
|
||||
url="${baseurl}-aarch64.tar.bz2" # diff url
|
||||
pkg='aarch64'
|
||||
;;
|
||||
'linux' )
|
||||
hash="${linux32_hash}"
|
||||
pkg='linux32' # package name revised
|
||||
url="${baseurl}-${pkg}.tar.bz2" # new url
|
||||
pkg='linux32'
|
||||
;;
|
||||
'linux64' )
|
||||
hash="${linux64_hash}"
|
||||
@@ -42,13 +51,7 @@ function pypy_pkg_data {
|
||||
if require_osx_version "10.13"; then
|
||||
hash="${osx64_hash}"
|
||||
else
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
|
||||
echo "try '${basesrc}' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
err_no_binary "${ARCH}, OS X < 10.13"
|
||||
fi
|
||||
;;
|
||||
's390x' )
|
||||
@@ -57,21 +60,18 @@ function pypy_pkg_data {
|
||||
'win64' )
|
||||
hash="${win64_hash}"
|
||||
cmd='install_zip' # diff command
|
||||
url="${baseurl}-${pkg}.zip" # zip rather than bz2
|
||||
ext='zip' # zip rather than bz2
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
|
||||
echo "try '${basesrc}' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
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}" "${url}#${hash}"
|
||||
echo "${cmd}" "${basever}-${pkg}" "${baseurl}-${pkg}.${ext}#${hash}"
|
||||
}
|
||||
|
||||
# determine command, package directory, url+hash
|
||||
|
||||
@@ -11,29 +11,38 @@ win64_hash=8acb184b48fb3c854de0662e4d23a66b90e73b1ab73a86695022c12c745d8b00
|
||||
|
||||
### end of manual settings - following lines same for every download
|
||||
|
||||
function pypy_pkg_data {
|
||||
# pypy architecture
|
||||
local ARCH="${1}"
|
||||
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
|
||||
}
|
||||
|
||||
local basesrc="pypy${PYVER}-${VERSION}-src"
|
||||
local basever="pypy${PYVER}-v${VERSION}"
|
||||
local baseurl="https://downloads.python.org/pypy/${basever}"
|
||||
function pypy_pkg_data {
|
||||
# pypy architecture tag
|
||||
local ARCH="${1}"
|
||||
|
||||
# defaults
|
||||
local cmd='install_package' # use bz2
|
||||
local pkg="${ARCH}" # assume matches
|
||||
local url="${baseurl}-${pkg}.tar.bz2" # use bz2
|
||||
local ext='tar.bz2' # windows is always diff...
|
||||
local hash='' # undefined
|
||||
|
||||
case "${pkg}" in
|
||||
# select the hash, fix pkg if not match ARCH, windows has ext of zip
|
||||
case "${ARCH}" in
|
||||
'linux-aarch64' )
|
||||
hash="${aarch64_hash}"
|
||||
url="${baseurl}-aarch64.tar.bz2" # diff url
|
||||
pkg='aarch64'
|
||||
;;
|
||||
'linux' )
|
||||
hash="${linux32_hash}"
|
||||
pkg='linux32' # package name revised
|
||||
url="${baseurl}-${pkg}.tar.bz2" # new url
|
||||
pkg='linux32'
|
||||
;;
|
||||
'linux64' )
|
||||
hash="${linux64_hash}"
|
||||
@@ -42,13 +51,7 @@ function pypy_pkg_data {
|
||||
if require_osx_version "10.13"; then
|
||||
hash="${osx64_hash}"
|
||||
else
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
|
||||
echo "try '${basesrc}' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
err_no_binary "${ARCH}, OS X < 10.13"
|
||||
fi
|
||||
;;
|
||||
's390x' )
|
||||
@@ -57,21 +60,18 @@ function pypy_pkg_data {
|
||||
'win64' )
|
||||
hash="${win64_hash}"
|
||||
cmd='install_zip' # diff command
|
||||
url="${baseurl}-${pkg}.zip" # zip rather than bz2
|
||||
ext='zip' # zip rather than bz2
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
|
||||
echo "try '${basesrc}' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
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}" "${url}#${hash}"
|
||||
echo "${cmd}" "${basever}-${pkg}" "${baseurl}-${pkg}.${ext}#${hash}"
|
||||
}
|
||||
|
||||
# determine command, package directory, url+hash
|
||||
|
||||
81
plugins/python-build/share/python-build/pypy3.8-7.3.10
Normal file
81
plugins/python-build/share/python-build/pypy3.8-7.3.10
Normal file
@@ -0,0 +1,81 @@
|
||||
VERSION='7.3.10'
|
||||
PYVER='3.8'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
aarch64_hash=e4caa1a545f22cfee87d5b9aa6f8852347f223643ad7d2562e0b2a2f4663ad98
|
||||
linux32_hash=b70ed7fdc73a74ebdc04f07439f7bad1a849aaca95e26b4a74049d0e483f071c
|
||||
linux64_hash=ceef6496fd4ab1c99e3ec22ce657b8f10f8bb77a32427fadfb5e1dd943806011
|
||||
osarm64_hash=6cb1429371e4854b718148a509d80143f801e3abfc72fef58d88aeeee1e98f9e
|
||||
osx64_hash=399eb1ce4c65f62f6a096b7c273536601b7695e3c0dc0457393a659b95b7615b
|
||||
s390x_hash=c294f8e815158388628fe77ac5b8ad6cd93c8db1359091fa02d41cf6da4d61a1
|
||||
|
||||
### 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
|
||||
;;
|
||||
's390x' )
|
||||
hash="${s390x_hash}"
|
||||
;;
|
||||
* )
|
||||
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'
|
||||
14
plugins/python-build/share/python-build/pypy3.8-7.3.10-src
Normal file
14
plugins/python-build/share/python-build/pypy3.8-7.3.10-src
Normal file
@@ -0,0 +1,14 @@
|
||||
VERSION='7.3.10'
|
||||
PYVER='3.8'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
hash=218a1e062f17aba89f61bc398e8498f13c048b9fcf294343f5d9d56c3ac9b882
|
||||
|
||||
### 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'
|
||||
81
plugins/python-build/share/python-build/pypy3.8-7.3.11
Normal file
81
plugins/python-build/share/python-build/pypy3.8-7.3.11
Normal file
@@ -0,0 +1,81 @@
|
||||
VERSION='7.3.11'
|
||||
PYVER='3.8'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
aarch64_hash=9a2fa0b8d92b7830aa31774a9a76129b0ff81afbd22cd5c41fbdd9119e859f55
|
||||
linux32_hash=a79b31fce8f5bc1f9940b6777134189a1d3d18bda4b1c830384cda90077c9176
|
||||
linux64_hash=470330e58ac105c094041aa07bb05676b06292bc61409e26f5c5593ebb2292d9
|
||||
osarm64_hash=78cdc79ff964c4bfd13eb45a7d43a011cbe8d8b513323d204891f703fdc4fa1a
|
||||
osx64_hash=194ca0b4d91ae409a9cb1a59eb7572d7affa8a451ea3daf26539aa515443433a
|
||||
s390x_hash=eab7734d86d96549866f1cba67f4f9c73c989f6a802248beebc504080d4c3fcd
|
||||
|
||||
### 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
|
||||
;;
|
||||
's390x' )
|
||||
hash="${s390x_hash}"
|
||||
;;
|
||||
* )
|
||||
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'
|
||||
14
plugins/python-build/share/python-build/pypy3.8-7.3.11-src
Normal file
14
plugins/python-build/share/python-build/pypy3.8-7.3.11-src
Normal file
@@ -0,0 +1,14 @@
|
||||
VERSION='7.3.11'
|
||||
PYVER='3.8'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
hash=4d6769bfca73734e8666fd70503b7ceb06a6e259110e617331bb3899ca4e6058
|
||||
|
||||
### 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'
|
||||
@@ -11,29 +11,38 @@ win64_hash=05022baaa55db2b60880f2422312d9e4025e1267303ac57f33e8253559d0be88
|
||||
|
||||
### end of manual settings - following lines same for every download
|
||||
|
||||
function pypy_pkg_data {
|
||||
# pypy architecture
|
||||
local ARCH="${1}"
|
||||
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
|
||||
}
|
||||
|
||||
local basesrc="pypy${PYVER}-${VERSION}-src"
|
||||
local basever="pypy${PYVER}-v${VERSION}"
|
||||
local baseurl="https://downloads.python.org/pypy/${basever}"
|
||||
function pypy_pkg_data {
|
||||
# pypy architecture tag
|
||||
local ARCH="${1}"
|
||||
|
||||
# defaults
|
||||
local cmd='install_package' # use bz2
|
||||
local pkg="${ARCH}" # assume matches
|
||||
local url="${baseurl}-${pkg}.tar.bz2" # use bz2
|
||||
local ext='tar.bz2' # windows is always diff...
|
||||
local hash='' # undefined
|
||||
|
||||
case "${pkg}" in
|
||||
# select the hash, fix pkg if not match ARCH, windows has ext of zip
|
||||
case "${ARCH}" in
|
||||
'linux-aarch64' )
|
||||
hash="${aarch64_hash}"
|
||||
url="${baseurl}-aarch64.tar.bz2" # diff url
|
||||
pkg='aarch64'
|
||||
;;
|
||||
'linux' )
|
||||
hash="${linux32_hash}"
|
||||
pkg='linux32' # package name revised
|
||||
url="${baseurl}-${pkg}.tar.bz2" # new url
|
||||
pkg='linux32'
|
||||
;;
|
||||
'linux64' )
|
||||
hash="${linux64_hash}"
|
||||
@@ -42,13 +51,7 @@ function pypy_pkg_data {
|
||||
if require_osx_version "10.13"; then
|
||||
hash="${osx64_hash}"
|
||||
else
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
|
||||
echo "try '${basesrc}' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
err_no_binary "${ARCH}, OS X < 10.13"
|
||||
fi
|
||||
;;
|
||||
's390x' )
|
||||
@@ -57,21 +60,18 @@ function pypy_pkg_data {
|
||||
'win64' )
|
||||
hash="${win64_hash}"
|
||||
cmd='install_zip' # diff command
|
||||
url="${baseurl}-${pkg}.zip" # zip rather than bz2
|
||||
ext='zip' # zip rather than bz2
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
|
||||
echo "try '${basesrc}' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
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}" "${url}#${hash}"
|
||||
echo "${cmd}" "${basever}-${pkg}" "${baseurl}-${pkg}.${ext}#${hash}"
|
||||
}
|
||||
|
||||
# determine command, package directory, url+hash
|
||||
|
||||
81
plugins/python-build/share/python-build/pypy3.9-7.3.10
Normal file
81
plugins/python-build/share/python-build/pypy3.9-7.3.10
Normal file
@@ -0,0 +1,81 @@
|
||||
VERSION='7.3.10'
|
||||
PYVER='3.9'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
aarch64_hash=657a04fd9a5a992a2f116a9e7e9132ea0c578721f59139c9fb2083775f71e514
|
||||
linux32_hash=b6db59613b9a1c0c1ab87bc103f52ee95193423882dc8a848b68850b8ba59cc5
|
||||
linux64_hash=95cf99406179460d63ddbfe1ec870f889d05f7767ce81cef14b88a3a9e127266
|
||||
osarm64_hash=e2a6bec7408e6497c7de8165aa4a1b15e2416aec4a72f2578f793fb06859ccba
|
||||
osx64_hash=f90c8619b41e68ec9ffd7d5e913fe02e60843da43d3735b1c1bc75bcfe638d97
|
||||
s390x_hash=ca6525a540cf0c682d1592ae35d3fbc97559a97260e4b789255cc76dde7a14f0
|
||||
|
||||
### 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
|
||||
;;
|
||||
's390x' )
|
||||
hash="${s390x_hash}"
|
||||
;;
|
||||
* )
|
||||
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'
|
||||
14
plugins/python-build/share/python-build/pypy3.9-7.3.10-src
Normal file
14
plugins/python-build/share/python-build/pypy3.9-7.3.10-src
Normal file
@@ -0,0 +1,14 @@
|
||||
VERSION='7.3.10'
|
||||
PYVER='3.9'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
hash=3738d32575ed2513e3e66878e4e4c6c208caed267570f3f9f814748830002967
|
||||
|
||||
### 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'
|
||||
81
plugins/python-build/share/python-build/pypy3.9-7.3.11
Normal file
81
plugins/python-build/share/python-build/pypy3.9-7.3.11
Normal file
@@ -0,0 +1,81 @@
|
||||
VERSION='7.3.11'
|
||||
PYVER='3.9'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
aarch64_hash=09175dc652ed895d98e9ad63d216812bf3ee7e398d900a9bf9eb2906ba8302b9
|
||||
linux32_hash=0099d72c2897b229057bff7e2c343624aeabdc60d6fb43ca882bff082f1ffa48
|
||||
linux64_hash=d506172ca11071274175d74e9c581c3166432d0179b036470e3b9e8d20eae581
|
||||
osarm64_hash=91ad7500f1a39531dbefa0b345a3dcff927ff9971654e8d2e9ef7c5ae311f57e
|
||||
osx64_hash=d33f40b207099872585afd71873575ca6ea638a27d823bc621238c5ae82542ed
|
||||
s390x_hash=e1f30f2ddbe3f446ddacd79677b958d56c07463b20171fb2abf8f9a3178b79fc
|
||||
|
||||
### 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
|
||||
;;
|
||||
's390x' )
|
||||
hash="${s390x_hash}"
|
||||
;;
|
||||
* )
|
||||
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'
|
||||
14
plugins/python-build/share/python-build/pypy3.9-7.3.11-src
Normal file
14
plugins/python-build/share/python-build/pypy3.9-7.3.11-src
Normal file
@@ -0,0 +1,14 @@
|
||||
VERSION='7.3.11'
|
||||
PYVER='3.9'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
hash=b0f3166fb2a5aadfd5ceb9db5cdd5f7929a0eccca02b4a26c0dae0492f7ca8ea
|
||||
|
||||
### 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'
|
||||
@@ -11,29 +11,38 @@ win64_hash=be48ab42f95c402543a7042c999c9433b17e55477c847612c8733a583ca6dff5
|
||||
|
||||
### end of manual settings - following lines same for every download
|
||||
|
||||
function pypy_pkg_data {
|
||||
# pypy architecture
|
||||
local ARCH="${1}"
|
||||
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
|
||||
}
|
||||
|
||||
local basesrc="pypy${PYVER}-${VERSION}-src"
|
||||
local basever="pypy${PYVER}-v${VERSION}"
|
||||
local baseurl="https://downloads.python.org/pypy/${basever}"
|
||||
function pypy_pkg_data {
|
||||
# pypy architecture tag
|
||||
local ARCH="${1}"
|
||||
|
||||
# defaults
|
||||
local cmd='install_package' # use bz2
|
||||
local pkg="${ARCH}" # assume matches
|
||||
local url="${baseurl}-${pkg}.tar.bz2" # use bz2
|
||||
local ext='tar.bz2' # windows is always diff...
|
||||
local hash='' # undefined
|
||||
|
||||
case "${pkg}" in
|
||||
# select the hash, fix pkg if not match ARCH, windows has ext of zip
|
||||
case "${ARCH}" in
|
||||
'linux-aarch64' )
|
||||
hash="${aarch64_hash}"
|
||||
url="${baseurl}-aarch64.tar.bz2" # diff url
|
||||
pkg='aarch64'
|
||||
;;
|
||||
'linux' )
|
||||
hash="${linux32_hash}"
|
||||
pkg='linux32' # package name revised
|
||||
url="${baseurl}-${pkg}.tar.bz2" # new url
|
||||
pkg='linux32'
|
||||
;;
|
||||
'linux64' )
|
||||
hash="${linux64_hash}"
|
||||
@@ -42,13 +51,7 @@ function pypy_pkg_data {
|
||||
if require_osx_version "10.13"; then
|
||||
hash="${osx64_hash}"
|
||||
else
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
|
||||
echo "try '${basesrc}' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
err_no_binary "${ARCH}, OS X < 10.13"
|
||||
fi
|
||||
;;
|
||||
's390x' )
|
||||
@@ -57,21 +60,18 @@ function pypy_pkg_data {
|
||||
'win64' )
|
||||
hash="${win64_hash}"
|
||||
cmd='install_zip' # diff command
|
||||
url="${baseurl}-${pkg}.zip" # zip rather than bz2
|
||||
ext='zip' # zip rather than bz2
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
|
||||
echo "try '${basesrc}' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
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}" "${url}#${hash}"
|
||||
echo "${cmd}" "${basever}-${pkg}" "${baseurl}-${pkg}.${ext}#${hash}"
|
||||
}
|
||||
|
||||
# determine command, package directory, url+hash
|
||||
|
||||
23
plugins/python-build/share/python-build/pyston-2.3.5
Normal file
23
plugins/python-build/share/python-build/pyston-2.3.5
Normal file
@@ -0,0 +1,23 @@
|
||||
# sha256sum used for checksum values
|
||||
|
||||
# version of pyston
|
||||
VER='2.3.5'
|
||||
# alias for download location
|
||||
DOWNLOAD='https://github.com/pyston/pyston/releases/download'
|
||||
|
||||
case "$(pyston_architecture 2>/dev/null || true)" in
|
||||
"linux64" )
|
||||
install_package "pyston_${VER}_portable_amd64" "${DOWNLOAD}/pyston_${VER}/pyston_${VER}_portable_amd64.tar.gz#c71c711d60a9c18f243a9e30fd35e0818674ae96f534c67c27b0cdfbc9132ef8" "pyston" verify_py38 get_pip
|
||||
;;
|
||||
"linux-aarch64" )
|
||||
install_package "pyston_${VER}_portable_arm64" "${DOWNLOAD}/pyston_${VER}/pyston_${VER}_portable_arm64.tar.gz#c578cb806c62d9dca8728f190a87e172305bd80887e206df42c4c5658ab469c1" "pyston" verify_py38 get_pip
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": A Pyston ${VER} binary is not available for $(pyston_architecture 2>/dev/null || true)."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -35,7 +35,7 @@ tarball() {
|
||||
|
||||
executable "$configure" <<OUT
|
||||
#!$BASH
|
||||
echo "$name: CPPFLAGS=\\"\$CPPFLAGS\\" LDFLAGS=\\"\$LDFLAGS\\"" >> build.log
|
||||
echo "$name: CPPFLAGS=\\"\$CPPFLAGS\\" LDFLAGS=\\"\$LDFLAGS\\" PKG_CONFIG_PATH=\\"\$PKG_CONFIG_PATH\\"" >> build.log
|
||||
echo "$name: \$@" \${PYTHONOPT:+PYTHONOPT=\$PYTHONOPT} >> build.log
|
||||
OUT
|
||||
|
||||
@@ -62,7 +62,7 @@ assert_build_log() {
|
||||
cached_tarball "yaml-0.1.6"
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
||||
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
||||
stub brew false
|
||||
stub_make_install
|
||||
stub_make_install
|
||||
@@ -74,12 +74,12 @@ assert_build_log() {
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
yaml-0.1.6: --prefix=$INSTALL_ROOT
|
||||
make -j 2
|
||||
make install
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
@@ -89,7 +89,7 @@ OUT
|
||||
cached_tarball "yaml-0.1.6"
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
||||
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
||||
stub brew false
|
||||
stub_make_install
|
||||
stub_make_install
|
||||
@@ -103,13 +103,13 @@ OUT
|
||||
unstub patch
|
||||
|
||||
assert_build_log <<OUT
|
||||
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
yaml-0.1.6: --prefix=$INSTALL_ROOT
|
||||
make -j 2
|
||||
make install
|
||||
patch -p0 --force -i $TMP/python-patch.XXX
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
@@ -119,7 +119,7 @@ OUT
|
||||
cached_tarball "yaml-0.1.6"
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
||||
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
||||
stub brew false
|
||||
stub_make_install
|
||||
stub_make_install
|
||||
@@ -133,13 +133,13 @@ OUT
|
||||
unstub patch
|
||||
|
||||
assert_build_log <<OUT
|
||||
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
yaml-0.1.6: --prefix=$INSTALL_ROOT
|
||||
make -j 2
|
||||
make install
|
||||
patch -p1 --force -i $TMP/python-patch.XXX
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
@@ -166,8 +166,8 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib"
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -L$BREW_PREFIX/lib -Wl,-rpath,$BREW_PREFIX/lib" PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
@@ -194,8 +194,8 @@ OUT
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I$brew_libdir/include -I${TMP}/install/include " LDFLAGS="-L$brew_libdir/lib -L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I$brew_libdir/include -I${TMP}/install/include " LDFLAGS="-L$brew_libdir/lib -L${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
@@ -205,7 +205,7 @@ OUT
|
||||
cached_tarball "yaml-0.1.6"
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
||||
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
||||
stub brew true; brew
|
||||
stub_make_install
|
||||
stub_make_install
|
||||
@@ -218,12 +218,12 @@ OUT
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
yaml-0.1.6: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
yaml-0.1.6: --prefix=${TMP}/install
|
||||
make -j 2
|
||||
make install
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
@@ -252,8 +252,8 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I$readline_libdir/include -I${TMP}/install/include " LDFLAGS="-L$readline_libdir/lib -L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I$readline_libdir/include -I${TMP}/install/include " LDFLAGS="-L$readline_libdir/lib -L${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
@@ -262,7 +262,7 @@ OUT
|
||||
@test "no library searches performed during normal operation touch homebrew in non-MacOS" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
for i in {1..8}; do stub uname '-s : echo Linux'; done
|
||||
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
||||
stub brew true; brew
|
||||
stub_make_install
|
||||
|
||||
@@ -276,8 +276,34 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "no library searches performed during normal operation touch homebrew if envvar is set" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
for i in {1..5}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||
stub brew true; brew
|
||||
stub_make_install
|
||||
export PYTHON_BUILD_SKIP_HOMEBREW=1
|
||||
|
||||
run_inline_definition <<DEF
|
||||
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
||||
DEF
|
||||
assert_success
|
||||
|
||||
unstub uname
|
||||
unstub brew
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
@@ -309,8 +335,8 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT CPPFLAGS=-I$readline_libdir/include LDFLAGS=-L$readline_libdir/lib --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT CPPFLAGS=-I$readline_libdir/include LDFLAGS=-L$readline_libdir/lib --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
@@ -343,8 +369,8 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=${TMP}/install --libdir=${TMP}/install/lib --with-tcltk-libs=-L${TMP}/homebrew-tcl-tk/lib -ltcl$tcl_tk_version -ltk$tcl_tk_version --with-tcltk-includes=-I${TMP}/homebrew-tcl-tk/include
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " PKG_CONFIG_PATH="${TMP}/homebrew-tcl-tk/lib/pkgconfig"
|
||||
Python-3.6.2: --prefix=${TMP}/install --enable-shared --libdir=${TMP}/install/lib --with-tcltk-libs=-L${TMP}/homebrew-tcl-tk/lib -ltcl$tcl_tk_version -ltk$tcl_tk_version --with-tcltk-includes=-I${TMP}/homebrew-tcl-tk/include
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
@@ -375,13 +401,46 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib --with-tcltk-libs=-L${TMP}/custom-tcl-tk/lib -ltcl8.6 -ltk8.6
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib --with-tcltk-libs=-L${TMP}/custom-tcl-tk/lib -ltcl8.6 -ltk8.6
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "tcl-tk is linked from Homebrew via pkgconfig only when envvar is set" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||
|
||||
tcl_tk_libdir="$TMP/homebrew-tcl-tk"
|
||||
mkdir -p "$tcl_tk_libdir/lib"
|
||||
|
||||
stub brew false
|
||||
for i in {1..2}; do stub brew "--prefix tcl-tk : echo '${tcl_tk_libdir}'"; done
|
||||
for i in {1..2}; do stub brew false; done
|
||||
|
||||
stub_make_install
|
||||
|
||||
run_inline_definition <<DEF
|
||||
export PYTHON_BUILD_TCLTK_USE_PKGCONFIG=1
|
||||
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
||||
DEF
|
||||
assert_success
|
||||
|
||||
unstub uname
|
||||
unstub sw_vers
|
||||
unstub brew
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " PKG_CONFIG_PATH="${TMP}/homebrew-tcl-tk/lib/pkgconfig"
|
||||
Python-3.6.2: --prefix=${TMP}/install --enable-shared --libdir=${TMP}/install/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
}
|
||||
@test "number of CPU cores defaults to 2" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
@@ -402,8 +461,8 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
@@ -430,8 +489,8 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 4
|
||||
make install
|
||||
OUT
|
||||
@@ -440,7 +499,7 @@ OUT
|
||||
@test "number of CPU cores is detected on FreeBSD" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
for i in {1..7}; do stub uname '-s : echo FreeBSD'; done
|
||||
for i in {1..8}; do stub uname '-s : echo FreeBSD'; done
|
||||
stub uname '-r : echo 11.0-RELEASE'
|
||||
for i in {1..2}; do stub uname '-s : echo FreeBSD'; done
|
||||
|
||||
@@ -458,8 +517,8 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 1
|
||||
make install
|
||||
OUT
|
||||
@@ -468,7 +527,7 @@ OUT
|
||||
@test "setting PYTHON_MAKE_INSTALL_OPTS to a multi-word string" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
for i in {1..8}; do stub uname '-s : echo Linux'; done
|
||||
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
||||
|
||||
stub_make_install
|
||||
|
||||
@@ -482,21 +541,48 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install DOGE="such wow"
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "setting MAKE_INSTALL_OPTS to a multi-word string" {
|
||||
@test "configuring with dSYM in MacOS" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
for i in {1..8}; do stub uname '-s : echo Linux'; done
|
||||
for i in {1..10}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||
for i in {1..4}; do stub brew false; done
|
||||
stub_make_install
|
||||
|
||||
export MAKE_INSTALL_OPTS="DOGE=\"such wow\""
|
||||
run_inline_definition <<DEF
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_DSYMUTIL=1
|
||||
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
||||
DEF
|
||||
assert_success
|
||||
|
||||
unstub sw_vers
|
||||
unstub uname
|
||||
unstub brew
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=${TMP}/install/lib --with-dsymutil
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "configuring with dSYM has no effect in non-MacOS" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
for i in {1..10}; do stub uname '-s : echo Linux'; done
|
||||
stub_make_install
|
||||
|
||||
run_inline_definition <<DEF
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_DSYMUTIL=1
|
||||
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
||||
DEF
|
||||
assert_success
|
||||
@@ -505,10 +591,10 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=${TMP}/install/lib
|
||||
make -j 2
|
||||
make install DOGE="such wow"
|
||||
make install
|
||||
OUT
|
||||
}
|
||||
|
||||
@@ -525,7 +611,7 @@ OUT
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
stub uname "-s : echo FreeBSD" "-r : echo 9.1"
|
||||
for i in {1..6}; do stub uname "-s : echo FreeBSD"; done
|
||||
for i in {1..7}; do stub uname "-s : echo FreeBSD"; done
|
||||
stub uname "-r : echo 9.1"
|
||||
for i in {1..2}; do stub uname "-s : echo FreeBSD"; done
|
||||
|
||||
@@ -542,7 +628,7 @@ OUT
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
stub uname "-s : echo FreeBSD" "-r : echo 10.0-RELEASE"
|
||||
for i in {1..6}; do stub uname "-s : echo FreeBSD"; done
|
||||
for i in {1..7}; do stub uname "-s : echo FreeBSD"; done
|
||||
stub uname "-r : echo 10.0-RELEASE"
|
||||
for i in {1..2}; do stub uname "-s : echo FreeBSD"; done
|
||||
|
||||
@@ -558,7 +644,7 @@ OUT
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
stub uname "-s : echo FreeBSD" "-r : echo 11.0-RELEASE"
|
||||
for i in {1..6}; do stub uname "-s : echo FreeBSD"; done
|
||||
for i in {1..7}; do stub uname "-s : echo FreeBSD"; done
|
||||
stub uname "-r : echo 11.0-RELEASE"
|
||||
for i in {1..2}; do stub uname "-s : echo FreeBSD"; done
|
||||
|
||||
@@ -579,7 +665,7 @@ apply -p1 -i /my/patch.diff
|
||||
exec ./configure "\$@"
|
||||
CONF
|
||||
|
||||
for i in {1..8}; do stub uname '-s : echo Linux'; done
|
||||
for i in {1..9}; do stub uname '-s : echo Linux'; done
|
||||
stub apply 'echo apply "$@" >> build.log'
|
||||
stub_make_install
|
||||
|
||||
@@ -595,8 +681,8 @@ DEF
|
||||
|
||||
assert_build_log <<OUT
|
||||
apply -p1 -i /my/patch.diff
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib " PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
|
||||
@@ -45,7 +45,7 @@ DEF
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
CC=${TMP}/bin/gcc
|
||||
MACOSX_DEPLOYMENT_TARGET=10.9
|
||||
MACOSX_DEPLOYMENT_TARGET=10.10
|
||||
OUT
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ DEF
|
||||
unstub sw_vers
|
||||
|
||||
assert_output <<OUT
|
||||
./configure --prefix=$INSTALL_ROOT --libdir=${TMP}/install/lib
|
||||
./configure --prefix=$INSTALL_ROOT --enable-shared --libdir=${TMP}/install/lib
|
||||
CC=clang
|
||||
CFLAGS=no
|
||||
make -j 2
|
||||
@@ -115,6 +115,6 @@ DEF
|
||||
|
||||
#assert_success
|
||||
assert_output <<OUT
|
||||
CFLAGS_EXTRA=-DMICROPY_PY_SYS_PATH_DEFAULT='"${TMP}/install/lib/micropython"' -Wno-floating-conversion
|
||||
CFLAGS_EXTRA=-DMICROPY_PY_SYS_PATH_DEFAULT='".frozen:${TMP}/install/lib/micropython"' -Wno-floating-conversion
|
||||
OUT
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ setup() {
|
||||
@test "using aria2c if available" {
|
||||
export PYTHON_BUILD_ARIA2_OPTS=
|
||||
export -n PYTHON_BUILD_HTTP_CLIENT
|
||||
stub aria2c "--allow-overwrite=true --no-conf=true -o * http://example.com/* : cp $FIXTURE_ROOT/\${5##*/} \$4"
|
||||
stub aria2c "--allow-overwrite=true --no-conf=true -d * -o * http://example.com/* : cp $FIXTURE_ROOT/\${7##*/} \$6"
|
||||
|
||||
install_fixture definitions/without-checksum
|
||||
assert_success
|
||||
|
||||
@@ -15,6 +15,7 @@ after_install 'echo after: \$STATUS'
|
||||
OUT
|
||||
stub pyenv-hooks "install : echo '$HOOK_PATH'/install.bash"
|
||||
stub pyenv-rehash "echo rehashed"
|
||||
stub pyenv-latest false
|
||||
|
||||
definition="${TMP}/3.6.2"
|
||||
cat > "$definition" <<<"echo python-build"
|
||||
@@ -55,3 +56,38 @@ OUT
|
||||
|
||||
refute [ -d "${PYENV_ROOT}/versions/3.6.2" ]
|
||||
}
|
||||
|
||||
@test "pyenv-uninstall hooks with multiple versions" {
|
||||
cat > "${HOOK_PATH}/uninstall.bash" <<OUT
|
||||
before_uninstall 'echo before: \$PREFIX'
|
||||
after_uninstall 'echo after.'
|
||||
rm() {
|
||||
echo "rm \$@"
|
||||
command rm "\$@"
|
||||
}
|
||||
OUT
|
||||
stub pyenv-hooks "uninstall : echo '$HOOK_PATH'/uninstall.bash"
|
||||
stub pyenv-rehash "echo rehashed"
|
||||
stub pyenv-rehash "echo rehashed"
|
||||
|
||||
mkdir -p "${PYENV_ROOT}/versions/3.6.2"
|
||||
mkdir -p "${PYENV_ROOT}/versions/3.6.3"
|
||||
run pyenv-uninstall -f 3.6.2 3.6.3
|
||||
|
||||
assert_success
|
||||
assert_output <<-OUT
|
||||
before: ${PYENV_ROOT}/versions/3.6.2
|
||||
rm -rf ${PYENV_ROOT}/versions/3.6.2
|
||||
rehashed
|
||||
pyenv: 3.6.2 uninstalled
|
||||
after.
|
||||
before: ${PYENV_ROOT}/versions/3.6.3
|
||||
rm -rf ${PYENV_ROOT}/versions/3.6.3
|
||||
rehashed
|
||||
pyenv: 3.6.3 uninstalled
|
||||
after.
|
||||
OUT
|
||||
|
||||
refute [ -d "${PYENV_ROOT}/versions/3.6.2" ]
|
||||
refute [ -d "${PYENV_ROOT}/versions/3.6.3" ]
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ setup() {
|
||||
|
||||
stub_python_build() {
|
||||
stub python-build "--lib : $BATS_TEST_DIRNAME/../bin/python-build --lib" "$@"
|
||||
stub pyenv-latest ": false"
|
||||
}
|
||||
|
||||
@test "install proper" {
|
||||
@@ -23,6 +24,57 @@ stub_python_build() {
|
||||
unstub pyenv-rehash
|
||||
}
|
||||
|
||||
@test "install proper multi versions" {
|
||||
#stub python-build "--lib : $BATS_TEST_DIRNAME/../bin/python-build --lib" 'echo python-build "$@"' 'echo python-build "$@"'
|
||||
#stub pyenv-latest ": false" ": false"
|
||||
stub_python_build 'echo python-build "$@"' 'echo python-build "$@"'
|
||||
stub pyenv-latest ": false"
|
||||
stub pyenv-rehash 'true'
|
||||
|
||||
run pyenv-install 3.4.1 3.4.2
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
python-build 3.4.1 ${TMP}/pyenv/versions/3.4.1
|
||||
python-build 3.4.2 ${TMP}/pyenv/versions/3.4.2
|
||||
OUT
|
||||
|
||||
unstub python-build
|
||||
unstub pyenv-latest
|
||||
unstub pyenv-hooks
|
||||
unstub pyenv-rehash
|
||||
}
|
||||
|
||||
@test "install resolves a prefix" {
|
||||
stub_python_build 'echo python-build "$@"'
|
||||
stub pyenv-latest '-q -k 3.4 : echo 3.4.2'
|
||||
pyenv-latest || true # pass through the stub entry added by stub_python_build
|
||||
|
||||
run pyenv-install 3.4
|
||||
assert_success "python-build 3.4.2 ${PYENV_ROOT}/versions/3.4.2"
|
||||
|
||||
unstub python-build
|
||||
unstub pyenv-hooks
|
||||
unstub pyenv-rehash
|
||||
}
|
||||
|
||||
@test "install resolves a prefix with multi versions" {
|
||||
stub_python_build 'echo python-build "$@"' 'echo python-build "$@"'
|
||||
stub pyenv-latest '-q -k 3.4 : echo 3.4.2' '-q -k 3.5 : echo 3.5.2'
|
||||
stub pyenv-rehash 'true'
|
||||
pyenv-latest || true # pass through the stub entry added by stub_python_build
|
||||
|
||||
run pyenv-install 3.4 3.5
|
||||
assert_success <<OUT
|
||||
python-build 3.4.2 ${PYENV_ROOT}/versions/3.4.2
|
||||
python-build 3.5.2 ${PYENV_ROOT}/versions/3.5.2
|
||||
OUT
|
||||
|
||||
|
||||
unstub python-build
|
||||
unstub pyenv-hooks
|
||||
unstub pyenv-rehash
|
||||
}
|
||||
|
||||
@test "install pyenv local version by default" {
|
||||
stub_python_build 'echo python-build "$1"'
|
||||
stub pyenv-local 'echo 3.4.2'
|
||||
@@ -34,6 +86,21 @@ stub_python_build() {
|
||||
unstub pyenv-local
|
||||
}
|
||||
|
||||
@test "install pyenv local multi versions by default" {
|
||||
stub_python_build 'echo python-build "$1"' 'echo python-build "$1"'
|
||||
stub pyenv-local 'printf "%s\n%s\n" 3.4.2 3.4.1'
|
||||
stub pyenv-latest ": false"
|
||||
|
||||
run pyenv-install
|
||||
assert_success <<OUT
|
||||
python-build 3.4.2"
|
||||
python-build 3.4.1"
|
||||
OUT
|
||||
|
||||
unstub python-build
|
||||
unstub pyenv-local
|
||||
}
|
||||
|
||||
@test "list available versions" {
|
||||
stub_python_build \
|
||||
"--definitions : echo 2.6.9 2.7.9-rc1 2.7.9-rc2 3.4.2 | tr ' ' $'\\n'"
|
||||
@@ -155,22 +222,23 @@ ${PYENV_ROOT}/plugins/foo/share/python-build
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "not enough arguments for pyenv-install" {
|
||||
@test "not enough arguments for pyenv-install if no local version" {
|
||||
stub_python_build
|
||||
stub pyenv-help 'install : true'
|
||||
|
||||
run pyenv-install
|
||||
assert_failure
|
||||
unstub pyenv-help
|
||||
assert_output ""
|
||||
}
|
||||
|
||||
@test "too many arguments for pyenv-install" {
|
||||
@test "multi arguments for pyenv-install" {
|
||||
stub_python_build
|
||||
stub pyenv-help 'install : true'
|
||||
|
||||
run pyenv-install 3.4.1 3.4.2
|
||||
assert_failure
|
||||
unstub pyenv-help
|
||||
assert_success
|
||||
assert_output ""
|
||||
}
|
||||
|
||||
@test "show help for pyenv-install" {
|
||||
@@ -195,12 +263,28 @@ OUT
|
||||
unstub pyenv-help
|
||||
}
|
||||
|
||||
@test "too many arguments for pyenv-uninstall" {
|
||||
stub pyenv-help 'uninstall : true'
|
||||
@test "more than one argument for pyenv-uninstall" {
|
||||
mkdir -p "${PYENV_ROOT}/versions/3.4.1"
|
||||
mkdir -p "${PYENV_ROOT}/versions/3.4.2"
|
||||
run pyenv-uninstall -f 3.4.1 3.4.2
|
||||
|
||||
run pyenv-uninstall 3.4.1 3.4.2
|
||||
assert_success
|
||||
refute [ -d "${PYENV_ROOT}/versions/3.4.1" ]
|
||||
refute [ -d "${PYENV_ROOT}/versions/3.4.2" ]
|
||||
}
|
||||
|
||||
@test "invalid arguments for pyenv-uninstall" {
|
||||
mkdir -p "${PYENV_ROOT}/versions/3.10.3"
|
||||
mkdir -p "${PYENV_ROOT}/versions/3.10.4"
|
||||
|
||||
run pyenv-uninstall -f 3.10.3 --invalid-option 3.10.4
|
||||
assert_failure
|
||||
unstub pyenv-help
|
||||
|
||||
assert [ -d "${PYENV_ROOT}/versions/3.10.3" ]
|
||||
assert [ -d "${PYENV_ROOT}/versions/3.10.4" ]
|
||||
|
||||
rmdir "${PYENV_ROOT}/versions/3.10.3"
|
||||
rmdir "${PYENV_ROOT}/versions/3.10.4"
|
||||
}
|
||||
|
||||
@test "show help for pyenv-uninstall" {
|
||||
|
||||
@@ -123,8 +123,8 @@ run_inline_definition_with_name() {
|
||||
|
||||
assert_build_log <<OUT
|
||||
patch -p0 --force -i $TMP/python-patch.XXX
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
@@ -153,8 +153,8 @@ OUT
|
||||
patch: bar
|
||||
patch: baz
|
||||
patch: foo
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
@@ -178,7 +178,7 @@ OUT
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make altinstall
|
||||
OUT
|
||||
@@ -280,7 +280,7 @@ echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
||||
OUT
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-universalsdk=/)
|
||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--enable-shared --libdir=${TMP}/install/lib --enable-universalsdk=/)
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
||||
OUT
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-universalsdk=/ --with-universal-archs=universal2)
|
||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--enable-shared --libdir=${TMP}/install/lib --enable-universalsdk=/ --with-universal-archs=universal2)
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
||||
OUT
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-universalsdk=/)
|
||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--enable-shared --libdir=${TMP}/install/lib --enable-universalsdk=/)
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ EOS
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
for i in {1..4}; do stub brew false; done
|
||||
for i in {1..7}; do stub uname '-s : echo Linux'; done
|
||||
for i in {1..8}; do stub uname '-s : echo Linux'; done
|
||||
stub "$MAKE" \
|
||||
" : echo \"$MAKE \$@\" >> build.log" \
|
||||
" : echo \"$MAKE \$@\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'"
|
||||
@@ -324,8 +324,8 @@ EOS
|
||||
assert_success
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-unicode=ucs2 --libdir=$INSTALL_ROOT/lib
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include " LDFLAGS="-L${TMP}/install/lib -Wl,-rpath=${TMP}/install/lib "
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-unicode=ucs2 --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
@@ -336,10 +336,8 @@ OUT
|
||||
|
||||
@test "default MACOSX_DEPLOYMENT_TARGET" {
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
for i in {1..3}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 10.10'; done
|
||||
|
||||
TMPDIR="$TMP" run_inline_definition <<OUT
|
||||
echo "\${MACOSX_DEPLOYMENT_TARGET}"
|
||||
|
||||
@@ -111,8 +111,10 @@ assert_failure() {
|
||||
|
||||
assert_equal() {
|
||||
if [ "$1" != "$2" ]; then
|
||||
{ echo "expected: $1"
|
||||
echo "actual: $2"
|
||||
{ echo "expected:"
|
||||
echo "$1"
|
||||
echo "actual:"
|
||||
echo "$2"
|
||||
} | flunk
|
||||
fi
|
||||
}
|
||||
@@ -137,3 +139,29 @@ assert_output_contains() {
|
||||
} | flunk
|
||||
}
|
||||
}
|
||||
|
||||
# Output a modified PATH that ensures that the given executable is not present,
|
||||
# but in which system utils necessary for pyenv operation are still available.
|
||||
path_without() {
|
||||
local path=":${PATH}:"
|
||||
for exe; do
|
||||
local found alt util
|
||||
for found in $(PATH="$path" type -aP "$exe"); do
|
||||
found="${found%/*}"
|
||||
if [ "$found" != "${PYENV_ROOT}/shims" ]; then
|
||||
alt="${PYENV_TEST_DIR}/$(echo "${found#/}" | tr '/' '-')"
|
||||
mkdir -p "$alt"
|
||||
for util in bash head cut readlink greadlink; do
|
||||
if [ -x "${found}/$util" ]; then
|
||||
ln -s "${found}/$util" "${alt}/$util"
|
||||
fi
|
||||
done
|
||||
path="${path/:${found}:/:${alt}:}"
|
||||
fi
|
||||
done
|
||||
done
|
||||
path="${path#:}"
|
||||
path="${path%:}"
|
||||
echo "$path"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
DEFINITION_PREFIX="${DEFINITION%%:*}"
|
||||
DEFINITION_TYPE="${DEFINITION_PREFIX%%-*}" # TODO: support non-CPython versions
|
||||
if [[ "${DEFINITION}" != "${DEFINITION_PREFIX}" ]]; then
|
||||
DEFINITION_CANDIDATES=($(python-build --definitions | grep -F "${DEFINITION_PREFIX}" | grep "^${DEFINITION_TYPE}" | sed -e '/-dev$/d' -e '/-src$/d' | sort -t. -k1,1r -k 2,2nr -k 3,3nr || true))
|
||||
DEFINITION_CANDIDATES=(\
|
||||
$(python-build --definitions | \
|
||||
grep -F "${DEFINITION_PREFIX}" | \
|
||||
grep "^${DEFINITION_TYPE}" | \
|
||||
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/(b|rc)[0-9]+$/d' | \
|
||||
sort -t. -k1,1r -k 2,2nr -k 3,3nr \
|
||||
|| true))
|
||||
DEFINITION="${DEFINITION_CANDIDATES}"
|
||||
VERSION_NAME="${DEFINITION##*/}"
|
||||
fi
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
activate
|
||||
activate.csh
|
||||
activate.fish
|
||||
activate.nu
|
||||
# gettext (#688)
|
||||
gettext.sh
|
||||
|
||||
@@ -63,6 +63,12 @@ OUT
|
||||
assert_line 'pyenv init - | source'
|
||||
}
|
||||
|
||||
@test "shell detection for installer" {
|
||||
run pyenv-init --detect-shell
|
||||
assert_success
|
||||
assert_line "PYENV_SHELL_DETECT=bash"
|
||||
}
|
||||
|
||||
@test "option to skip rehash" {
|
||||
run pyenv-init - --no-rehash
|
||||
assert_success
|
||||
@@ -98,7 +104,6 @@ echo "\$PATH"
|
||||
command -v fish >/dev/null || skip "-- fish not installed"
|
||||
OLDPATH="$PATH"
|
||||
export PATH="${BATS_TEST_DIRNAME}/nonexistent:${PYENV_ROOT}/shims:$PATH"
|
||||
# fish 2 (Ubuntu Bionic) adds spurious messages when setting PATH, messing up the output
|
||||
run fish <<!
|
||||
set -x PATH "$PATH"
|
||||
pyenv init - | source
|
||||
@@ -108,6 +113,50 @@ echo "\$PATH"
|
||||
assert_output "${PYENV_ROOT}/shims:${BATS_TEST_DIRNAME}/nonexistent:${OLDPATH//${PYENV_ROOT}\/shims:/}"
|
||||
}
|
||||
|
||||
@test "adds shims to PATH with --no-push-path if they're not on PATH" {
|
||||
export PATH="${BATS_TEST_DIRNAME}/../libexec:/usr/bin:/bin:/usr/local/bin"
|
||||
run bash -e <<!
|
||||
eval "\$(pyenv-init - --no-push-path)"
|
||||
echo "\$PATH"
|
||||
!
|
||||
assert_success
|
||||
assert_output "${PYENV_ROOT}/shims:${PATH}"
|
||||
}
|
||||
|
||||
@test "adds shims to PATH with --no-push-path if they're not on PATH (fish)" {
|
||||
command -v fish >/dev/null || skip "-- fish not installed"
|
||||
export PATH="${BATS_TEST_DIRNAME}/../libexec:/usr/bin:/bin:/usr/local/bin"
|
||||
run fish <<!
|
||||
set -x PATH "$PATH"
|
||||
pyenv-init - --no-push-path| source
|
||||
echo "\$PATH"
|
||||
!
|
||||
assert_success
|
||||
assert_output "${PYENV_ROOT}/shims:${PATH}"
|
||||
}
|
||||
|
||||
@test "doesn't change PATH with --no-push-path if shims are already on PATH" {
|
||||
export PATH="${BATS_TEST_DIRNAME}/../libexec:${PYENV_ROOT}/shims:/usr/bin:/bin:/usr/local/bin"
|
||||
run bash -e <<!
|
||||
eval "\$(pyenv-init - --no-push-path)"
|
||||
echo "\$PATH"
|
||||
!
|
||||
assert_success
|
||||
assert_output "${PATH}"
|
||||
}
|
||||
|
||||
@test "doesn't change PATH with --no-push-path if shims are already on PATH (fish)" {
|
||||
command -v fish >/dev/null || skip "-- fish not installed"
|
||||
export PATH="${BATS_TEST_DIRNAME}/../libexec:/usr/bin:${PYENV_ROOT}/shims:/bin:/usr/local/bin"
|
||||
run fish <<!
|
||||
set -x PATH "$PATH"
|
||||
pyenv-init - --no-push-path| source
|
||||
echo "\$PATH"
|
||||
!
|
||||
assert_success
|
||||
assert_output "${PATH}"
|
||||
}
|
||||
|
||||
@test "outputs sh-compatible syntax" {
|
||||
run pyenv-init - bash
|
||||
assert_success
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user