mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-08 11:33:49 -05:00
Compare commits
151 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cca008ba04 | ||
|
|
2fd7be0453 | ||
|
|
cdccbd0ba3 | ||
|
|
51c026bf56 | ||
|
|
5d967fa38a | ||
|
|
f03adae58a | ||
|
|
65316a7e99 | ||
|
|
e928e75f22 | ||
|
|
de1f8a7a1d | ||
|
|
7256feeaa8 | ||
|
|
6d4365a696 | ||
|
|
8439f8e187 | ||
|
|
32a86a84c0 | ||
|
|
d5b12f826d | ||
|
|
b6b761f9f1 | ||
|
|
e8f952a5d8 | ||
|
|
864cd79980 | ||
|
|
6d20b3b123 | ||
|
|
fe4eccf3e7 | ||
|
|
f0f2cdd1c6 | ||
|
|
58427b9a5c | ||
|
|
72757562c1 | ||
|
|
fb97a9c2bd | ||
|
|
48b545345e | ||
|
|
45bb60dc39 | ||
|
|
c0fef470cb | ||
|
|
986fe1a749 | ||
|
|
bfe54c9459 | ||
|
|
a43631d7c0 | ||
|
|
a157725dbe | ||
|
|
3a95c969e1 | ||
|
|
0d949796ce | ||
|
|
ee6ef20859 | ||
|
|
7bc426e2be | ||
|
|
3b0ee099a8 | ||
|
|
44db3b03d0 | ||
|
|
49d955d584 | ||
|
|
1e79a5222b | ||
|
|
d29feab2c8 | ||
|
|
a98fee0555 | ||
|
|
7ea0408966 | ||
|
|
42e6409f6c | ||
|
|
6f7a29c3f4 | ||
|
|
8aa8d84e09 | ||
|
|
39f1b141ef | ||
|
|
a55dd92436 | ||
|
|
9f5aa953b4 | ||
|
|
971397dd4e | ||
|
|
867909c933 | ||
|
|
162fea40f7 | ||
|
|
423de9ae8d | ||
|
|
40d35f84b4 | ||
|
|
8675031879 | ||
|
|
381002dbe2 | ||
|
|
2d9e981d60 | ||
|
|
152457a428 | ||
|
|
86ca164a11 | ||
|
|
943c5f995d | ||
|
|
c80b1cdfb9 | ||
|
|
15677f7f5a | ||
|
|
631bf6a23a | ||
|
|
2862858052 | ||
|
|
a7e09ce2ea | ||
|
|
4d56947277 | ||
|
|
07b7471819 | ||
|
|
3d4fc164a2 | ||
|
|
f2925393e4 | ||
|
|
a681e756e1 | ||
|
|
dc3a201301 | ||
|
|
7706a45080 | ||
|
|
23dfe75b73 | ||
|
|
df7ccfe0e8 | ||
|
|
e342d84715 | ||
|
|
e54cd5f49d | ||
|
|
80ec306155 | ||
|
|
a9e11ba164 | ||
|
|
5b7c140f5b | ||
|
|
aebed1c0a4 | ||
|
|
4adc45ef8a | ||
|
|
d79bda4602 | ||
|
|
552d943762 | ||
|
|
663abeb5fa | ||
|
|
748261869a | ||
|
|
54889eb87a | ||
|
|
cfe2aba670 | ||
|
|
009fea2b20 | ||
|
|
6e214570d1 | ||
|
|
abfa1c6d92 | ||
|
|
066c05336f | ||
|
|
1fa027af1e | ||
|
|
a0cc289d15 | ||
|
|
4bbf7d7bb0 | ||
|
|
4b82f575c7 | ||
|
|
c0d8b9cfe8 | ||
|
|
0388da7d0b | ||
|
|
13efdea9ab | ||
|
|
8db91d5516 | ||
|
|
a015760854 | ||
|
|
d4f45b0096 | ||
|
|
444088b1db | ||
|
|
09877f45cb | ||
|
|
f864294e0e | ||
|
|
5963dc4f61 | ||
|
|
0915c5b7b6 | ||
|
|
ed38af6409 | ||
|
|
208be7d6af | ||
|
|
07aa659dbb | ||
|
|
88c3404997 | ||
|
|
3a35f43eb4 | ||
|
|
9a42b48da4 | ||
|
|
f5cc25ed14 | ||
|
|
e0e3244015 | ||
|
|
9c72c27d76 | ||
|
|
483d95d6d2 | ||
|
|
05ca057bb2 | ||
|
|
108a10a198 | ||
|
|
979e6f0a61 | ||
|
|
2a9c18372a | ||
|
|
8315e1528b | ||
|
|
c81a28105f | ||
|
|
d601efa0d5 | ||
|
|
0688b17cc1 | ||
|
|
bb6a747c02 | ||
|
|
681d31bc36 | ||
|
|
3b1bc86031 | ||
|
|
6139b51af4 | ||
|
|
10a8c83888 | ||
|
|
9985f7b436 | ||
|
|
a7895e6ea8 | ||
|
|
7dd48d1665 | ||
|
|
11c54713bb | ||
|
|
3051d21004 | ||
|
|
9ecfdd1073 | ||
|
|
47d3dee0bb | ||
|
|
0a3b72d890 | ||
|
|
f018056165 | ||
|
|
af55330d37 | ||
|
|
0211c345f7 | ||
|
|
2f8c625a7d | ||
|
|
e28661c7e2 | ||
|
|
6882be06a6 | ||
|
|
c6c4e41eb9 | ||
|
|
f504b01818 | ||
|
|
876be1bb04 | ||
|
|
6185bb55e6 | ||
|
|
7f714c34ba | ||
|
|
848e56e992 | ||
|
|
8b07b92c37 | ||
|
|
3a20ce7555 | ||
|
|
0c6ad7c52b | ||
|
|
1bd397112a |
12
.github/FUNDING.yml
vendored
Normal file
12
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [pyenv] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: pyenv # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
4
.github/ISSUE_TEMPLATE.md
vendored
4
.github/ISSUE_TEMPLATE.md
vendored
@@ -17,5 +17,5 @@ Make sure you have checked all steps below.
|
||||
- [ ] pyenv version:
|
||||
- [ ] Python version:
|
||||
- [ ] C Compiler information (e.g. gcc 7.3):
|
||||
- [ ] Please attach verbose build log as gist
|
||||
* You can turn on verbose debug logging using by setting `PYENV_DEBUG=1`, e.g. `env PYENV_DEBUG=1 pyenv install -v 3.6.4`
|
||||
- [ ] Please attach the debug trace of the failing command as a gist:
|
||||
* Run `env PYENV_DEBUG=1 <faulty command> 2>&1 | tee trace.log` and attach `trace.log`. E.g. if you have a problem with installing Python, run `env PYENV_DEBUG=1 pyenv install -v <version> 2>&1 | tee trace.log` (note the `-v` option to `pyenv install`).
|
||||
|
||||
38
.github/workflows/macos_build.yml
vendored
Normal file
38
.github/workflows/macos_build.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: macos_build
|
||||
on: [pull_request, push]
|
||||
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
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
# Normally, we would use the superbly maintained...
|
||||
# - uses: actions/setup-python@v2
|
||||
# with:
|
||||
# python-version: ${{ matrix.python-version }}
|
||||
# ... but in the repo, we want to test pyenv builds on macOS
|
||||
- run: |
|
||||
brew install openssl readline sqlite3 xz zlib
|
||||
# https://github.com/pyenv/pyenv#installation
|
||||
- run: pwd
|
||||
- env:
|
||||
PYENV_ROOT: /Users/runner/work/pyenv/pyenv
|
||||
run: |
|
||||
echo $PYENV_ROOT
|
||||
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
|
||||
bin/pyenv install ${{ matrix.python-version }}
|
||||
bin/pyenv global ${{ matrix.python-version }}
|
||||
bin/pyenv rehash
|
||||
- run: python --version
|
||||
- run: python -m pip --version
|
||||
- shell: python # Prove that actual Python == expected Python
|
||||
env:
|
||||
EXPECTED_PYTHON: ${{ matrix.python-version }}
|
||||
run: import os, sys ; assert sys.version.startswith(os.getenv("EXPECTED_PYTHON"))
|
||||
40
.github/workflows/pyenv_tests.yml
vendored
Normal file
40
.github/workflows/pyenv_tests.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: pyenv_tests
|
||||
on: [pull_request, push]
|
||||
jobs:
|
||||
pyenv_tests:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-20.04
|
||||
- ubuntu-18.04
|
||||
- macos-11
|
||||
- macos-10.15
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
# Normally, we would use the superbly maintained...
|
||||
# - uses: actions/setup-python@v2
|
||||
# with:
|
||||
# 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
|
||||
# https://github.com/pyenv/pyenv#installation
|
||||
- run: |
|
||||
if test "$RUNNER_OS" == "macOS"; then
|
||||
brew install coreutils fish
|
||||
elif [[ $(lsb_release -sr | awk -F. '{print $1}') -ge 20 ]]; then
|
||||
# Ubuntu 18 has fish 2 which lacks many features that facilitate testing
|
||||
sudo apt install fish -yq
|
||||
fi
|
||||
- run: pwd
|
||||
- env:
|
||||
PYENV_ROOT: /home/runner/work/pyenv/pyenv
|
||||
run: |
|
||||
echo $PYENV_ROOT
|
||||
echo "$PYENV_ROOT/shims:$PYENV_ROOT/bin" >> $GITHUB_PATH
|
||||
- run: |
|
||||
make test
|
||||
@@ -1,18 +1,15 @@
|
||||
name: ubuntu_tests
|
||||
name: ubuntu_build
|
||||
on: [pull_request, push]
|
||||
jobs:
|
||||
ubuntu_tests:
|
||||
ubuntu_build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version:
|
||||
- 2.7.18
|
||||
- 3.5.10
|
||||
- 3.6.13
|
||||
- 3.7.10
|
||||
- 3.8.10
|
||||
- 3.9.5
|
||||
- 3.10.0rc2
|
||||
- 3.10.0
|
||||
runs-on: Ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
103
CHANGELOG.md
103
CHANGELOG.md
@@ -1,5 +1,108 @@
|
||||
## Version History
|
||||
|
||||
## Release 2.3.0
|
||||
|
||||
* Bump openssl 1.1 to 1.1.1n for CPython 3.7 3.8 3.9 (#2276)
|
||||
* Doc Fix: Escape a hash character causing unwanted GitHub Issue linking (#2282)
|
||||
* Add CPython 3.9.12 (#2296)
|
||||
* Add CPython 3.10.4 (#2295)
|
||||
* Add patch for 3.6.15 to support Xcode 13.3 (#2288)
|
||||
* Add patch for 3.7.12 to support Xcode 13.3 (#2292)
|
||||
* Add CONTRIBUTING.md (#2287)
|
||||
* Add PyPy 7.3.9 release 2022-03-30 (#2308)
|
||||
* Add Pyston 2.3.3 (#2316)
|
||||
* Add CPython 3.11.0a7 (#2315)
|
||||
* Add "nogil" Python v3.9.10 (#2342)
|
||||
* Support XCode 13.3 in all releases that officially support MacOS 11 (#2344)
|
||||
* Add GraalPython 22.1.0 (#2346)
|
||||
* Make PYENV_DEBUG imply -v for `pyenv install` (#2347)
|
||||
* Simplify init scheme (#2310)
|
||||
* Don't use Homebrew outside of MacOS (#2349)
|
||||
* Add `:latest` syntax to documentation for the `install` command (#2351)
|
||||
|
||||
## Release 2.2.5
|
||||
|
||||
* Add CPython 3.10.3
|
||||
* Add CPython 3.9.11
|
||||
* Add CPython 3.8.13
|
||||
* Add CPython 3.7.13
|
||||
* Add CPython 3.11.0a6 (#2266)
|
||||
* Add PyPy 7.3.8 (#2253)
|
||||
* Add miniconda3-3.7-4.11.0, miniconda3-3.8-4.11.0, miniconda3-3.9-4.11.0 (#2268)
|
||||
* Add pyston-2.3.2 (#2240)
|
||||
* Fix UnicodeDecodeError for CPython 3.6.15 and 3.7.12 (#2237)
|
||||
* python-build: add URL for get-pip for Python 3.6 (#2238)
|
||||
* Bump openssl to 1.1.1n for CPython 3.10.x
|
||||
|
||||
## Release 2.2.4
|
||||
|
||||
* Added docstrings to several undocumented functions (#2197)
|
||||
* Fix incorrect pypy 2.7-7.3.6 sha256 hashes (#2208)
|
||||
* Fix a regression in include paths when compiling ctypes in 3.6.15/3.7.12 (#2209)
|
||||
* Revert "Disable coreutils on M1 Apple Silicon with arm64 (#2020)" (#2212)
|
||||
* CPython 3.11.0a4 (#2217)
|
||||
* CPython 3.9.10 and 3.10.2 (#2219)
|
||||
* miniconda3-latest: added Linux-aarch64 (#2221)
|
||||
* Add GraalPython 22.0.0 (#2226)
|
||||
|
||||
|
||||
## Release 2.2.3
|
||||
|
||||
* Add new pypy versions (pypy2.7-7.3.2~7.3.5) to the version list (#2194)
|
||||
* Fix Python 3.7.12 compilation on macOS arm64/M1. (#2190)
|
||||
* Fix Python 3.6.15 compilation on macOS arm64/M1. (#2189)
|
||||
* Add Anaconda3-2021.11 (#2193)
|
||||
* CPython 3.11.0a3 (#2187)
|
||||
* Fix errant "echo" in README install instructions (#2185)
|
||||
* Add Miniforge and Mambaforge 4.10.3-10 (#2184)
|
||||
* Add CPython 3.10.1 (#2183)
|
||||
* Fix 3.6.15 build on macOS (#2182)
|
||||
|
||||
## Release 2.2.2
|
||||
|
||||
* Add support for macOS Apple M1 (#2164)
|
||||
|
||||
## Release 2.2.1
|
||||
|
||||
* Add CPython 3.9.9 (#2162)
|
||||
* Add CPython 3.9.8 (#2152)
|
||||
* Add Add micropython 1.17 (#2158)
|
||||
* Add Add micropython 1.16 (#2158)
|
||||
* Patch 3.10.0 configure, fixes https://bugs.python.org/issue45350 (#2155)
|
||||
* Use command and type instead of which (#2144)
|
||||
* Add definition of pyenv help in COMMANDS.md #2139
|
||||
* Use OpenSSL 1.0 for CPython 2.7.18
|
||||
|
||||
## Release 2.2.0
|
||||
* Adding PyPy release 7.3.7 (Python 3.7 and 3.8). (#2132)
|
||||
* Append Homebrew custom prefix to search path (#1957)
|
||||
* Add documentation for init command (#2125)
|
||||
* Add setup instructions for the case when one installs Pyenv as part of a batch job (#2127)
|
||||
* Add documentation for completions command (#2126)
|
||||
* Default --with-universal-archs to universal2 on Apple Silicon (#2122)
|
||||
* Update README.md (#2120)
|
||||
* Add GraalPython 21.3.0 (#2117)
|
||||
* Pypy ver 7.3.6 - python 3.7 and python 3.8 (#2111)
|
||||
* Discover Tcl/Tk reliably and use active version (#2106)
|
||||
* Fish installation instructions (#2104)
|
||||
* Add CPython 3.11.0a1 (#2099)
|
||||
|
||||
## Release 2.1.0
|
||||
* Fix mambaforge-pypy3 build (#2096)
|
||||
* Add Python 3.10.0 (#2093)
|
||||
* Add documentation for exec command (#2090)
|
||||
* Add documentation for shims command (#2091)
|
||||
* Add documentation for hooks command (#2089)
|
||||
* Add documentation for root command (#2088)
|
||||
* Add documentaion for prefix command (#2087)
|
||||
* Update to Pyston's v2 package of the 2.3.1 release (#2078)
|
||||
* Add pyston-2.3.1 support (#2075)
|
||||
* Don't update conda when installing pip (#2074)
|
||||
* Improve `add_miniconda.py` (#2072)
|
||||
* GitHub actions tests (#2073)
|
||||
* Fix sed commands (#2071)
|
||||
* macOS: fix the build of Python 2.7.18 on macOS 11.5.2 (Big Sur) + Apple Silicon (#2061)
|
||||
|
||||
## Release 2.0.7
|
||||
* Update setup instructions in the Readme (#2067)
|
||||
* Allow tcl-tk as argument or try with homebrew by default (#1646)
|
||||
|
||||
100
COMMANDS.md
100
COMMANDS.md
@@ -5,6 +5,7 @@ first argument.
|
||||
|
||||
The most common subcommands are:
|
||||
|
||||
* [`pyenv help`](#pyenv-help)
|
||||
* [`pyenv commands`](#pyenv-commands)
|
||||
* [`pyenv local`](#pyenv-local)
|
||||
* [`pyenv global`](#pyenv-global)
|
||||
@@ -16,6 +17,17 @@ The most common subcommands are:
|
||||
* [`pyenv versions`](#pyenv-versions)
|
||||
* [`pyenv which`](#pyenv-which)
|
||||
* [`pyenv whence`](#pyenv-whence)
|
||||
* [`pyenv exec`](#pyenv-exec)
|
||||
* [`pyenv root`](#pyenv-root)
|
||||
* [`pyenv prefix`](#pyenv-prefix)
|
||||
* [`pyenv hooks`](#pyenv-hooks)
|
||||
* [`pyenv shims`](#pyenv-shims)
|
||||
* [`pyenv init`](#pyenv-init)
|
||||
* [`pyenv completions`](#pyenv-completions)
|
||||
|
||||
## `pyenv help`
|
||||
|
||||
List all available pyenv commands along with a brief description of what they do. Run `pyenv help <command>` for information on a specific command. For full documentation, see: https://github.com/pyenv/pyenv#readme
|
||||
|
||||
|
||||
## `pyenv commands`
|
||||
@@ -216,6 +228,14 @@ 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:
|
||||
|
||||
pyenv install 3.8:latest
|
||||
|
||||
To install the latest major release for Python 3 try:
|
||||
|
||||
pyenv install 3:latest
|
||||
|
||||
## `pyenv uninstall`
|
||||
|
||||
Uninstall a specific Python version.
|
||||
@@ -278,3 +298,83 @@ Lists all Python versions with the given command installed.
|
||||
2.6.8
|
||||
2.7.6
|
||||
3.3.3
|
||||
|
||||
## `pyenv exec`
|
||||
|
||||
Usage: pyenv exec <command> [arg1 arg2...]
|
||||
|
||||
Runs an executable by first preparing PATH so that the selected Python
|
||||
version's `bin` directory is at the front.
|
||||
|
||||
For example, if the currently selected Python version is 3.9.7:
|
||||
|
||||
pyenv exec pip install -r requirements.txt
|
||||
|
||||
is equivalent to:
|
||||
|
||||
PATH="$PYENV_ROOT/versions/3.9.7/bin:$PATH" pip install -r requirements.txt
|
||||
|
||||
## `pyenv root`
|
||||
|
||||
Displays the root directory where versions and shims are kept.
|
||||
|
||||
$ pyenv root
|
||||
/home/user/.pyenv
|
||||
|
||||
## `pyenv prefix`
|
||||
|
||||
Displays the directories where the given Python versions are installed,
|
||||
separated by colons. If no version is given, `pyenv prefix` displays the
|
||||
locations of the currently selected versions.
|
||||
|
||||
$ pyenv prefix 3.9.7
|
||||
/home/user/.pyenv/versions/3.9.7
|
||||
|
||||
## `pyenv hooks`
|
||||
|
||||
Lists installed hook scripts for a given pyenv command.
|
||||
|
||||
Usage: pyenv hooks <command>
|
||||
|
||||
## `pyenv shims`
|
||||
|
||||
List existing pyenv shims.
|
||||
|
||||
Usage: pyenv shims [--short]
|
||||
|
||||
$ pyenv shims
|
||||
/home/user/.pyenv/shims/2to3
|
||||
/home/user/.pyenv/shims/2to3-3.9
|
||||
/home/user/.pyenv/shims/idle
|
||||
/home/user/.pyenv/shims/idle3
|
||||
/home/user/.pyenv/shims/idle3.9
|
||||
/home/user/.pyenv/shims/pip
|
||||
/home/user/.pyenv/shims/pip3
|
||||
/home/user/.pyenv/shims/pip3.9
|
||||
/home/user/.pyenv/shims/pydoc
|
||||
/home/user/.pyenv/shims/pydoc3
|
||||
/home/user/.pyenv/shims/pydoc3.9
|
||||
/home/user/.pyenv/shims/python
|
||||
/home/user/.pyenv/shims/python3
|
||||
/home/user/.pyenv/shims/python3.9
|
||||
/home/user/.pyenv/shims/python3.9-config
|
||||
/home/user/.pyenv/shims/python3.9-gdb.py
|
||||
/home/user/.pyenv/shims/python3-config
|
||||
/home/user/.pyenv/shims/python-config
|
||||
|
||||
## `pyenv init`
|
||||
|
||||
Configure the shell environment for pyenv
|
||||
|
||||
Usage: eval "$(pyenv init [-|--path] [--no-rehash] [<shell>])"
|
||||
|
||||
- Initialize shims directory, print PYENV_SHELL variable, completions path
|
||||
and shell function
|
||||
--path Print shims path
|
||||
--no-rehash Add no rehash command to output
|
||||
|
||||
## `pyenv completions`
|
||||
|
||||
Lists available completions for a given pyenv command.
|
||||
|
||||
Usage: pyenv completions <command> [arg1 arg2...]
|
||||
|
||||
104
CONTRIBUTING.md
Normal file
104
CONTRIBUTING.md
Normal file
@@ -0,0 +1,104 @@
|
||||
General guidance
|
||||
================
|
||||
|
||||
* The usual principes 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 general 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.
|
||||
* We do not provide any guarantees from our side that any such fix works or will continue working going forward. It's up to the interested parties to maintain it.
|
||||
|
||||
|
||||
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.
|
||||
638
README.md
638
README.md
@@ -2,8 +2,6 @@
|
||||
|
||||
[](https://gitter.im/yyuu/pyenv?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
[](https://travis-ci.org/pyenv/pyenv)
|
||||
|
||||
pyenv lets you easily switch between multiple versions of Python. It's
|
||||
simple, unobtrusive, and follows the UNIX tradition of single-purpose
|
||||
tools that do one thing well.
|
||||
@@ -14,13 +12,13 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
|
||||

|
||||
|
||||
|
||||
### pyenv _does..._
|
||||
### What pyenv _does..._
|
||||
|
||||
* Let you **change the global Python version** on a per-user basis.
|
||||
* Provide support for **per-project Python versions**.
|
||||
* Allow you to **override the Python version** with an environment
|
||||
* Lets you **change the global Python version** on a per-user basis.
|
||||
* Provides support for **per-project Python versions**.
|
||||
* Allows you to **override the Python version** with an environment
|
||||
variable.
|
||||
* Search commands from **multiple versions of Python at a time**.
|
||||
* Searches for commands from **multiple versions of Python at a time**.
|
||||
This may be helpful to test across Python versions with [tox](https://pypi.python.org/pypi/tox).
|
||||
|
||||
|
||||
@@ -29,12 +27,11 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
|
||||
* **Depend on Python itself.** pyenv was made from pure shell scripts.
|
||||
There is no bootstrap problem of Python.
|
||||
* **Need to be loaded into your shell.** Instead, pyenv's shim
|
||||
approach works by adding a directory to your `$PATH`.
|
||||
approach works by adding a directory to your `PATH`.
|
||||
* **Manage virtualenv.** Of course, you can create [virtualenv](https://pypi.python.org/pypi/virtualenv)
|
||||
yourself, or [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv)
|
||||
to automate the process.
|
||||
|
||||
|
||||
----
|
||||
|
||||
|
||||
@@ -43,19 +40,27 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
|
||||
* **[How It Works](#how-it-works)**
|
||||
* [Understanding PATH](#understanding-path)
|
||||
* [Understanding Shims](#understanding-shims)
|
||||
* [Choosing the Python Version](#choosing-the-python-version)
|
||||
* [Locating the Python Installation](#locating-the-python-installation)
|
||||
* [Understanding Python version selection](#understanding-python-version-selection)
|
||||
* [Locating Pyenv-provided Python Installations](#locating-pyenv-provided-python-installations)
|
||||
* **[Installation](#installation)**
|
||||
* [Prerequisites](#prerequisites)
|
||||
* [Homebrew in macOS](#homebrew-in-macos)
|
||||
* [Windows](#windows)
|
||||
* [Automatic installer](#automatic-installer)
|
||||
* [Basic GitHub Checkout](#basic-github-checkout)
|
||||
* [Upgrading](#upgrading)
|
||||
* [Homebrew on macOS](#homebrew-on-macos)
|
||||
* [Advanced Configuration](#advanced-configuration)
|
||||
* [Uninstalling Python Versions](#uninstalling-python-versions)
|
||||
* **[Command Reference](#command-reference)**
|
||||
* [Getting Pyenv](#getting-pyenv)
|
||||
* [Homebrew in macOS](#homebrew-in-macos)
|
||||
* [Windows](#windows)
|
||||
* [Automatic installer](#automatic-installer)
|
||||
* [Basic GitHub Checkout](#basic-github-checkout)
|
||||
* [Set up your shell environment for Pyenv](#set-up-your-shell-environment-for-pyenv)
|
||||
* [Restart your shell](#restart-your-shell)
|
||||
* [Install Python build dependencies](#install-python-build-dependencies)
|
||||
* **[Usage](#usage)**
|
||||
* [Install additional Python versions](#install-additional-python-versions)
|
||||
* [Switch between Python versions](#switch-between-python-versions)
|
||||
* [Uninstall Python versions](#uninstall-python-versions)
|
||||
* [Other operations](#other-operations)
|
||||
* [Upgrading](#upgrading)
|
||||
* [Uninstalling pyenv](#uninstalling-pyenv)
|
||||
* [Advanced Configuration](#advanced-configuration)
|
||||
* [Using Pyenv without shims](#using-pyenv-without-shims)
|
||||
* [Environment variables](#environment-variables)
|
||||
* **[Development](#development)**
|
||||
* [Version History](#version-history)
|
||||
* [License](#license)
|
||||
@@ -71,6 +76,7 @@ executables injected into your `PATH`, determines which Python version
|
||||
has been specified by your application, and passes your commands along
|
||||
to the correct Python installation.
|
||||
|
||||
|
||||
### Understanding PATH
|
||||
|
||||
When you run a command like `python` or `pip`, your operating system
|
||||
@@ -86,6 +92,7 @@ precedence over another one at the end. In this example, the
|
||||
`/usr/local/bin` directory will be searched first, then `/usr/bin`,
|
||||
then `/bin`.
|
||||
|
||||
|
||||
### Understanding Shims
|
||||
|
||||
pyenv works by inserting a directory of _shims_ at the front of your
|
||||
@@ -106,7 +113,8 @@ operating system will do the following:
|
||||
* Run the shim named `pip`, which in turn passes the command along to
|
||||
pyenv
|
||||
|
||||
### Choosing the Python Version
|
||||
|
||||
### Understanding Python version selection
|
||||
|
||||
When you execute a shim, pyenv determines which Python version to use by
|
||||
reading it from the following sources, in this order:
|
||||
@@ -124,25 +132,45 @@ reading it from the following sources, in this order:
|
||||
directory, until reaching the root of your filesystem.
|
||||
|
||||
4. The global `$(pyenv root)/version` file. You can modify this file using
|
||||
the [`pyenv global`](https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-global) command. If the global version
|
||||
file is not present, pyenv assumes you want to use the "system"
|
||||
Python. (In other words, whatever version would run if pyenv weren't in your
|
||||
`PATH`.)
|
||||
the [`pyenv global`](https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-global) command.
|
||||
If the global version file is not present, pyenv assumes you want to use the "system"
|
||||
Python (see below).
|
||||
|
||||
A special version name "`system`" means to use whatever Python is found on `PATH`
|
||||
after the shims `PATH` entry (in other words, whatever would be run if Pyenv
|
||||
shims weren't on `PATH`). Note that Pyenv considers those installations outside
|
||||
its control and does not attempt to inspect or distinguish them in any way.
|
||||
So e.g. if you are on MacOS and have OS-bundled Python 3.8.9 and Homebrew-installed
|
||||
Python 3.9.12 and 3.10.2 -- for Pyenv, this is still a single "`system`" version,
|
||||
and whichever of those is first on `PATH` under the executable name you
|
||||
specified will be run.
|
||||
|
||||
**NOTE:** You can activate multiple versions at the same time, including multiple
|
||||
versions of Python2 or Python3 simultaneously. This allows for parallel usage of
|
||||
Python2 and Python3, and is required with tools like `tox`. For example, to set
|
||||
your path to first use your `system` Python and Python3 (set to 2.7.9 and 3.4.2
|
||||
in this example), but also have Python 3.3.6, 3.2, and 2.5 available on your
|
||||
`PATH`, one would first `pyenv install` the missing versions, then set `pyenv
|
||||
global system 3.3.6 3.2 2.5`. At this point, one should be able to find the full
|
||||
executable path to each of these using `pyenv which`, e.g. `pyenv which python2.5`
|
||||
(should display `$(pyenv root)/versions/2.5/bin/python2.5`), or `pyenv which
|
||||
python3.4` (should display path to system Python3). You can also specify multiple
|
||||
versions in a `.python-version` file, separated by newlines.
|
||||
Lines starting with a `#` are ignored.
|
||||
Python2 and Python3, and is required with tools like `tox`. For example, to instruct
|
||||
Pyenv to first use your system Python and Python3 (which are e.g. 2.7.9 and 3.4.2)
|
||||
but also have Python 3.3.6, 3.2.1, and 2.5.2 available, you first `pyenv install`
|
||||
the missing versions, then set `pyenv global system 3.3.6 3.2.1 2.5.2`.
|
||||
Then you'll be able to invoke any of those versions with an appropriate `pythonX` or
|
||||
`pythonX.Y` name.
|
||||
You can also specify multiple versions in a `.python-version` file by hand,
|
||||
separated by newlines. Lines starting with a `#` are ignored.
|
||||
|
||||
### Locating the Python Installation
|
||||
[`pyenv which <command>`](COMMANDS.md#pyenv-which) displays which real executable would be
|
||||
run when you invoke `<command>` via a shim.
|
||||
E.g. if you have 3.3.6, 3.2.1 and 2.5.2 installed of which 3.3.6 and 2.5.2 are selected
|
||||
and your system Python is 3.2.5,
|
||||
`pyenv which python2.5` should display `$(pyenv root)/versions/2.5.2/bin/python2.5`,
|
||||
`pyenv which python3` -- `$(pyenv root)/versions/3.3.6/bin/python3` and
|
||||
`pyenv which python3.2` -- path to your system Python due to the fall-through (see below).
|
||||
|
||||
Shims also fall through to anything further on `PATH` if the corresponding executable is
|
||||
not present in any of the selected Python installations.
|
||||
This allows you to use any programs installed elsewhere on the system as long as
|
||||
they are not shadowed by a selected Python installation.
|
||||
|
||||
|
||||
### Locating Pyenv-provided Python installations
|
||||
|
||||
Once pyenv has determined which version of Python your application has
|
||||
specified, it passes the command along to the corresponding Python
|
||||
@@ -160,248 +188,262 @@ For example, you might have these versions installed:
|
||||
As far as Pyenv is concerned, version names are simply directories under
|
||||
`$(pyenv root)/versions`.
|
||||
|
||||
### Managing Virtual Environments
|
||||
|
||||
There is a pyenv plugin named [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv) which comes with various features to help pyenv users to manage virtual environments created by virtualenv or Anaconda.
|
||||
Because the `activate` script of those virtual environments are relying on mutating `$PATH` variable of user's interactive shell, it will intercept pyenv's shim style command execution hooks.
|
||||
We'd recommend to install pyenv-virtualenv as well if you have some plan to play with those virtual environments.
|
||||
|
||||
|
||||
----
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
### Prerequisites
|
||||
|
||||
For pyenv to install python correctly you should [**install the Python build dependencies**](https://github.com/pyenv/pyenv/wiki#suggested-build-environment).
|
||||
|
||||
### Homebrew in macOS
|
||||
### Getting Pyenv
|
||||
#### Homebrew in macOS
|
||||
|
||||
1. Consider installing with [Homebrew](https://brew.sh):
|
||||
```sh
|
||||
brew update
|
||||
brew install pyenv
|
||||
```
|
||||
2. Then follow the rest of the post-installation steps under [Basic GitHub Checkout](https://github.com/pyenv/pyenv#basic-github-checkout), starting with #2 ("Configure your shell's environment for Pyenv").
|
||||
2. Then follow the rest of the post-installation steps, starting with
|
||||
[Set up your shell environment for Pyenv](#set-up-your-shell-environment-for-pyenv).
|
||||
|
||||
3. OPTIONAL. To fix `brew doctor`'s warning _""config" scripts exist outside your system or Homebrew directories"_
|
||||
|
||||
If you're going to build Homebrew formulae from source that link against Python
|
||||
like Tkinter or NumPy
|
||||
_(This is only generally the case if you are a developer of such a formula,
|
||||
or if you have an EOL version of MacOS for which prebuilt bottles are no longer provided
|
||||
and you are using such a formula)._
|
||||
|
||||
To avoid them accidentally linking against a Pyenv-provided Python,
|
||||
add the following line into your interactive shell's configuration:
|
||||
|
||||
* Bash/Zsh:
|
||||
|
||||
~~~bash
|
||||
alias brew='env PATH="${PATH//$(pyenv root)\/shims:/}" brew'
|
||||
~~~
|
||||
|
||||
* Fish:
|
||||
|
||||
~~~fish
|
||||
alias brew="env PATH=(string replace (pyenv root)/shims '' \"\$PATH\") brew"
|
||||
~~~
|
||||
|
||||
|
||||
### Windows
|
||||
#### Windows
|
||||
|
||||
Pyenv does not officially support Windows and does not work in Windows outside
|
||||
the Windows Subsystem for Linux.
|
||||
Moreover, even there, the Pythons it installs are not native Windows versions
|
||||
but rather Linux versions run through a compatibility layer --
|
||||
but rather Linux versions running in a virtual machine --
|
||||
so you won't get Windows-specific functionality.
|
||||
|
||||
If you're in Windows, we recommend using @kirankotari's [`pyenv-win`](https://github.com/pyenv-win/pyenv-win) fork --
|
||||
which does install native Windows Python versions.
|
||||
|
||||
|
||||
### Automatic installer
|
||||
#### Automatic installer
|
||||
|
||||
Visit our other project:
|
||||
https://github.com/pyenv/pyenv-installer
|
||||
|
||||
|
||||
### Basic GitHub Checkout
|
||||
#### Basic GitHub Checkout
|
||||
|
||||
This will get you going with the latest version of Pyenv and make it
|
||||
easy to fork and contribute any changes back upstream.
|
||||
|
||||
1. **Check out Pyenv where you want it installed.**
|
||||
* **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
|
||||
* 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
|
||||
|
||||
2. **Configure your shell's environment for Pyenv**
|
||||
|
||||
**Note:** The below instructions for specific shells are designed for common shell setups;
|
||||
they also install shell functions into interactive shells only.
|
||||
If you have an uncommon setup and/or needs and they don't work for you,
|
||||
use the [Advanced Configuration](#advanced-configuration)
|
||||
section below to figure out what you need to do in your specific case.
|
||||
|
||||
**General MacOS note:**
|
||||
Make sure that your terminal app is configured to run the shell as a login shell
|
||||
(especially if you're using an alternative terminal app and/or shell).
|
||||
The configuration samples for MacOS are written under this assumption and won't work otherwise.
|
||||
|
||||
- For **Bash**:
|
||||
|
||||
- **If your `~/.profile` sources `~/.bashrc` (Debian, Ubuntu, Mint):**
|
||||
|
||||
~~~bash
|
||||
# the sed invocation inserts the lines at the start of the file
|
||||
# after any initial comment lines
|
||||
sed -iEe '/^([^#]|$)/ {a \
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
a \
|
||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
a \
|
||||
' -e ':a' -e '$!{n;ba};}' ~/.profile
|
||||
echo 'eval "$(pyenv init --path)"' >>~/.profile
|
||||
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
|
||||
~~~
|
||||
|
||||
- **If your `~/.bash_profile` sources `~/.bashrc` (Red Hat, Fedora, CentOS):**
|
||||
|
||||
~~~ bash
|
||||
sed -iEe '/^([^#]|$)/ {a \
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
a \
|
||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
a \
|
||||
' -e ':a' -e '$!{n;ba};}' ~/.bash_profile
|
||||
echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile
|
||||
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
|
||||
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
|
||||
echo 'eval "$(pyenv init --path)"' >> ~/.profile
|
||||
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
|
||||
~~~
|
||||
|
||||
- **If you have no `~/.bash_profile` and your `/etc/profile` sources `~/.bashrc` (SUSE):**
|
||||
|
||||
~~~bash
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
|
||||
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
|
||||
echo 'eval "$(pyenv init --path)"' >> ~/.profile
|
||||
|
||||
echo 'if command -v pyenv >/dev/null; then eval "$(pyenv init -)"; fi' >> ~/.bashrc
|
||||
~~~
|
||||
|
||||
- **Otherwise if you have no stock `~/.profile` or `~/.bash_profile` (MacOS):**
|
||||
|
||||
~~~bash
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
|
||||
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
|
||||
echo 'eval "$(pyenv init --path)"' >> ~/.profile
|
||||
echo 'if [ -n "$PS1" -a -n "$BASH_VERSION" ]; then source ~/.bashrc; fi' >> ~/.profile
|
||||
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
|
||||
~~~
|
||||
|
||||
In MacOS, make sure that your terminal app runs the shell as a login shell.
|
||||
|
||||
- **Temporary environments (CI, batch jobs):**
|
||||
|
||||
In CI/build environments, paths and the environment are usually already set up for you
|
||||
in one of the above ways.
|
||||
You may only need to install Pyenv as a shell function into the (noninteractive) shell
|
||||
that runs the batch script, and only if you need subcommands that require `pyenv`
|
||||
to be a shell function (e.g. `shell` and Pyenv-Virtualenv's `activate`).
|
||||
|
||||
~~~bash
|
||||
echo 'eval "$(pyenv init -)"'
|
||||
~~~
|
||||
|
||||
**General Bash warning**: There are some systems where the `BASH_ENV` variable is configured
|
||||
to point to `.bashrc`. On such systems, you should almost certainly put the
|
||||
`eval "$(pyenv init -)"` line into `.bash_profile`, and **not** into `.bashrc`. Otherwise, you
|
||||
may observe strange behaviour, such as `pyenv` getting into an infinite loop.
|
||||
See [#264](https://github.com/pyenv/pyenv/issues/264) for details.
|
||||
cd ~/.pyenv && src/configure && make -C src
|
||||
|
||||
|
||||
- For **Zsh**:
|
||||
### Set up your shell environment for Pyenv
|
||||
|
||||
- **MacOS, if Pyenv is installed with Homebrew:**
|
||||
**Upgrade note:** The startup logic and instructions have been updated for simplicity in 2.3.0.
|
||||
The previous, more complicated configuration scheme for 2.0.0-2.2.5 still works.
|
||||
|
||||
~~~ zsh
|
||||
echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
|
||||
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
||||
~~~
|
||||
|
||||
Make sure that your terminal app runs the shell as a login shell.
|
||||
* Define environment variable `PYENV_ROOT` to point to the path where
|
||||
Pyenv will store its data. `$HOME/.pyenv` is the default.
|
||||
If you installed Pyenv via Git checkout, we recommend
|
||||
to set it to the same location as where you cloned it.
|
||||
* Add the `pyenv` executable to your `PATH` if it's not already there
|
||||
* run `eval "$(pyenv init -)"` to install `pyenv` into your shell as a shell function, enable shims and autocompletion
|
||||
* You may run `eval "$(pyenv init --path)"` instead to just enable shims, without shell integration
|
||||
|
||||
The below setup should work for the vast majority of users for commmon use cases.
|
||||
See [Advanvced configuration](#advanced-configuration) for details and more configuration options.
|
||||
|
||||
- For **bash**:
|
||||
|
||||
Stock Bash startup files vary widely between distibutions in which of them source
|
||||
which, under what circumstances, in what order and what additional configuration they perform.
|
||||
As such, the most reliable way to get Pyenv in all environments is to append Pyenv
|
||||
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`:
|
||||
|
||||
~~~ bash
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
|
||||
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
|
||||
~~~
|
||||
|
||||
Then, if you have `~/.profile`, `~/.bash_profile` or `~/.bash_login`, add the commands there as well.
|
||||
If you have none of these, add them to `~/.profile`.
|
||||
|
||||
* to add to `~/.profile`:
|
||||
~~~ bash
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
|
||||
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.profile
|
||||
~~~
|
||||
|
||||
* to add to `~/.bash_profile`:
|
||||
~~~ bash
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
|
||||
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
|
||||
~~~
|
||||
|
||||
- For **Zsh**:
|
||||
~~~ zsh
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
|
||||
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
||||
~~~
|
||||
|
||||
If you wish to get Pyenv in noninteractive login shells as well, also add the commands to `~/.zprofile` or `~/.zlogin`.
|
||||
|
||||
- For **Fish shell**:
|
||||
|
||||
Execute this interactively:
|
||||
|
||||
~~~ 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`:
|
||||
|
||||
~~~ fish
|
||||
pyenv init - | source
|
||||
~~~
|
||||
|
||||
**Bash warning**: There are some systems where the `BASH_ENV` variable is configured
|
||||
to point to `.bashrc`. On such systems, you should almost certainly put the
|
||||
`eval "$(pyenv init -)"` line into `.bash_profile`, and **not** into `.bashrc`. Otherwise, you
|
||||
may observe strange behaviour, such as `pyenv` getting into an infinite loop.
|
||||
See [#264](https://github.com/pyenv/pyenv/issues/264) for details.
|
||||
|
||||
**Proxy note**: If you use a proxy, export `http_proxy` and `https_proxy`, too.
|
||||
|
||||
|
||||
- **MacOS, if Pyenv is installed with a Git checkout:**
|
||||
|
||||
~~~ zsh
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zprofile
|
||||
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zprofile
|
||||
echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
|
||||
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
||||
~~~
|
||||
### Restart your shell
|
||||
|
||||
Make sure that your terminal app runs the shell as a login shell.
|
||||
for the `PATH` changes to take effect.
|
||||
|
||||
- **Other OSes:**
|
||||
|
||||
~~~ zsh
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zprofile
|
||||
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zprofile
|
||||
echo 'eval "$(pyenv init --path)"' >> ~/.zprofile
|
||||
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
|
||||
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
|
||||
echo 'eval "$(pyenv init --path)"' >> ~/.profile
|
||||
```sh
|
||||
exec "$SHELL"
|
||||
```
|
||||
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
||||
~~~
|
||||
|
||||
- For **Fish shell**:
|
||||
### Install Python build dependencies
|
||||
|
||||
Execute this interactively:
|
||||
|
||||
~~~ fish
|
||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
||||
set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
|
||||
~~~
|
||||
[**Install Python build dependencies**](https://github.com/pyenv/pyenv/wiki#suggested-build-environment)
|
||||
before attempting to install a new Python version.
|
||||
|
||||
And add this to `~/.config/fish/config.fish`:
|
||||
|
||||
~~~ fish
|
||||
status is-login; and pyenv init --path | source
|
||||
status is-interactive; and pyenv init - | source
|
||||
~~~
|
||||
You can now begin using Pyenv.
|
||||
|
||||
If Fish is not your login shell, also follow the Bash/Zsh instructions to add to `~/.profile`.
|
||||
|
||||
**Proxy note**: If you use a proxy, export `http_proxy` and `https_proxy`, too.
|
||||
----
|
||||
|
||||
|
||||
4. **Restart your login session for the changes to profile files to take effect.**
|
||||
E.g. if you're in a GUI session, you need to fully log out and log back in.
|
||||
|
||||
In MacOS, restarting terminal windows is enough (because MacOS runs shells
|
||||
in them as login shells by default).
|
||||
## Usage
|
||||
|
||||
5. [**Install Python build dependencies**](https://github.com/pyenv/pyenv/wiki#suggested-build-environment) before attempting to install a new Python version.
|
||||
### Install additional Python versions
|
||||
|
||||
6. **Install Python versions into `$(pyenv root)/versions`.**
|
||||
For example, to download and install Python 2.7.8, run:
|
||||
```sh
|
||||
pyenv install 2.7.8
|
||||
```
|
||||
**NOTE:** If you need to pass a `configure` option to a build, please use the
|
||||
```CONFIGURE_OPTS``` environment variable.
|
||||
To install additonal Python versions, use [`pyenv install`](COMMANDS.md#pyenv-install).
|
||||
|
||||
**NOTE:** If you want to use proxy to download, please set the `http_proxy` and `https_proxy`
|
||||
environment variables.
|
||||
For example, to download and install Python 3.10.4, run:
|
||||
|
||||
**NOTE:** If you are having trouble installing a Python version,
|
||||
please visit the wiki page about
|
||||
[Common Build Problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems).
|
||||
```sh
|
||||
pyenv install 3.10.4
|
||||
```
|
||||
|
||||
**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 want to use proxy for download, please set the `http_proxy` and `https_proxy`
|
||||
environment variables.
|
||||
|
||||
**NOTE:** If you are having trouble installing a Python version,
|
||||
please visit the wiki page about
|
||||
[Common Build Problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems).
|
||||
|
||||
|
||||
#### Upgrading
|
||||
### Switch between Python versions
|
||||
|
||||
To select a Pyenv-installed Python as the version to use, run one
|
||||
of the following commands:
|
||||
|
||||
* [`pyenv shell <version>`](COMMANDS.md#pyenv-shell) -- select just for current shell session
|
||||
* [`pyenv local <version>`](COMMANDS.md#pyenv-local) -- automatically select whenever you are in the current directory (or its subdirectories)
|
||||
* [`pyenv global <version>`](COMMANDS.md#pyenv-shell) -- select globally for your user account
|
||||
|
||||
E.g. to select the above-mentioned newly-installed Python 3.10.4 as your preferred version to use:
|
||||
|
||||
~~~bash
|
||||
pyenv global 3.10.4
|
||||
~~~
|
||||
|
||||
Now whenever you invoke `python`, `pip` etc., an executable from the Pyenv-provided
|
||||
3.10.4 installation will be run instead of the system Python.
|
||||
|
||||
Using "`system`" as a version name would reset the selection to your system-provided Python.
|
||||
|
||||
See [Understanding shims](#understanding-shims) and
|
||||
[Understanding Python version selection](#understanding-python-version-selection)
|
||||
for more details on how the selection works and more information on its usage.
|
||||
|
||||
|
||||
### Uninstall Python versions
|
||||
|
||||
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).
|
||||
|
||||
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
|
||||
with the `pyenv prefix` command, e.g. `pyenv prefix 2.6.8`.
|
||||
Note however that plugins may run additional operations on uninstall
|
||||
which you would need to do by hand as well. E.g. Pyenv-Virtualenv also
|
||||
removes any virtual environments linked to the version being uninstalled.
|
||||
|
||||
|
||||
### Other operations
|
||||
|
||||
Run `pyenv commands` to get a list of all available subcommands.
|
||||
Run a subcommand with `--help` to get help on it, or see the [Commands Reference](COMMANDS.md).
|
||||
|
||||
Note that Pyenv plugins that you install may add their own subcommands.
|
||||
|
||||
|
||||
## Upgrading
|
||||
|
||||
If you've installed Pyenv using Homebrew, upgrade using:
|
||||
```sh
|
||||
brew upgrade pyenv
|
||||
```
|
||||
|
||||
If you've installed Pyenv using the instructions above, you can
|
||||
If you've installed Pyenv using Pyenv-installer or Git checkout, you can
|
||||
upgrade your installation at any time using Git.
|
||||
|
||||
To upgrade to the latest development version of pyenv, use `git pull`:
|
||||
@@ -420,7 +462,7 @@ git tag
|
||||
git checkout v0.1.0
|
||||
```
|
||||
|
||||
### Uninstalling pyenv
|
||||
## Uninstalling pyenv
|
||||
|
||||
The simplicity of pyenv makes it easy to temporarily disable it, or
|
||||
uninstall from the system.
|
||||
@@ -430,124 +472,113 @@ uninstall from the system.
|
||||
remove Pyenv shims directory from `PATH`, and future invocations like
|
||||
`python` will execute the system Python version, as it was before Pyenv.
|
||||
|
||||
`pyenv` will still be accessible on the command line, but your Python
|
||||
apps won't be affected by version switching.
|
||||
`pyenv` will still be accessible on the command line, but your Python
|
||||
apps won't be affected by version switching.
|
||||
|
||||
2. To completely **uninstall** Pyenv, remove _all_ configuration lines for it
|
||||
from your shell startup configuration, and then remove
|
||||
its root directory. This will **delete all Python versions** that were
|
||||
installed under `` $(pyenv root)/versions/ `` directory:
|
||||
|
||||
```sh
|
||||
rm -rf $(pyenv root)
|
||||
```
|
||||
2. To completely **uninstall** Pyenv, remove _all_ Pyenv configuration lines
|
||||
from your shell startup configuration, and then remove
|
||||
its root directory. This will **delete all Python versions** that were
|
||||
installed under the `` $(pyenv root)/versions/ `` directory:
|
||||
|
||||
If you've installed Pyenv using a package manager, as a final step,
|
||||
perform the Pyenv package removal. For instance, for Homebrew:
|
||||
```sh
|
||||
rm -rf $(pyenv root)
|
||||
```
|
||||
|
||||
```
|
||||
brew uninstall pyenv
|
||||
```
|
||||
If you've installed Pyenv using a package manager, as a final step,
|
||||
perform the Pyenv package removal. For instance, for Homebrew:
|
||||
|
||||
### Advanced Configuration
|
||||
```
|
||||
brew uninstall pyenv
|
||||
```
|
||||
|
||||
## Advanced Configuration
|
||||
|
||||
Skip this section unless you must know what every line in your shell
|
||||
profile is doing.
|
||||
|
||||
`pyenv init` is the only command that crosses the line of loading
|
||||
extra commands into your shell. Coming from RVM, some of you might be
|
||||
opposed to this idea.
|
||||
|
||||
Also see the [Environment variables](#environment-variables) section
|
||||
for the environment variables that control Pyenv's behavior.
|
||||
|
||||
|
||||
* `eval "$(pyenv init --path)"`:
|
||||
|
||||
1. **Sets up your shims path.** This is the only requirement for pyenv to
|
||||
function properly. You can do this by hand by prepending
|
||||
`$(pyenv root)/shims` to your `$PATH`.
|
||||
|
||||
`eval "$(pyenv init --path)"` is supposed to be run in your session's login
|
||||
shell startup script -- so that all processes in the session get access to
|
||||
Pyenv's functionality and it only runs once,
|
||||
avoiding breaking `PATH` in nested shells
|
||||
(e.g. shells started from editors/IDEs).
|
||||
|
||||
In Linux, GUI managers typically act as a `sh` login shell, running
|
||||
`/etc/profile` and `~/.profile` at their startup. MacOS' GUI doesn't do that,
|
||||
so its terminal emulator apps run their shells as login shells by default
|
||||
to compensate.
|
||||
`pyenv init` is the only command that crosses the line of loading
|
||||
extra commands into your shell. Coming from RVM, some of you might be
|
||||
opposed to this idea. Here's what `eval "$(pyenv init -)"` actually does:
|
||||
|
||||
|
||||
* `eval "$(pyenv init -)"`:
|
||||
1. **Sets up the shims path.** This is what allows Pyenv to intercept
|
||||
and redirect invocations of `python`, `pip` etc. transparently.
|
||||
It prepends `$(pyenv root)/shims` to your `$PATH`.
|
||||
It also deletes any other instances of `$(pyenv root)/shims` on `PATH`
|
||||
which allows to invoke `eval "$(pyenv init -)"` multiple times without
|
||||
getting duplicate `PATH` entries.
|
||||
|
||||
1. **Installs autocompletion.** This is entirely optional but pretty
|
||||
useful. Sourcing `$(pyenv root)/completions/pyenv.bash` will set that
|
||||
up. There is also a `$(pyenv root)/completions/pyenv.zsh` for Zsh
|
||||
users.
|
||||
2. **Installs autocompletion.** This is entirely optional but pretty
|
||||
useful. Sourcing `$(pyenv root)/completions/pyenv.bash` will set that
|
||||
up. There are also completions for Zsh and Fish.
|
||||
|
||||
2. **Rehashes shims.** From time to time you'll need to rebuild your
|
||||
shim files. Doing this on init makes sure everything is up to
|
||||
date. You can always run `pyenv rehash` manually.
|
||||
3. **Rehashes shims.** From time to time you'll need to rebuild your
|
||||
shim files. Doing this on init makes sure everything is up to
|
||||
date. You can always run `pyenv rehash` manually.
|
||||
|
||||
3. **Installs `pyenv` into the current shell as a shell function.**
|
||||
This bit is also optional, but allows
|
||||
pyenv and plugins to change variables in your current shell, making
|
||||
commands like `pyenv shell` possible. The sh dispatcher doesn't do
|
||||
anything crazy like override `cd` or hack your shell prompt, but if
|
||||
for some reason you need `pyenv` to be a real script rather than a
|
||||
shell function, you can safely skip it.
|
||||
|
||||
`eval "$(pyenv init -)"` is supposed to run at any interactive shell's
|
||||
startup (including nested shells) so that you get completion and
|
||||
convenience shell functions.
|
||||
4. **Installs `pyenv` into the current shell as a shell function.**
|
||||
This bit is also optional, but allows
|
||||
pyenv and plugins to change variables in your current shell.
|
||||
This is required for some commands like `pyenv shell` to work.
|
||||
The sh dispatcher doesn't do
|
||||
anything crazy like override `cd` or hack your shell prompt, but if
|
||||
for some reason you need `pyenv` to be a real script rather than a
|
||||
shell function, you can safely skip it.
|
||||
|
||||
`eval "$(pyenv init --path)"` only does items 1 and 3.
|
||||
|
||||
To see exactly what happens under the hood for yourself, run `pyenv init -`
|
||||
or `pyenv init --path`.
|
||||
|
||||
`eval "$(pyenv init -)"` is supposed to run at any interactive shell's
|
||||
startup (including nested shells -- e.g. those invoked from editors)
|
||||
so that you get completion and convenience shell functions.
|
||||
|
||||
`eval "$(pyenv init --path)"` can be used instead of `eval "$(pyenv init -)"`
|
||||
to just enable shims, without shell integration. It can also be used to bump shims
|
||||
to the front of `PATH` after some other logic has prepended stuff to `PATH`
|
||||
that may shadow Pyenv's shims.
|
||||
|
||||
* In particular, in Debian-based distributions, the stock `~/.profile`
|
||||
prepends per-user `bin` directories to `PATH` after having sourced `~/.bashrc`.
|
||||
This necessitates appending a `pyenv init` call to `~/.profile` as well as `~/.bashrc`
|
||||
in these distributions because the system's Pip places executables for
|
||||
modules installed by a non-root user into those per-user `bin` directories.
|
||||
|
||||
|
||||
### Using Pyenv without shims
|
||||
|
||||
If you don't want to use `pyenv init` and shims, you can still benefit
|
||||
from pyenv's ability to install Python versions for you. Just run
|
||||
`pyenv install` and you will find versions installed in
|
||||
`$(pyenv root)/versions`, which you can manually execute or symlink
|
||||
as required.
|
||||
`$(pyenv root)/versions`.
|
||||
|
||||
### Uninstalling Python Versions
|
||||
You can manually execute or symlink them as required,
|
||||
or you can use [`pyenv exec <command>`](COMMANDS.md#pyenv-exec)
|
||||
whenever you want `<command>` to be affected by Pyenv's version selection
|
||||
as currently configured.
|
||||
|
||||
As time goes on, you will accumulate Python versions in your
|
||||
`$(pyenv root)/versions` directory.
|
||||
|
||||
To remove old Python versions, `pyenv uninstall` command to automate
|
||||
the removal process.
|
||||
|
||||
Alternatively, simply `rm -rf` the directory of the version you want
|
||||
to remove. You can find the directory of a particular Python version
|
||||
with the `pyenv prefix` command, e.g. `pyenv prefix 2.6.8`.
|
||||
`pyenv exec` works by prepending `$(pyenv root)/versions/<selected version>/bin`
|
||||
to `PATH` in the `<command>`'s environment, the same as what e.g. RVM does.
|
||||
|
||||
|
||||
----
|
||||
### Environment variables
|
||||
|
||||
|
||||
## Command Reference
|
||||
|
||||
See [COMMANDS.md](COMMANDS.md).
|
||||
|
||||
|
||||
----
|
||||
|
||||
## Environment variables
|
||||
|
||||
You can affect how pyenv operates with the following settings:
|
||||
You can affect how Pyenv operates with the following settings:
|
||||
|
||||
name | default | description
|
||||
-----|---------|------------
|
||||
`PYENV_VERSION` | | Specifies the Python version to be used.<br>Also see [`pyenv shell`](https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-shell)
|
||||
`PYENV_ROOT` | `~/.pyenv` | Defines the directory under which Python versions and shims reside.<br>Also see `pyenv root`
|
||||
`PYENV_VERSION` | | Specifies the Python version to be used.<br>Also see [`pyenv shell`]COMMANDS.md#pyenv-shell)
|
||||
`PYENV_ROOT` | `~/.pyenv` | Defines the directory under which Python versions and shims reside.<br>Also see [`pyenv root`](COMMANDS.md#pyenv-root)
|
||||
`PYENV_DEBUG` | | Outputs debug information.<br>Also as: `pyenv --debug <subcommand>`
|
||||
`PYENV_HOOK_PATH` | [_see wiki_][hooks] | Colon-separated list of paths searched for pyenv hooks.
|
||||
`PYENV_DIR` | `$PWD` | Directory to start searching for `.python-version` files.
|
||||
`PYTHON_BUILD_ARIA2_OPTS` | | Used to pass additional parameters to [`aria2`](https://aria2.github.io/).<br>If the `aria2c` binary is available on PATH, pyenv uses `aria2c` instead of `curl` or `wget` to download the Python Source code. If you have an unstable internet connection, you can use this variable to instruct `aria2` to accelerate the download.<br>In most cases, you will only need to use `-x 10 -k 1M` as value to `PYTHON_BUILD_ARIA2_OPTS` environment variable
|
||||
`PYTHON_BUILD_ARIA2_OPTS` | | Used to pass additional parameters to [`aria2`](https://aria2.github.io/).<br>If the `aria2c` binary is available on `PATH`, pyenv uses `aria2c` instead of `curl` or `wget` to download the Python Source code. If you have an unstable internet connection, you can use this variable to instruct `aria2` to accelerate the download.<br>In most cases, you will only need to use `-x 10 -k 1M` as value to `PYTHON_BUILD_ARIA2_OPTS` environment variable
|
||||
|
||||
----
|
||||
|
||||
|
||||
## Development
|
||||
@@ -565,9 +596,6 @@ Please feel free to submit pull requests and file bugs on the [issue
|
||||
tracker](https://github.com/pyenv/pyenv/issues).
|
||||
|
||||
|
||||
[pyenv-virtualenv]: https://github.com/pyenv/pyenv-virtualenv#readme
|
||||
[hooks]: https://github.com/pyenv/pyenv/wiki/Authoring-plugins#pyenv-hooks
|
||||
|
||||
### Version History
|
||||
|
||||
See [CHANGELOG.md](CHANGELOG.md).
|
||||
@@ -575,3 +603,7 @@ See [CHANGELOG.md](CHANGELOG.md).
|
||||
### License
|
||||
|
||||
[The MIT License](LICENSE)
|
||||
|
||||
|
||||
[pyenv-virtualenv]: https://github.com/pyenv/pyenv-virtualenv#readme
|
||||
[hooks]: https://github.com/pyenv/pyenv/wiki/Authoring-plugins#pyenv-hooks
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
version="2.0.7"
|
||||
version="2.3.0"
|
||||
git_revision=""
|
||||
|
||||
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q pyenv; then
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
# version's `bin' directory is at the front.
|
||||
#
|
||||
# For example, if the currently selected Python version is 2.7.6:
|
||||
# pyenv exec pip install -rrequirements.txt
|
||||
# pyenv exec pip install -r requirements.txt
|
||||
#
|
||||
# is equivalent to:
|
||||
# PATH="$PYENV_ROOT/versions/2.7.6/bin:$PATH" pip install -rrequirements.txt
|
||||
# PATH="$PYENV_ROOT/versions/2.7.6/bin:$PATH" pip install -r requirements.txt
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
@@ -44,8 +44,9 @@ extract_initial_comment_block() {
|
||||
}
|
||||
|
||||
collect_documentation() {
|
||||
# shellcheck disable=SC2016
|
||||
$(type -P gawk awk | head -1) '
|
||||
# `tail` prevents "broken pipe" errors due to `head` closing thge pipe without reading everything
|
||||
# https://superuser.com/questions/554855/how-can-i-fix-a-broken-pipe-error/642932#642932
|
||||
$(type -P gawk awk | tail -n +1 | head -1) '
|
||||
/^Summary:/ {
|
||||
summary = substr($0, 10)
|
||||
next
|
||||
|
||||
@@ -57,12 +57,15 @@ function main() {
|
||||
;;
|
||||
"path")
|
||||
print_path
|
||||
print_rehash
|
||||
exit 0
|
||||
;;
|
||||
"print")
|
||||
init_dirs
|
||||
print_path
|
||||
print_env
|
||||
print_completion
|
||||
print_rehash
|
||||
print_shell_function
|
||||
exit 0
|
||||
;;
|
||||
@@ -74,7 +77,12 @@ function main() {
|
||||
function help_() {
|
||||
case "$shell" in
|
||||
bash )
|
||||
profile='~/.bash_profile'
|
||||
if [ -e '~/.bash_profile' ]; then
|
||||
profile='~/.bash_profile'
|
||||
else
|
||||
profile='~/.profile'
|
||||
fi
|
||||
profile_explain="~/.bash_profile if it exists, otherwise ~/.profile"
|
||||
rc='~/.bashrc'
|
||||
;;
|
||||
zsh )
|
||||
@@ -92,10 +100,39 @@ function help_() {
|
||||
esac
|
||||
|
||||
{
|
||||
case "$shell" in
|
||||
fish )
|
||||
echo "# Add pyenv executable to PATH by running"
|
||||
echo "# the following interactively:"
|
||||
echo
|
||||
echo 'set -Ux PYENV_ROOT $HOME/.pyenv'
|
||||
echo 'set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths'
|
||||
echo
|
||||
echo "# Load pyenv automatically by appending"
|
||||
echo "# the following to ~/.config/fish/config.fish:"
|
||||
echo
|
||||
echo 'pyenv init - | source'
|
||||
echo
|
||||
;;
|
||||
* )
|
||||
echo '# Load pyenv automatically by appending'
|
||||
echo -n "# the following to "
|
||||
if [ "$profile" == "$rc" ]; then
|
||||
echo "$profile :"
|
||||
else
|
||||
echo
|
||||
echo "${profile_explain:-$profile} (for login shells)"
|
||||
echo "and $rc (for interactive shells) :"
|
||||
fi
|
||||
echo
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"'
|
||||
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"'
|
||||
echo 'eval "$(pyenv init -)"'
|
||||
;;
|
||||
esac
|
||||
echo
|
||||
echo '# Restart your shell for the changes to take effect.'
|
||||
echo
|
||||
echo '# See the README for instructions on how to set up'
|
||||
echo '# your shell environment for Pyenv.'
|
||||
echo
|
||||
} >&2
|
||||
}
|
||||
|
||||
@@ -104,13 +141,15 @@ function init_dirs() {
|
||||
}
|
||||
|
||||
function print_path() {
|
||||
# Need to use the login shell rather than the current one
|
||||
case "$shell" in
|
||||
fish )
|
||||
echo "set -gx PATH '${PYENV_ROOT}/shims' \$PATH"
|
||||
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'
|
||||
;;
|
||||
* )
|
||||
echo 'export PATH="'${PYENV_ROOT}'/shims:${PATH}"'
|
||||
echo 'PATH="$(bash -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
|
||||
}
|
||||
@@ -131,7 +170,9 @@ function print_completion() {
|
||||
if [ -r "$completion" ]; then
|
||||
echo "source '$completion'"
|
||||
fi
|
||||
}
|
||||
|
||||
function print_rehash() {
|
||||
if [ -z "$no_rehash" ]; then
|
||||
echo 'command pyenv rehash 2>/dev/null'
|
||||
fi
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
# Summary: Display prefix for a Python version
|
||||
# Usage: pyenv prefix [<version>]
|
||||
# Summary: Display prefixes for Python versions
|
||||
# Usage: pyenv prefix [<version>...]
|
||||
#
|
||||
# Displays the directory where a Python version is installed. If no
|
||||
# version is given, `pyenv prefix' displays the location of the
|
||||
# currently selected version.
|
||||
# Displays the directories where the given Python versions are installed,
|
||||
# separated by colons. If no version is given, `pyenv prefix' displays the
|
||||
# locations of the currently selected versions.
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
@@ -73,6 +73,8 @@ unset VERBOSE
|
||||
unset HAS_PATCH
|
||||
unset DEBUG
|
||||
|
||||
[ -n "$PYENV_DEBUG" ] && VERBOSE="-v"
|
||||
|
||||
parse_options "$@"
|
||||
for option in "${OPTIONS[@]}"; do
|
||||
case "$option" in
|
||||
|
||||
@@ -112,13 +112,6 @@ is_mac() {
|
||||
[ $# -eq 0 ] || [ "$(osx_version)" "$@" ]
|
||||
}
|
||||
|
||||
is_arm64_apple() {
|
||||
if [ "$(uname -s)" = "Darwin" ] && [ "$(uname -m)" = "arm64" ]; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
# 9.1 -> 901
|
||||
# 10.9 -> 1009
|
||||
# 10.10 -> 1010
|
||||
@@ -773,10 +766,13 @@ build_package_standard_build() {
|
||||
local PACKAGE_CFLAGS="${package_var_name}_CFLAGS"
|
||||
|
||||
if [ "$package_var_name" = "PYTHON" ]; then
|
||||
use_tcltk || true
|
||||
use_homebrew_readline || use_freebsd_pkg || true
|
||||
use_homebrew || true
|
||||
use_tcltk || true
|
||||
use_homebrew_readline || use_freebsd_pkg || true
|
||||
if is_mac -ge 1014; then
|
||||
use_xcode_sdk_zlib || use_homebrew_zlib || true
|
||||
else
|
||||
use_homebrew_zlib || true
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -858,8 +854,8 @@ build_package_jython_builder() {
|
||||
( cd "dist" && build_package_jython )
|
||||
}
|
||||
|
||||
build_package_pyston() {
|
||||
# currently supported version 2.2 and upper
|
||||
build_package_pyston2_2() {
|
||||
# currently supported version 2.2 and 2.3
|
||||
build_package_copy
|
||||
mkdir -p "${PREFIX_PATH}/bin" "${PREFIX_PATH}/lib"
|
||||
local bin
|
||||
@@ -876,6 +872,11 @@ build_package_pyston() {
|
||||
shopt -u nullglob
|
||||
}
|
||||
|
||||
build_package_pyston() {
|
||||
# currently supported version 2.3.1v2 and higher
|
||||
build_package_copy
|
||||
}
|
||||
|
||||
build_package_ironpython() {
|
||||
mkdir -p "${PREFIX_PATH}/bin"
|
||||
cp -fR . "${PREFIX_PATH}/bin"
|
||||
@@ -1042,7 +1043,9 @@ build_package_anaconda() {
|
||||
|
||||
build_package_miniconda() {
|
||||
build_package_anaconda "$@"
|
||||
"${PREFIX_PATH}/bin/conda" install --yes "pip"
|
||||
# Workaround to not upgrade conda when installing pip
|
||||
# see https://github.com/pyenv/pyenv/issues/2070
|
||||
"${PREFIX_PATH}/bin/conda" install --yes "pip" "conda=$(${PREFIX_PATH}/bin/conda --version | cut -d ' ' -f 2)"
|
||||
}
|
||||
|
||||
build_package_copy() {
|
||||
@@ -1318,12 +1321,27 @@ configured_with_package_dir() {
|
||||
return 1
|
||||
}
|
||||
|
||||
use_homebrew() {
|
||||
is_mac || 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
|
||||
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
|
||||
export CPPFLAGS="${CPPFLAGS:+${CPPFLAGS% } }-I${brew_prefix}/include"
|
||||
export LDFLAGS="${LDFLAGS:+${LDFLAGS% } }-L${brew_prefix}/lib"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
needs_yaml() {
|
||||
! configured_with_package_dir "python" "yaml.h" &&
|
||||
! use_homebrew_yaml
|
||||
}
|
||||
|
||||
use_homebrew_yaml() {
|
||||
is_mac || return 1
|
||||
local libdir="$(brew --prefix libyaml 2>/dev/null || true)"
|
||||
if [ -d "$libdir" ]; then
|
||||
echo "python-build: use libyaml from homebrew"
|
||||
@@ -1367,6 +1385,7 @@ has_broken_mac_readline() {
|
||||
}
|
||||
|
||||
use_homebrew_readline() {
|
||||
is_mac || 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
|
||||
@@ -1407,6 +1426,7 @@ has_broken_mac_openssl() {
|
||||
}
|
||||
|
||||
use_homebrew_openssl() {
|
||||
is_mac || 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)"
|
||||
@@ -1506,6 +1526,7 @@ build_package_verify_openssl() {
|
||||
}
|
||||
|
||||
use_homebrew_zlib() {
|
||||
is_mac || return 1
|
||||
local brew_zlib="$(brew --prefix zlib 2>/dev/null || true)"
|
||||
if [ -d "$brew_zlib" ]; then
|
||||
echo "python-build: use zlib from homebrew"
|
||||
@@ -1525,13 +1546,15 @@ use_xcode_sdk_zlib() {
|
||||
}
|
||||
|
||||
use_homebrew_tcltk() {
|
||||
is_mac || return 1
|
||||
# get the version from the folder that homebrew versions
|
||||
local tcltk_version_long="$(ls "$(brew --cellar tcl-tk)")"
|
||||
local tcltk_version="${tcltk_version_long%.*}"
|
||||
local tcltk_flags="--with-tcltk-includes=-I$tcltk_libdir/include --with-tcltk-libs=-L$tcltk_libdir/lib -ltcl$tcltk_version -ltk$tcltk_version"
|
||||
echo "python-build: use tcl-tk from homebrew"
|
||||
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"
|
||||
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"
|
||||
fi
|
||||
}
|
||||
|
||||
# FIXME: this function is a workaround for #1125
|
||||
@@ -1581,7 +1604,9 @@ get_tcltk_flag_from() {
|
||||
}
|
||||
|
||||
use_tcltk() {
|
||||
local tcltk_libdir="$(brew --prefix tcl-tk 2>/dev/null || true)"
|
||||
if is_mac; then
|
||||
local tcltk_libdir="$(brew --prefix tcl-tk 2>/dev/null || true)"
|
||||
fi
|
||||
local tcl_tk_libs="$(get_tcltk_flag_from "$PYTHON_CONFIGURE_OPTS")"
|
||||
|
||||
# if tcltk_ops_flag is in PYTHON_CONFIGURE_OPTS, use user provided tcltk
|
||||
@@ -1593,29 +1618,6 @@ use_tcltk() {
|
||||
fi
|
||||
}
|
||||
|
||||
# CPython 3.9.1+ and 3.8.10+ have old config.sub that doesn't support "arm64" arch
|
||||
# which is what Gnu uname (but not Apple uname) produces on Apple M1
|
||||
# (https://github.com/pyenv/pyenv/pull/2020#issuecomment-891911842)
|
||||
build_package_arm64_apple_disable_homebrew_coreutils() {
|
||||
if is_arm64_apple; then
|
||||
local brew_coreutils="$(brew --prefix coreutils 2>/dev/null || true)"
|
||||
if [ -d "$brew_coreutils" ]; then
|
||||
local after_list=()
|
||||
# Bash 3 ignores IFS set for command when doing expansions so have to set it separately
|
||||
IFS=':'; local -a list=(${PATH}); IFS="$OLDIFS"
|
||||
for str in "${list[@]}"; do
|
||||
if [[ "$str" != "$brew_coreutils"/* ]]; then
|
||||
after_list+=("$str")
|
||||
else
|
||||
echo "python-build: excluding \`$str' from PATH"
|
||||
fi
|
||||
done
|
||||
# Bash 3 ignores IFS set for command when doing expansions so have to set it separately
|
||||
IFS=':'; export PATH="${after_list[*]}"; IFS="$OLDIFS"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
build_package_enable_shared() {
|
||||
package_option python configure --enable-shared
|
||||
}
|
||||
@@ -1647,7 +1649,7 @@ apply_python_patch() {
|
||||
}
|
||||
|
||||
build_package_symlink_version_suffix() {
|
||||
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
||||
if [ -e "${PREFIX_PATH}/bin" ]; then
|
||||
# Always create `bin` as symlink to framework path if the version was built with `--enable-frameowrk` (#590)
|
||||
rm -rf "${PREFIX_PATH}/bin.orig"
|
||||
@@ -2096,7 +2098,7 @@ fi
|
||||
package_option python configure --libdir="${PREFIX_PATH}/lib"
|
||||
|
||||
# python-build: Set `RPATH` if `--enable-shared` was given (#65, #66, #82)
|
||||
if [[ "$CONFIGURE_OPTS" == *"--enable-shared"* ]] || [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-shared"* ]]; then
|
||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--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}"
|
||||
@@ -2109,7 +2111,7 @@ if [[ "$PYPY_OPTS" == *"--shared"* ]]; then
|
||||
fi
|
||||
|
||||
# Add support for framework installation (`--enable-framework`) of CPython (#55, #99)
|
||||
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
||||
if ! is_mac; then
|
||||
echo "python-build: framework installation is not supported." >&2
|
||||
exit 1
|
||||
@@ -2129,13 +2131,21 @@ if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-framework"* ]]; then
|
||||
package_option python configure --enable-framework="${PREFIX_PATH}/Library/Frameworks"
|
||||
fi
|
||||
|
||||
# Build against universal SDK (#219, #220)
|
||||
if [[ "$PYTHON_CONFIGURE_OPTS" == *"--enable-universalsdk"* ]]; then
|
||||
# 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
|
||||
exit 1
|
||||
fi
|
||||
package_option python configure --enable-universalsdk=/ --with-universal-archs=intel
|
||||
package_option python configure --enable-universalsdk=/
|
||||
if [[ "$CONFIGURE_OPTS $PYTHON_CONFIGURE_OPTS" != *"--with-universal-archs"* ]]; then
|
||||
# in CPython's configure.ac, --with-universal-archs defaults to 'intel' which means i386 + x86_64
|
||||
# since 2.7.5 and 3.3.0 -- i.e. in all non-EOL versions
|
||||
# Apple Silicon cannot build these, in it, it rather makes sense to default to Universal2 binaries
|
||||
if [[ $(arch) == "arm64" ]]; then
|
||||
package_option python configure --with-universal-archs=universal2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Compile with `--enable-unicode=ucs4` by default (#257)
|
||||
@@ -2202,6 +2212,9 @@ if [ -z "${GET_PIP_URL}" ]; then
|
||||
3.5 | 3.5.* )
|
||||
GET_PIP_URL="https://bootstrap.pypa.io/pip/3.5/get-pip.py"
|
||||
;;
|
||||
3.6 | 3.6.* )
|
||||
GET_PIP_URL="https://bootstrap.pypa.io/pip/3.6/get-pip.py"
|
||||
;;
|
||||
* )
|
||||
GET_PIP_URL="https://bootstrap.pypa.io/get-pip.py"
|
||||
;;
|
||||
|
||||
@@ -44,7 +44,7 @@ esac
|
||||
|
||||
install_line_fmt = """
|
||||
"{os}-{arch}" )
|
||||
install_script "Miniconda{suffix}-{version_str}-{os}-{arch}" "{repo}/Miniconda{suffix}-{version_str}-{os}-{arch}.sh#{md5}" "miniconda" verify_{py_version}
|
||||
install_script "Miniconda{suffix}-{version_py_version}{version_str}-{os}-{arch}" "{repo}/Miniconda{suffix}-{version_py_version}{version_str}-{os}-{arch}.sh#{md5}" "miniconda" verify_{py_version}
|
||||
;;
|
||||
""".strip()
|
||||
|
||||
@@ -126,17 +126,35 @@ class VersionStr(str):
|
||||
class MinicondaVersion(NamedTuple):
|
||||
suffix: Suffix
|
||||
version_str: VersionStr
|
||||
py_version: Optional[PyVersion]
|
||||
|
||||
@classmethod
|
||||
def from_str(cls, s):
|
||||
miniconda_n, ver = s.split("-")
|
||||
return MinicondaVersion(Suffix(miniconda_n[-1]), VersionStr(ver))
|
||||
"""
|
||||
Convert a string of the form "miniconda_n-ver" or "miniconda_n-py_ver-ver" to a :class:`MinicondaVersion` object.
|
||||
"""
|
||||
components = s.split("-")
|
||||
if len(components) == 3:
|
||||
miniconda_n, py_ver, ver = components
|
||||
py_ver = PyVersion(f"py{py_ver.replace('.', '')}")
|
||||
else:
|
||||
miniconda_n, ver = components
|
||||
py_ver = None
|
||||
return MinicondaVersion(Suffix(miniconda_n[-1]), VersionStr(ver), py_ver)
|
||||
|
||||
def to_filename(self):
|
||||
return f"miniconda{self.suffix}-{self.version_str}"
|
||||
if self.py_version:
|
||||
return f"miniconda{self.suffix}-{self.py_version.version()}-{self.version_str}"
|
||||
else:
|
||||
return f"miniconda{self.suffix}-{self.version_str}"
|
||||
|
||||
def default_py_version(self):
|
||||
if self.suffix == Suffix.TWO:
|
||||
"""
|
||||
:class:`PyVersion` of Python used with this Miniconda version
|
||||
"""
|
||||
if self.py_version:
|
||||
return self.py_version
|
||||
elif self.suffix == Suffix.TWO:
|
||||
return PyVersion.PY27
|
||||
elif self.version_str.info() < (4, 7):
|
||||
# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-python.html
|
||||
@@ -146,7 +164,7 @@ class MinicondaVersion(NamedTuple):
|
||||
|
||||
def with_version_triple(self):
|
||||
return MinicondaVersion(
|
||||
self.suffix, VersionStr.from_info(self.version_str.info()[:3])
|
||||
self.suffix, VersionStr.from_info(self.version_str.info()[:3]), self.py_version
|
||||
)
|
||||
|
||||
|
||||
@@ -160,8 +178,13 @@ class MinicondaSpec(NamedTuple):
|
||||
@classmethod
|
||||
def from_filestem(cls, stem, md5, py_version=None):
|
||||
miniconda_n, ver, os, arch = stem.split("-")
|
||||
if ver.startswith("py"):
|
||||
py_ver, ver = ver.split("_", maxsplit=1)
|
||||
py_ver = PyVersion(py_ver)
|
||||
else:
|
||||
py_ver = None
|
||||
spec = MinicondaSpec(
|
||||
MinicondaVersion(Suffix(miniconda_n[-1]), VersionStr(ver)),
|
||||
MinicondaVersion(Suffix(miniconda_n[-1]), VersionStr(ver), py_ver),
|
||||
SupportedOS(os),
|
||||
SupportedArch(arch),
|
||||
md5,
|
||||
@@ -171,10 +194,14 @@ class MinicondaSpec(NamedTuple):
|
||||
return spec
|
||||
|
||||
def to_install_lines(self):
|
||||
"""
|
||||
Installation command for this version of Miniconda for use in a Pyenv installation script
|
||||
"""
|
||||
return install_line_fmt.format(
|
||||
repo=MINICONDA_REPO,
|
||||
suffix=self.version.suffix,
|
||||
version_str=self.version.version_str,
|
||||
version_py_version=f"{self.version.py_version}_" if self.version.py_version else "",
|
||||
os=self.os,
|
||||
arch=self.arch,
|
||||
md5=self.md5,
|
||||
@@ -195,6 +222,11 @@ def make_script(specs: List[MinicondaSpec]):
|
||||
|
||||
|
||||
def get_existing_minicondas():
|
||||
"""
|
||||
Enumerate existing Miniconda installation scripts in share/python-build/ except rolling releases.
|
||||
|
||||
:returns: A generator of :class:`MinicondaVersion` objects.
|
||||
"""
|
||||
logger.info("Getting known miniconda versions")
|
||||
for p in out_dir.iterdir():
|
||||
name = p.name
|
||||
@@ -210,6 +242,12 @@ def get_existing_minicondas():
|
||||
|
||||
|
||||
def get_available_minicondas():
|
||||
"""
|
||||
Fetch remote miniconda versions.
|
||||
|
||||
:returns: A generator of :class:`MinicondaSpec` objects for each release available for download
|
||||
except rolling releases.
|
||||
"""
|
||||
logger.info("Fetching remote miniconda versions")
|
||||
session = requests_html.HTMLSession()
|
||||
response = session.get(MINICONDA_REPO)
|
||||
@@ -250,7 +288,7 @@ if __name__ == "__main__":
|
||||
help="Do not write scripts, just report them to stdout",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-v", "--verbose", action="count",
|
||||
"-v", "--verbose", action="count", default=0,
|
||||
help="Increase verbosity of logging",
|
||||
)
|
||||
parsed = parser.parse_args()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#require_gcc
|
||||
export PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA="openssl@1.1 openssl@1.0 openssl"
|
||||
install_package "openssl-1.0.2q" "https://www.openssl.org/source/old/1.0.2/openssl-1.0.2q.tar.gz#5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684" 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#require_gcc
|
||||
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 "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
|
||||
install_git "Python-3.10-dev" "https://github.com/python/cpython" 3.10 standard verify_py310 copy_python_gdb ensurepip
|
||||
|
||||
10
plugins/python-build/share/python-build/3.10.0
Normal file
10
plugins/python-build/share/python-build/3.10.0
Normal file
@@ -0,0 +1,10 @@
|
||||
#require_gcc
|
||||
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.10.0" "https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz#5a99f8e7a6a11a7b98b4e75e0d1303d3832cada5534068f69c7b6222a7b1b002" standard verify_py310 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.10.0" "https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz#c4e0cbad57c90690cb813fb4663ef670b4d0f587d8171e2c42bd4c9245bd2758" standard verify_py310 copy_python_gdb ensurepip
|
||||
fi
|
||||
@@ -1,10 +0,0 @@
|
||||
#require_gcc
|
||||
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
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.10.0rc2" "https://www.python.org/ftp/python/3.10.0/Python-3.10.0rc2.tar.xz#e75b56088548b7b9ad1f2571e6f5a2315e4808cb6b5fbe8288502afc802b2f24" standard verify_py310 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.10.0rc2" "https://www.python.org/ftp/python/3.10.0/Python-3.10.0rc2.tgz#0f8bf53dbe6f85785d502e73984aa3f12f67ac4958d9b8d8012019c35c646fe2" standard verify_py310 copy_python_gdb ensurepip
|
||||
fi
|
||||
10
plugins/python-build/share/python-build/3.10.1
Normal file
10
plugins/python-build/share/python-build/3.10.1
Normal file
@@ -0,0 +1,10 @@
|
||||
#require_gcc
|
||||
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.10.1" "https://www.python.org/ftp/python/3.10.1/Python-3.10.1.tar.xz#a7f1265b6e1a5de1ec5c3ec7019ab53413469934758311e9d240c46e5ae6e177" standard verify_py310 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.10.1" "https://www.python.org/ftp/python/3.10.1/Python-3.10.1.tgz#b76117670e7c5064344b9c138e141a377e686b9063f3a8a620ff674fa8ec90d3" standard verify_py310 copy_python_gdb ensurepip
|
||||
fi
|
||||
10
plugins/python-build/share/python-build/3.10.2
Normal file
10
plugins/python-build/share/python-build/3.10.2
Normal file
@@ -0,0 +1,10 @@
|
||||
#require_gcc
|
||||
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.10.2" "https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tar.xz#17de3ac7da9f2519aa9d64378c603a73a0e9ad58dffa8812e45160c086de64c7" standard verify_py310 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.10.2" "https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tgz#3c0ede893011319f9b0a56b44953a3d52c7abf9657c23fb4bc9ced93b86e9c97" standard verify_py310 copy_python_gdb ensurepip
|
||||
fi
|
||||
10
plugins/python-build/share/python-build/3.10.3
Normal file
10
plugins/python-build/share/python-build/3.10.3
Normal file
@@ -0,0 +1,10 @@
|
||||
#require_gcc
|
||||
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.10.3" "https://www.python.org/ftp/python/3.10.3/Python-3.10.3.tar.xz#596c72de998dc39205bc4f70ef0dbf7edec740a306d09b49a9bd0a77806730dc" standard verify_py310 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.10.3" "https://www.python.org/ftp/python/3.10.3/Python-3.10.3.tgz#5a3b029bad70ba2a019ebff08a65060a8b9b542ffc1a83c697f1449ecca9813b" standard verify_py310 copy_python_gdb ensurepip
|
||||
fi
|
||||
10
plugins/python-build/share/python-build/3.10.4
Normal file
10
plugins/python-build/share/python-build/3.10.4
Normal file
@@ -0,0 +1,10 @@
|
||||
#require_gcc
|
||||
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.10.4" "https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tar.xz#80bf925f571da436b35210886cf79f6eb5fa5d6c571316b73568343451f77a19" standard verify_py310 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.10.4" "https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz#f3bcc65b1d5f1dc78675c746c98fcee823c038168fc629c5935b044d0911ad28" standard verify_py310 copy_python_gdb ensurepip
|
||||
fi
|
||||
10
plugins/python-build/share/python-build/3.11.0a7
Normal file
10
plugins/python-build/share/python-build/3.11.0a7
Normal file
@@ -0,0 +1,10 @@
|
||||
#require_gcc
|
||||
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.0a7" "https://www.python.org/ftp/python/3.11.0/Python-3.11.0a7.tar.xz#b7c56dd74c2f472d496b5a8d356bd6ad9ef9b03f26288c3237d3ff698ab03d74" standard verify_py311 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.11.0a7" "https://www.python.org/ftp/python/3.11.0/Python-3.11.0a7.tgz#6cc20b9b53a8e7a29e0fd56a0d502ff64a5677507fcf2c503decf732a31c513d" standard verify_py311 copy_python_gdb ensurepip
|
||||
fi
|
||||
@@ -1,6 +1,5 @@
|
||||
#require_gcc
|
||||
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.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
|
||||
|
||||
10
plugins/python-build/share/python-build/3.7.13
Normal file
10
plugins/python-build/share/python-build/3.7.13
Normal file
@@ -0,0 +1,10 @@
|
||||
#require_gcc
|
||||
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.13" "https://www.python.org/ftp/python/3.7.13/Python-3.7.13.tar.xz#99f106275df8899c3e8cb9d7c01ce686c202ef275953301427194693de5bef84" standard verify_py37 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.7.13" "https://www.python.org/ftp/python/3.7.13/Python-3.7.13.tgz#e405417f50984bc5870c7e7a9f9aeb93e9d270f5ac67f667a0cd3a09439682b5" standard verify_py37 copy_python_gdb ensurepip
|
||||
fi
|
||||
@@ -3,4 +3,4 @@ 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 "Python-3.8-dev" "https://github.com/python/cpython" "3.8" arm64_apple_disable_homebrew_coreutils standard verify_py38 copy_python_gdb ensurepip
|
||||
install_git "Python-3.8-dev" "https://github.com/python/cpython" "3.8" standard verify_py38 copy_python_gdb ensurepip
|
||||
|
||||
@@ -4,7 +4,7 @@ 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
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.8.10" "https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tar.xz#6af24a66093dd840bcccf371d4044a3027e655cf24591ce26e48022bc79219d9" arm64_apple_disable_homebrew_coreutils standard verify_py38 copy_python_gdb ensurepip
|
||||
install_package "Python-3.8.10" "https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tar.xz#6af24a66093dd840bcccf371d4044a3027e655cf24591ce26e48022bc79219d9" standard verify_py38 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.8.10" "https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tgz#b37ac74d2cbad2590e7cd0dd2b3826c29afe89a734090a87bf8c03c45066cb65" arm64_apple_disable_homebrew_coreutils standard verify_py38 copy_python_gdb ensurepip
|
||||
install_package "Python-3.8.10" "https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tgz#b37ac74d2cbad2590e7cd0dd2b3826c29afe89a734090a87bf8c03c45066cb65" standard verify_py38 copy_python_gdb ensurepip
|
||||
fi
|
||||
|
||||
@@ -4,7 +4,7 @@ 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.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.11" "https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tar.xz#fb1a1114ebfe9e97199603c6083e20b236a0e007a2c51f29283ffb50c1420fb2" arm64_apple_disable_homebrew_coreutils standard verify_py38 copy_python_gdb ensurepip
|
||||
install_package "Python-3.8.11" "https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tar.xz#fb1a1114ebfe9e97199603c6083e20b236a0e007a2c51f29283ffb50c1420fb2" standard verify_py38 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.8.11" "https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz#b77464ea80cec14581b86aeb7fb2ff02830e0abc7bcdc752b7b4bdfcd8f3e393" arm64_apple_disable_homebrew_coreutils standard verify_py38 copy_python_gdb ensurepip
|
||||
install_package "Python-3.8.11" "https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz#b77464ea80cec14581b86aeb7fb2ff02830e0abc7bcdc752b7b4bdfcd8f3e393" standard verify_py38 copy_python_gdb ensurepip
|
||||
fi
|
||||
|
||||
10
plugins/python-build/share/python-build/3.8.13
Normal file
10
plugins/python-build/share/python-build/3.8.13
Normal file
@@ -0,0 +1,10 @@
|
||||
#require_gcc
|
||||
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.13" "https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tar.xz#6f309077012040aa39fe8f0c61db8c0fa1c45136763299d375c9e5756f09cf57" standard verify_py38 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.8.13" "https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tgz#903b92d76354366b1d9c4434d0c81643345cef87c1600adfa36095d7b00eede4" standard verify_py38 copy_python_gdb ensurepip
|
||||
fi
|
||||
@@ -3,4 +3,4 @@ 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 "Python-3.9-dev" "https://github.com/python/cpython" 3.9 arm64_apple_disable_homebrew_coreutils standard verify_py39 copy_python_gdb ensurepip
|
||||
install_git "Python-3.9-dev" "https://github.com/python/cpython" 3.9 standard verify_py39 copy_python_gdb ensurepip
|
||||
|
||||
@@ -4,8 +4,8 @@ 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
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.9.1" "https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tar.xz#991c3f8ac97992f3d308fefeb03a64db462574eadbff34ce8bc5bb583d9903ff" arm64_apple_disable_homebrew_coreutils standard verify_py39 copy_python_gdb ensurepip
|
||||
install_package "Python-3.9.1" "https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tar.xz#991c3f8ac97992f3d308fefeb03a64db462574eadbff34ce8bc5bb583d9903ff" standard verify_py39 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.9.1" "https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz#29cb91ba038346da0bd9ab84a0a55a845d872c341a4da6879f462e94c741f117" arm64_apple_disable_homebrew_coreutils standard verify_py39 copy_python_gdb ensurepip
|
||||
install_package "Python-3.9.1" "https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz#29cb91ba038346da0bd9ab84a0a55a845d872c341a4da6879f462e94c741f117" standard verify_py39 copy_python_gdb ensurepip
|
||||
fi
|
||||
|
||||
|
||||
10
plugins/python-build/share/python-build/3.9.10
Normal file
10
plugins/python-build/share/python-build/3.9.10
Normal file
@@ -0,0 +1,10 @@
|
||||
#require_gcc
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1l" "https://www.openssl.org/source/openssl-1.1.1l.tar.gz#0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1" 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.10" "https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tar.xz#0a8fbfb5287ebc3a13e9baf3d54e08fa06778ffeccf6311aef821bb3a6586cc8" standard verify_py39 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.9.10" "https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tgz#1aa9c0702edbae8f6a2c95f70a49da8420aaa76b7889d3419c186bfc8c0e571e" standard verify_py39 copy_python_gdb ensurepip
|
||||
fi
|
||||
10
plugins/python-build/share/python-build/3.9.11
Normal file
10
plugins/python-build/share/python-build/3.9.11
Normal file
@@ -0,0 +1,10 @@
|
||||
#require_gcc
|
||||
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.11" "https://www.python.org/ftp/python/3.9.11/Python-3.9.11.tar.xz#66767a35309d724f370df9e503c172b4ee444f49d62b98bc4eca725123e26c49" standard verify_py39 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.9.11" "https://www.python.org/ftp/python/3.9.11/Python-3.9.11.tgz#3442400072f582ac2f0df30895558f08883b416c8c7877ea55d40d00d8a93112" standard verify_py39 copy_python_gdb ensurepip
|
||||
fi
|
||||
10
plugins/python-build/share/python-build/3.9.12
Normal file
10
plugins/python-build/share/python-build/3.9.12
Normal file
@@ -0,0 +1,10 @@
|
||||
#require_gcc
|
||||
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.12" "https://www.python.org/ftp/python/3.9.12/Python-3.9.12.tar.xz#2cd94b20670e4159c6d9ab57f91dbf255b97d8c1a1451d1c35f4ec1968adf971" standard verify_py39 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.9.12" "https://www.python.org/ftp/python/3.9.12/Python-3.9.12.tgz#70e08462ebf265012bd2be88a63d2149d880c73e53f1712b7bbbe93750560ae8" standard verify_py39 copy_python_gdb ensurepip
|
||||
fi
|
||||
@@ -4,8 +4,8 @@ export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1i" "https://www.openssl.org/source/old/1.1.1/openssl-1.1.1i.tar.gz#e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242" 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.9.2" "https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tar.xz#3c2034c54f811448f516668dce09d24008a0716c3a794dd8639b5388cbde247d" arm64_apple_disable_homebrew_coreutils standard verify_py39 copy_python_gdb ensurepip
|
||||
install_package "Python-3.9.2" "https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tar.xz#3c2034c54f811448f516668dce09d24008a0716c3a794dd8639b5388cbde247d" standard verify_py39 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.9.2" "https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tgz#7899e8a6f7946748830d66739f2d8f2b30214dad956e56b9ba216b3de5581519" arm64_apple_disable_homebrew_coreutils standard verify_py39 copy_python_gdb ensurepip
|
||||
install_package "Python-3.9.2" "https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tgz#7899e8a6f7946748830d66739f2d8f2b30214dad956e56b9ba216b3de5581519" standard verify_py39 copy_python_gdb ensurepip
|
||||
fi
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ 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
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.9.4" "https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz#4b0e6644a76f8df864ae24ac500a51bbf68bd098f6a173e27d3b61cdca9aa134" arm64_apple_disable_homebrew_coreutils standard verify_py39 copy_python_gdb ensurepip
|
||||
install_package "Python-3.9.4" "https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz#4b0e6644a76f8df864ae24ac500a51bbf68bd098f6a173e27d3b61cdca9aa134" standard verify_py39 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.9.4" "https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tgz#66c4de16daa74a825cf9da9ddae1fe020b72c3854b73b1762011cc33f9e4592f" arm64_apple_disable_homebrew_coreutils standard verify_py39 copy_python_gdb ensurepip
|
||||
install_package "Python-3.9.4" "https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tgz#66c4de16daa74a825cf9da9ddae1fe020b72c3854b73b1762011cc33f9e4592f" standard verify_py39 copy_python_gdb ensurepip
|
||||
fi
|
||||
|
||||
@@ -4,7 +4,7 @@ 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
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.9.5" "https://www.python.org/ftp/python/3.9.5/Python-3.9.5.tar.xz#0c5a140665436ec3dbfbb79e2dfb6d192655f26ef4a29aeffcb6d1820d716d83" arm64_apple_disable_homebrew_coreutils standard verify_py39 copy_python_gdb ensurepip
|
||||
install_package "Python-3.9.5" "https://www.python.org/ftp/python/3.9.5/Python-3.9.5.tar.xz#0c5a140665436ec3dbfbb79e2dfb6d192655f26ef4a29aeffcb6d1820d716d83" standard verify_py39 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.9.5" "https://www.python.org/ftp/python/3.9.5/Python-3.9.5.tgz#e0fbd5b6e1ee242524430dee3c91baf4cbbaba4a72dd1674b90fda87b713c7ab" arm64_apple_disable_homebrew_coreutils standard verify_py39 copy_python_gdb ensurepip
|
||||
install_package "Python-3.9.5" "https://www.python.org/ftp/python/3.9.5/Python-3.9.5.tgz#e0fbd5b6e1ee242524430dee3c91baf4cbbaba4a72dd1674b90fda87b713c7ab" standard verify_py39 copy_python_gdb ensurepip
|
||||
fi
|
||||
|
||||
@@ -4,7 +4,7 @@ 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.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.6" "https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tar.xz#397920af33efc5b97f2e0b57e91923512ef89fc5b3c1d21dbfc8c4828ce0108a" arm64_apple_disable_homebrew_coreutils standard verify_py39 copy_python_gdb ensurepip
|
||||
install_package "Python-3.9.6" "https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tar.xz#397920af33efc5b97f2e0b57e91923512ef89fc5b3c1d21dbfc8c4828ce0108a" standard verify_py39 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.9.6" "https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz#d0a35182e19e416fc8eae25a3dcd4d02d4997333e4ad1f2eee6010aadc3fe866" arm64_apple_disable_homebrew_coreutils standard verify_py39 copy_python_gdb ensurepip
|
||||
install_package "Python-3.9.6" "https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz#d0a35182e19e416fc8eae25a3dcd4d02d4997333e4ad1f2eee6010aadc3fe866" standard verify_py39 copy_python_gdb ensurepip
|
||||
fi
|
||||
|
||||
10
plugins/python-build/share/python-build/3.9.8
Normal file
10
plugins/python-build/share/python-build/3.9.8
Normal file
@@ -0,0 +1,10 @@
|
||||
#require_gcc
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1l" "https://www.openssl.org/source/openssl-1.1.1l.tar.gz#0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1" 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.8" "https://www.python.org/ftp/python/3.9.8/Python-3.9.8.tar.xz#675ce09bf23c09836bf1969b744b1ea4c1a18c32788626632525f08444ebad5c" standard verify_py39 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.9.8" "https://www.python.org/ftp/python/3.9.8/Python-3.9.8.tgz#7447fb8bb270942d620dd24faa7814b1383b61fa99029a240025fd81c1db8283" standard verify_py39 copy_python_gdb ensurepip
|
||||
fi
|
||||
10
plugins/python-build/share/python-build/3.9.9
Normal file
10
plugins/python-build/share/python-build/3.9.9
Normal file
@@ -0,0 +1,10 @@
|
||||
#require_gcc
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1l" "https://www.openssl.org/source/openssl-1.1.1l.tar.gz#0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1" 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.9" "https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tar.xz#06828c04a573c073a4e51c4292a27c1be4ae26621c3edc7cf9318418ce3b6d27" standard verify_py39 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.9.9" "https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tgz#2cc7b67c1f3f66c571acc42479cdf691d8ed6b47bee12c9b68430413a17a44ea" standard verify_py39 copy_python_gdb ensurepip
|
||||
fi
|
||||
19
plugins/python-build/share/python-build/anaconda3-2021.11
Normal file
19
plugins/python-build/share/python-build/anaconda3-2021.11
Normal file
@@ -0,0 +1,19 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-ppc64le" )
|
||||
install_script "Anaconda3-2021.11-Linux-ppc64le" "https://repo.continuum.io/archive/Anaconda3-2021.11-Linux-ppc64le.sh#7eb6a95925ee756240818599f8dcbba7a155adfb05ef6cd5336aa3c083de65f3" "anaconda" verify_py39
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Anaconda3-2021.11-Linux-x86_64" "https://repo.continuum.io/archive/Anaconda3-2021.11-Linux-x86_64.sh#fedf9e340039557f7b5e8a8a86affa9d299f5e9820144bd7b92ae9f7ee08ac60" "anaconda" verify_py39
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Anaconda3-2021.11-MacOSX-x86_64" "https://repo.continuum.io/archive/Anaconda3-2021.11-MacOSX-x86_64.sh#6a9217d1a08c599f860045d56ef64fc6c3e3112b55cc97f3d07c573d7bbcdb58" "anaconda" verify_py39
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of Anaconda3 is not available for $(anaconda_architecture 2>/dev/null || true)."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
48
plugins/python-build/share/python-build/graalpython-21.3.0
Normal file
48
plugins/python-build/share/python-build/graalpython-21.3.0
Normal file
@@ -0,0 +1,48 @@
|
||||
# Copyright (c) 2021, 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='21.3.0'
|
||||
BUILD=''
|
||||
|
||||
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||
"linux64" )
|
||||
graalpython_arch="linux"
|
||||
checksum="b17bbc9753fb04f03290660952acfd212020676603970323780f190509b061b9"
|
||||
;;
|
||||
"osx64" )
|
||||
graalpython_arch="macos"
|
||||
checksum="feecbd2567a43aeaeb5ca6a7385ef3d5bd2c94e563b64afee7dcce0c8f87a1c9"
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": No binary distribution of GraalPython is available for $(pypy_architecture 2>/dev/null || true)."
|
||||
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 "graalpython-${VERSION}${BUILD}" "${urlprefix}/graalpython-${VERSION}-${graalpython_arch}-amd64.tar.gz#${checksum}" "graalpython" ensurepip
|
||||
48
plugins/python-build/share/python-build/graalpython-22.0.0
Normal file
48
plugins/python-build/share/python-build/graalpython-22.0.0
Normal file
@@ -0,0 +1,48 @@
|
||||
# Copyright (c) 2021, 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.0.0.2'
|
||||
BUILD=''
|
||||
|
||||
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||
"linux64" )
|
||||
graalpython_arch="linux"
|
||||
checksum="e80c6051a609e7e1403b96992951814e967cf6deb9ca2507e691769d01970d55"
|
||||
;;
|
||||
"osx64" )
|
||||
graalpython_arch="macos"
|
||||
checksum="5b0476321162557a7b43e6cdadfc187280bc40a3452d327a4ae8d624afaa5336"
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": No binary distribution of GraalPython is available for $(pypy_architecture 2>/dev/null || true)."
|
||||
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 "graalpython-${VERSION}${BUILD}" "${urlprefix}/graalpython-${VERSION}-${graalpython_arch}-amd64.tar.gz#${checksum}" "graalpython" ensurepip
|
||||
48
plugins/python-build/share/python-build/graalpython-22.1.0
Normal file
48
plugins/python-build/share/python-build/graalpython-22.1.0
Normal file
@@ -0,0 +1,48 @@
|
||||
# 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.1.0'
|
||||
BUILD=''
|
||||
|
||||
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||
"linux64" )
|
||||
graalpython_arch="linux"
|
||||
checksum="06862993573b64bd64c802aace9135192a4ba28a15d8260c42c5de632ad616bc"
|
||||
;;
|
||||
"osx64" )
|
||||
graalpython_arch="macos"
|
||||
checksum="88b22ea4a5cb8345b680d15cc385dff7a8ab858fdf0e182c79c6c3b74755de6c"
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": No binary distribution of GraalPython is available for $(pypy_architecture 2>/dev/null || true)."
|
||||
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 "graalpython-${VERSION}${BUILD}" "${urlprefix}/graalpython-${VERSION}-${graalpython_arch}-amd64.tar.gz#${checksum}" "graalpython" ensurepip
|
||||
22
plugins/python-build/share/python-build/mambaforge-4.10.3-10
Normal file
22
plugins/python-build/share/python-build/mambaforge-4.10.3-10
Normal file
@@ -0,0 +1,22 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-x86_64" )
|
||||
install_script "Mambaforge-4.10.3-10-Linux-x86_64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Mambaforge-4.10.3-10-Linux-x86_64.sh#8b789c619d03760e606a9c9b3d098414653f6037b80f16174ad94f0ee0c679d8" "miniconda" verify_py38
|
||||
;;
|
||||
"Linux-aarch64" )
|
||||
install_script "Mambaforge-4.10.3-10-Linux-aarch64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Mambaforge-4.10.3-10-Linux-aarch64.sh#60a1d50c92fe1d48e2744effca9e7b51bfd5cc4e863dbcdb762ed48020703e3a" "miniconda" verify_py38
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Mambaforge-4.10.3-10-MacOSX-arm64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Mambaforge-4.10.3-10-MacOSX-arm64.sh#72bc86612ab9435915b616c2edb076737cbabe2c33fd684d58c2f9ae72e1957c" "miniconda" verify_py39
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Mambaforge-4.10.3-10-MacOSX-x86_64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Mambaforge-4.10.3-10-MacOSX-x86_64.sh#7c44259a0982cd3ef212649678af5f0dd4e0bb7306e8fffc93601dd1d739ec0b" "miniconda" verify_py38
|
||||
;;
|
||||
* )
|
||||
{ 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
|
||||
@@ -1,4 +1,4 @@
|
||||
ase "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-ppc64le" )
|
||||
install_script "Mambaforge-pypy3-Linux-ppc64le" "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-pypy3-Linux-ppc64le.sh" "miniconda" verify_py3_latest
|
||||
;;
|
||||
|
||||
4
plugins/python-build/share/python-build/micropython-1.16
Normal file
4
plugins/python-build/share/python-build/micropython-1.16
Normal file
@@ -0,0 +1,4 @@
|
||||
has_tar_xz_support \
|
||||
&& { install=install_package; src="https://micropython.org/resources/source/micropython-1.16.tar.xz#48271fb5da97efc22325c3fc1d87ba45b32bab25673206d8d8136c25e4ff29a9"; } \
|
||||
|| { install=install_zip; src="https://micropython.org/resources/source/micropython-1.16.zip#427adc00d2a99d102e4ce46d9eb4933d168e863f859bb3ce5b84735f0899c1ed"; }
|
||||
$install micropython-1.16 "$src" micropython
|
||||
4
plugins/python-build/share/python-build/micropython-1.17
Normal file
4
plugins/python-build/share/python-build/micropython-1.17
Normal file
@@ -0,0 +1,4 @@
|
||||
has_tar_xz_support \
|
||||
&& { install=install_package; src="https://micropython.org/resources/source/micropython-1.17.tar.xz#e322f915cee784de0f8614779cdb88fce175956975b3864e2d1898a53638a2f7"; } \
|
||||
|| { install=install_zip; src="https://micropython.org/resources/source/micropython-1.17.zip#4dfc60e2ba67e89c0b794c0533bb4e43a10d4e38095d0640b64b4faa9160f244"; }
|
||||
$install micropython-1.17 "$src" micropython
|
||||
19
plugins/python-build/share/python-build/miniconda2-2.7-4.8.3
Normal file
19
plugins/python-build/share/python-build/miniconda2-2.7-4.8.3
Normal file
@@ -0,0 +1,19 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-ppc64le" )
|
||||
install_script "Miniconda2-py27_4.8.3-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda2-py27_4.8.3-Linux-ppc64le.sh#120b300120b1362831f2075cc0bd452f" "miniconda" verify_py27
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda2-py27_4.8.3-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda2-py27_4.8.3-Linux-x86_64.sh#19ce7d0039ab349914d928e7f32b1c1b" "miniconda" verify_py27
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda2-py27_4.8.3-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda2-py27_4.8.3-MacOSX-x86_64.sh#14e2d294decc5a48a449b588f5819c10" "miniconda" verify_py27
|
||||
;;
|
||||
* )
|
||||
{ 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,19 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-ppc64le" )
|
||||
install_script "Miniconda3-py37_4.10.3-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-ppc64le.sh#a926bbaf28d59ac1264799e3ca770a44" "miniconda" verify_py37
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-py37_4.10.3-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-x86_64.sh#9f186c1d86c266acc47dbc1603f0e2ed" "miniconda" verify_py37
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py37_4.10.3-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-MacOSX-x86_64.sh#b88a2eb66917c55a6bd1973fabaf05b3" "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,19 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-ppc64le" )
|
||||
install_script "Miniconda3-py37_4.11.0-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.11.0-Linux-ppc64le.sh#cf7cbccc16bf82365bbf0129f646ff45" "miniconda" verify_py37
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-py37_4.11.0-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.11.0-Linux-x86_64.sh#7675bd23411179956bcc4692f16ef27d" "miniconda" verify_py37
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py37_4.11.0-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py37_4.11.0-MacOSX-x86_64.sh#0dde31d693fbcb4feb1eb4292cba4371" "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,19 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-ppc64le" )
|
||||
install_script "Miniconda3-py38_4.10.3-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linux-ppc64le.sh#12ddb1b94f30f8fc633c3223b0398d2f" "miniconda" verify_py38
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-py38_4.10.3-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linux-x86_64.sh#14da4a9a44b337f7ccb8363537f65b9c" "miniconda" verify_py38
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py38_4.10.3-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-MacOSX-x86_64.sh#cb609591c280423e999fc421cdb779d3" "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,19 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-ppc64le" )
|
||||
install_script "Miniconda3-py38_4.11.0-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.11.0-Linux-ppc64le.sh#adec9893a69557f1eaadce56f24f6614" "miniconda" verify_py38
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-py38_4.11.0-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.11.0-Linux-x86_64.sh#252d3b0c863333639f99fbc465ee1d61" "miniconda" verify_py38
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py38_4.11.0-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py38_4.11.0-MacOSX-x86_64.sh#e0ab9762f3d20d23bbff4b804a03cb08" "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,19 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-ppc64le" )
|
||||
install_script "Miniconda3-py39_4.10.3-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-ppc64le.sh#07ea41c691bdcc7d9c71cae1a1a88151" "miniconda" verify_py39
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-py39_4.10.3-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh#8c69f65a4ae27fb41df0fe552b4a8a3b" "miniconda" verify_py39
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py39_4.10.3-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-MacOSX-x86_64.sh#09bb30a9204ced74ce3c06762cb442fc" "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
|
||||
@@ -0,0 +1,19 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-ppc64le" )
|
||||
install_script "Miniconda3-py39_4.11.0-Linux-ppc64le" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-ppc64le.sh#305e55110a3ad9384230e5fe396ccd89" "miniconda" verify_py39
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-py39_4.11.0-Linux-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-x86_64.sh#4e2f31e0b2598634c80daa12e4981647" "miniconda" verify_py39
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-py39_4.11.0-MacOSX-x86_64" "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-MacOSX-x86_64.sh#d1303e5c7510b2ef444b9ba474551733" "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
|
||||
@@ -5,9 +5,15 @@ case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniconda3-latest-Linux-x86_64" "https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh" "miniconda" verify_py3_latest
|
||||
;;
|
||||
"Linux-aarch64" )
|
||||
install_script "Miniconda3-latest-Linux-aarch64" "https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-aarch64.sh" "miniconda" verify_py3_latest
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniconda3-latest-MacOSX-x86_64" "https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh" "miniconda" verify_py3_latest
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Miniconda3-latest-MacOSX-arm64" "https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-arm64.sh" "miniconda" verify_py3_latest
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
|
||||
25
plugins/python-build/share/python-build/miniforge3-4.10.3-10
Normal file
25
plugins/python-build/share/python-build/miniforge3-4.10.3-10
Normal file
@@ -0,0 +1,25 @@
|
||||
case "$(anaconda_architecture 2>/dev/null || true)" in
|
||||
"Linux-ppc64le" )
|
||||
install_script "Miniforge3-4.10.3-10-Linux-ppc64le" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Miniforge3-4.10.3-10-Linux-ppc64le.sh#8df85d4af3d2d24f86bb6784d4c196b770b7b9c0be8917d79aec9e08f517d0e9" "miniconda" verify_py38
|
||||
;;
|
||||
"Linux-x86_64" )
|
||||
install_script "Miniforge3-4.10.3-10-Linux-x86_64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Miniforge3-4.10.3-10-Linux-x86_64.sh#8ed8cd582d16cd58e0ccd87e692fbe71de6365a51678b579b2f40d8d6f6e5771" "miniconda" verify_py38
|
||||
;;
|
||||
"Linux-aarch64" )
|
||||
install_script "Miniforge3-4.10.3-10-Linux-aarch64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Miniforge3-4.10.3-10-Linux-aarch64.sh#b2d510c6cd0aac3964a7a7838a7f7376b804fbdd0ba04909ece53f883f624233" "miniconda" verify_py38
|
||||
;;
|
||||
"MacOSX-arm64" )
|
||||
install_script "Miniforge3-4.10.3-10-MacOSX-arm64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Miniforge3-4.10.3-10-MacOSX-arm64.sh#bd4d59ead779a6e2d9af69fd8cdcaac8e1446191c59ab446ae8547a1aecd75b7" "miniconda" verify_py39
|
||||
;;
|
||||
"MacOSX-x86_64" )
|
||||
install_script "Miniforge3-4.10.3-10-MacOSX-x86_64" "https://github.com/conda-forge/miniforge/releases/download/4.10.3-10/Miniforge3-4.10.3-10-MacOSX-x86_64.sh#7d325a5370664ec2fe1c09c3066c22fd905431f338c7eed31ad7e14c7ce4bd83" "miniconda" verify_py38
|
||||
;;
|
||||
* )
|
||||
{ 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
|
||||
6
plugins/python-build/share/python-build/nogil-3.9.10
Normal file
6
plugins/python-build/share/python-build/nogil-3.9.10
Normal file
@@ -0,0 +1,6 @@
|
||||
#require_gcc
|
||||
prefer_openssl11
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-1.1.1l" "https://www.openssl.org/source/openssl-1.1.1l.tar.gz#0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1" 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
|
||||
install_package "nogil-3.9.10" "https://github.com/colesbury/nogil/archive/refs/tags/v3.9.10-nogil.tar.gz#5058c0ec07f0444673b86977c18e786183ca35617d9e6ada2329f7a87a4a0993" standard verify_py39 copy_python_gdb ensurepip
|
||||
@@ -0,0 +1,41 @@
|
||||
From 5495fb4719fa67ea3abeda0434699c8b28c77bb3 Mon Sep 17 00:00:00 2001
|
||||
From: Takumi Sueda <puhitaku@gmail.com>
|
||||
Date: Sat, 11 Sep 2021 16:50:14 +0900
|
||||
Subject: [PATCH 1/7] Detect arm64 in configure
|
||||
|
||||
---
|
||||
configure | 3 +++
|
||||
configure.ac | 3 +++
|
||||
2 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 63d675312d..c40ec120de 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -8474,6 +8474,9 @@ fi
|
||||
ppc)
|
||||
MACOSX_DEFAULT_ARCH="ppc64"
|
||||
;;
|
||||
+ arm64)
|
||||
+ MACOSX_DEFAULT_ARCH="arm64"
|
||||
+ ;;
|
||||
*)
|
||||
as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5
|
||||
;;
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index efe6922b5d..df05bee87b 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2066,6 +2066,9 @@ case $ac_sys_system/$ac_sys_release in
|
||||
ppc)
|
||||
MACOSX_DEFAULT_ARCH="ppc64"
|
||||
;;
|
||||
+ arm64)
|
||||
+ MACOSX_DEFAULT_ARCH="arm64"
|
||||
+ ;;
|
||||
*)
|
||||
AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
|
||||
;;
|
||||
--
|
||||
2.30.1
|
||||
|
||||
@@ -0,0 +1,237 @@
|
||||
From f17b9e30bd295b1eec68105e3f04568477ce6286 Mon Sep 17 00:00:00 2001
|
||||
From: Takumi Sueda <puhitaku@gmail.com>
|
||||
Date: Sat, 11 Sep 2021 17:14:34 +0900
|
||||
Subject: [PATCH 2/7] Fix macOS _tkinter use of Tck/Tk in /Library/Framework
|
||||
|
||||
Modified and imported from https://github.com/Homebrew/formula-patches/blob/master/python/3.8.7.patch
|
||||
---
|
||||
setup.py | 148 +++++++++++++++++++++++++++++++++++++++----------------
|
||||
1 file changed, 106 insertions(+), 42 deletions(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index f764223d06..da1d34efaf 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -50,6 +50,7 @@ def add_dir_to_list(dirlist, dir):
|
||||
dirlist.insert(0, dir)
|
||||
|
||||
MACOS_SDK_ROOT = None
|
||||
+MACOS_SDK_SPECIFIED = None
|
||||
|
||||
def macosx_sdk_root():
|
||||
"""Return the directory of the current macOS SDK.
|
||||
@@ -61,8 +62,9 @@ def macosx_sdk_root():
|
||||
(The SDK may be supplied via Xcode or via the Command Line Tools).
|
||||
The SDK paths used by Apple-supplied tool chains depend on the
|
||||
setting of various variables; see the xcrun man page for more info.
|
||||
+ Also sets MACOS_SDK_SPECIFIED for use by macosx_sdk_specified().
|
||||
"""
|
||||
- global MACOS_SDK_ROOT
|
||||
+ global MACOS_SDK_ROOT, MACOS_SDK_SPECIFIED
|
||||
|
||||
# If already called, return cached result.
|
||||
if MACOS_SDK_ROOT:
|
||||
@@ -72,8 +74,10 @@ def macosx_sdk_root():
|
||||
m = re.search(r'-isysroot\s+(\S+)', cflags)
|
||||
if m is not None:
|
||||
MACOS_SDK_ROOT = m.group(1)
|
||||
+ MACOS_SDK_SPECIFIED = MACOS_SDK_ROOT != '/'
|
||||
else:
|
||||
MACOS_SDK_ROOT = '/'
|
||||
+ MACOS_SDK_SPECIFIED = False
|
||||
cc = sysconfig.get_config_var('CC')
|
||||
tmpfile = '/tmp/setup_sdk_root.%d' % os.getpid()
|
||||
try:
|
||||
@@ -101,6 +105,27 @@ def macosx_sdk_root():
|
||||
|
||||
return MACOS_SDK_ROOT
|
||||
|
||||
+def macosx_sdk_specified():
|
||||
+ """Returns true if an SDK was explicitly configured.
|
||||
+
|
||||
+ True if an SDK was selected at configure time, either by specifying
|
||||
+ --enable-universalsdk=(something other than no or /) or by adding a
|
||||
+ -isysroot option to CFLAGS. In some cases, like when making
|
||||
+ decisions about macOS Tk framework paths, we need to be able to
|
||||
+ know whether the user explicitly asked to build with an SDK versus
|
||||
+ the implicit use of an SDK when header files are no longer
|
||||
+ installed on a running system by the Command Line Tools.
|
||||
+ """
|
||||
+ global MACOS_SDK_SPECIFIED
|
||||
+
|
||||
+ # If already called, return cached result.
|
||||
+ if MACOS_SDK_SPECIFIED:
|
||||
+ return MACOS_SDK_SPECIFIED
|
||||
+
|
||||
+ # Find the sdk root and set MACOS_SDK_SPECIFIED
|
||||
+ macosx_sdk_root()
|
||||
+ return MACOS_SDK_SPECIFIED
|
||||
+
|
||||
def is_macosx_sdk_path(path):
|
||||
"""
|
||||
Returns True if 'path' can be located in an OSX SDK
|
||||
@@ -1834,31 +1859,72 @@ class PyBuildExt(build_ext):
|
||||
return 1
|
||||
|
||||
def detect_tkinter_darwin(self, inc_dirs, lib_dirs):
|
||||
- # The _tkinter module, using frameworks. Since frameworks are quite
|
||||
- # different the UNIX search logic is not sharable.
|
||||
- from os.path import join, exists
|
||||
- framework_dirs = [
|
||||
- '/Library/Frameworks',
|
||||
- '/System/Library/Frameworks/',
|
||||
- join(os.getenv('HOME'), '/Library/Frameworks')
|
||||
- ]
|
||||
+ # Build default _tkinter on macOS using Tcl and Tk frameworks.
|
||||
+ #
|
||||
+ # The macOS native Tk (AKA Aqua Tk) and Tcl are most commonly
|
||||
+ # built and installed as macOS framework bundles. However,
|
||||
+ # for several reasons, we cannot take full advantage of the
|
||||
+ # Apple-supplied compiler chain's -framework options here.
|
||||
+ # Instead, we need to find and pass to the compiler the
|
||||
+ # absolute paths of the Tcl and Tk headers files we want to use
|
||||
+ # and the absolute path to the directory containing the Tcl
|
||||
+ # and Tk frameworks for linking.
|
||||
+ #
|
||||
+ # We want to handle here two common use cases on macOS:
|
||||
+ # 1. Build and link with system-wide third-party or user-built
|
||||
+ # Tcl and Tk frameworks installed in /Library/Frameworks.
|
||||
+ # 2. Build and link using a user-specified macOS SDK so that the
|
||||
+ # built Python can be exported to other systems. In this case,
|
||||
+ # search only the SDK's /Library/Frameworks (normally empty)
|
||||
+ # and /System/Library/Frameworks.
|
||||
+ #
|
||||
+ # Any other use case should be able to be handled explicitly by
|
||||
+ # using the options described above in detect_tkinter_explicitly().
|
||||
+ # In particular it would be good to handle here the case where
|
||||
+ # you want to build and link with a framework build of Tcl and Tk
|
||||
+ # that is not in /Library/Frameworks, say, in your private
|
||||
+ # $HOME/Library/Frameworks directory or elsewhere. It turns
|
||||
+ # out to be difficult to make that work automtically here
|
||||
+ # without bringing into play more tools and magic. That case
|
||||
+ # can be hamdled using a recipe with the right arguments
|
||||
+ # to detect_tkinter_explicitly().
|
||||
+ #
|
||||
+ # Note also that the fallback case here is to try to use the
|
||||
+ # Apple-supplied Tcl and Tk frameworks in /System/Library but
|
||||
+ # be forewarned that they are deprecated by Apple and typically
|
||||
+ # out-of-date and buggy; their use should be avoided if at
|
||||
+ # all possible by installing a newer version of Tcl and Tk in
|
||||
+ # /Library/Frameworks before bwfore building Python without
|
||||
+ # an explicit SDK or by configuring build arguments explicitly.
|
||||
|
||||
- sysroot = macosx_sdk_root()
|
||||
+ from os.path import join, exists
|
||||
+ sysroot = macosx_sdk_root() # path to the SDK or '/'
|
||||
+
|
||||
+ if macosx_sdk_specified():
|
||||
+ # Use case #2: an SDK other than '/' was specified.
|
||||
+ # Only search there.
|
||||
+ framework_dirs = [
|
||||
+ join(sysroot, 'Library', 'Frameworks'),
|
||||
+ join(sysroot, 'System', 'Library', 'Frameworks'),
|
||||
+ ]
|
||||
+ else:
|
||||
+ # Use case #1: no explicit SDK selected.
|
||||
+ # Search the local system-wide /Library/Frameworks,
|
||||
+ # not the one in the default SDK, othewise fall back to
|
||||
+ # /System/Library/Frameworks whose header files may be in
|
||||
+ # the default SDK or, on older systems, actually installed.
|
||||
+ framework_dirs = [
|
||||
+ join('/', 'Library', 'Frameworks'),
|
||||
+ join(sysroot, 'System', 'Library', 'Frameworks'),
|
||||
+ ]
|
||||
|
||||
- # Find the directory that contains the Tcl.framework and Tk.framework
|
||||
- # bundles.
|
||||
- # XXX distutils should support -F!
|
||||
+ # Find the directory that contains the Tcl.framework and
|
||||
+ # Tk.framework bundles.
|
||||
for F in framework_dirs:
|
||||
# both Tcl.framework and Tk.framework should be present
|
||||
-
|
||||
-
|
||||
for fw in 'Tcl', 'Tk':
|
||||
- if is_macosx_sdk_path(F):
|
||||
- if not exists(join(sysroot, F[1:], fw + '.framework')):
|
||||
- break
|
||||
- else:
|
||||
- if not exists(join(F, fw + '.framework')):
|
||||
- break
|
||||
+ if not exists(join(F, fw + '.framework')):
|
||||
+ break
|
||||
else:
|
||||
# ok, F is now directory with both frameworks. Continure
|
||||
# building
|
||||
@@ -1868,32 +1934,20 @@ class PyBuildExt(build_ext):
|
||||
# will now resume.
|
||||
return 0
|
||||
|
||||
- # For 8.4a2, we must add -I options that point inside the Tcl and Tk
|
||||
- # frameworks. In later release we should hopefully be able to pass
|
||||
- # the -F option to gcc, which specifies a framework lookup path.
|
||||
- #
|
||||
include_dirs = [
|
||||
join(F, fw + '.framework', H)
|
||||
for fw in 'Tcl', 'Tk'
|
||||
- for H in 'Headers', 'Versions/Current/PrivateHeaders'
|
||||
+ for H in ('Headers',)
|
||||
]
|
||||
|
||||
- # For 8.4a2, the X11 headers are not included. Rather than include a
|
||||
- # complicated search, this is a hard-coded path. It could bail out
|
||||
- # if X11 libs are not found...
|
||||
- include_dirs.append('/usr/X11R6/include')
|
||||
- frameworks = ['-framework', 'Tcl', '-framework', 'Tk']
|
||||
+ # Add the base framework directory as well
|
||||
+ compile_args = ['-F', F]
|
||||
|
||||
- # All existing framework builds of Tcl/Tk don't support 64-bit
|
||||
- # architectures.
|
||||
+ # Do not build tkinter for archs that this Tk was not built with.
|
||||
cflags = sysconfig.get_config_vars('CFLAGS')[0]
|
||||
archs = re.findall('-arch\s+(\w+)', cflags)
|
||||
|
||||
- if is_macosx_sdk_path(F):
|
||||
- fp = os.popen("file %s/Tk.framework/Tk | grep 'for architecture'"%(os.path.join(sysroot, F[1:]),))
|
||||
- else:
|
||||
- fp = os.popen("file %s/Tk.framework/Tk | grep 'for architecture'"%(F,))
|
||||
-
|
||||
+ fp = os.popen("file %s/Tk.framework/Tk | grep 'for architecture'"%(F,))
|
||||
detected_archs = []
|
||||
for ln in fp:
|
||||
a = ln.split()[-1]
|
||||
@@ -1901,16 +1955,26 @@ class PyBuildExt(build_ext):
|
||||
detected_archs.append(ln.split()[-1])
|
||||
fp.close()
|
||||
|
||||
+ arch_args = []
|
||||
for a in detected_archs:
|
||||
- frameworks.append('-arch')
|
||||
- frameworks.append(a)
|
||||
+ arch_args.append('-arch')
|
||||
+ arch_args.append(a)
|
||||
+
|
||||
+ compile_args += arch_args
|
||||
+ link_args = [','.join(['-Wl', '-F', F, '-framework', 'Tcl', '-framework', 'Tk'])] + arch_args
|
||||
+
|
||||
+ # The X11/xlib.h file bundled in the Tk sources can cause function
|
||||
+ # prototype warnings from the compiler. Since we cannot easily fix
|
||||
+ # that, suppress the warnings here instead.
|
||||
+ if '-Wstrict-prototypes' in cflags.split():
|
||||
+ compile_args.append('-Wno-strict-prototypes')
|
||||
|
||||
ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
|
||||
define_macros=[('WITH_APPINIT', 1)],
|
||||
include_dirs = include_dirs,
|
||||
libraries = [],
|
||||
- extra_compile_args = frameworks[2:],
|
||||
- extra_link_args = frameworks,
|
||||
+ extra_compile_args = compile_args,
|
||||
+ extra_link_args = link_args,
|
||||
)
|
||||
self.extensions.append(ext)
|
||||
return 1
|
||||
--
|
||||
2.30.1
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From d93a26fee21a5f91c51d8cb14ecaf29122f1b222 Mon Sep 17 00:00:00 2001
|
||||
From: Takumi Sueda <puhitaku@gmail.com>
|
||||
Date: Sat, 11 Sep 2021 17:25:00 +0900
|
||||
Subject: [PATCH 3/7] Support "arm64" in Mac/Tools/pythonw
|
||||
|
||||
Imported from: https://github.com/Homebrew/formula-patches/blob/master/python/3.8.7.patch
|
||||
---
|
||||
Mac/Tools/pythonw.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/Mac/Tools/pythonw.c b/Mac/Tools/pythonw.c
|
||||
index 76734c1063..ebe5e8d975 100644
|
||||
--- a/Mac/Tools/pythonw.c
|
||||
+++ b/Mac/Tools/pythonw.c
|
||||
@@ -116,10 +116,16 @@ setup_spawnattr(posix_spawnattr_t* spawnattr)
|
||||
|
||||
#elif defined(__ppc__)
|
||||
cpu_types[0] = CPU_TYPE_POWERPC;
|
||||
+
|
||||
#elif defined(__i386__)
|
||||
cpu_types[0] = CPU_TYPE_X86;
|
||||
+
|
||||
+#elif defined(__arm64__)
|
||||
+ cpu_types[0] = CPU_TYPE_ARM64;
|
||||
+
|
||||
#else
|
||||
# error "Unknown CPU"
|
||||
+
|
||||
#endif
|
||||
|
||||
if (posix_spawnattr_setbinpref_np(spawnattr, count,
|
||||
--
|
||||
2.30.1
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
From a1b08c7de72c27d80a86b92c263d1f5b351e581b Mon Sep 17 00:00:00 2001
|
||||
From: Takumi Sueda <puhitaku@gmail.com>
|
||||
Date: Sat, 11 Sep 2021 18:07:48 +0900
|
||||
Subject: [PATCH 4/7] Use system libffi for Mac OS 10.15 and up
|
||||
|
||||
Modified and imported from: https://github.com/Homebrew/formula-patches/blob/master/python/3.8.7.patch
|
||||
---
|
||||
setup.py | 37 ++++++++++++++++++++++++++++---------
|
||||
1 file changed, 28 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index da1d34efaf..c92d0552e3 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -126,6 +126,13 @@ def macosx_sdk_specified():
|
||||
macosx_sdk_root()
|
||||
return MACOS_SDK_SPECIFIED
|
||||
|
||||
+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
|
||||
@@ -2180,7 +2187,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 = []
|
||||
@@ -2224,15 +2235,24 @@ class PyBuildExt(build_ext):
|
||||
sources=['_ctypes/_ctypes_test.c'])
|
||||
self.extensions.extend([ext, ext_test])
|
||||
|
||||
- if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"):
|
||||
- return
|
||||
+ ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
|
||||
+ ffi_lib = None
|
||||
|
||||
+ #inc_dirs = self.inc_dirs.copy()
|
||||
+ inc_dirs = self.compiler.include_dirs[:]
|
||||
if host_platform == 'darwin':
|
||||
- # OS X 10.5 comes with libffi.dylib; the include files are
|
||||
- # in /usr/include/ffi
|
||||
- inc_dirs.append('/usr/include/ffi')
|
||||
+ if not self.use_system_libffi:
|
||||
+ return
|
||||
+ 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'
|
||||
+ sources.remove('_ctypes/malloc_closure.c')
|
||||
+ else:
|
||||
+ # 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:
|
||||
@@ -2247,8 +2267,7 @@ class PyBuildExt(build_ext):
|
||||
ffi_inc = None
|
||||
print('Header file {} does not define LIBFFI_H or '
|
||||
'ffi_wrapper_h'.format(ffi_h))
|
||||
- ffi_lib = None
|
||||
- if ffi_inc is not None:
|
||||
+ if ffi_lib is None and ffi_inc is not None:
|
||||
for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
|
||||
if (self.compiler.find_library_file(lib_dirs, lib_name)):
|
||||
ffi_lib = lib_name
|
||||
--
|
||||
2.30.1
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
From 4394ec26842b04335b30b9a0595fcc8591c68496 Mon Sep 17 00:00:00 2001
|
||||
From: Takumi Sueda <puhitaku@gmail.com>
|
||||
Date: Sat, 11 Sep 2021 18:59:44 +0900
|
||||
Subject: [PATCH 5/7] ctypes: use the correct ABI for variadic functions
|
||||
|
||||
Modified and imported from https://github.com/Homebrew/formula-patches/blob/master/python/3.8.7.patch
|
||||
---
|
||||
Doc/library/ctypes.rst | 6 +++++
|
||||
Lib/test/test_str.py | 2 ++
|
||||
Lib/test/test_unicode.py | 3 +++
|
||||
Modules/_ctypes/_ctypes.c | 31 +++++++++++++++++++++++
|
||||
Modules/_ctypes/callproc.c | 51 +++++++++++++++++++++++++++++---------
|
||||
Modules/_ctypes/ctypes.h | 1 +
|
||||
6 files changed, 82 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
|
||||
index 6a5299145f..ec97da607f 100644
|
||||
--- a/Doc/library/ctypes.rst
|
||||
+++ b/Doc/library/ctypes.rst
|
||||
@@ -1584,6 +1584,12 @@ 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
|
||||
|
||||
diff --git a/Lib/test/test_str.py b/Lib/test/test_str.py
|
||||
index 73ed542a51..131f6d13e0 100644
|
||||
--- a/Lib/test/test_str.py
|
||||
+++ b/Lib/test/test_str.py
|
||||
@@ -489,6 +489,8 @@ class CAPITest(unittest.TestCase):
|
||||
c_char_p)
|
||||
|
||||
PyString_FromFormat = pythonapi.PyString_FromFormat
|
||||
+ PyString_FromFormat.variadic = True
|
||||
+ PyString_FromFormat.argtypes = (c_char_p,)
|
||||
PyString_FromFormat.restype = py_object
|
||||
|
||||
# basic tests
|
||||
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
|
||||
index 92476f68a5..23e9e643e0 100644
|
||||
--- a/Lib/test/test_unicode.py
|
||||
+++ b/Lib/test/test_unicode.py
|
||||
@@ -1676,6 +1676,7 @@ class CAPITest(unittest.TestCase):
|
||||
def test_from_format(self):
|
||||
test_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)
|
||||
@@ -1684,6 +1685,8 @@ class CAPITest(unittest.TestCase):
|
||||
else:
|
||||
name = "PyUnicodeUCS4_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 bef251ef04..d03b98d09c 100644
|
||||
--- a/Modules/_ctypes/_ctypes.c
|
||||
+++ b/Modules/_ctypes/_ctypes.c
|
||||
@@ -3253,6 +3253,34 @@ PyCFuncPtr_get_restype(PyCFuncPtrObject *self)
|
||||
}
|
||||
}
|
||||
|
||||
+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)
|
||||
{
|
||||
@@ -3299,6 +3327,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 }
|
||||
};
|
||||
|
||||
@@ -5838,6 +5868,7 @@ init_ctypes(void)
|
||||
PyModule_AddObject(m, "FUNCFLAG_USE_ERRNO", PyInt_FromLong(FUNCFLAG_USE_ERRNO));
|
||||
PyModule_AddObject(m, "FUNCFLAG_USE_LASTERROR", PyInt_FromLong(FUNCFLAG_USE_LASTERROR));
|
||||
PyModule_AddObject(m, "FUNCFLAG_PYTHONAPI", PyInt_FromLong(FUNCFLAG_PYTHONAPI));
|
||||
+ PyModule_AddObject(m, "FUNCFLAG_VARIADIC", PyInt_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 066fefc0cc..39a539db47 100644
|
||||
--- a/Modules/_ctypes/callproc.c
|
||||
+++ b/Modules/_ctypes/callproc.c
|
||||
@@ -88,6 +88,9 @@
|
||||
#define DONT_USE_SEH
|
||||
#endif
|
||||
|
||||
+#if defined(__APPLE__) && __arm64__
|
||||
+#define HAVE_FFI_PREP_CIF_VAR 1
|
||||
+#endif
|
||||
|
||||
#define CTYPES_CAPSULE_ERROROBJ "_ctypes/callproc.c error object"
|
||||
CTYPES_CAPSULE_INSTANTIATE_DESTRUCTOR(CTYPES_CAPSULE_ERROROBJ)
|
||||
@@ -773,7 +776,8 @@ static int _call_function_pointer(int flags,
|
||||
ffi_type **atypes,
|
||||
ffi_type *restype,
|
||||
void *resmem,
|
||||
- int argcount)
|
||||
+ int argcount,
|
||||
+ int argtypecount)
|
||||
{
|
||||
#ifdef WITH_THREAD
|
||||
PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
|
||||
@@ -801,15 +805,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);
|
||||
@@ -1181,9 +1209,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 12b56c4342..8aec3d1ade 100644
|
||||
--- a/Modules/_ctypes/ctypes.h
|
||||
+++ b/Modules/_ctypes/ctypes.h
|
||||
@@ -325,6 +325,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
|
||||
--
|
||||
2.30.1
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
From 43819cd35cddd189cbe513032e76f1c1a6ec6d8c Mon Sep 17 00:00:00 2001
|
||||
From: Takumi Sueda <puhitaku@gmail.com>
|
||||
Date: Sat, 11 Sep 2021 19:14:50 +0900
|
||||
Subject: [PATCH 6/7] ctypes: probe libffi for ffi_closure_alloc and
|
||||
ffi_prep_cif_var
|
||||
|
||||
Modified and imported from https://github.com/Homebrew/formula-patches/blob/master/python/3.8.7.patch
|
||||
---
|
||||
Modules/_ctypes/callproc.c | 4 ----
|
||||
setup.py | 34 +++++++++++++++++++++++++---------
|
||||
2 files changed, 25 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
|
||||
index 39a539db47..5273e8d246 100644
|
||||
--- a/Modules/_ctypes/callproc.c
|
||||
+++ b/Modules/_ctypes/callproc.c
|
||||
@@ -88,10 +88,6 @@
|
||||
#define DONT_USE_SEH
|
||||
#endif
|
||||
|
||||
-#if defined(__APPLE__) && __arm64__
|
||||
-#define HAVE_FFI_PREP_CIF_VAR 1
|
||||
-#endif
|
||||
-
|
||||
#define CTYPES_CAPSULE_ERROROBJ "_ctypes/callproc.c error object"
|
||||
CTYPES_CAPSULE_INSTANTIATE_DESTRUCTOR(CTYPES_CAPSULE_ERROROBJ)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index c92d0552e3..beaf60f3e5 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -141,6 +141,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
|
||||
@@ -2235,7 +2242,7 @@ class PyBuildExt(build_ext):
|
||||
sources=['_ctypes/_ctypes_test.c'])
|
||||
self.extensions.extend([ext, ext_test])
|
||||
|
||||
- ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
|
||||
+ ffi_inc = sysconfig.get_config_var("LIBFFI_INCLUDEDIR")
|
||||
ffi_lib = None
|
||||
|
||||
#inc_dirs = self.inc_dirs.copy()
|
||||
@@ -2245,18 +2252,19 @@ class PyBuildExt(build_ext):
|
||||
return
|
||||
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_inc = ffi_in_sdk
|
||||
ffi_lib = 'ffi'
|
||||
- sources.remove('_ctypes/malloc_closure.c')
|
||||
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 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'
|
||||
+ 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'
|
||||
with open(ffi_h) as f:
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
@@ -2267,14 +2275,22 @@ class PyBuildExt(build_ext):
|
||||
ffi_inc = None
|
||||
print('Header file {} does not define LIBFFI_H or '
|
||||
'ffi_wrapper_h'.format(ffi_h))
|
||||
- if ffi_lib is None and ffi_inc is not None:
|
||||
+ 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
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From 41ee254166bb690feb665991fc2442e335631314 Mon Sep 17 00:00:00 2001
|
||||
From: Takumi Sueda <puhitaku@gmail.com>
|
||||
Date: Sat, 11 Sep 2021 19:20:30 +0900
|
||||
Subject: [PATCH 7/7] Remove QuickTime from link args
|
||||
|
||||
---
|
||||
Mac/Modules/qt/setup.py | 2 +-
|
||||
setup.py | 3 +--
|
||||
2 files changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/Mac/Modules/qt/setup.py b/Mac/Modules/qt/setup.py
|
||||
index 8442011ab9..4b5bc2bc20 100644
|
||||
--- a/Mac/Modules/qt/setup.py
|
||||
+++ b/Mac/Modules/qt/setup.py
|
||||
@@ -6,7 +6,7 @@ from distutils.core import Extension, setup
|
||||
setup(name="QuickTime", version="0.2",
|
||||
ext_modules=[
|
||||
Extension('QuickTime._Qt', ['_Qtmodule.c'],
|
||||
- extra_link_args=['-framework', 'Carbon', '-framework', 'QuickTime'])
|
||||
+ extra_link_args=['-framework', 'Carbon'])
|
||||
],
|
||||
py_modules=['QuickTime.Qt', 'QuickTime.QuickTime'],
|
||||
package_dir={'QuickTime':'../../../Lib/plat-mac/Carbon'}
|
||||
diff --git a/setup.py b/setup.py
|
||||
index beaf60f3e5..ff2298af91 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -1819,8 +1819,7 @@ class PyBuildExt(build_ext):
|
||||
|
||||
exts.append( Extension('_Qt', ['qt/_Qtmodule.c'],
|
||||
extra_compile_args=carbon_extra_compile_args,
|
||||
- extra_link_args=['-framework', 'QuickTime',
|
||||
- '-framework', 'Carbon']) )
|
||||
+ extra_link_args=['-framework', 'Carbon']) )
|
||||
|
||||
|
||||
self.extensions.extend(exts)
|
||||
--
|
||||
2.30.1
|
||||
|
||||
@@ -0,0 +1,535 @@
|
||||
From f146ca36f81075f222aa3a1595042597d96dfad3 Mon Sep 17 00:00:00 2001
|
||||
From: Pablo Galindo Salgado <Pablogsal@gmail.com>
|
||||
Date: Mon, 4 Oct 2021 00:39:54 +0100
|
||||
Subject: [PATCH] bpo-45350: Rerun autoreconf with the pkg-config macros
|
||||
(GH-28707)
|
||||
|
||||
diff --git a/aclocal.m4 b/aclocal.m4
|
||||
index 987bfdf215..2f1bd37528 100644
|
||||
--- a/aclocal.m4
|
||||
+++ b/aclocal.m4
|
||||
@@ -275,3 +275,347 @@ AC_DEFUN([AX_CHECK_OPENSSL], [
|
||||
AC_SUBST([OPENSSL_LDFLAGS])
|
||||
])
|
||||
|
||||
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
||||
+# serial 11 (pkg-config-0.29.1)
|
||||
+
|
||||
+dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
||||
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
|
||||
+dnl
|
||||
+dnl This program is free software; you can redistribute it and/or modify
|
||||
+dnl it under the terms of the GNU General Public License as published by
|
||||
+dnl the Free Software Foundation; either version 2 of the License, or
|
||||
+dnl (at your option) any later version.
|
||||
+dnl
|
||||
+dnl This program is distributed in the hope that it will be useful, but
|
||||
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+dnl General Public License for more details.
|
||||
+dnl
|
||||
+dnl You should have received a copy of the GNU General Public License
|
||||
+dnl along with this program; if not, write to the Free Software
|
||||
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
+dnl 02111-1307, USA.
|
||||
+dnl
|
||||
+dnl As a special exception to the GNU General Public License, if you
|
||||
+dnl distribute this file as part of a program that contains a
|
||||
+dnl configuration script generated by Autoconf, you may include it under
|
||||
+dnl the same distribution terms that you use for the rest of that
|
||||
+dnl program.
|
||||
+
|
||||
+dnl PKG_PREREQ(MIN-VERSION)
|
||||
+dnl -----------------------
|
||||
+dnl Since: 0.29
|
||||
+dnl
|
||||
+dnl Verify that the version of the pkg-config macros are at least
|
||||
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
|
||||
+dnl installed version of pkg-config, this checks the developer's version
|
||||
+dnl of pkg.m4 when generating configure.
|
||||
+dnl
|
||||
+dnl To ensure that this macro is defined, also add:
|
||||
+dnl m4_ifndef([PKG_PREREQ],
|
||||
+dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
|
||||
+dnl
|
||||
+dnl See the "Since" comment for each macro you use to see what version
|
||||
+dnl of the macros you require.
|
||||
+m4_defun([PKG_PREREQ],
|
||||
+[m4_define([PKG_MACROS_VERSION], [0.29.1])
|
||||
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
|
||||
+ [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
|
||||
+])dnl PKG_PREREQ
|
||||
+
|
||||
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
||||
+dnl ----------------------------------
|
||||
+dnl Since: 0.16
|
||||
+dnl
|
||||
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
|
||||
+dnl first found in the path. Checks that the version of pkg-config found
|
||||
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
|
||||
+dnl used since that's the first version where most current features of
|
||||
+dnl pkg-config existed.
|
||||
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
||||
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
||||
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
|
||||
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
|
||||
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
|
||||
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
|
||||
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
|
||||
+
|
||||
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
||||
+fi
|
||||
+if test -n "$PKG_CONFIG"; then
|
||||
+ _pkg_min_version=m4_default([$1], [0.9.0])
|
||||
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
||||
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
+ AC_MSG_RESULT([yes])
|
||||
+ else
|
||||
+ AC_MSG_RESULT([no])
|
||||
+ PKG_CONFIG=""
|
||||
+ fi
|
||||
+fi[]dnl
|
||||
+])dnl PKG_PROG_PKG_CONFIG
|
||||
+
|
||||
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
+dnl -------------------------------------------------------------------
|
||||
+dnl Since: 0.18
|
||||
+dnl
|
||||
+dnl Check to see whether a particular set of modules exists. Similar to
|
||||
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
|
||||
+dnl
|
||||
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
+dnl only at the first occurence in configure.ac, so if the first place
|
||||
+dnl it's called might be skipped (such as if it is within an "if", you
|
||||
+dnl have to call PKG_CHECK_EXISTS manually
|
||||
+AC_DEFUN([PKG_CHECK_EXISTS],
|
||||
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
+if test -n "$PKG_CONFIG" && \
|
||||
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
|
||||
+ m4_default([$2], [:])
|
||||
+m4_ifvaln([$3], [else
|
||||
+ $3])dnl
|
||||
+fi])
|
||||
+
|
||||
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
||||
+dnl ---------------------------------------------
|
||||
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
|
||||
+dnl pkg_failed based on the result.
|
||||
+m4_define([_PKG_CONFIG],
|
||||
+[if test -n "$$1"; then
|
||||
+ pkg_cv_[]$1="$$1"
|
||||
+ elif test -n "$PKG_CONFIG"; then
|
||||
+ PKG_CHECK_EXISTS([$3],
|
||||
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
|
||||
+ test "x$?" != "x0" && pkg_failed=yes ],
|
||||
+ [pkg_failed=yes])
|
||||
+ else
|
||||
+ pkg_failed=untried
|
||||
+fi[]dnl
|
||||
+])dnl _PKG_CONFIG
|
||||
+
|
||||
+dnl _PKG_SHORT_ERRORS_SUPPORTED
|
||||
+dnl ---------------------------
|
||||
+dnl Internal check to see if pkg-config supports short errors.
|
||||
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
|
||||
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
||||
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
||||
+ _pkg_short_errors_supported=yes
|
||||
+else
|
||||
+ _pkg_short_errors_supported=no
|
||||
+fi[]dnl
|
||||
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
|
||||
+
|
||||
+
|
||||
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
||||
+dnl [ACTION-IF-NOT-FOUND])
|
||||
+dnl --------------------------------------------------------------
|
||||
+dnl Since: 0.4.0
|
||||
+dnl
|
||||
+dnl Note that if there is a possibility the first call to
|
||||
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
|
||||
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
||||
+AC_DEFUN([PKG_CHECK_MODULES],
|
||||
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
||||
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
||||
+
|
||||
+pkg_failed=no
|
||||
+AC_MSG_CHECKING([for $1])
|
||||
+
|
||||
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
||||
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
||||
+
|
||||
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
|
||||
+and $1[]_LIBS to avoid the need to call pkg-config.
|
||||
+See the pkg-config man page for more details.])
|
||||
+
|
||||
+if test $pkg_failed = yes; then
|
||||
+ AC_MSG_RESULT([no])
|
||||
+ _PKG_SHORT_ERRORS_SUPPORTED
|
||||
+ if test $_pkg_short_errors_supported = yes; then
|
||||
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
|
||||
+ else
|
||||
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
|
||||
+ fi
|
||||
+ # Put the nasty error message in config.log where it belongs
|
||||
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
||||
+
|
||||
+ m4_default([$4], [AC_MSG_ERROR(
|
||||
+[Package requirements ($2) were not met:
|
||||
+
|
||||
+$$1_PKG_ERRORS
|
||||
+
|
||||
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
|
||||
+installed software in a non-standard prefix.
|
||||
+
|
||||
+_PKG_TEXT])[]dnl
|
||||
+ ])
|
||||
+elif test $pkg_failed = untried; then
|
||||
+ AC_MSG_RESULT([no])
|
||||
+ m4_default([$4], [AC_MSG_FAILURE(
|
||||
+[The pkg-config script could not be found or is too old. Make sure it
|
||||
+is in your PATH or set the PKG_CONFIG environment variable to the full
|
||||
+path to pkg-config.
|
||||
+
|
||||
+_PKG_TEXT
|
||||
+
|
||||
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
|
||||
+ ])
|
||||
+else
|
||||
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
||||
+ AC_MSG_RESULT([yes])
|
||||
+ $3
|
||||
+fi[]dnl
|
||||
+])dnl PKG_CHECK_MODULES
|
||||
+
|
||||
+
|
||||
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
||||
+dnl [ACTION-IF-NOT-FOUND])
|
||||
+dnl ---------------------------------------------------------------------
|
||||
+dnl Since: 0.29
|
||||
+dnl
|
||||
+dnl Checks for existence of MODULES and gathers its build flags with
|
||||
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
|
||||
+dnl and VARIABLE-PREFIX_LIBS from --libs.
|
||||
+dnl
|
||||
+dnl Note that if there is a possibility the first call to
|
||||
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
|
||||
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
|
||||
+dnl configure.ac.
|
||||
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
|
||||
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
+_save_PKG_CONFIG=$PKG_CONFIG
|
||||
+PKG_CONFIG="$PKG_CONFIG --static"
|
||||
+PKG_CHECK_MODULES($@)
|
||||
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
|
||||
+])dnl PKG_CHECK_MODULES_STATIC
|
||||
+
|
||||
+
|
||||
+dnl PKG_INSTALLDIR([DIRECTORY])
|
||||
+dnl -------------------------
|
||||
+dnl Since: 0.27
|
||||
+dnl
|
||||
+dnl Substitutes the variable pkgconfigdir as the location where a module
|
||||
+dnl should install pkg-config .pc files. By default the directory is
|
||||
+dnl $libdir/pkgconfig, but the default can be changed by passing
|
||||
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
|
||||
+dnl parameter.
|
||||
+AC_DEFUN([PKG_INSTALLDIR],
|
||||
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
|
||||
+m4_pushdef([pkg_description],
|
||||
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
|
||||
+AC_ARG_WITH([pkgconfigdir],
|
||||
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
|
||||
+ [with_pkgconfigdir=]pkg_default)
|
||||
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
|
||||
+m4_popdef([pkg_default])
|
||||
+m4_popdef([pkg_description])
|
||||
+])dnl PKG_INSTALLDIR
|
||||
+
|
||||
+
|
||||
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
|
||||
+dnl --------------------------------
|
||||
+dnl Since: 0.27
|
||||
+dnl
|
||||
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
|
||||
+dnl module should install arch-independent pkg-config .pc files. By
|
||||
+dnl default the directory is $datadir/pkgconfig, but the default can be
|
||||
+dnl changed by passing DIRECTORY. The user can override through the
|
||||
+dnl --with-noarch-pkgconfigdir parameter.
|
||||
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
|
||||
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
|
||||
+m4_pushdef([pkg_description],
|
||||
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
|
||||
+AC_ARG_WITH([noarch-pkgconfigdir],
|
||||
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
|
||||
+ [with_noarch_pkgconfigdir=]pkg_default)
|
||||
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
|
||||
+m4_popdef([pkg_default])
|
||||
+m4_popdef([pkg_description])
|
||||
+])dnl PKG_NOARCH_INSTALLDIR
|
||||
+
|
||||
+
|
||||
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
|
||||
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
||||
+dnl -------------------------------------------
|
||||
+dnl Since: 0.28
|
||||
+dnl
|
||||
+dnl Retrieves the value of the pkg-config variable for the given module.
|
||||
+AC_DEFUN([PKG_CHECK_VAR],
|
||||
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
||||
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
|
||||
+
|
||||
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
|
||||
+AS_VAR_COPY([$1], [pkg_cv_][$1])
|
||||
+
|
||||
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
|
||||
+])dnl PKG_CHECK_VAR
|
||||
+
|
||||
+dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
|
||||
+dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
|
||||
+dnl [DESCRIPTION], [DEFAULT])
|
||||
+dnl ------------------------------------------
|
||||
+dnl
|
||||
+dnl Prepare a "--with-" configure option using the lowercase
|
||||
+dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
|
||||
+dnl PKG_CHECK_MODULES in a single macro.
|
||||
+AC_DEFUN([PKG_WITH_MODULES],
|
||||
+[
|
||||
+m4_pushdef([with_arg], m4_tolower([$1]))
|
||||
+
|
||||
+m4_pushdef([description],
|
||||
+ [m4_default([$5], [build with ]with_arg[ support])])
|
||||
+
|
||||
+m4_pushdef([def_arg], [m4_default([$6], [auto])])
|
||||
+m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
|
||||
+m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
|
||||
+
|
||||
+m4_case(def_arg,
|
||||
+ [yes],[m4_pushdef([with_without], [--without-]with_arg)],
|
||||
+ [m4_pushdef([with_without],[--with-]with_arg)])
|
||||
+
|
||||
+AC_ARG_WITH(with_arg,
|
||||
+ AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
|
||||
+ [AS_TR_SH([with_]with_arg)=def_arg])
|
||||
+
|
||||
+AS_CASE([$AS_TR_SH([with_]with_arg)],
|
||||
+ [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
|
||||
+ [auto],[PKG_CHECK_MODULES([$1],[$2],
|
||||
+ [m4_n([def_action_if_found]) $3],
|
||||
+ [m4_n([def_action_if_not_found]) $4])])
|
||||
+
|
||||
+m4_popdef([with_arg])
|
||||
+m4_popdef([description])
|
||||
+m4_popdef([def_arg])
|
||||
+
|
||||
+])dnl PKG_WITH_MODULES
|
||||
+
|
||||
+dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
|
||||
+dnl [DESCRIPTION], [DEFAULT])
|
||||
+dnl -----------------------------------------------
|
||||
+dnl
|
||||
+dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
|
||||
+dnl check._[VARIABLE-PREFIX] is exported as make variable.
|
||||
+AC_DEFUN([PKG_HAVE_WITH_MODULES],
|
||||
+[
|
||||
+PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
|
||||
+
|
||||
+AM_CONDITIONAL([HAVE_][$1],
|
||||
+ [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
|
||||
+])dnl PKG_HAVE_WITH_MODULES
|
||||
+
|
||||
+dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
|
||||
+dnl [DESCRIPTION], [DEFAULT])
|
||||
+dnl ------------------------------------------------------
|
||||
+dnl
|
||||
+dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
|
||||
+dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
|
||||
+dnl and preprocessor variable.
|
||||
+AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
|
||||
+[
|
||||
+PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
|
||||
+
|
||||
+AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
|
||||
+ [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
|
||||
+])dnl PKG_HAVE_DEFINE_WITH_MODULES
|
||||
+
|
||||
diff --git a/configure b/configure
|
||||
index 753f956469..02d882ed39 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -630,7 +630,6 @@ OPENSSL_RPATH
|
||||
OPENSSL_LDFLAGS
|
||||
OPENSSL_LIBS
|
||||
OPENSSL_INCLUDES
|
||||
-PKG_CONFIG
|
||||
ENSUREPIP
|
||||
SRCDIRS
|
||||
THREADHEADERS
|
||||
@@ -662,6 +661,9 @@ DTRACE
|
||||
TCLTK_LIBS
|
||||
TCLTK_INCLUDES
|
||||
LIBFFI_INCLUDEDIR
|
||||
+PKG_CONFIG_LIBDIR
|
||||
+PKG_CONFIG_PATH
|
||||
+PKG_CONFIG
|
||||
TZPATH
|
||||
SHLIBS
|
||||
CFLAGSFORSHARED
|
||||
@@ -873,7 +875,10 @@ LDFLAGS
|
||||
LIBS
|
||||
CPPFLAGS
|
||||
CPP
|
||||
-PROFILE_TASK'
|
||||
+PROFILE_TASK
|
||||
+PKG_CONFIG
|
||||
+PKG_CONFIG_PATH
|
||||
+PKG_CONFIG_LIBDIR'
|
||||
|
||||
|
||||
# Initialize some variables set by options.
|
||||
@@ -1637,6 +1642,11 @@ Some influential environment variables:
|
||||
CPP C preprocessor
|
||||
PROFILE_TASK
|
||||
Python args for PGO generation task
|
||||
+ PKG_CONFIG path to pkg-config utility
|
||||
+ PKG_CONFIG_PATH
|
||||
+ directories to add to pkg-config's search path
|
||||
+ PKG_CONFIG_LIBDIR
|
||||
+ path overriding pkg-config's built-in search path
|
||||
|
||||
Use these variables to override the choices made by `configure' or to help
|
||||
it to find libraries and programs with nonstandard names/locations.
|
||||
@@ -10542,7 +10552,126 @@ $as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
-PKG_PROG_PKG_CONFIG
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
||||
+ if test -n "$ac_tool_prefix"; then
|
||||
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
|
||||
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
+$as_echo_n "checking for $ac_word... " >&6; }
|
||||
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ case $PKG_CONFIG in
|
||||
+ [\\/]* | ?:[\\/]*)
|
||||
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
|
||||
+ ;;
|
||||
+ *)
|
||||
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
+for as_dir in $PATH
|
||||
+do
|
||||
+ IFS=$as_save_IFS
|
||||
+ test -z "$as_dir" && as_dir=.
|
||||
+ for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
|
||||
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
+ break 2
|
||||
+ fi
|
||||
+done
|
||||
+ done
|
||||
+IFS=$as_save_IFS
|
||||
+
|
||||
+ ;;
|
||||
+esac
|
||||
+fi
|
||||
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
|
||||
+if test -n "$PKG_CONFIG"; then
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
|
||||
+$as_echo "$PKG_CONFIG" >&6; }
|
||||
+else
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
+$as_echo "no" >&6; }
|
||||
+fi
|
||||
+
|
||||
+
|
||||
+fi
|
||||
+if test -z "$ac_cv_path_PKG_CONFIG"; then
|
||||
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
|
||||
+ # Extract the first word of "pkg-config", so it can be a program name with args.
|
||||
+set dummy pkg-config; ac_word=$2
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
+$as_echo_n "checking for $ac_word... " >&6; }
|
||||
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ case $ac_pt_PKG_CONFIG in
|
||||
+ [\\/]* | ?:[\\/]*)
|
||||
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
|
||||
+ ;;
|
||||
+ *)
|
||||
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
+for as_dir in $PATH
|
||||
+do
|
||||
+ IFS=$as_save_IFS
|
||||
+ test -z "$as_dir" && as_dir=.
|
||||
+ for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
|
||||
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
+ break 2
|
||||
+ fi
|
||||
+done
|
||||
+ done
|
||||
+IFS=$as_save_IFS
|
||||
+
|
||||
+ ;;
|
||||
+esac
|
||||
+fi
|
||||
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
|
||||
+if test -n "$ac_pt_PKG_CONFIG"; then
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
|
||||
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
|
||||
+else
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
+$as_echo "no" >&6; }
|
||||
+fi
|
||||
+
|
||||
+ if test "x$ac_pt_PKG_CONFIG" = x; then
|
||||
+ PKG_CONFIG=""
|
||||
+ else
|
||||
+ case $cross_compiling:$ac_tool_warned in
|
||||
+yes:)
|
||||
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
|
||||
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
|
||||
+ac_tool_warned=yes ;;
|
||||
+esac
|
||||
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
|
||||
+ fi
|
||||
+else
|
||||
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
|
||||
+fi
|
||||
+
|
||||
+fi
|
||||
+if test -n "$PKG_CONFIG"; then
|
||||
+ _pkg_min_version=0.9.0
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
|
||||
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
|
||||
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
+$as_echo "yes" >&6; }
|
||||
+ else
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
+$as_echo "no" >&6; }
|
||||
+ PKG_CONFIG=""
|
||||
+ fi
|
||||
+fi
|
||||
|
||||
# Check for use of the system expat library
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-expat" >&5
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From c8ee4dc57dd995e96ef9af0a04957b61ae1a7ac9 Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index cc37185068..f238470c17 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5226,9 +5226,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5387,6 +5384,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 3e6c07c279..dd68777b6a 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -717,9 +717,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -875,6 +872,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
From 002501946bad91a308f37a09204393c172f03c3e Mon Sep 17 00:00:00 2001
|
||||
From: Takumi Sueda <puhitaku@gmail.com>
|
||||
Date: Sat, 11 Sep 2021 16:50:14 +0900
|
||||
Subject: [PATCH 2/6] Detect arm64 in configure
|
||||
|
||||
---
|
||||
configure | 3 +++
|
||||
configure.ac | 3 +++
|
||||
2 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index e39c16eee2..8dc1fc7595 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -9230,6 +9230,9 @@ fi
|
||||
ppc)
|
||||
MACOSX_DEFAULT_ARCH="ppc64"
|
||||
;;
|
||||
+ arm64)
|
||||
+ MACOSX_DEFAULT_ARCH="arm64"
|
||||
+ ;;
|
||||
*)
|
||||
as_fn_error $? "Unexpected output of 'arch' on OSX" "$LINENO" 5
|
||||
;;
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index cf280506bd..34846a7df3 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2435,6 +2435,9 @@ case $ac_sys_system/$ac_sys_release in
|
||||
ppc)
|
||||
MACOSX_DEFAULT_ARCH="ppc64"
|
||||
;;
|
||||
+ arm64)
|
||||
+ MACOSX_DEFAULT_ARCH="arm64"
|
||||
+ ;;
|
||||
*)
|
||||
AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
|
||||
;;
|
||||
--
|
||||
2.30.1 (Apple Git-130)
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
From c7302116573d853d3181133477d9d0e4d4d3abfd Mon Sep 17 00:00:00 2001
|
||||
From: Ned Deily <nad@python.org>
|
||||
Date: Tue, 18 Jun 2019 16:28:13 -0400
|
||||
Subject: [PATCH] bpo-36231: Support building on macOS without /usr/include
|
||||
(GH-13773) (GH-14208)
|
||||
|
||||
---
|
||||
.../2019-06-03-05-49-49.bpo-36231.RfmW_p.rst | 3 ++
|
||||
setup.py | 53 ++++++++++++++++---
|
||||
2 files changed, 49 insertions(+), 7 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/macOS/2019-06-03-05-49-49.bpo-36231.RfmW_p.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/macOS/2019-06-03-05-49-49.bpo-36231.RfmW_p.rst b/Misc/NEWS.d/next/macOS/2019-06-03-05-49-49.bpo-36231.RfmW_p.rst
|
||||
new file mode 100644
|
||||
index 0000000000..c82e54c12c
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/macOS/2019-06-03-05-49-49.bpo-36231.RfmW_p.rst
|
||||
@@ -0,0 +1,3 @@
|
||||
+Support building Python on macOS without /usr/include installed. As of macOS
|
||||
+10.14, system header files are only available within an SDK provided by
|
||||
+either the Command Line Tools or the Xcode app.
|
||||
diff --git a/setup.py b/setup.py
|
||||
index bcc4bfa89d..5e0cd02430 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -90,18 +90,57 @@ def sysroot_paths(make_vars, subdirs):
|
||||
break
|
||||
return dirs
|
||||
|
||||
+MACOS_SDK_ROOT = None
|
||||
+
|
||||
def macosx_sdk_root():
|
||||
+ """Return the directory of the current macOS SDK.
|
||||
+
|
||||
+ If no SDK was explicitly configured, call the compiler to find which
|
||||
+ include files paths are being searched by default. Use '/' if the
|
||||
+ compiler is searching /usr/include (meaning system header files are
|
||||
+ installed) or use the root of an SDK if that is being searched.
|
||||
+ (The SDK may be supplied via Xcode or via the Command Line Tools).
|
||||
+ The SDK paths used by Apple-supplied tool chains depend on the
|
||||
+ setting of various variables; see the xcrun man page for more info.
|
||||
"""
|
||||
- Return the directory of the current OSX SDK,
|
||||
- or '/' if no SDK was specified.
|
||||
- """
|
||||
+ global MACOS_SDK_ROOT
|
||||
+
|
||||
+ # If already called, return cached result.
|
||||
+ if MACOS_SDK_ROOT:
|
||||
+ return MACOS_SDK_ROOT
|
||||
+
|
||||
cflags = sysconfig.get_config_var('CFLAGS')
|
||||
m = re.search(r'-isysroot\s+(\S+)', cflags)
|
||||
- if m is None:
|
||||
- sysroot = '/'
|
||||
+ if m is not None:
|
||||
+ MACOS_SDK_ROOT = m.group(1)
|
||||
else:
|
||||
- sysroot = m.group(1)
|
||||
- return sysroot
|
||||
+ MACOS_SDK_ROOT = '/'
|
||||
+ cc = sysconfig.get_config_var('CC')
|
||||
+ tmpfile = '/tmp/setup_sdk_root.%d' % os.getpid()
|
||||
+ try:
|
||||
+ os.unlink(tmpfile)
|
||||
+ except:
|
||||
+ pass
|
||||
+ ret = os.system('%s -E -v - </dev/null 2>%s 1>/dev/null' % (cc, tmpfile))
|
||||
+ in_incdirs = False
|
||||
+ try:
|
||||
+ if ret >> 8 == 0:
|
||||
+ with open(tmpfile) as fp:
|
||||
+ for line in fp.readlines():
|
||||
+ if line.startswith("#include <...>"):
|
||||
+ in_incdirs = True
|
||||
+ elif line.startswith("End of search list"):
|
||||
+ in_incdirs = False
|
||||
+ elif in_incdirs:
|
||||
+ line = line.strip()
|
||||
+ if line == '/usr/include':
|
||||
+ MACOS_SDK_ROOT = '/'
|
||||
+ elif line.endswith(".sdk/usr/include"):
|
||||
+ MACOS_SDK_ROOT = line[:-12]
|
||||
+ finally:
|
||||
+ os.unlink(tmpfile)
|
||||
+
|
||||
+ return MACOS_SDK_ROOT
|
||||
|
||||
def is_macosx_sdk_path(path):
|
||||
"""
|
||||
--
|
||||
2.30.1 (Apple Git-130)
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
From 942db3e6b96225ef8330f5329c702d62483c6ef8 Mon Sep 17 00:00:00 2001
|
||||
From: Takumi Sueda <puhitaku@gmail.com>
|
||||
Date: Sat, 11 Sep 2021 17:14:34 +0900
|
||||
Subject: [PATCH 3/6] Fix macOS _tkinter use of Tck/Tk in /Library/Framework
|
||||
|
||||
Modified and imported from https://github.com/Homebrew/formula-patches/blob/master/python/3.8.7.patch
|
||||
---
|
||||
setup.py | 147 ++++++++++++++++++++++++++++++++++++++++---------------
|
||||
1 file changed, 107 insertions(+), 40 deletions(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index e2c1898253..8e03c77997 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -91,6 +91,7 @@ def sysroot_paths(make_vars, subdirs):
|
||||
return dirs
|
||||
|
||||
MACOS_SDK_ROOT = None
|
||||
+MACOS_SDK_SPECIFIED = None
|
||||
|
||||
def macosx_sdk_root():
|
||||
"""Return the directory of the current macOS SDK.
|
||||
@@ -102,8 +103,9 @@ def macosx_sdk_root():
|
||||
(The SDK may be supplied via Xcode or via the Command Line Tools).
|
||||
The SDK paths used by Apple-supplied tool chains depend on the
|
||||
setting of various variables; see the xcrun man page for more info.
|
||||
+ Also sets MACOS_SDK_SPECIFIED for use by macosx_sdk_specified().
|
||||
"""
|
||||
- global MACOS_SDK_ROOT
|
||||
+ global MACOS_SDK_ROOT, MACOS_SDK_SPECIFIED
|
||||
|
||||
# If already called, return cached result.
|
||||
if MACOS_SDK_ROOT:
|
||||
@@ -113,8 +115,10 @@ def macosx_sdk_root():
|
||||
m = re.search(r'-isysroot\s+(\S+)', cflags)
|
||||
if m is not None:
|
||||
MACOS_SDK_ROOT = m.group(1)
|
||||
+ MACOS_SDK_SPECIFIED = MACOS_SDK_ROOT != '/'
|
||||
else:
|
||||
MACOS_SDK_ROOT = '/'
|
||||
+ MACOS_SDK_SPECIFIED = False
|
||||
cc = sysconfig.get_config_var('CC')
|
||||
tmpfile = '/tmp/setup_sdk_root.%d' % os.getpid()
|
||||
try:
|
||||
@@ -142,6 +146,27 @@ def macosx_sdk_root():
|
||||
|
||||
return MACOS_SDK_ROOT
|
||||
|
||||
+def macosx_sdk_specified():
|
||||
+ """Returns true if an SDK was explicitly configured.
|
||||
+
|
||||
+ True if an SDK was selected at configure time, either by specifying
|
||||
+ --enable-universalsdk=(something other than no or /) or by adding a
|
||||
+ -isysroot option to CFLAGS. In some cases, like when making
|
||||
+ decisions about macOS Tk framework paths, we need to be able to
|
||||
+ know whether the user explicitly asked to build with an SDK versus
|
||||
+ the implicit use of an SDK when header files are no longer
|
||||
+ installed on a running system by the Command Line Tools.
|
||||
+ """
|
||||
+ global MACOS_SDK_SPECIFIED
|
||||
+
|
||||
+ # If already called, return cached result.
|
||||
+ if MACOS_SDK_SPECIFIED:
|
||||
+ return MACOS_SDK_SPECIFIED
|
||||
+
|
||||
+ # Find the sdk root and set MACOS_SDK_SPECIFIED
|
||||
+ macosx_sdk_root()
|
||||
+ return MACOS_SDK_SPECIFIED
|
||||
+
|
||||
def is_macosx_sdk_path(path):
|
||||
"""
|
||||
Returns True if 'path' can be located in an OSX SDK
|
||||
@@ -1758,31 +1783,72 @@ class PyBuildExt(build_ext):
|
||||
return 1
|
||||
|
||||
def detect_tkinter_darwin(self, inc_dirs, lib_dirs):
|
||||
- # The _tkinter module, using frameworks. Since frameworks are quite
|
||||
- # different the UNIX search logic is not sharable.
|
||||
- from os.path import join, exists
|
||||
- framework_dirs = [
|
||||
- '/Library/Frameworks',
|
||||
- '/System/Library/Frameworks/',
|
||||
- join(os.getenv('HOME'), '/Library/Frameworks')
|
||||
- ]
|
||||
+ # Build default _tkinter on macOS using Tcl and Tk frameworks.
|
||||
+ #
|
||||
+ # The macOS native Tk (AKA Aqua Tk) and Tcl are most commonly
|
||||
+ # built and installed as macOS framework bundles. However,
|
||||
+ # for several reasons, we cannot take full advantage of the
|
||||
+ # Apple-supplied compiler chain's -framework options here.
|
||||
+ # Instead, we need to find and pass to the compiler the
|
||||
+ # absolute paths of the Tcl and Tk headers files we want to use
|
||||
+ # and the absolute path to the directory containing the Tcl
|
||||
+ # and Tk frameworks for linking.
|
||||
+ #
|
||||
+ # We want to handle here two common use cases on macOS:
|
||||
+ # 1. Build and link with system-wide third-party or user-built
|
||||
+ # Tcl and Tk frameworks installed in /Library/Frameworks.
|
||||
+ # 2. Build and link using a user-specified macOS SDK so that the
|
||||
+ # built Python can be exported to other systems. In this case,
|
||||
+ # search only the SDK's /Library/Frameworks (normally empty)
|
||||
+ # and /System/Library/Frameworks.
|
||||
+ #
|
||||
+ # Any other use case should be able to be handled explicitly by
|
||||
+ # using the options described above in detect_tkinter_explicitly().
|
||||
+ # In particular it would be good to handle here the case where
|
||||
+ # you want to build and link with a framework build of Tcl and Tk
|
||||
+ # that is not in /Library/Frameworks, say, in your private
|
||||
+ # $HOME/Library/Frameworks directory or elsewhere. It turns
|
||||
+ # out to be difficult to make that work automtically here
|
||||
+ # without bringing into play more tools and magic. That case
|
||||
+ # can be hamdled using a recipe with the right arguments
|
||||
+ # to detect_tkinter_explicitly().
|
||||
+ #
|
||||
+ # Note also that the fallback case here is to try to use the
|
||||
+ # Apple-supplied Tcl and Tk frameworks in /System/Library but
|
||||
+ # be forewarned that they are deprecated by Apple and typically
|
||||
+ # out-of-date and buggy; their use should be avoided if at
|
||||
+ # all possible by installing a newer version of Tcl and Tk in
|
||||
+ # /Library/Frameworks before bwfore building Python without
|
||||
+ # an explicit SDK or by configuring build arguments explicitly.
|
||||
|
||||
- sysroot = macosx_sdk_root()
|
||||
+ from os.path import join, exists
|
||||
+ sysroot = macosx_sdk_root() # path to the SDK or '/'
|
||||
+
|
||||
+ if macosx_sdk_specified():
|
||||
+ # Use case #2: an SDK other than '/' was specified.
|
||||
+ # Only search there.
|
||||
+ framework_dirs = [
|
||||
+ join(sysroot, 'Library', 'Frameworks'),
|
||||
+ join(sysroot, 'System', 'Library', 'Frameworks'),
|
||||
+ ]
|
||||
+ else:
|
||||
+ # Use case #1: no explicit SDK selected.
|
||||
+ # Search the local system-wide /Library/Frameworks,
|
||||
+ # not the one in the default SDK, othewise fall back to
|
||||
+ # /System/Library/Frameworks whose header files may be in
|
||||
+ # the default SDK or, on older systems, actually installed.
|
||||
+ framework_dirs = [
|
||||
+ join('/', 'Library', 'Frameworks'),
|
||||
+ join(sysroot, 'System', 'Library', 'Frameworks'),
|
||||
+ ]
|
||||
|
||||
- # Find the directory that contains the Tcl.framework and Tk.framework
|
||||
- # bundles.
|
||||
- # XXX distutils should support -F!
|
||||
+ # Find the directory that contains the Tcl.framework and
|
||||
+ # Tk.framework bundles.
|
||||
for F in framework_dirs:
|
||||
# both Tcl.framework and Tk.framework should be present
|
||||
-
|
||||
-
|
||||
for fw in 'Tcl', 'Tk':
|
||||
- if is_macosx_sdk_path(F):
|
||||
- if not exists(join(sysroot, F[1:], fw + '.framework')):
|
||||
- break
|
||||
- else:
|
||||
- if not exists(join(F, fw + '.framework')):
|
||||
- break
|
||||
+ if not exists(join(F, fw + '.framework')):
|
||||
+ break
|
||||
else:
|
||||
# ok, F is now directory with both frameworks. Continure
|
||||
# building
|
||||
@@ -1792,24 +1858,16 @@ class PyBuildExt(build_ext):
|
||||
# will now resume.
|
||||
return 0
|
||||
|
||||
- # For 8.4a2, we must add -I options that point inside the Tcl and Tk
|
||||
- # frameworks. In later release we should hopefully be able to pass
|
||||
- # the -F option to gcc, which specifies a framework lookup path.
|
||||
- #
|
||||
include_dirs = [
|
||||
join(F, fw + '.framework', H)
|
||||
for fw in ('Tcl', 'Tk')
|
||||
- for H in ('Headers', 'Versions/Current/PrivateHeaders')
|
||||
+ for H in ('Headers',)
|
||||
]
|
||||
|
||||
- # For 8.4a2, the X11 headers are not included. Rather than include a
|
||||
- # complicated search, this is a hard-coded path. It could bail out
|
||||
- # if X11 libs are not found...
|
||||
- include_dirs.append('/usr/X11R6/include')
|
||||
- frameworks = ['-framework', 'Tcl', '-framework', 'Tk']
|
||||
+ # Add the base framework directory as well
|
||||
+ compile_args = ['-F', F]
|
||||
|
||||
- # All existing framework builds of Tcl/Tk don't support 64-bit
|
||||
- # architectures.
|
||||
+ # Do not build tkinter for archs that this Tk was not built with.
|
||||
cflags = sysconfig.get_config_vars('CFLAGS')[0]
|
||||
archs = re.findall(r'-arch\s+(\w+)', cflags)
|
||||
|
||||
@@ -1819,10 +1877,7 @@ class PyBuildExt(build_ext):
|
||||
|
||||
# Note: cannot use os.popen or subprocess here, that
|
||||
# requires extensions that are not available here.
|
||||
- if is_macosx_sdk_path(F):
|
||||
- os.system("file %s/Tk.framework/Tk | grep 'for architecture' > %s"%(os.path.join(sysroot, F[1:]), tmpfile))
|
||||
- else:
|
||||
- os.system("file %s/Tk.framework/Tk | grep 'for architecture' > %s"%(F, tmpfile))
|
||||
+ os.system("file %s/Tk.framework/Tk | grep 'for architecture' > %s"%(F, tmpfile))
|
||||
|
||||
with open(tmpfile) as fp:
|
||||
detected_archs = []
|
||||
@@ -1832,16 +1887,26 @@ class PyBuildExt(build_ext):
|
||||
detected_archs.append(ln.split()[-1])
|
||||
os.unlink(tmpfile)
|
||||
|
||||
+ arch_args = []
|
||||
for a in detected_archs:
|
||||
- frameworks.append('-arch')
|
||||
- frameworks.append(a)
|
||||
+ arch_args.append('-arch')
|
||||
+ arch_args.append(a)
|
||||
+
|
||||
+ compile_args += arch_args
|
||||
+ link_args = [','.join(['-Wl', '-F', F, '-framework', 'Tcl', '-framework', 'Tk'])] + arch_args
|
||||
+
|
||||
+ # The X11/xlib.h file bundled in the Tk sources can cause function
|
||||
+ # prototype warnings from the compiler. Since we cannot easily fix
|
||||
+ # that, suppress the warnings here instead.
|
||||
+ if '-Wstrict-prototypes' in cflags.split():
|
||||
+ compile_args.append('-Wno-strict-prototypes')
|
||||
|
||||
ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
|
||||
define_macros=[('WITH_APPINIT', 1)],
|
||||
include_dirs = include_dirs,
|
||||
libraries = [],
|
||||
- extra_compile_args = frameworks[2:],
|
||||
- extra_link_args = frameworks,
|
||||
+ extra_compile_args = compile_args,
|
||||
+ extra_link_args = link_args,
|
||||
)
|
||||
self.extensions.append(ext)
|
||||
return 1
|
||||
--
|
||||
2.30.1 (Apple Git-130)
|
||||
|
||||
@@ -0,0 +1,314 @@
|
||||
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.6.15
|
||||
|
||||
This ports the following ctypes and libffi pyenv patches for Python
|
||||
2.7.18 to Python 3.6.15:
|
||||
|
||||
* `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.6.15 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 a7cc0c84df..f25f3c78d9 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 56ab0ad732..013b1e9ce7 100644
|
||||
--- a/Lib/test/test_unicode.py
|
||||
+++ b/Lib/test/test_unicode.py
|
||||
@@ -2443,11 +2443,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 24d64858ed..351f274ad3 100644
|
||||
--- a/Modules/_ctypes/_ctypes.c
|
||||
+++ b/Modules/_ctypes/_ctypes.c
|
||||
@@ -3120,6 +3120,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))
|
||||
{
|
||||
@@ -3166,6 +3194,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 }
|
||||
};
|
||||
|
||||
@@ -5576,6 +5606,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 2bb289bce0..12951eadbf 100644
|
||||
--- a/Modules/_ctypes/callproc.c
|
||||
+++ b/Modules/_ctypes/callproc.c
|
||||
@@ -752,7 +754,8 @@ static int _call_function_pointer(int flags,
|
||||
ffi_type **atypes,
|
||||
ffi_type *restype,
|
||||
void *resmem,
|
||||
- int argcount)
|
||||
+ int argcount,
|
||||
+ int argtypecount)
|
||||
{
|
||||
#ifdef WITH_THREAD
|
||||
PyThreadState *_save = NULL; /* For Py_BLOCK_THREADS and Py_UNBLOCK_THREADS */
|
||||
@@ -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);
|
||||
@@ -1181,9 +1208,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 5d3b966338..1299ec25aa 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 8e03c77997..3b124c4b7b 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -167,6 +167,13 @@ def macosx_sdk_specified():
|
||||
macosx_sdk_root()
|
||||
return MACOS_SDK_SPECIFIED
|
||||
|
||||
+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
|
||||
@@ -175,6 +182,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
|
||||
@@ -2115,7 +2129,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 = []
|
||||
@@ -2162,20 +2180,29 @@ class PyBuildExt(build_ext):
|
||||
libraries=math_libs)
|
||||
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"):
|
||||
- return
|
||||
- # OS X 10.5 comes with libffi.dylib; the include files are
|
||||
- # in /usr/include/ffi
|
||||
- inc_dirs.append('/usr/include/ffi')
|
||||
+ if not self.use_system_libffi:
|
||||
+ return
|
||||
+ 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')
|
||||
elif '--without-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"):
|
||||
return
|
||||
|
||||
- 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'
|
||||
+ 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'
|
||||
with open(ffi_h) as f:
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
@@ -2186,15 +2213,22 @@ class PyBuildExt(build_ext):
|
||||
ffi_inc = None
|
||||
print('Header file {} does not define LIBFFI_H or '
|
||||
'ffi_wrapper_h'.format(ffi_h))
|
||||
- ffi_lib = None
|
||||
- if ffi_inc is not None:
|
||||
+ if ffi_lib is None and ffi_inc is not None:
|
||||
for lib_name in ('ffi', 'ffi_pic'):
|
||||
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,48 @@
|
||||
From 8ea6353f60625c96ce96588c70ff24a77f8c71f9 Mon Sep 17 00:00:00 2001
|
||||
From: Ronald Oussoren <ronaldoussoren@mac.com>
|
||||
Date: Thu, 25 Jun 2020 16:55:48 +0200
|
||||
Subject: [PATCH] BPO-41100: Support macOS 11 when building (GH-21113)
|
||||
|
||||
---
|
||||
Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst | 1 +
|
||||
configure | 2 +-
|
||||
configure.ac | 2 +-
|
||||
3 files changed, 3 insertions(+), 2 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst b/Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..ded66b567a
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst
|
||||
@@ -0,0 +1 @@
|
||||
+Support macOS 11 when building.
|
||||
diff --git a/configure b/configure
|
||||
index c51f396824..5024860ca4 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -3375,7 +3375,7 @@ $as_echo "#define _BSD_SOURCE 1" >>confdefs.h
|
||||
# has no effect, don't bother defining them
|
||||
Darwin/[6789].*)
|
||||
define_xopen_source=no;;
|
||||
- Darwin/1[0-9].*)
|
||||
+ Darwin/[12][0-9].*)
|
||||
define_xopen_source=no;;
|
||||
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
|
||||
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 70deefb6b9..5a3e340aa3 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -495,7 +495,7 @@ case $ac_sys_system/$ac_sys_release in
|
||||
# has no effect, don't bother defining them
|
||||
Darwin/@<:@6789@:>@.*)
|
||||
define_xopen_source=no;;
|
||||
- Darwin/1@<:@0-9@:>@.*)
|
||||
+ Darwin/@<:@[12]@:>@@<:@0-9@:>@.*)
|
||||
define_xopen_source=no;;
|
||||
# On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
|
||||
# used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
|
||||
--
|
||||
2.30.1 (Apple Git-130)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From 604d95e235d86465b8c17f02095edcaf18464d4c 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 108b76efa8..35ce429f60 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.30.1 (Apple Git-130)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From d9782f66445c9fa5d835ad29c23b22be85cde354 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 4aaa51e0d4..3556bbe041 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -184,7 +184,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,86 @@
|
||||
From 655f26bb742d6bd32c388e9fea14b64eb25fd4de Mon Sep 17 00:00:00 2001
|
||||
From: Ned Deily <nad@python.org>
|
||||
Date: Tue, 15 Mar 2022 03:18:39 -0400
|
||||
Subject: [PATCH] bpo-45405: Prevent internal configure error when running
|
||||
configure with recent versions of clang. (GH-28845) (GH-31890)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
The Apple Clang included with Xcode 13.3 now supports --print-multiarch
|
||||
causing configure to fail without this change.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
(cherry picked from commit 9c4766772cda67648184f8ddba546a5fc0167f91)
|
||||
|
||||
Co-authored-by: David Bohman <debohman@gmail.com>
|
||||
(cherry picked from commit 720bb456dc711b0776bae837d1f9a0b10c28ddf2)
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..13c93d1b8a
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index fb0a499145..67e6e69b5f 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5203,9 +5203,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5334,6 +5331,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index d86dad9a7c..468ad6070f 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -747,9 +747,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -875,6 +872,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.32.0 (Apple Git-132)
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From 35ddc7ad61b20a18496ba9410aa31b405e23fe78 Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index 829dd69bb8..455481bc50 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5183,9 +5183,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5342,6 +5339,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index f1cc8e9bcb..1afcba3307 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -724,9 +724,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -880,6 +877,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From 0c2fd7c1de5121ea636134f131cf7ebada023acf Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index 829dd69bb8..455481bc50 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5183,9 +5183,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5342,6 +5339,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index f1cc8e9bcb..1afcba3307 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -724,9 +724,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -880,6 +877,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
||||
@@ -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,36 @@
|
||||
From 604d95e235d86465b8c17f02095edcaf18464d4c 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 108b76efa8..35ce429f60 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.30.1 (Apple Git-130)
|
||||
@@ -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,43 @@
|
||||
From 720bb456dc711b0776bae837d1f9a0b10c28ddf2 Mon Sep 17 00:00:00 2001
|
||||
From: Ned Deily <nad@python.org>
|
||||
Date: Tue, 15 Mar 2022 03:18:39 -0400
|
||||
Subject: [PATCH] bpo-45405: Prevent internal configure error when running
|
||||
configure with recent versions of clang. (GH-28845) (GH-31890)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
The Apple Clang included with Xcode 13.3 now supports --print-multiarch
|
||||
causing configure to fail without this change.
|
||||
---
|
||||
configure | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git configure configure
|
||||
index 829dd69bb8..455481bc50 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5183,9 +5183,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5342,6 +5339,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
--
|
||||
2.35.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,36 @@
|
||||
From 604d95e235d86465b8c17f02095edcaf18464d4c 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 108b76efa8..35ce429f60 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.30.1 (Apple Git-130)
|
||||
@@ -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,80 @@
|
||||
From 5b79a7da20953f107657dea5192ed77cc8554ff0 Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index c807c98e56..51a7d60f54 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5183,9 +5183,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5342,6 +5339,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 805c0bba08..ede2197cb3 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -724,9 +724,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -880,6 +877,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From 1d6f94126d0af2370ba0e4c7d8befc1c7ecf35d8 Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index 829dd69bb8..455481bc50 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5183,9 +5183,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5342,6 +5339,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index f1cc8e9bcb..1afcba3307 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -724,9 +724,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -880,6 +877,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.29.2.windows.2
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From 8ced1a904558ff9499673083cf13abf03a76b7d0 Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index 936f3d4596..c091865aff 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5160,9 +5160,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5321,6 +5318,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index e02cc2c656..de83332dd3 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -719,9 +719,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -877,6 +874,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.36.0
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From 7f35b41fa1e13fb9915fd476eaec2b15e2082c4f Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index 936f3d4596..c091865aff 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5160,9 +5160,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5321,6 +5318,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index e02cc2c656..de83332dd3 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -719,9 +719,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -877,6 +874,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.36.0
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From c4379ecd43dab0d2c836787d82bce4f20eed892b Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index 936f3d4596..c091865aff 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5160,9 +5160,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5321,6 +5318,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index e02cc2c656..de83332dd3 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -719,9 +719,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -877,6 +874,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.36.0
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From 3af555f75a53a82fa074572b24cb6516d3db0645 Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index 96dcd0dcd5..1fb735bf8b 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5167,9 +5167,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5328,6 +5325,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 18a044629a..6d841d928d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -706,9 +706,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -864,6 +861,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.36.0
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From 988821dfd8b087368dfee462d73f518ca4cfbfe0 Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index 96dcd0dcd5..1fb735bf8b 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5167,9 +5167,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5328,6 +5325,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 18a044629a..6d841d928d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -706,9 +706,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -864,6 +861,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.36.0
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From 7ec2de6bb20a934424df28c6566e6fc3a5eab6d4 Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index 96dcd0dcd5..1fb735bf8b 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5167,9 +5167,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5328,6 +5325,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 18a044629a..6d841d928d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -706,9 +706,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -864,6 +861,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.36.0
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From 97f07c98cac3d095c5c3f5816e4c7b3fe7b9c251 Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index c164d68c4e..dcc0795296 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5167,9 +5167,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5328,6 +5325,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index fc082a3cd2..5c9bee2850 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -706,9 +706,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -864,6 +861,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.36.0
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From cb51d8b90c5668e77b9ed8ded562eeaabf518f5c Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index c164d68c4e..dcc0795296 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5167,9 +5167,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5328,6 +5325,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index fc082a3cd2..5c9bee2850 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -706,9 +706,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -864,6 +861,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.36.0
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From 9d066808637164f1386ece0d3b26b8e4262c4dfd Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index c737256c15..97a371c6da 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5155,9 +5155,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5316,6 +5313,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 040ddfc791..0969bb5b0c 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -713,9 +713,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -871,6 +868,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.36.0
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From b8f6adaf38973076542c54e5d9a4fd7c6665c8f2 Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index 9e6fd46583..80c3a6589a 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5193,9 +5193,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5354,6 +5351,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index d60f05251a..110318545d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -718,9 +718,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -876,6 +873,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.36.0
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
From 8ada29fb655f9803bab4777308c77db8c1f74735 Mon Sep 17 00:00:00 2001
|
||||
From: David Bohman <debohman@gmail.com>
|
||||
Date: Tue, 12 Oct 2021 17:10:26 -0700
|
||||
Subject: [PATCH] bpo-45405: Prevent ``internal configure error`` when running
|
||||
``configure`` with recent versions of non-Apple clang. (#28845)
|
||||
|
||||
Change the configure logic to function properly on macOS when the compiler
|
||||
outputs a platform triplet for option --print-multiarch.
|
||||
|
||||
Co-authored-by: Ned Deily <nad@python.org>
|
||||
---
|
||||
.../next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst | 2 ++
|
||||
configure | 8 +++++---
|
||||
configure.ac | 8 +++++---
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
new file mode 100644
|
||||
index 0000000000..a2dc5bcc32
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Build/2021-10-11-16-27-38.bpo-45405.iSfdW5.rst
|
||||
@@ -0,0 +1,2 @@
|
||||
+Prevent ``internal configure error`` when running ``configure``
|
||||
+with recent versions of non-Apple clang. Patch by David Bohman.
|
||||
diff --git a/configure b/configure
|
||||
index 2d379feb4b..e36d8d523d 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5193,9 +5193,6 @@ $as_echo "$as_me:
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-
|
||||
-
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
|
||||
$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
|
||||
cat >> conftest.c <<EOF
|
||||
@@ -5354,6 +5351,11 @@ $as_echo "none" >&6; }
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index c968d149c2..a16e475bc2 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -718,9 +718,6 @@ then
|
||||
fi
|
||||
|
||||
|
||||
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
-AC_SUBST(MULTIARCH)
|
||||
-
|
||||
AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
|
||||
cat >> conftest.c <<EOF
|
||||
#undef bfin
|
||||
@@ -876,6 +873,11 @@ else
|
||||
fi
|
||||
rm -f conftest.c conftest.out
|
||||
|
||||
+if test x$PLATFORM_TRIPLET != xdarwin; then
|
||||
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
|
||||
+fi
|
||||
+AC_SUBST(MULTIARCH)
|
||||
+
|
||||
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
|
||||
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
|
||||
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
|
||||
--
|
||||
2.36.0
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user