mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-08 11:33:49 -05:00
Compare commits
110 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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: ['https://www.bountysource.com/teams/yyuu-pyenv/issues'] # 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`).
|
||||
|
||||
41
.github/workflows/macos_tests.yml
vendored
Normal file
41
.github/workflows/macos_tests.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: macos_tests
|
||||
on: [pull_request, push]
|
||||
jobs:
|
||||
macos_tests:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version:
|
||||
- 2.7.18
|
||||
- 3.5.10
|
||||
- 3.6.15
|
||||
- 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"))
|
||||
35
.github/workflows/pyenv_tests.yml
vendored
Normal file
35
.github/workflows/pyenv_tests.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
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; 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
|
||||
4
.github/workflows/ubuntu_tests.yml
vendored
4
.github/workflows/ubuntu_tests.yml
vendored
@@ -8,11 +8,11 @@ jobs:
|
||||
python-version:
|
||||
- 2.7.18
|
||||
- 3.5.10
|
||||
- 3.6.13
|
||||
- 3.6.15
|
||||
- 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
|
||||
|
||||
69
CHANGELOG.md
69
CHANGELOG.md
@@ -1,5 +1,74 @@
|
||||
## Version History
|
||||
|
||||
## 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)
|
||||
|
||||
92
COMMANDS.md
92
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`
|
||||
@@ -278,3 +290,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 directory where a Python version is installed. If no
|
||||
version is given, `pyenv prefix` displays the location of the
|
||||
currently selected version.
|
||||
|
||||
$ 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...]
|
||||
|
||||
58
README.md
58
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).
|
||||
|
||||
|
||||
@@ -185,6 +183,28 @@ For pyenv to install python correctly you should [**install the Python build dep
|
||||
```
|
||||
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").
|
||||
|
||||
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 `libpython`
|
||||
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 available
|
||||
and 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
|
||||
|
||||
@@ -228,7 +248,7 @@ easy to fork and contribute any changes back upstream.
|
||||
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
|
||||
[Make sure that your terminal app is configured to run the shell as a login shell](https://github.com/pyenv/pyenv/wiki/MacOS-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.
|
||||
|
||||
@@ -239,7 +259,7 @@ easy to fork and contribute any changes back upstream.
|
||||
~~~bash
|
||||
# the sed invocation inserts the lines at the start of the file
|
||||
# after any initial comment lines
|
||||
sed -iEe '/^([^#]|$)/ {a \
|
||||
sed -Ei -e '/^([^#]|$)/ {a \
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
a \
|
||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
@@ -253,7 +273,7 @@ easy to fork and contribute any changes back upstream.
|
||||
- **If your `~/.bash_profile` sources `~/.bashrc` (Red Hat, Fedora, CentOS):**
|
||||
|
||||
~~~ bash
|
||||
sed -iEe '/^([^#]|$)/ {a \
|
||||
sed -Ei -e '/^([^#]|$)/ {a \
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
a \
|
||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
@@ -291,7 +311,7 @@ easy to fork and contribute any changes back upstream.
|
||||
|
||||
In MacOS, make sure that your terminal app runs the shell as a login shell.
|
||||
|
||||
- **Temporary environments (CI, batch jobs):**
|
||||
- **Temporary environments (CI, Docker, batch jobs):**
|
||||
|
||||
In CI/build environments, paths and the environment are usually already set up for you
|
||||
in one of the above ways.
|
||||
@@ -300,9 +320,21 @@ easy to fork and contribute any changes back upstream.
|
||||
to be a shell function (e.g. `shell` and Pyenv-Virtualenv's `activate`).
|
||||
|
||||
~~~bash
|
||||
echo 'eval "$(pyenv init -)"'
|
||||
eval "$(pyenv init -)"
|
||||
~~~
|
||||
|
||||
If you are installing Pyenv yourself as part of the batch job,
|
||||
after installing the files, run the following in the job's shell
|
||||
to be able to use it.
|
||||
|
||||
~~~bash
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
export PATH="$PYENV_ROOT/bin:$PATH" # if `pyenv` is not already on PATH
|
||||
eval "$(pyenv init --path)"
|
||||
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
|
||||
@@ -349,7 +381,7 @@ easy to fork and contribute any changes back upstream.
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
|
||||
~~~
|
||||
|
||||
- For **Fish shell**:
|
||||
- For **Fish shell**:
|
||||
|
||||
Execute this interactively:
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
version="2.0.7"
|
||||
version="2.2.4"
|
||||
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
|
||||
|
||||
@@ -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,6 +1321,19 @@ configured_with_package_dir() {
|
||||
return 1
|
||||
}
|
||||
|
||||
use_homebrew() {
|
||||
# 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 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
|
||||
@@ -1526,12 +1542,13 @@ use_xcode_sdk_zlib() {
|
||||
|
||||
use_homebrew_tcltk() {
|
||||
# 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
|
||||
@@ -1593,29 +1610,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 +1641,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 +2090,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 +2103,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 +2123,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" != *"--enable-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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.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
|
||||
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.0rc2" "https://www.python.org/ftp/python/3.10.0/Python-3.10.0rc2.tgz#0f8bf53dbe6f85785d502e73984aa3f12f67ac4958d9b8d8012019c35c646fe2" standard verify_py310 copy_python_gdb ensurepip
|
||||
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
|
||||
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.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.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.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.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.11.0a4
Normal file
10
plugins/python-build/share/python-build/3.11.0a4
Normal file
@@ -0,0 +1,10 @@
|
||||
#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.11.0a4" "https://www.python.org/ftp/python/3.11.0/Python-3.11.0a4.tar.xz#437fe7376c363dafaf34ce80f0446b41fc9a42c0e2a8c7e519d3f0a0b7cfb3ed" standard verify_py311 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.11.0a4" "https://www.python.org/ftp/python/3.11.0/Python-3.11.0a4.tgz#1ae9cfbf06ac2e40c7f51e86ad9c7e821f5a33b6c1aa7473b46126e3112aa4a0" 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
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-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-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
|
||||
@@ -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
|
||||
@@ -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,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,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)
|
||||
39
plugins/python-build/share/python-build/pypy2.7-7.3.2
Normal file
39
plugins/python-build/share/python-build/pypy2.7-7.3.2
Normal file
@@ -0,0 +1,39 @@
|
||||
VERSION='7.3.2'
|
||||
PYVER='2.7'
|
||||
|
||||
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||
"linux" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux32.tar.bz2#78f30ac17abe3cc077fc2456ef55adb51b052c5126011b2a32bacc858acaca7d" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux64.tar.bz2#8d4f08116a97153a0f739de8981874d544b564cbc87dd064cca33f36c29da13b" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux-aarch64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-aarch64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-aarch64.tar.bz2#fce1f06f20ab8bcacb9ac1c33572d6425033de53c3a93fbd5391189cc3e106cb" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"osx64" )
|
||||
if require_osx_version "10.13"; then
|
||||
install_package "pypy${PYVER}-v${VERSION}-osx64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-osx64.tar.bz2#10ca57050793923aea3808b9c8669cf53b7342c90c091244e9660bf797d397c7" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
else
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
"win32" )
|
||||
install_zip "pypy${PYVER}-v${VERSION}-win32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-win32.zip#0fd62265e0421a02432f10a294a712a5e784a8e061375e6d8ea5fd619be1be62" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,4 @@
|
||||
#require_gcc
|
||||
prefer_openssl11
|
||||
install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "pypy2.7-v7.3.2-src" "https://downloads.python.org/pypy/pypy2.7-v7.3.2-src.tar.bz2#8189480d8350ad6364d05c2b39fd7d832644d4b1cd018f785126389df45928d1" "pypy_builder" verify_py27 ensurepip
|
||||
39
plugins/python-build/share/python-build/pypy2.7-7.3.3
Normal file
39
plugins/python-build/share/python-build/pypy2.7-7.3.3
Normal file
@@ -0,0 +1,39 @@
|
||||
VERSION='7.3.3'
|
||||
PYVER='2.7'
|
||||
|
||||
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||
"linux" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux32.tar.bz2#bfbc81874b137837a8ba8c517b97de29f5a336f7ec500c52f2bfdbd3580d1703" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux64.tar.bz2#f412b602ccd6912ddee0e7523e0e38f4b2c7a144449c2cad078cffbdb66fd7b1" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux-aarch64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-aarch64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-aarch64.tar.bz2#23b145b7cfbaeefb6ee76fc8216c83b652ab1daffac490558718edbbd60082d8" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"osx64" )
|
||||
if require_osx_version "10.13"; then
|
||||
install_package "pypy${PYVER}-v${VERSION}-osx64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-osx64.tar.bz2#f34dc4f5ded1f6bcea05841aa9781b9307329e3ab755607917148568824ae0b0" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
else
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
"win32" )
|
||||
install_zip "pypy${PYVER}-v${VERSION}-win32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-win32.zip#b3e660dae8d25d8278fd6a0db77e76a16ac9a8c1dca22e7e103d39ed696dc69e" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,4 @@
|
||||
#require_gcc
|
||||
prefer_openssl11
|
||||
install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "pypy2.7-v7.3.3-src" "https://downloads.python.org/pypy/pypy2.7-v7.3.3-src.tar.bz2#f63488051ba877fd65840bf8d53822a9c6423d947839023b8720139f4b6e2336" "pypy_builder" verify_py27 ensurepip
|
||||
39
plugins/python-build/share/python-build/pypy2.7-7.3.4
Normal file
39
plugins/python-build/share/python-build/pypy2.7-7.3.4
Normal file
@@ -0,0 +1,39 @@
|
||||
VERSION='7.3.4'
|
||||
PYVER='2.7'
|
||||
|
||||
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||
"linux" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux32.tar.bz2#653cc3f0612399e494021027f4463d62639dffa4345736a16d0704f3f8a61d5f" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux64.tar.bz2#d3f7b0625e770d9be62201765d7d2316febc463372fba9c93a12969d26ae03dd" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux-aarch64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-aarch64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-aarch64.tar.bz2#9e741162ce486b14fbcf5aa377796d26b0529a9352fb602ee8b66c005f8420d1" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"osx64" )
|
||||
if require_osx_version "10.13"; then
|
||||
install_package "pypy${PYVER}-v${VERSION}-osx64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-osx64.tar.bz2#ee7bf42ce843596521e02c763408a5164d18f23c9617f1b8e032ce0675686582" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
else
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
"win32" )
|
||||
install_zip "pypy${PYVER}-v${VERSION}-win32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-win32.zip#1080012d7a3cea65182528259b51d52b1f61a3717377c2d9ba11ef36e06162d5" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,4 @@
|
||||
#require_gcc
|
||||
prefer_openssl11
|
||||
install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "pypy2.7-v7.3.4-src" "https://downloads.python.org/pypy/pypy2.7-v7.3.4-src.tar.bz2#ff9b928237767efe08ccfba79dae489519b3c768fb6e3af52d39c2a8a1c21ca4" "pypy_builder" verify_py27 ensurepip
|
||||
39
plugins/python-build/share/python-build/pypy2.7-7.3.5
Normal file
39
plugins/python-build/share/python-build/pypy2.7-7.3.5
Normal file
@@ -0,0 +1,39 @@
|
||||
VERSION='7.3.5'
|
||||
PYVER='2.7'
|
||||
|
||||
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||
"linux" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux32.tar.bz2#35bb5cb1dcca8e05dc58ba0a4b4d54f8b4787f24dfc93f7562f049190e4f0d94" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux64.tar.bz2#4858b347801fba3249ad90af015b3aaec9d57f54d038a58d806a1bd3217d5150" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux-aarch64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-aarch64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-aarch64.tar.bz2#8dc2c753f8a94eca1a304d7736c99b439c09274f492eaa3446770c6c32ed010e" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"osx64" )
|
||||
if require_osx_version "10.13"; then
|
||||
install_package "pypy${PYVER}-v${VERSION}-osx64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-osx64.tar.bz2#8b10442ef31c3b28048816f858adde6d6858a190d9367001a49648e669cbebb6" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
else
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
"win32" )
|
||||
install_zip "pypy${PYVER}-v${VERSION}-win32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-win32.zip#0b90eded11ba89a526c4288f17fff7e75000914ac071bd6d67912748ae89d761" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,4 @@
|
||||
#require_gcc
|
||||
prefer_openssl11
|
||||
install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "pypy2.7-v7.3.5-src" "https://downloads.python.org/pypy/pypy2.7-v7.3.5-src.tar.bz2#c0444fd9873058c1c0d99e13a934e92285cb05992c9968bf523c32bf9bec0a9d" "pypy_builder" verify_py27 ensurepip
|
||||
39
plugins/python-build/share/python-build/pypy2.7-7.3.6
Normal file
39
plugins/python-build/share/python-build/pypy2.7-7.3.6
Normal file
@@ -0,0 +1,39 @@
|
||||
VERSION='7.3.6'
|
||||
PYVER='2.7'
|
||||
|
||||
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||
"linux" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux32.tar.bz2#7a1145f3a278ffab4da0e2d4c4bd024ab8d67106a502e4bb7f6d67337e7af2b7" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux64.tar.bz2#82127f43fae6ce75d47d6c4539f8c1ea372e9c2dbfa40fae8b58351d522793a4" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux-aarch64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-aarch64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-aarch64.tar.bz2#90e9aafb310314938f54678d4d6d7db1163b57c9343e640b447112f74d7f9151" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"osx64" )
|
||||
if require_osx_version "10.13"; then
|
||||
install_package "pypy${PYVER}-v${VERSION}-osx64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-osx64.tar.bz2#9a97de82037d4be1949ec0c35a4d638ba635e8b34948549ae2fa08abd2cbaa8c" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
else
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
"win32" )
|
||||
install_zip "pypy${PYVER}-v${VERSION}-win32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-win32.zip#fcc8f6b3b472a77eaa754951f288fe234b4953bfba845888dd839b9b862cb891" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,4 @@
|
||||
#require_gcc
|
||||
prefer_openssl11
|
||||
install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "pypy2.7-v7.3.6-src" "https://downloads.python.org/pypy/pypy2.7-v7.3.6-src.tar.bz2#0114473c8c57169cdcab1a69c60ad7fef7089731fdbe6f46af55060b29be41e4" "pypy_builder" verify_py27 ensurepip
|
||||
43
plugins/python-build/share/python-build/pypy3.7-7.3.6
Normal file
43
plugins/python-build/share/python-build/pypy3.7-7.3.6
Normal file
@@ -0,0 +1,43 @@
|
||||
VERSION='7.3.6'
|
||||
PYVER='3.7'
|
||||
# https://www.pypy.org/checksums.html
|
||||
|
||||
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||
"linux" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux32.tar.bz2#459e77c845b31fa9367f7b1b1122155f0ba7888b1d4ce4455c35d2111eeeb275" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux64.tar.bz2#c41d07063b1d002a91ad2a0763b4baaca2b306ec635889c2e4826e706cc7f9ca" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux-aarch64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-aarch64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-aarch64.tar.bz2#d446b6987eeaa03d706603863e83d6b99df69232cf1e06d3ee5706add6a84cd6" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"osx64" )
|
||||
if require_osx_version "10.13"; then
|
||||
install_package "pypy${PYVER}-v${VERSION}-osx64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-osx64.tar.bz2#26f0c5c2a5f4a2ce35281d2fa760aa10715300dd110387eac43699a78ed32365" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
else
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
"s390x" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-s390x" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-s390x.tar.bz2#3659bf96a177a53426ffc38d3619c6ee307e600c80e924edc9cee604680c141d" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"win64" )
|
||||
install_zip "pypy${PYVER}-v${VERSION}-win64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-win64.zip#341e69a369da5a1f4f69dbbd47e7dff5e745439b203e28c7afcf98308a24b003" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,7 @@
|
||||
VERSION='7.3.6'
|
||||
PYVER='3.7'
|
||||
|
||||
#require_gcc
|
||||
prefer_openssl11
|
||||
install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "pypy${PYVER}-v${VERSION}-src" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-src.tar.bz2#9252ccaa130094205b3c7f0a2cad5adc0d9dfba31658ff3172f788dec1fdb348" "pypy_builder" "verify_py${PYVER//./}" ensurepip
|
||||
43
plugins/python-build/share/python-build/pypy3.7-7.3.7
Normal file
43
plugins/python-build/share/python-build/pypy3.7-7.3.7
Normal file
@@ -0,0 +1,43 @@
|
||||
VERSION='7.3.7'
|
||||
PYVER='3.7'
|
||||
# https://www.pypy.org/checksums.html
|
||||
|
||||
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||
"linux" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux32.tar.bz2#0ab9e2e8ae1ac463bb811b9d3ba24d138f41f7378c17ca9e2d8dee51bf151d19" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux64.tar.bz2#8332f923755441fedfe4767a84601c94f4d6f8475384406cb5f259ad8d0b2002" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux-aarch64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-aarch64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-aarch64.tar.bz2#a1a84882525dd574c4b051b66e9b7ef0e132392acc2f729420d7825f96835216" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"osx64" )
|
||||
if require_osx_version "10.13"; then
|
||||
install_package "pypy${PYVER}-v${VERSION}-osx64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-osx64.tar.bz2#edc9df7d0f7c56f7ee05b24117bdb6c03aa65e768471e210c05ccdbbfd11a866" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
else
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
"s390x" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-s390x" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-s390x.tar.bz2#7f91efc65a69e727519cc885ca6351f4bfdd6b90580dced2fdcc9ae1bf10013b" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"win64" )
|
||||
install_zip "pypy${PYVER}-v${VERSION}-win64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-win64.zip#53505dc0b57590290efd7656117ee5384bcd036f7f7c4f0bc3f5cd10299037d1" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,7 @@
|
||||
VERSION='7.3.7'
|
||||
PYVER='3.7'
|
||||
|
||||
#require_gcc
|
||||
prefer_openssl11
|
||||
install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "pypy${PYVER}-v${VERSION}-src" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-src.tar.bz2#2ed02ac9e710859c41bc82deafb08619792bb9a27eeaa1676c741ededd214dd7" "pypy_builder" "verify_py${PYVER//./}" ensurepip
|
||||
43
plugins/python-build/share/python-build/pypy3.8-7.3.6
Normal file
43
plugins/python-build/share/python-build/pypy3.8-7.3.6
Normal file
@@ -0,0 +1,43 @@
|
||||
VERSION='7.3.6'
|
||||
PYVER='3.8'
|
||||
# https://www.pypy.org/checksums.html
|
||||
|
||||
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||
"linux" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux32.tar.bz2#e857a04a76285f0ef5bae84f6f5e9943ca415d499204c531b1c33fe8f015b48d" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux64.tar.bz2#8579ea990e95d2b7e101ef47fd9ebf25a9500d5086e8f708c43f9bae83306ece" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux-aarch64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-aarch64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-aarch64.tar.bz2#704d5303096e8a3173e73435f3bb204e31a8bf02ed5ba617a4a0f1e7491edf50" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"osx64" )
|
||||
if require_osx_version "10.13"; then
|
||||
install_package "pypy${PYVER}-v${VERSION}-osx64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-osx64.tar.bz2#8195e52a20cf2a4f42c2d7e4969fbf44fe349c1f80f758e20525dd0f8c134bec" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
else
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
"s390x" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-s390x" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-s390x.zip#a36208d5e950ec4b630b33d0aede8ca3da383d973fc5ca387082c7e5bad8d245" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"win64" )
|
||||
install_zip "pypy${PYVER}-v${VERSION}-win64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-win64.zip#1b216fd75f8f0a48633cc21dce7d6f25ba65016142df758842e1df661269b458" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,8 @@
|
||||
VERSION='7.3.6'
|
||||
PYVER='3.8'
|
||||
# https://www.pypy.org/checksums.html
|
||||
|
||||
#require_gcc
|
||||
prefer_openssl11
|
||||
install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "pypy${PYVER}-v${VERSION}-src" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-src.tar.bz2#f234c56eb0d4ab0afb196232fb38cd1ca8e19b1c65cf7b65eb691695499be259" "pypy_builder" "verify_py${PYVER//./}" ensurepip
|
||||
43
plugins/python-build/share/python-build/pypy3.8-7.3.7
Normal file
43
plugins/python-build/share/python-build/pypy3.8-7.3.7
Normal file
@@ -0,0 +1,43 @@
|
||||
VERSION='7.3.7'
|
||||
PYVER='3.8'
|
||||
# https://www.pypy.org/checksums.html
|
||||
|
||||
case "$(pypy_architecture 2>/dev/null || true)" in
|
||||
"linux" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux32.tar.bz2#dfb9d005f0fc917edc60fd618143e4934c412f9168b55166f5519ba0a3b1a835" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-linux64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux64.tar.bz2#5dee37c7c3cb8b160028fbde3a5901c68043dfa545a16794502b897d4bc40d7e" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"linux-aarch64" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-aarch64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-aarch64.tar.bz2#cbd44e0a9146b3c03a9d14b265774a848f387ed846316c3e984847e278d0efd3" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"osx64" )
|
||||
if require_osx_version "10.13"; then
|
||||
install_package "pypy${PYVER}-v${VERSION}-osx64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-osx64.tar.bz2#1f044fe7bbdd443b7913ecf554683dab6dade5dcd7f47d4e6d01f4bb4cf84836" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
else
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
"s390x" )
|
||||
install_package "pypy${PYVER}-v${VERSION}-s390x" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-s390x.zip#ae7d6a76490b317a74b87788d596610c7ffd0ae2d3ffa2433d5bb5300f6b4b77" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
"win64" )
|
||||
install_zip "pypy${PYVER}-v${VERSION}-win64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-win64.zip#8ceb03d2f7b73c6ce0758290bc42ba366a45c46e033eda36f1779d957a905735" "pypy" "verify_py${PYVER//./}" ensurepip
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
|
||||
echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,8 @@
|
||||
VERSION='7.3.7'
|
||||
PYVER='3.8'
|
||||
# https://www.pypy.org/checksums.html
|
||||
|
||||
#require_gcc
|
||||
prefer_openssl11
|
||||
install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "pypy${PYVER}-v${VERSION}-src" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-src.tar.bz2#21ae339f4f5016d6ca7300305f3e3b554373835cb3c39a9041fe30e6811c80c6" "pypy_builder" "verify_py${PYVER//./}" ensurepip
|
||||
@@ -6,7 +6,7 @@ echo
|
||||
|
||||
case "$(pyston_architecture 2>/dev/null || true)" in
|
||||
"linux64" )
|
||||
install_package "pyston_2.2" "https://github.com/pyston/pyston/releases/download/pyston_2.2/pyston_2.2_portable.tar.gz#d113cc4d1f6821c0f117f7a84978823d8ac751d7970fa7841eb994663ec5a59f" "pyston" verify_py38 get_pip
|
||||
install_package "pyston_2.2" "https://github.com/pyston/pyston/releases/download/pyston_2.2/pyston_2.2_portable.tar.gz#d113cc4d1f6821c0f117f7a84978823d8ac751d7970fa7841eb994663ec5a59f" "pyston2_2" verify_py38 get_pip
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
|
||||
@@ -6,7 +6,7 @@ echo
|
||||
|
||||
case "$(pyston_architecture 2>/dev/null || true)" in
|
||||
"linux64" )
|
||||
install_package "pyston_2.3" "https://github.com/pyston/pyston/releases/download/v2.3/pyston_2.3_portable-v2.tar.gz#90185e29e4a1a19562c095f2bb4e81a5d0715150fa10eca363ec1188b5ba7ee7" "pyston" verify_py38 get_pip
|
||||
install_package "pyston_2.3" "https://github.com/pyston/pyston/releases/download/v2.3/pyston_2.3_portable-v2.tar.gz#90185e29e4a1a19562c095f2bb4e81a5d0715150fa10eca363ec1188b5ba7ee7" "pyston2_2" verify_py38 get_pip
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
|
||||
19
plugins/python-build/share/python-build/pyston-2.3.1
Normal file
19
plugins/python-build/share/python-build/pyston-2.3.1
Normal file
@@ -0,0 +1,19 @@
|
||||
echo
|
||||
colorize 1 "WARNING"
|
||||
echo ": Pyston only runs on x86_64 platforms, and only has been tested on Ubuntu"
|
||||
echo "so, your mileage may vary with other Linux distributions."
|
||||
echo
|
||||
|
||||
case "$(pyston_architecture 2>/dev/null || true)" in
|
||||
"linux64" )
|
||||
install_package "pyston_2.3.1" "https://github.com/pyston/pyston/releases/download/pyston_2.3.1/pyston_2.3.1_portable_v2.tar.gz#4e16df1eaf5f226c0629f2db1e63033454c94cb9e29f50154177819662df5b15" "pyston" verify_py38 get_pip
|
||||
;;
|
||||
* )
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": A Pyston 2.3.1 binary is not available for $(pyston_architecture 2>/dev/null || true)."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -62,10 +62,7 @@ assert_build_log() {
|
||||
cached_tarball "yaml-0.1.6"
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
# pyenv/pyenv#1026
|
||||
stub uname false false
|
||||
|
||||
stub uname '-s : echo Linux' '-s : echo Linux'
|
||||
for i in {1..4}; do stub uname '-s : echo Linux'; done
|
||||
stub brew false
|
||||
stub_make_install
|
||||
stub_make_install
|
||||
@@ -92,10 +89,7 @@ OUT
|
||||
cached_tarball "yaml-0.1.6"
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
# pyenv/pyenv#1026
|
||||
stub uname false false
|
||||
|
||||
stub uname '-s : echo Linux' '-s : echo Linux'
|
||||
for i in {1..4}; do stub uname '-s : echo Linux'; done
|
||||
stub brew false
|
||||
stub_make_install
|
||||
stub_make_install
|
||||
@@ -154,23 +148,50 @@ make install
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "homebrew with uncommon prefix is added to search path" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
BREW_PREFIX="$TMP/homebrew-prefix"
|
||||
mkdir -p "$BREW_PREFIX"
|
||||
|
||||
for i in {1..4}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||
stub brew "--prefix : echo '$BREW_PREFIX'" false
|
||||
stub_make_install
|
||||
|
||||
run_inline_definition <<DEF
|
||||
install_package "Python-3.6.2" "http://python.org/ftp/python/3.6.2/Python-3.6.2.tar.gz"
|
||||
DEF
|
||||
assert_success
|
||||
|
||||
unstub sw_vers
|
||||
unstub uname
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CPPFLAGS="-I${TMP}/install/include -I$BREW_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -L$BREW_PREFIX/lib"
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "yaml is linked from Homebrew" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
brew_libdir="$TMP/homebrew-yaml"
|
||||
mkdir -p "$brew_libdir"
|
||||
|
||||
# pyenv/pyenv#1026
|
||||
stub uname false false
|
||||
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Darwin'
|
||||
stub brew "--prefix libyaml : echo '$brew_libdir'" false false
|
||||
for i in {1..4}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..2}; do stub sw_vers '-productVersion : echo 1010'; done
|
||||
stub brew "--prefix libyaml : echo '$brew_libdir'"
|
||||
for i in {1..4}; do stub brew false; done
|
||||
stub_make_install
|
||||
|
||||
install_fixture definitions/needs-yaml
|
||||
assert_success
|
||||
|
||||
unstub sw_vers
|
||||
unstub uname
|
||||
unstub brew
|
||||
unstub make
|
||||
@@ -188,11 +209,10 @@ OUT
|
||||
|
||||
readline_libdir="$TMP/homebrew-readline"
|
||||
mkdir -p "$readline_libdir"
|
||||
|
||||
# pyenv/pyenv#1026
|
||||
stub uname false false
|
||||
|
||||
stub brew false "--prefix readline : echo '$readline_libdir'"
|
||||
stub uname false
|
||||
for i in {1..2}; do stub brew false; done
|
||||
stub brew "--prefix readline : echo '$readline_libdir'"
|
||||
stub brew false
|
||||
stub_make_install
|
||||
|
||||
run_inline_definition <<DEF
|
||||
@@ -222,7 +242,7 @@ OUT
|
||||
# pyenv/pyenv#1026
|
||||
stub uname false false
|
||||
|
||||
stub brew false
|
||||
for i in {1..3}; do stub brew false; done
|
||||
stub_make_install
|
||||
|
||||
export PYTHON_CONFIGURE_OPTS="CPPFLAGS=-I$readline_libdir/include LDFLAGS=-L$readline_libdir/lib"
|
||||
@@ -244,18 +264,15 @@ OUT
|
||||
|
||||
@test "tcl-tk is linked from Homebrew" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
# python build
|
||||
tcl_tk_version=8.6
|
||||
tcl_tk_libdir="$TMP/homebrew-tcl-tk"
|
||||
tcl_tk_version_long="8.6.10"
|
||||
tcl_tk_version="${tcl_tk_version_long%.*}"
|
||||
mkdir -p "$tcl_tk_libdir"
|
||||
mkdir -p "$tcl_tk_libdir/$tcl_tk_version_long"
|
||||
mkdir -p "$tcl_tk_libdir/lib"
|
||||
echo "TCL_VERSION='$tcl_tk_version'" >>"$tcl_tk_libdir/lib/tclConfig.sh"
|
||||
|
||||
# pyenv/pyenv#1026
|
||||
stub uname false false
|
||||
|
||||
stub brew "--prefix tcl-tk : echo '$tcl_tk_libdir'" "--cellar tcl-tk : echo '$TMP/homebrew-tcl-tk'" false
|
||||
stub uname false
|
||||
stub brew false
|
||||
for i in {1..2}; do stub brew "--prefix tcl-tk : echo '$tcl_tk_libdir'"; done
|
||||
for i in {1..2}; do stub brew false; done
|
||||
stub_make_install
|
||||
|
||||
run_inline_definition <<DEF
|
||||
@@ -284,7 +301,7 @@ OUT
|
||||
# pyenv/pyenv#1026
|
||||
stub uname false false
|
||||
|
||||
stub brew false false
|
||||
for i in {1..4}; do stub brew false; done
|
||||
stub_make_install
|
||||
|
||||
export PYTHON_CONFIGURE_OPTS="--with-tcltk-libs='-L${TMP}/custom-tcl-tk/lib -ltcl$tcl_tk_version -ltk$tcl_tk_version'"
|
||||
|
||||
@@ -63,13 +63,9 @@ DEF
|
||||
mkdir -p "$INSTALL_ROOT"
|
||||
cd "$INSTALL_ROOT"
|
||||
|
||||
# pyenv/pyenv#1026
|
||||
stub uname false '-s : echo Darwin' false '-s : echo Darwin' '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
for i in {1..5}; do stub uname '-s : echo Darwin'; done
|
||||
for i in {1..4}; do stub sw_vers '-productVersion : echo 10.10'; done
|
||||
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
stub cc 'false'
|
||||
stub brew 'false'
|
||||
stub make \
|
||||
|
||||
@@ -183,7 +183,7 @@ OUT
|
||||
}
|
||||
|
||||
@test "pyenv-install has usage help preface" {
|
||||
run head "$(which pyenv-install)"
|
||||
run head "$(command -v pyenv-install)"
|
||||
assert_output_contains 'Usage: pyenv install'
|
||||
}
|
||||
|
||||
@@ -212,6 +212,6 @@ OUT
|
||||
}
|
||||
|
||||
@test "pyenv-uninstall has usage help preface" {
|
||||
run head "$(which pyenv-uninstall)"
|
||||
run head "$(command -v pyenv-uninstall)"
|
||||
assert_output_contains 'Usage: pyenv uninstall'
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ OUT
|
||||
@test "apply built-in python patches should be sorted by its name" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
stub brew false
|
||||
for i in {1..2}; do stub brew '* : false'; done
|
||||
stub_make_install
|
||||
stub patch ' : for arg; do [[ "$arg" == "-"* ]] || sed -e "s/^/patch: /" "$arg"; done >> build.log'
|
||||
|
||||
@@ -144,9 +144,7 @@ OUT
|
||||
echo "bar" | install_patch definitions/vanilla-python "Python-3.6.2/bar.patch"
|
||||
echo "baz" | install_patch definitions/vanilla-python "Python-3.6.2/baz.patch"
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Linux'
|
||||
for i in {1..2}; do stub uname '-s : echo Linux'; done
|
||||
|
||||
TMPDIR="$TMP" install_tmp_fixture definitions/vanilla-python < /dev/null
|
||||
assert_success
|
||||
@@ -173,9 +171,7 @@ OUT
|
||||
" : echo \"$MAKE \$@\" >> build.log" \
|
||||
" : echo \"$MAKE \$@\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'"
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Linux'
|
||||
stub uname '-s : echo Linux'
|
||||
for i in {1..4}; do stub uname '-s : echo Darwin'; done
|
||||
|
||||
PYTHON_MAKE_INSTALL_TARGET="altinstall" TMPDIR="$TMP" install_tmp_fixture definitions/vanilla-python < /dev/null
|
||||
assert_success
|
||||
@@ -259,10 +255,7 @@ OUT
|
||||
touch "${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin/python3.4-config"
|
||||
chmod +x "${INSTALL_ROOT}/Library/Frameworks/Python.framework/Versions/Current/bin/python3.4-config"
|
||||
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
for i in {1..3}; do stub uname '-s : echo Darwin'; done
|
||||
|
||||
PYTHON_CONFIGURE_OPTS="--enable-framework" TMPDIR="$TMP" run_inline_definition <<OUT
|
||||
echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
||||
@@ -278,24 +271,51 @@ EOS
|
||||
}
|
||||
|
||||
@test "enable universalsdk" {
|
||||
# yyuu/pyenv#257
|
||||
stub uname '-s : echo Darwin'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
for i in {1..3}; do stub uname '-s : echo Darwin'; done
|
||||
stub arch "echo x86_64"
|
||||
|
||||
PYTHON_CONFIGURE_OPTS="--enable-universalsdk" TMPDIR="$TMP" run_inline_definition <<OUT
|
||||
echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
||||
OUT
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-universalsdk=/ --with-universal-archs=intel)
|
||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-universalsdk=/)
|
||||
EOS
|
||||
}
|
||||
|
||||
@test "enable universalsdk on Apple Silicon" {
|
||||
|
||||
for i in {1..3}; do stub uname '-s : echo Darwin'; done
|
||||
stub arch "echo arm64"
|
||||
|
||||
PYTHON_CONFIGURE_OPTS="--enable-universalsdk" TMPDIR="$TMP" run_inline_definition <<OUT
|
||||
echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
||||
OUT
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-universalsdk=/ --with-universal-archs=universal2)
|
||||
EOS
|
||||
}
|
||||
|
||||
@test "enable universalsdk with explicit archs argument" {
|
||||
|
||||
for i in {1..3}; do stub uname '-s : echo Darwin'; done
|
||||
|
||||
PYTHON_CONFIGURE_OPTS="--enable-universalsdk --with-universal-archs=foo" TMPDIR="$TMP" run_inline_definition <<OUT
|
||||
echo "PYTHON_CONFIGURE_OPTS_ARRAY=(\${PYTHON_CONFIGURE_OPTS_ARRAY[@]})"
|
||||
OUT
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
PYTHON_CONFIGURE_OPTS_ARRAY=(--libdir=${TMP}/install/lib --enable-universalsdk=/)
|
||||
EOS
|
||||
}
|
||||
|
||||
@test "enable custom unicode configuration" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
stub brew false
|
||||
for i in {1..4}; do stub brew false; done
|
||||
for i in {1..3}; do stub uname '-s : echo Linux'; done
|
||||
stub "$MAKE" \
|
||||
" : echo \"$MAKE \$@\" >> build.log" \
|
||||
" : echo \"$MAKE \$@\" >> build.log && cat build.log >> '$INSTALL_ROOT/build.log'"
|
||||
@@ -311,6 +331,8 @@ make install
|
||||
OUT
|
||||
|
||||
unstub make
|
||||
unstub uname
|
||||
unstub brew
|
||||
}
|
||||
|
||||
@test "default MACOSX_DEPLOYMENT_TARGET" {
|
||||
|
||||
@@ -11,11 +11,10 @@ _STUB_RUN="${PROGRAM}_STUB_RUN"
|
||||
_STUB_INDEX="${PROGRAM}_STUB_INDEX"
|
||||
_STUB_RESULT="${PROGRAM}_STUB_RESULT"
|
||||
_STUB_END="${PROGRAM}_STUB_END"
|
||||
_STUB_DEBUG="${PROGRAM}_STUB_DEBUG"
|
||||
_STUB_LOG="${PROGRAM}_STUB_LOG"
|
||||
|
||||
if [ -n "${!_STUB_DEBUG}" ]; then
|
||||
echo "$program" "$@" >&${!_STUB_DEBUG}
|
||||
fi
|
||||
[ -n "${!_STUB_LOG}" ] || eval "${_STUB_LOG}"="${TMPDIR}/${program}-stub-log"
|
||||
if test -z "${!_STUB_END}"; then echo "$program" "$@" >>"${!_STUB_LOG}"; fi
|
||||
|
||||
[ -e "${!_STUB_PLAN}" ] || exit 1
|
||||
[ -n "${!_STUB_RUN}" ] || eval "${_STUB_RUN}"="${TMPDIR}/${program}-stub-run"
|
||||
@@ -24,7 +23,7 @@ fi
|
||||
# Initialize or load the stub run information.
|
||||
eval "${_STUB_INDEX}"=1
|
||||
eval "${_STUB_RESULT}"=0
|
||||
[ ! -e "${!_STUB_RUN}" ] || source "${!_STUB_RUN}"
|
||||
if test -e "${!_STUB_RUN}"; then source "${!_STUB_RUN}"; fi
|
||||
|
||||
|
||||
# Loop over each line in the plan.
|
||||
@@ -80,14 +79,39 @@ done < "${!_STUB_PLAN}"
|
||||
|
||||
|
||||
if [ -n "${!_STUB_END}" ]; then
|
||||
# Clean up the run file.
|
||||
rm -f "${!_STUB_RUN}"
|
||||
|
||||
# If the number of lines in the plan is larger than
|
||||
# the requested index, we failed.
|
||||
if [ $index -ge "${!_STUB_INDEX}" ]; then
|
||||
eval "${_STUB_RESULT}"=1
|
||||
{
|
||||
echo "index: $index; stub index: ${!_STUB_INDEX}"
|
||||
echo "plan:"
|
||||
cat "${!_STUB_PLAN}"
|
||||
echo "run:"
|
||||
cat "${!_STUB_RUN}"
|
||||
echo "log:"
|
||||
cat "${!_STUB_LOG}"
|
||||
} >&2
|
||||
fi
|
||||
if [ "${!_STUB_RESULT}" -ne 0 ]; then
|
||||
{
|
||||
echo "index: $index; stub index: ${!_STUB_INDEX}"
|
||||
echo "plan:"
|
||||
cat "${!_STUB_PLAN}" || true
|
||||
echo "run:"
|
||||
cat "${!_STUB_RUN}" || true
|
||||
echo "log:"
|
||||
cat "${!_STUB_LOG}" || true
|
||||
} >&2
|
||||
fi
|
||||
|
||||
# Clean up the run file.
|
||||
rm -f "${!_STUB_RUN}"
|
||||
rm -f "${!_STUB_LOG}"
|
||||
|
||||
# Clean up the run file.
|
||||
rm -f "${!_STUB_RUN}"
|
||||
rm -f "${!_STUB_LOG}"
|
||||
|
||||
# Return the result.
|
||||
exit "${!_STUB_RESULT}"
|
||||
|
||||
@@ -25,6 +25,7 @@ stub() {
|
||||
|
||||
export "${prefix}_STUB_PLAN"="${TMP}/${program}-stub-plan"
|
||||
export "${prefix}_STUB_RUN"="${TMP}/${program}-stub-run"
|
||||
export "${prefix}_STUB_LOG"="${TMP}/${program}-stub-log"
|
||||
export "${prefix}_STUB_END"=
|
||||
|
||||
mkdir -p "${TMP}/bin"
|
||||
|
||||
@@ -32,8 +32,7 @@ static_version="$(grep VERSION "$bats_bin" | head -1 | cut -d'"' -f 2)"
|
||||
|
||||
@test "git remote doesn't match" {
|
||||
stub git \
|
||||
'remote -v : echo origin https://github.com/Homebrew/homebrew.git' \
|
||||
"describe --tags HEAD : echo v1984-12-gSHA"
|
||||
'remote -v : echo origin https://github.com/Homebrew/homebrew.git'
|
||||
run python-build --version
|
||||
assert_success "python-build ${static_version}"
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ OUT
|
||||
}
|
||||
|
||||
@test "sys.executable with system version (#98)" {
|
||||
system_python=$(which python3)
|
||||
system_python="$(python3 -c 'import sys; print(sys.executable)')"
|
||||
|
||||
PYENV_VERSION="custom"
|
||||
create_executable "python3" ""
|
||||
|
||||
@@ -25,7 +25,7 @@ load test_helper
|
||||
}
|
||||
|
||||
#Arch has Python at sbin as well as bin
|
||||
@test "prefix for sbin system" {
|
||||
@test "prefix for system in sbin" {
|
||||
mkdir -p "${PYENV_TEST_DIR}/sbin"
|
||||
touch "${PYENV_TEST_DIR}/sbin/python"
|
||||
chmod +x "${PYENV_TEST_DIR}/sbin/python"
|
||||
@@ -46,6 +46,6 @@ OUT
|
||||
}
|
||||
|
||||
@test "prefix for invalid system" {
|
||||
PATH="$(path_without python)" run pyenv-prefix system
|
||||
PATH="$(path_without python python2 python3)" run pyenv-prefix system
|
||||
assert_failure "pyenv: system version not found in PATH"
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@ flunk() {
|
||||
|
||||
assert_success() {
|
||||
if [ "$status" -ne 0 ]; then
|
||||
flunk "command failed with exit status $status"
|
||||
flunk "command failed with exit status $status" $'\n'\
|
||||
"output: $output"
|
||||
elif [ "$#" -gt 0 ]; then
|
||||
assert_output "$1"
|
||||
fi
|
||||
@@ -52,7 +53,8 @@ assert_success() {
|
||||
|
||||
assert_failure() {
|
||||
if [ "$status" -eq 0 ]; then
|
||||
flunk "expected failed exit status"
|
||||
flunk "expected failed exit status" $'\n'\
|
||||
"output: $output"
|
||||
elif [ "$#" -gt 0 ]; then
|
||||
assert_output "$1"
|
||||
fi
|
||||
@@ -111,24 +113,26 @@ assert() {
|
||||
# Output a modified PATH that ensures that the given executable is not present,
|
||||
# but in which system utils necessary for pyenv operation are still available.
|
||||
path_without() {
|
||||
local exe="$1"
|
||||
local path=":${PATH}:"
|
||||
local found alt util
|
||||
for found in $(which -a "$exe"); do
|
||||
found="${found%/*}"
|
||||
if [ "$found" != "${PYENV_ROOT}/shims" ]; then
|
||||
alt="${PYENV_TEST_DIR}/$(echo "${found#/}" | tr '/' '-')"
|
||||
mkdir -p "$alt"
|
||||
for util in bash head cut readlink greadlink; do
|
||||
if [ -x "${found}/$util" ]; then
|
||||
ln -s "${found}/$util" "${alt}/$util"
|
||||
fi
|
||||
done
|
||||
path="${path/:${found}:/:${alt}:}"
|
||||
fi
|
||||
for exe; do
|
||||
local found alt util
|
||||
for found in $(PATH="$path" type -aP "$exe"); do
|
||||
found="${found%/*}"
|
||||
if [ "$found" != "${PYENV_ROOT}/shims" ]; then
|
||||
alt="${PYENV_TEST_DIR}/$(echo "${found#/}" | tr '/' '-')"
|
||||
mkdir -p "$alt"
|
||||
for util in bash head cut readlink greadlink; do
|
||||
if [ -x "${found}/$util" ]; then
|
||||
ln -s "${found}/$util" "${alt}/$util"
|
||||
fi
|
||||
done
|
||||
path="${path/:${found}:/:${alt}:}"
|
||||
fi
|
||||
done
|
||||
done
|
||||
path="${path#:}"
|
||||
echo "${path%:}"
|
||||
path="${path%:}"
|
||||
echo "$path"
|
||||
}
|
||||
|
||||
create_hook() {
|
||||
|
||||
@@ -25,7 +25,7 @@ stub_system_python() {
|
||||
}
|
||||
|
||||
@test "not even system python available" {
|
||||
PATH="$(path_without python)" run pyenv-versions
|
||||
PATH="$(path_without python python2 python3)" run pyenv-versions
|
||||
assert_failure
|
||||
assert_output "Warning: no Python detected on the system"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user