mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-09 03:53:48 -05:00
Compare commits
146 Commits
v0.1.0
...
v0.4.0-201
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc9c72747a | ||
|
|
b473f7a271 | ||
|
|
b726ace943 | ||
|
|
499edda1d7 | ||
|
|
3bfd91de51 | ||
|
|
c7e139186b | ||
|
|
7c84490649 | ||
|
|
b75ef17db7 | ||
|
|
daa12e97c6 | ||
|
|
1c5eb82e93 | ||
|
|
ff387010b3 | ||
|
|
27dd805acb | ||
|
|
5f1761645f | ||
|
|
f8c9282e8c | ||
|
|
37f46df390 | ||
|
|
4f8138c70a | ||
|
|
db3b4773bc | ||
|
|
fe04103e24 | ||
|
|
7777bb6d58 | ||
|
|
e9bcd9e0bd | ||
|
|
2cc2c22094 | ||
|
|
319000b448 | ||
|
|
b4ba76a15a | ||
|
|
3ff0785fe7 | ||
|
|
1b7d3b0502 | ||
|
|
c43711a216 | ||
|
|
3c86d811c8 | ||
|
|
d94c1d2143 | ||
|
|
3fd475e1d5 | ||
|
|
309a6cd65e | ||
|
|
924f6dc76d | ||
|
|
56a9a7cebf | ||
|
|
b8cbb18f7b | ||
|
|
27caf0ef3d | ||
|
|
b203ccbe74 | ||
|
|
cb962d5a74 | ||
|
|
539800cc3b | ||
|
|
b77ae3e0b5 | ||
|
|
dfc3f9e13c | ||
|
|
f120551ef3 | ||
|
|
b03a4cde78 | ||
|
|
71b2081a75 | ||
|
|
5fbc3ae3d5 | ||
|
|
1ce37e53c7 | ||
|
|
9ae12a7c22 | ||
|
|
b3deef5e80 | ||
|
|
28317ecb34 | ||
|
|
78efa7613d | ||
|
|
0bf26d8f1d | ||
|
|
ac70eb701c | ||
|
|
c834f241a8 | ||
|
|
aa39b392a9 | ||
|
|
907ddb614d | ||
|
|
dd0e3feae3 | ||
|
|
c24207428c | ||
|
|
8b23026d6c | ||
|
|
cc9b7aa7dd | ||
|
|
318a41d723 | ||
|
|
5a52177d15 | ||
|
|
2e8c43215d | ||
|
|
45966deb49 | ||
|
|
7aa644da5c | ||
|
|
56379532a6 | ||
|
|
9bf0755c81 | ||
|
|
f01d1d1064 | ||
|
|
e9b0ecf021 | ||
|
|
cbc6f38774 | ||
|
|
e220b76c3e | ||
|
|
8d1bf96267 | ||
|
|
e49922064d | ||
|
|
95882fce68 | ||
|
|
cc20ab3392 | ||
|
|
fe50ed29ea | ||
|
|
e9db2caace | ||
|
|
2d55aea467 | ||
|
|
521c2c3e06 | ||
|
|
0bc8d8252e | ||
|
|
80f4022891 | ||
|
|
998af2a3ab | ||
|
|
3b820e8c0c | ||
|
|
8bc19e28e0 | ||
|
|
0d0516ad05 | ||
|
|
6997026064 | ||
|
|
dd1b6502c6 | ||
|
|
d1013e82de | ||
|
|
bb2d058167 | ||
|
|
6e58c43d8a | ||
|
|
dce4eb636a | ||
|
|
c170255580 | ||
|
|
8bf0938e60 | ||
|
|
aa831836e1 | ||
|
|
0eb1520707 | ||
|
|
606346761f | ||
|
|
48e1488bc9 | ||
|
|
0259b6adfb | ||
|
|
dbb1fb5a06 | ||
|
|
755c00e67c | ||
|
|
ad900ba436 | ||
|
|
ea7dc5f1e1 | ||
|
|
be53bb8951 | ||
|
|
167ff2a198 | ||
|
|
ee3c9bef5e | ||
|
|
6d307c6e11 | ||
|
|
a0705cb86e | ||
|
|
fca31c4307 | ||
|
|
684f7b7f21 | ||
|
|
da06998457 | ||
|
|
f466679bd1 | ||
|
|
4a217a0cd1 | ||
|
|
5b14236bac | ||
|
|
a16355fe33 | ||
|
|
c9575d7cb0 | ||
|
|
252003f18e | ||
|
|
7509b9fadf | ||
|
|
f878896a77 | ||
|
|
d09af20897 | ||
|
|
b520475b22 | ||
|
|
ffa2505450 | ||
|
|
d73e945329 | ||
|
|
779aacbf07 | ||
|
|
2ed400bfc6 | ||
|
|
e8ad78f837 | ||
|
|
aede700619 | ||
|
|
ffa5fb0ea0 | ||
|
|
42079cf3fb | ||
|
|
d14eda2c1a | ||
|
|
579d44203f | ||
|
|
a7695aa5d3 | ||
|
|
f3ae8fd904 | ||
|
|
4174749b24 | ||
|
|
e89ae3a4a9 | ||
|
|
13122ca9bf | ||
|
|
34a4a532b2 | ||
|
|
d08fcc522e | ||
|
|
f0ff5a416e | ||
|
|
e66ca60340 | ||
|
|
71e5cd962e | ||
|
|
da659739d2 | ||
|
|
dff57ae35d | ||
|
|
2856f81bb9 | ||
|
|
5224641f1a | ||
|
|
a4c02082cb | ||
|
|
80c0dce7b2 | ||
|
|
de25a84dc2 | ||
|
|
8187bc84e3 | ||
|
|
880ea61dd8 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
#/plugins
|
/cache
|
||||||
/shims
|
/shims
|
||||||
/version
|
/version
|
||||||
/versions
|
/versions
|
||||||
|
/sources
|
||||||
|
|||||||
40
CHANGELOG.md
Normal file
40
CHANGELOG.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
## Version History
|
||||||
|
|
||||||
|
#### 0.4.0-20130613
|
||||||
|
|
||||||
|
* pyenv: Changed versioning schema. There are two parts; the former is the base rbenv version, and the latter is the date of release.
|
||||||
|
* python-build: Add `--debug` option to build CPython with debug symbols. (#11)
|
||||||
|
* python-build: Add new CPython versions: 2.7.4, 2.7.5, 3.2.4, 3.2.5, 3.3.1, 3.3.2 (#12, #17)
|
||||||
|
* python-build: Add `svnversion` patch for old CPython versions (#14)
|
||||||
|
* python-build: Enable mirror by default for faster download (#20)
|
||||||
|
* python-build: Add `OPENSSL_NO_SSL2` patch for old CPython versions (#22)
|
||||||
|
* python-build: Install GNU Readline on Darwin if the system one is broken (#23)
|
||||||
|
* python-build: Bundle patches in `${PYTHON_BUILD_ROOT}/share/python-build/patches` and improve patching mechanism (`apply_patches`).
|
||||||
|
* python-build: Verify native extensions after building. (`build_package_verify_py*`)
|
||||||
|
* python-build: Add `install_hg` to install package from Mercurial repository
|
||||||
|
* python-build: Support building Jython and PyPy.
|
||||||
|
* python-build: Add new CPython development versions: 2.6-dev, 2.7-dev, 3.1-dev, 3.2-dev, 3.3-dev, 3.4-dev
|
||||||
|
* python-build: Add new Jython development versions: jython-2.5.4-rc1, jython-2.5-dev, jython-2.7-beta1, jython-dev
|
||||||
|
* python-build: Add new PyPy versions: pypy-1.5{,-src}, pypy-1.6, pypy-1.7, pypy-2.0{,-src}, pypy-2.0.1{,-src}, pypy-2.0.2{,-src}
|
||||||
|
* python-build: Add new PyPy development versions: pypy-1.7-dev, pypy-1.8-dev, pypy-1.9-dev, pypy-2.0-dev, pypy-dev, pypy-py3k-dev
|
||||||
|
* python-build: Add new Stackless development versions: stackless-2.7-dev, stackless-3.2-dev, stackless-3.3-dev, stackless-dev
|
||||||
|
* python-build: Update default pip version (1.2.1 -> 1.3.1)
|
||||||
|
* python-build: Update default setuptools version (0.6.34 (distribute) -> 0.7.2 ([new setuptools](https://bitbucket.org/pypa/setuptools)))
|
||||||
|
|
||||||
|
#### 0.2.0 (February 18, 2013)
|
||||||
|
|
||||||
|
* Import changes from rbenv 0.4.0.
|
||||||
|
|
||||||
|
#### 0.1.2 (October 23, 2012)
|
||||||
|
|
||||||
|
* Add push/pop for version stack management.
|
||||||
|
* Support multiple versions via environment variable.
|
||||||
|
* Now GCC is not a requirement to build CPython and Stackless.
|
||||||
|
|
||||||
|
#### 0.1.1 (September 3, 2012)
|
||||||
|
|
||||||
|
* Support multiple versions of Python at a time.
|
||||||
|
|
||||||
|
#### 0.1.0 (August 31, 2012)
|
||||||
|
|
||||||
|
* Initial public release.
|
||||||
4
LICENSE
4
LICENSE
@@ -1,5 +1,5 @@
|
|||||||
Copyright (c) 2011 Sam Stephenson
|
Copyright (c) 2013 Yamashita, Yuu
|
||||||
Copyright (c) 2012 Yamashita, Yuu
|
Copyright (c) 2013 Sam Stephenson
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
|
|||||||
391
README.md
391
README.md
@@ -4,50 +4,144 @@ pyenv lets you easily switch between multiple versions of Python. It's
|
|||||||
simple, unobtrusive, and follows the UNIX tradition of single-purpose
|
simple, unobtrusive, and follows the UNIX tradition of single-purpose
|
||||||
tools that do one thing well.
|
tools that do one thing well.
|
||||||
|
|
||||||
This project was forked from [rbenv](https://github.com/sstephenson/rbenv) and.
|
This project was forked from [rbenv](https://github.com/sstephenson/rbenv) and
|
||||||
[ruby-build](https://github.com/sstephenson/ruby-build) and modified for Python.
|
[ruby-build](https://github.com/sstephenson/ruby-build), and modified for Python.
|
||||||
|
|
||||||
### pyenv _does…_
|
<img src="http://gyazo.com/9c829fafdf5e58880c820349c4e9197e.png?1346414267" width="849" height="454">
|
||||||
|
|
||||||
|
### pyenv _does..._
|
||||||
|
|
||||||
* Let you **change the global Python version** on a per-user basis.
|
* Let you **change the global Python version** on a per-user basis.
|
||||||
* Provide support for **per-project Python versions**.
|
* Provide support for **per-project Python versions**.
|
||||||
* Allow you to **override the Python version** with an environment
|
* Allow you to **override the Python version** with an environment
|
||||||
variable.
|
variable.
|
||||||
|
* Search commands from **multiple versions of Python at a time**.
|
||||||
|
This may be helpful to test across Python versions with [tox](http://pypi.python.org/pypi/tox).
|
||||||
|
|
||||||
|
### In contrast with pythonbrew and pythonz, pyenv _does not..._
|
||||||
|
|
||||||
|
* **Depending on Python itself.** pyenv was made from pure shell scripts.
|
||||||
|
There is no bootstrap problem of Python.
|
||||||
|
* **Need to be loaded into your shell.** Instead, pyenv's shim
|
||||||
|
approach works by adding a directory to your `$PATH`.
|
||||||
|
* **Manage virtualenv.** Of course, you can create [virtualenv](http://pypi.python.org/pypi/virtualenv)
|
||||||
|
yourself, or [pyenv-virtualenv](https://github.com/yyuu/pyenv-virtualenv)
|
||||||
|
to automate the process.
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
* [1 How It Works](#section_1)
|
* [How It Works](#how-it-works)
|
||||||
* [2 Installation](#section_2)
|
* [Understanding PATH](#understanding-path)
|
||||||
* [2.1 Basic GitHub Checkout](#section_2.1)
|
* [Understanding Shims](#understanding-shims)
|
||||||
* [2.1.1 Upgrading](#section_2.1.1)
|
* [Choosing the Python Version](#choosing-the-python-version)
|
||||||
* [3 Usage](#section_3)
|
* [Locating the Python Installation](#locating-the-python-installation)
|
||||||
* [4 Development](#section_4)
|
* [Installation](#installation)
|
||||||
* [4.1 Version History](#section_4.1)
|
* [Basic GitHub Checkout](#basic-github-checkout)
|
||||||
* [4.2 License](#section_4.2)
|
* [Upgrading](#upgrading)
|
||||||
|
* [Homebrew on Mac OS X](#homebrew-on-mac-os-x)
|
||||||
|
* [Neckbeard Configuration](#neckbeard-configuration)
|
||||||
|
* [Uninstalling Python Versions](#uninstalling-python-versions)
|
||||||
|
* [Command Reference](#command-reference)
|
||||||
|
* [pyenv local](#pyenv-local)
|
||||||
|
* [pyenv global](#pyenv-global)
|
||||||
|
* [pyenv shell](#pyenv-shell)
|
||||||
|
* [pyenv versions](#pyenv-versions)
|
||||||
|
* [pyenv version](#pyenv-version)
|
||||||
|
* [pyenv rehash](#pyenv-rehash)
|
||||||
|
* [pyenv which](#pyenv-which)
|
||||||
|
* [pyenv whence](#pyenv-whence)
|
||||||
|
* [Development](#development)
|
||||||
|
* [Version History](#version-history)
|
||||||
|
* [License](#license)
|
||||||
|
|
||||||
## <a name="section_1"></a> 1 How It Works
|
## How It Works
|
||||||
|
|
||||||
pyenv operates on the per-user directory `~/.pyenv`. Version names in
|
At a high level, pyenv intercepts Python commands using shim
|
||||||
pyenv correspond to subdirectories of `~/.pyenv/versions`. For
|
executables injected into your `PATH`, determines which Python version
|
||||||
example, you might have `~/.pyenv/versions/2.7.3` and
|
has been specified by your application, and passes your commands along
|
||||||
`~/.pyenv/versions/2.7.3`.
|
to the correct Python installation.
|
||||||
|
|
||||||
Each version is a working tree with its own binaries, like
|
### Understanding PATH
|
||||||
`~/.pyenv/versions/2.7.3/bin/python2.7` and
|
|
||||||
`~/.pyenv/versions/3.2.3/bin/python3.2`. pyenv makes _shim binaries_
|
|
||||||
for every such binary across all installed versions of Python.
|
|
||||||
|
|
||||||
These shims are simple wrapper scripts that live in `~/.pyenv/shims`
|
When you run a command like `python` or `pip`, your operating system
|
||||||
and detect which Python version you want to use. They insert the
|
searches through a list of directories to find an executable file with
|
||||||
directory for the selected version at the beginning of your `$PATH`
|
that name. This list of directories lives in an environment variable
|
||||||
and then execute the corresponding binary.
|
called `PATH`, with each directory in the list separated by a colon:
|
||||||
|
|
||||||
Because of the simplicity of the shim approach, all you need to use
|
/usr/local/bin:/usr/bin:/bin
|
||||||
pyenv is `~/.pyenv/shims` in your `$PATH`.
|
|
||||||
|
|
||||||
## <a name="section_2"></a> 2 Installation
|
Directories in `PATH` are searched from left to right, so a matching
|
||||||
|
executable in a directory at the beginning of the list takes
|
||||||
|
precedence over another one at the end. In this example, the
|
||||||
|
`/usr/local/bin` directory will be searched first, then `/usr/bin`,
|
||||||
|
then `/bin`.
|
||||||
|
|
||||||
### <a name="section_2.1"></a> 2.1 Basic GitHub Checkout
|
### Understanding Shims
|
||||||
|
|
||||||
|
pyenv works by inserting a directory of _shims_ at the front of your
|
||||||
|
`PATH`:
|
||||||
|
|
||||||
|
~/.pyenv/shims:/usr/local/bin:/usr/bin:/bin
|
||||||
|
|
||||||
|
Through a process called _rehashing_, pyenv maintains shims in that
|
||||||
|
directory to match every Python command across every installed version
|
||||||
|
of Python—`python`, `pip`, and so on.
|
||||||
|
|
||||||
|
Shims are lightweight executables that simply pass your command along
|
||||||
|
to pyenv. So with pyenv installed, when you run, say, `pip`, your
|
||||||
|
operating system will do the following:
|
||||||
|
|
||||||
|
* Search your `PATH` for an executable file named `pip`
|
||||||
|
* Find the pyenv shim named `pip` at the beginning of your `PATH`
|
||||||
|
* Run the shim named `pip`, which in turn passes the command along to
|
||||||
|
pyenv
|
||||||
|
|
||||||
|
### Choosing the Python Version
|
||||||
|
|
||||||
|
When you execute a shim, pyenv determines which Python version to use by
|
||||||
|
reading it from the following sources, in this order:
|
||||||
|
|
||||||
|
1. The `PYENV_VERSION` environment variable, if specified. You can use
|
||||||
|
the [`pyenv shell`](#pyenv-shell) command to set this environment
|
||||||
|
variable in your current shell session.
|
||||||
|
|
||||||
|
2. The application-specific `.python-version` file in the current
|
||||||
|
directory, if present. You can modify the current directory's
|
||||||
|
`.python-version` file with the [`pyenv local`](#pyenv-local)
|
||||||
|
command.
|
||||||
|
|
||||||
|
3. The first `.python-version` file found by searching each parent
|
||||||
|
directory until reaching the root of your filesystem, if any.
|
||||||
|
|
||||||
|
4. The global `~/.pyenv/version` file. You can modify this file using
|
||||||
|
the [`pyenv global`](#pyenv-global) command. If the global version
|
||||||
|
file is not present, pyenv assumes you want to use the "system"
|
||||||
|
Python—i.e. whatever version would be run if pyenv weren't in your
|
||||||
|
path.
|
||||||
|
|
||||||
|
### Locating the Python Installation
|
||||||
|
|
||||||
|
Once pyenv has determined which version of Python your application has
|
||||||
|
specified, it passes the command along to the corresponding Python
|
||||||
|
installation.
|
||||||
|
|
||||||
|
Each Python version is installed into its own directory under
|
||||||
|
`~/.pyenv/versions`. For example, you might have these versions
|
||||||
|
installed:
|
||||||
|
|
||||||
|
* `~/.pyenv/versions/2.7.5/`
|
||||||
|
* `~/.pyenv/versions/3.3.2/`
|
||||||
|
* `~/.pyenv/versions/pypy-1.9/`
|
||||||
|
|
||||||
|
Version names to pyenv are simply the names of the directories in
|
||||||
|
`~/.pyenv/versions`.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
If you're on Mac OS X, consider
|
||||||
|
[installing with Homebrew](#homebrew-on-mac-os-x).
|
||||||
|
|
||||||
|
### Basic GitHub Checkout
|
||||||
|
|
||||||
This will get you going with the latest version of pyenv and make it
|
This will get you going with the latest version of pyenv and make it
|
||||||
easy to fork and contribute any changes back upstream.
|
easy to fork and contribute any changes back upstream.
|
||||||
@@ -76,17 +170,20 @@ easy to fork and contribute any changes back upstream.
|
|||||||
$ exec $SHELL
|
$ exec $SHELL
|
||||||
|
|
||||||
5. Install Python versions into `~/.pyenv/versions`. For example, to
|
5. Install Python versions into `~/.pyenv/versions`. For example, to
|
||||||
install Python 2.7.3, download and unpack the source, then run:
|
install Python 2.7.5, download and unpack the source, then run:
|
||||||
|
|
||||||
$ pyenv install 2.7.3
|
$ pyenv install 2.7.5
|
||||||
|
|
||||||
|
**NOTE** If you need to pass configure option to build, please use
|
||||||
|
```CONFIGURE_OPTS``` environment variable.
|
||||||
|
|
||||||
6. Rebuild the shim binaries. You should do this any time you install
|
6. Rebuild the shim binaries. You should do this any time you install
|
||||||
a new Python binary (for example, when installing a new Python version,
|
a new Python binary (for example, when installing a new Python version,
|
||||||
or when installing a gem that provides a binary).
|
or when installing a package that provides a binary).
|
||||||
|
|
||||||
$ pyenv rehash
|
$ pyenv rehash
|
||||||
|
|
||||||
#### <a name="section_2.1.1"></a> 2.1.1 Upgrading
|
#### Upgrading
|
||||||
|
|
||||||
If you've installed pyenv using the instructions above, you can
|
If you've installed pyenv using the instructions above, you can
|
||||||
upgrade your installation at any time using git.
|
upgrade your installation at any time using git.
|
||||||
@@ -103,14 +200,221 @@ tag:
|
|||||||
$ git fetch
|
$ git fetch
|
||||||
$ git tag
|
$ git tag
|
||||||
v0.1.0
|
v0.1.0
|
||||||
v0.1.1
|
$ git checkout v0.1.0
|
||||||
v0.1.2
|
|
||||||
v0.2.0
|
|
||||||
$ git checkout v0.2.0
|
|
||||||
|
|
||||||
## <a name="section_3"></a> 3 Usage
|
### Homebrew on Mac OS X
|
||||||
|
|
||||||
## <a name="section_4"></a> 4 Development
|
You can also install pyenv using the
|
||||||
|
[Homebrew](http://mxcl.github.com/homebrew/) package manager on Mac OS
|
||||||
|
X.
|
||||||
|
|
||||||
|
~~
|
||||||
|
$ brew update
|
||||||
|
$ brew install pyenv
|
||||||
|
~~
|
||||||
|
|
||||||
|
To later update these installs, use `upgrade` instead of `install`.
|
||||||
|
|
||||||
|
Afterwards you'll still need to add `eval "$(pyenv init -)"` to your
|
||||||
|
profile as stated in the caveats. You'll only ever have to do this
|
||||||
|
once.
|
||||||
|
|
||||||
|
### Neckbeard Configuration
|
||||||
|
|
||||||
|
Skip this section unless you must know what every line in your shell
|
||||||
|
profile is doing.
|
||||||
|
|
||||||
|
`pyenv init` is the only command that crosses the line of loading
|
||||||
|
extra commands into your shell. Coming from rvm, some of you might be
|
||||||
|
opposed to this idea. Here's what `pyenv init` actually does:
|
||||||
|
|
||||||
|
1. Sets up your shims path. This is the only requirement for pyenv to
|
||||||
|
function properly. You can do this by hand by prepending
|
||||||
|
`~/.pyenv/shims` to your `$PATH`.
|
||||||
|
|
||||||
|
2. Installs autocompletion. This is entirely optional but pretty
|
||||||
|
useful. Sourcing `~/.pyenv/completions/pyenv.bash` will set that
|
||||||
|
up. There is also a `~/.pyenv/completions/pyenv.zsh` for Zsh
|
||||||
|
users.
|
||||||
|
|
||||||
|
3. Rehashes shims. From time to time you'll need to rebuild your
|
||||||
|
shim files. Doing this on init makes sure everything is up to
|
||||||
|
date. You can always run `pyenv rehash` manually.
|
||||||
|
|
||||||
|
4. Installs the sh dispatcher. This bit is also optional, but allows
|
||||||
|
pyenv and plugins to change variables in your current shell, making
|
||||||
|
commands like `pyenv shell` possible. The sh dispatcher doesn't do
|
||||||
|
anything crazy like override `cd` or hack your shell prompt, but if
|
||||||
|
for some reason you need `pyenv` to be a real script rather than a
|
||||||
|
shell function, you can safely skip it.
|
||||||
|
|
||||||
|
Run `pyenv init -` for yourself to see exactly what happens under the
|
||||||
|
hood.
|
||||||
|
|
||||||
|
### Uninstalling Python Versions
|
||||||
|
|
||||||
|
As time goes on, Python versions you install will accumulate in your
|
||||||
|
`~/.pyenv/versions` directory.
|
||||||
|
|
||||||
|
To remove old Python versions, `pyenv uninstall` command to automate
|
||||||
|
the removal process.
|
||||||
|
|
||||||
|
Or, simply `rm -rf` the directory of the
|
||||||
|
version you want to remove. You can find the directory of a particular
|
||||||
|
Python version with the `pyenv prefix` command, e.g. `pyenv prefix
|
||||||
|
2.6.8`.
|
||||||
|
|
||||||
|
## Command Reference
|
||||||
|
|
||||||
|
Like `git`, the `pyenv` command delegates to subcommands based on its
|
||||||
|
first argument. The most common subcommands are:
|
||||||
|
|
||||||
|
### pyenv local
|
||||||
|
|
||||||
|
Sets a local application-specific Python version by writing the version
|
||||||
|
name to a `.python-version` file in the current directory. This version
|
||||||
|
overrides the global version, and can be overridden itself by setting
|
||||||
|
the `PYENV_VERSION` environment variable or with the `pyenv shell`
|
||||||
|
command.
|
||||||
|
|
||||||
|
$ pyenv local 2.7.5
|
||||||
|
|
||||||
|
When run without a version number, `pyenv local` reports the currently
|
||||||
|
configured local version. You can also unset the local version:
|
||||||
|
|
||||||
|
$ pyenv local --unset
|
||||||
|
|
||||||
|
Previous versions of pyenv stored local version specifications in a
|
||||||
|
file named `.pyenv-version`. For backwards compatibility, pyenv will
|
||||||
|
read a local version specified in an `.pyenv-version` file, but a
|
||||||
|
`.python-version` file in the same directory will take precedence.
|
||||||
|
|
||||||
|
**pyenv feature**
|
||||||
|
|
||||||
|
You can specify multiple versions as local Python. Commands
|
||||||
|
within these Python versions are searched by specified order.
|
||||||
|
|
||||||
|
$ pyenv local 2.7.5 3.2.5
|
||||||
|
$ pyenv local
|
||||||
|
2.7.5
|
||||||
|
3.2.5
|
||||||
|
$ pyenv which python2.7
|
||||||
|
/home/yyuu/.pyenv/versions/2.7.5/bin/python2.7
|
||||||
|
$ pyenv which python3.2
|
||||||
|
/home/yyuu/.pyenv/versions/3.2.5/bin/python3.2
|
||||||
|
$ pyenv which python
|
||||||
|
/home/yyuu/.pyenv/versions/2.7.5/bin/python
|
||||||
|
|
||||||
|
### pyenv global
|
||||||
|
|
||||||
|
Sets the global version of Python to be used in all shells by writing
|
||||||
|
the version name to the `~/.pyenv/version` file. This version can be
|
||||||
|
overridden by an application-specific `.python-version` file, or by
|
||||||
|
setting the `PYENV_VERSION` environment variable.
|
||||||
|
|
||||||
|
$ pyenv global 2.7.5
|
||||||
|
|
||||||
|
The special version name `system` tells pyenv to use the system Python
|
||||||
|
(detected by searching your `$PATH`).
|
||||||
|
|
||||||
|
When run without a version number, `pyenv global` reports the
|
||||||
|
currently configured global version.
|
||||||
|
|
||||||
|
**pyenv feature**
|
||||||
|
|
||||||
|
You can specify multiple versions as global Python. Commands
|
||||||
|
within these Python versions are searched by specified order.
|
||||||
|
|
||||||
|
$ pyenv global 2.7.5 3.2.5
|
||||||
|
$ pyenv global
|
||||||
|
2.7.5
|
||||||
|
3.2.5
|
||||||
|
$ pyenv which python2.7
|
||||||
|
/home/yyuu/.pyenv/versions/2.7.5/bin/python2.7
|
||||||
|
$ pyenv which python3.2
|
||||||
|
/home/yyuu/.pyenv/versions/3.2.5/bin/python3.2
|
||||||
|
$ pyenv which python
|
||||||
|
/home/yyuu/.pyenv/versions/2.7.5/bin/python
|
||||||
|
|
||||||
|
### pyenv shell
|
||||||
|
|
||||||
|
Sets a shell-specific Python version by setting the `PYENV_VERSION`
|
||||||
|
environment variable in your shell. This version overrides
|
||||||
|
application-specific versions and the global version.
|
||||||
|
|
||||||
|
$ pyenv shell pypy-1.9
|
||||||
|
|
||||||
|
When run without a version number, `pyenv shell` reports the current
|
||||||
|
value of `PYENV_VERSION`. You can also unset the shell version:
|
||||||
|
|
||||||
|
$ pyenv shell --unset
|
||||||
|
|
||||||
|
Note that you'll need pyenv's shell integration enabled (step 3 of
|
||||||
|
the installation instructions) in order to use this command. If you
|
||||||
|
prefer not to use shell integration, you may simply set the
|
||||||
|
`PYENV_VERSION` variable yourself:
|
||||||
|
|
||||||
|
$ export PYENV_VERSION=pypy-1.9
|
||||||
|
|
||||||
|
**pyenv feature**
|
||||||
|
|
||||||
|
You can specify multiple versions via `PYENV_VERSION`
|
||||||
|
environment variable in your shell.
|
||||||
|
|
||||||
|
$ pyenv shell pypy-1.9 2.7.5
|
||||||
|
$ echo $PYENV_VERSION
|
||||||
|
pypy-1.9:2.7.5
|
||||||
|
$ pyenv version
|
||||||
|
pypy-1.9 (set by PYENV_VERSION environment variable)
|
||||||
|
2.7.5 (set by PYENV_VERSION environment variable)
|
||||||
|
|
||||||
|
### pyenv versions
|
||||||
|
|
||||||
|
Lists all Python versions known to pyenv, and shows an asterisk next to
|
||||||
|
the currently active version.
|
||||||
|
|
||||||
|
$ pyenv versions
|
||||||
|
2.5.6
|
||||||
|
2.6.8
|
||||||
|
* 2.7.5 (set by /home/yyuu/.pyenv/version)
|
||||||
|
3.2.5
|
||||||
|
jython-2.5.3
|
||||||
|
pypy-1.9
|
||||||
|
|
||||||
|
### pyenv version
|
||||||
|
|
||||||
|
Displays the currently active Python version, along with information on
|
||||||
|
how it was set.
|
||||||
|
|
||||||
|
$ pyenv version
|
||||||
|
2.7.5 (set by /home/yyuu/.pyenv/version)
|
||||||
|
|
||||||
|
### pyenv rehash
|
||||||
|
|
||||||
|
Installs shims for all Python binaries known to pyenv (i.e.,
|
||||||
|
`~/.pyenv/versions/*/bin/*`). Run this command after you install a new
|
||||||
|
version of Python, or install a package that provides binaries.
|
||||||
|
|
||||||
|
$ pyenv rehash
|
||||||
|
|
||||||
|
### pyenv which
|
||||||
|
|
||||||
|
Displays the full path to the executable that pyenv will invoke when
|
||||||
|
you run the given command.
|
||||||
|
|
||||||
|
$ pyenv which python3.2
|
||||||
|
/home/yyuu/.pyenv/versions/3.2.5/bin/python3.2
|
||||||
|
|
||||||
|
### pyenv whence
|
||||||
|
|
||||||
|
Lists all Python versions with the given command installed.
|
||||||
|
|
||||||
|
$ pyenv whence 2to3
|
||||||
|
2.6.8
|
||||||
|
2.7.5
|
||||||
|
3.2.5
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
The pyenv source code is [hosted on
|
The pyenv source code is [hosted on
|
||||||
GitHub](https://github.com/yyuu/pyenv). It's clean, modular,
|
GitHub](https://github.com/yyuu/pyenv). It's clean, modular,
|
||||||
@@ -119,18 +423,17 @@ and easy to understand, even if you're not a shell hacker.
|
|||||||
Please feel free to submit pull requests and file bugs on the [issue
|
Please feel free to submit pull requests and file bugs on the [issue
|
||||||
tracker](https://github.com/yyuu/pyenv/issues).
|
tracker](https://github.com/yyuu/pyenv/issues).
|
||||||
|
|
||||||
### <a name="section_4.1"></a> 4.1 Version History
|
### Version History
|
||||||
|
|
||||||
**0.1.0** (August 31, 2012)
|
See CHANGELOG.md.
|
||||||
|
|
||||||
* Initial public release.
|
|
||||||
|
|
||||||
### <a name="section_4.2"></a> 4.2 License
|
### License
|
||||||
|
|
||||||
(The MIT license)
|
(The MIT license)
|
||||||
|
|
||||||
Copyright (c) 2011 Sam Stephenson
|
* Copyright (c) 2013 Yamashita, Yuu
|
||||||
Copyright (c) 2012 Yamashita, Yuu
|
* Copyright (c) 2013 Sam Stephenson
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
a copy of this software and associated documentation files (the
|
a copy of this software and associated documentation files (the
|
||||||
|
|||||||
@@ -13,4 +13,11 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
export PYENV_DIR="${1%/*}"
|
export PYENV_DIR="${1%/*}"
|
||||||
|
|
||||||
|
[ -n "$PYENV_SILENCE_WARNINGS" ] || {
|
||||||
|
echo "pyenv: \`python-local-exec' is deprecated and will be removed in the next release."
|
||||||
|
echo " To upgrade: https://github.com/yyuu/pyenv/wiki/python-local-exec"
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
|
||||||
exec python "$@"
|
exec python "$@"
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ _pyenv() {
|
|||||||
if [ "$COMP_CWORD" -eq 1 ]; then
|
if [ "$COMP_CWORD" -eq 1 ]; then
|
||||||
COMPREPLY=( $(compgen -W "$(pyenv commands)" -- "$word") )
|
COMPREPLY=( $(compgen -W "$(pyenv commands)" -- "$word") )
|
||||||
else
|
else
|
||||||
local command="${COMP_WORDS[1]}"
|
local words=("${COMP_WORDS[@]}")
|
||||||
local completions="$(pyenv completions "$command")"
|
unset words[0]
|
||||||
|
unset words[$COMP_CWORD]
|
||||||
|
local completions=$(pyenv completions "${words[@]}")
|
||||||
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
|
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,14 +5,13 @@ fi
|
|||||||
compctl -K _pyenv pyenv
|
compctl -K _pyenv pyenv
|
||||||
|
|
||||||
_pyenv() {
|
_pyenv() {
|
||||||
local word words completions
|
local words completions
|
||||||
read -cA words
|
read -cA words
|
||||||
word="${words[2]}"
|
|
||||||
|
|
||||||
if [ "${#words}" -eq 2 ]; then
|
if [ "${#words}" -eq 2 ]; then
|
||||||
completions="$(pyenv commands)"
|
completions="$(pyenv commands)"
|
||||||
else
|
else
|
||||||
completions="$(pyenv completions "${word}")"
|
completions="$(pyenv completions "${words[2,-2]}")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
reply=("${(ps:\n:)completions}")
|
reply=("${(ps:\n:)completions}")
|
||||||
|
|||||||
@@ -60,7 +60,10 @@ shopt -u nullglob
|
|||||||
command="$1"
|
command="$1"
|
||||||
case "$command" in
|
case "$command" in
|
||||||
"" | "-h" | "--help" )
|
"" | "-h" | "--help" )
|
||||||
echo -e "pyenv 0.1.0\n$(pyenv-help)" >&2
|
echo -e "$(pyenv---version)\n$(pyenv-help)" >&2
|
||||||
|
;;
|
||||||
|
"-v" )
|
||||||
|
exec pyenv---version
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
command_path="$(command -v "pyenv-$command" || true)"
|
command_path="$(command -v "pyenv-$command" || true)"
|
||||||
|
|||||||
21
libexec/pyenv---version
Executable file
21
libexec/pyenv---version
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Summary: Display the version of pyenv
|
||||||
|
#
|
||||||
|
# Displays the version number of this pyenv release, including the
|
||||||
|
# current revision from git, if available.
|
||||||
|
#
|
||||||
|
# The format of the git revision is:
|
||||||
|
# <version>-<num_commits>-<git_sha>
|
||||||
|
# where `num_commits` is the number of commits since `version` was
|
||||||
|
# tagged.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
|
version="0.4.0-20130613"
|
||||||
|
|
||||||
|
cd "$PYENV_ROOT"
|
||||||
|
git_revision="$(git describe --tags HEAD 2>/dev/null || true)"
|
||||||
|
git_revision="${git_revision#v}"
|
||||||
|
|
||||||
|
echo "pyenv ${git_revision:-$version}"
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Summary: List all available pyenv commands
|
||||||
|
# Usage: pyenv commands [--sh|--no-sh]
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Usage: pyenv completions <command> [arg1 arg2...]
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
COMMAND="$1"
|
COMMAND="$1"
|
||||||
if [ -z "$COMMAND" ]; then
|
if [ -z "$COMMAND" ]; then
|
||||||
echo "usage: pyenv completions COMMAND [arg1 arg2...]" >&2
|
pyenv-help --usage completions >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,18 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Summary: Run an executable with the selected Python version
|
||||||
|
#
|
||||||
|
# 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 2.7.7:
|
||||||
|
# pyenv exec pip install -rrequirements.txt
|
||||||
|
#
|
||||||
|
# is equivalent to:
|
||||||
|
# PATH="$PYENV_ROOT/versions/2.7.7/bin:$PATH" pip install -rrequirements.txt
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
@@ -7,9 +21,11 @@ if [ "$1" = "--complete" ]; then
|
|||||||
exec pyenv shims --short
|
exec pyenv shims --short
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export PYENV_VERSION="$(pyenv-version-name)"
|
||||||
PYENV_COMMAND="$1"
|
PYENV_COMMAND="$1"
|
||||||
|
|
||||||
if [ -z "$PYENV_COMMAND" ]; then
|
if [ -z "$PYENV_COMMAND" ]; then
|
||||||
echo "usage: pyenv exec COMMAND [arg1 arg2...]" >&2
|
pyenv-help --usage exec >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -21,5 +37,7 @@ for script in $(pyenv-hooks exec); do
|
|||||||
done
|
done
|
||||||
|
|
||||||
shift 1
|
shift 1
|
||||||
export PATH="${PYENV_BIN_PATH}:${PATH}"
|
if [ "$PYENV_VERSION" != "system" ]; then
|
||||||
|
export PATH="${PYENV_BIN_PATH}:${PATH}"
|
||||||
|
fi
|
||||||
exec -a "$PYENV_COMMAND" "$PYENV_COMMAND_PATH" "$@"
|
exec -a "$PYENV_COMMAND" "$PYENV_COMMAND_PATH" "$@"
|
||||||
|
|||||||
@@ -1,4 +1,17 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Summary: Set or show the global Python version
|
||||||
|
#
|
||||||
|
# Usage: pyenv global <version>
|
||||||
|
#
|
||||||
|
# Sets the global Python version. You can override the global version at
|
||||||
|
# any time by setting a directory-specific version with `pyenv local'
|
||||||
|
# or by setting the `PYENV_VERSION' environment variable.
|
||||||
|
#
|
||||||
|
# <version> should be a string matching a Python version known to pyenv.
|
||||||
|
# The special version string `system' will use your default system Python.
|
||||||
|
# Run `pyenv versions' for a list of available Python versions.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
@@ -8,14 +21,19 @@ if [ "$1" = "--complete" ]; then
|
|||||||
exec pyenv-versions --bare
|
exec pyenv-versions --bare
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PYENV_VERSION="$1"
|
versions=($@)
|
||||||
PYENV_VERSION_FILE="${PYENV_ROOT}/version"
|
PYENV_VERSION_FILE="${PYENV_ROOT}/version"
|
||||||
|
|
||||||
if [ -n "$PYENV_VERSION" ]; then
|
if [ -n "$versions" ]; then
|
||||||
pyenv-version-file-write "$PYENV_VERSION_FILE" "$PYENV_VERSION"
|
pyenv-version-file-write "$PYENV_VERSION_FILE" "${versions[@]}"
|
||||||
else
|
else
|
||||||
pyenv-version-file-read "$PYENV_VERSION_FILE" ||
|
IFS=: versions=($(
|
||||||
pyenv-version-file-read "${PYENV_ROOT}/global" ||
|
pyenv-version-file-read "$PYENV_VERSION_FILE" ||
|
||||||
pyenv-version-file-read "${PYENV_ROOT}/default" ||
|
pyenv-version-file-read "${PYENV_ROOT}/global" ||
|
||||||
echo system
|
pyenv-version-file-read "${PYENV_ROOT}/default" ||
|
||||||
|
echo system
|
||||||
|
))
|
||||||
|
for version in "${versions[@]}"; do
|
||||||
|
echo "$version"
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,99 +1,162 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Summary: Display help for a command
|
||||||
|
#
|
||||||
|
# Usage: pyenv help [--usage] COMMAND
|
||||||
|
#
|
||||||
|
# Parses and displays help contents from a command's source file.
|
||||||
|
#
|
||||||
|
# A command is considered documented if it starts with a comment block
|
||||||
|
# that has a `Summary:' or `Usage:' section. Usage instructions can
|
||||||
|
# span multiple lines as long as subsequent lines are indented.
|
||||||
|
# The remainder of the comment block is displayed as extended
|
||||||
|
# documentation.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
print_set_version() {
|
command_path() {
|
||||||
echo "<version> should be a string matching a Python version known by pyenv."
|
local command="$1"
|
||||||
|
command -v pyenv-"$command" || command -v pyenv-sh-"$command" || true
|
||||||
local versions="$(pyenv-versions --bare)"
|
|
||||||
if [ -z "$versions" ]; then
|
|
||||||
echo "There are currently no Python versions installed for pyenv."
|
|
||||||
else
|
|
||||||
echo "The currently installed Python versions are:"
|
|
||||||
echo "$versions" | sed 's/^/ /'
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo "The special version string 'system' will use your default system Python"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
extract_initial_comment_block() {
|
||||||
"") echo "usage: pyenv <command> [<args>]
|
sed -ne "
|
||||||
|
/^#/ !{
|
||||||
|
q
|
||||||
|
}
|
||||||
|
|
||||||
Some useful pyenv commands are:
|
s/^#$/# /
|
||||||
commands List all pyenv commands
|
|
||||||
rehash Rehash pyenv shims (run this after installing binaries)
|
|
||||||
global Set or show the global Python version
|
|
||||||
local Set or show the local directory-specific Python version
|
|
||||||
shell Set or show the shell-specific Python version
|
|
||||||
version Show the current Python version
|
|
||||||
versions List all Python versions known by pyenv
|
|
||||||
which Show the full path for the given Python command
|
|
||||||
whence List all Python versions with the given command
|
|
||||||
|
|
||||||
See 'pyenv help <command>' for information on a specific command.
|
/^# / {
|
||||||
For full documentation, see: https://github.com/sstephenson/pyenv#readme"
|
s/^# //
|
||||||
;;
|
p
|
||||||
commands) echo "usage: pyenv commands
|
}
|
||||||
pyenv commands --sh
|
"
|
||||||
pyenv commands --no-sh
|
}
|
||||||
|
|
||||||
List all pyenv commands."
|
collect_documentation() {
|
||||||
;;
|
awk '
|
||||||
global) echo "usage: pyenv global <version>
|
/^Summary:/ {
|
||||||
|
summary = substr($0, 10)
|
||||||
|
next
|
||||||
|
}
|
||||||
|
|
||||||
Sets the global Python version. You can override the global version at
|
/^Usage:/ {
|
||||||
any time by setting a directory-specific version with \`pyenv local'
|
reading_usage = 1
|
||||||
or by setting the PYENV_VERSION environment variable.
|
usage = usage "\n" $0
|
||||||
|
next
|
||||||
|
}
|
||||||
|
|
||||||
$(print_set_version)"
|
/^( *$| )/ && reading_usage {
|
||||||
;;
|
usage = usage "\n" $0
|
||||||
local) echo "usage: pyenv local <version>
|
next
|
||||||
pyenv local --unset
|
}
|
||||||
|
|
||||||
Sets the local directory-specific Python version by writing the version
|
{
|
||||||
name to a file named '.pyenv-version'.
|
reading_usage = 0
|
||||||
|
help = help "\n" $0
|
||||||
|
}
|
||||||
|
|
||||||
When you run a Python command, pyenv will look for an '.pyenv-version'
|
function escape(str) {
|
||||||
file in the current directory and each parent directory. If no such
|
gsub(/[`\\$"]/, "\\\\&", str)
|
||||||
file is found in the tree, pyenv will use the global Python version
|
return str
|
||||||
specified with \`pyenv global', or the version specified in the
|
}
|
||||||
PYENV_VERSION environment variable.
|
|
||||||
|
|
||||||
$(print_set_version)"
|
function trim(str) {
|
||||||
;;
|
gsub(/^\n*/, "", str)
|
||||||
shell) echo "usage: pyenv shell <version>
|
gsub(/\n*$/, "", str)
|
||||||
pyenv shell --unset
|
return str
|
||||||
|
}
|
||||||
|
|
||||||
Sets a shell-specific Python version by setting the 'PYENV_VERSION'
|
END {
|
||||||
environment variable in your shell. This version overrides both
|
if (usage || summary) {
|
||||||
project-specific versions and the global version.
|
print "summary=\"" escape(summary) "\""
|
||||||
|
print "usage=\"" escape(trim(usage)) "\""
|
||||||
|
print "help=\"" escape(trim(help)) "\""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'
|
||||||
|
}
|
||||||
|
|
||||||
$(print_set_version)"
|
documentation_for() {
|
||||||
;;
|
local filename="$(command_path "$1")"
|
||||||
versions) echo "usage: pyenv versions
|
if [ -n "$filename" ]; then
|
||||||
pyenv versions --bare
|
extract_initial_comment_block < "$filename" | collect_documentation
|
||||||
|
|
||||||
Lists all Python versions known by pyenv."
|
|
||||||
;;
|
|
||||||
which) echo "usage: pyenv which <command>
|
|
||||||
|
|
||||||
Displays the full path to the binary that pyenv will execute when you
|
|
||||||
run the given command."
|
|
||||||
;;
|
|
||||||
whence) echo "usage: pyenv whence <command>
|
|
||||||
|
|
||||||
Lists all Python versions with the given command installed."
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
command_path="$(command -v "pyenv-$1" || true)"
|
|
||||||
if [ -n "$command_path" ]; then
|
|
||||||
echo "Sorry, the \`$1' command isn't documented yet."
|
|
||||||
echo
|
|
||||||
echo "You can view the command's source here:"
|
|
||||||
echo "$command_path"
|
|
||||||
echo
|
|
||||||
else
|
|
||||||
echo "pyenv: no such command \`$1'"
|
|
||||||
fi
|
fi
|
||||||
esac
|
}
|
||||||
|
|
||||||
|
print_summary() {
|
||||||
|
local command="$1"
|
||||||
|
local summary usage help
|
||||||
|
eval "$(documentation_for "$command")"
|
||||||
|
|
||||||
|
if [ -n "$summary" ]; then
|
||||||
|
printf " %-9s %s\n" "$command" "$summary"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
print_summaries() {
|
||||||
|
for command; do
|
||||||
|
print_summary "$command"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
print_help() {
|
||||||
|
local command="$1"
|
||||||
|
local summary usage help
|
||||||
|
eval "$(documentation_for "$command")"
|
||||||
|
[ -n "$help" ] || help="$summary"
|
||||||
|
|
||||||
|
if [ -n "$usage" -o -n "$summary" ]; then
|
||||||
|
if [ -n "$usage" ]; then
|
||||||
|
echo "$usage"
|
||||||
|
else
|
||||||
|
echo "Usage: pyenv ${command}"
|
||||||
|
fi
|
||||||
|
if [ -n "$help" ]; then
|
||||||
|
echo
|
||||||
|
echo "$help"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Sorry, this command isn't documented yet." >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
print_usage() {
|
||||||
|
local command="$1"
|
||||||
|
local summary usage help
|
||||||
|
eval "$(documentation_for "$command")"
|
||||||
|
[ -z "$usage" ] || echo "$usage"
|
||||||
|
}
|
||||||
|
|
||||||
|
unset usage
|
||||||
|
if [ "$1" = "--usage" ]; then
|
||||||
|
usage="1"
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$1" ] || [ "$1" == "pyenv" ]; then
|
||||||
|
echo "Usage: pyenv <command> [<args>]"
|
||||||
|
[ -z "$usage" ] || exit
|
||||||
|
echo
|
||||||
|
echo "Some useful pyenv commands are:"
|
||||||
|
print_summaries commands local global shell install uninstall rehash version versions which whence
|
||||||
|
echo
|
||||||
|
echo "See \`pyenv help <command>' for information on a specific command."
|
||||||
|
echo "For full documentation, see: https://github.com/yyuu/pyenv#readme"
|
||||||
|
else
|
||||||
|
command="$1"
|
||||||
|
if [ -n "$(command_path "$command")" ]; then
|
||||||
|
if [ -n "$usage" ]; then
|
||||||
|
print_usage "$command"
|
||||||
|
else
|
||||||
|
print_help "$command"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "pyenv: no such command \`$command'" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Summary: List hook scripts for a given pyenv command
|
||||||
|
# Usage: pyenv hooks <command>
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
@@ -12,7 +15,7 @@ fi
|
|||||||
|
|
||||||
PYENV_COMMAND="$1"
|
PYENV_COMMAND="$1"
|
||||||
if [ -z "$PYENV_COMMAND" ]; then
|
if [ -z "$PYENV_COMMAND" ]; then
|
||||||
echo "usage: pyenv hooks COMMAND" >&2
|
pyenv-help --usage hooks >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Summary: Configure the shell environment for pyenv
|
||||||
|
# Usage: eval "$(pyenv init - [--no-rehash] [<shell>])"
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
@@ -82,11 +85,12 @@ if [ -z "$no_rehash" ]; then
|
|||||||
echo 'pyenv rehash 2>/dev/null'
|
echo 'pyenv rehash 2>/dev/null'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
commands=(`pyenv commands --sh`)
|
commands=(`pyenv-commands --sh`)
|
||||||
IFS="|"
|
IFS="|"
|
||||||
cat <<EOS
|
cat <<EOS
|
||||||
pyenv() {
|
pyenv() {
|
||||||
local command="\$1"
|
typeset command
|
||||||
|
command="\$1"
|
||||||
if [ "\$#" -gt 0 ]; then
|
if [ "\$#" -gt 0 ]; then
|
||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,28 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Summary: Set or show the local application-specific Python version
|
||||||
|
#
|
||||||
|
# Usage: pyenv local <version>
|
||||||
|
# pyenv local --unset
|
||||||
|
#
|
||||||
|
# Sets the local application-specific Python version by writing the
|
||||||
|
# version name to a file named `.python-version'.
|
||||||
|
#
|
||||||
|
# When you run a Python command, pyenv will look for a `.python-version'
|
||||||
|
# file in the current directory and each parent directory. If no such
|
||||||
|
# file is found in the tree, pyenv will use the global Python version
|
||||||
|
# specified with `pyenv global'. A version specified with the
|
||||||
|
# `PYENV_VERSION' environment variable takes precedence over local
|
||||||
|
# and global versions.
|
||||||
|
#
|
||||||
|
# For backwards compatibility, pyenv will also read version
|
||||||
|
# specifications from `.pyenv-version' files, but a `.python-version'
|
||||||
|
# file in the same directory takes precedence.
|
||||||
|
#
|
||||||
|
# <version> should be a string matching a Python version known to pyenv.
|
||||||
|
# The special version string `system' will use your default system Python.
|
||||||
|
# Run `pyenv versions' for a list of available Python versions.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
@@ -9,16 +33,27 @@ if [ "$1" = "--complete" ]; then
|
|||||||
exec pyenv-versions --bare
|
exec pyenv-versions --bare
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PYENV_VERSION="$1"
|
versions=($@)
|
||||||
PYENV_VERSION_FILE=".pyenv-version"
|
|
||||||
|
|
||||||
if [ "$PYENV_VERSION" = "--unset" ]; then
|
if [ "$versions" = "--unset" ]; then
|
||||||
rm -f "$PYENV_VERSION_FILE"
|
rm -f .python-version .pyenv-version
|
||||||
elif [ -n "$PYENV_VERSION" ]; then
|
elif [ -n "$versions" ]; then
|
||||||
pyenv-version-file-write "$PYENV_VERSION_FILE" "$PYENV_VERSION"
|
if [ "$(PYENV_VERSION= pyenv-version-origin)" -ef .pyenv-version ]; then
|
||||||
|
rm -f .pyenv-version
|
||||||
|
{ echo "pyenv: removed existing \`.pyenv-version' file and migrated"
|
||||||
|
echo " local version specification to \`.python-version' file"
|
||||||
|
} >&2
|
||||||
|
fi
|
||||||
|
pyenv-version-file-write .python-version "${versions[@]}"
|
||||||
else
|
else
|
||||||
pyenv-version-file-read "$PYENV_VERSION_FILE" ||
|
IFS=: versions=($(
|
||||||
{ echo "pyenv: no local version configured for this directory"
|
pyenv-version-file-read .python-version ||
|
||||||
exit 1
|
pyenv-version-file-read .pyenv-version ||
|
||||||
} >&2
|
{ echo "pyenv: no local version configured for this directory"
|
||||||
|
exit 1
|
||||||
|
} >&2
|
||||||
|
))
|
||||||
|
for version in "${versions[@]}"; do
|
||||||
|
echo "$version"
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Summary: Display prefix for a Python version
|
||||||
|
# Usage: pyenv prefix [<version>]
|
||||||
|
#
|
||||||
|
# Displays the directory where a Python version is installed. If no
|
||||||
|
# version is given, `pyenv prefix' displays the location of the
|
||||||
|
# currently selected version.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
@@ -9,21 +16,27 @@ if [ "$1" = "--complete" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
export PYENV_VERSION="$1"
|
versions=($@)
|
||||||
elif [ -z "$PYENV_VERSION" ]; then
|
IFS=: PYENV_VERSION="${versions[*]}"
|
||||||
PYENV_VERSION="$(pyenv-version-name)"
|
export PYENV_VERSION
|
||||||
|
else
|
||||||
|
IFS=: versions=($(pyenv-version-name))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$PYENV_VERSION" = "system" ]; then
|
PYENV_PREFIX_PATHS=()
|
||||||
PYTHON_PATH="$(pyenv-which python)"
|
for version in "${versions[@]}"; do
|
||||||
echo "${PYTHON_PATH%/*}"
|
if [ "$version" = "system" ]; then
|
||||||
exit
|
PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python || true)"
|
||||||
fi
|
PYENV_PREFIX_PATH="${PYTHON_PATH%/*}"
|
||||||
|
else
|
||||||
|
PYENV_PREFIX_PATH="${PYENV_ROOT}/versions/${version}"
|
||||||
|
fi
|
||||||
|
if [ -d "$PYENV_PREFIX_PATH" ]; then
|
||||||
|
PYENV_PREFIX_PATHS=("${PYENV_PREFIX_PATHS[@]}" "$PYENV_PREFIX_PATH")
|
||||||
|
else
|
||||||
|
echo "pyenv: version \`${version}' not installed" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
PYENV_PREFIX_PATH="${PYENV_ROOT}/versions/${PYENV_VERSION}"
|
IFS=: echo "${PYENV_PREFIX_PATHS[*]}"
|
||||||
if [ ! -d "$PYENV_PREFIX_PATH" ]; then
|
|
||||||
echo "pyenv: version \`${PYENV_VERSION}' not installed" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$PYENV_PREFIX_PATH"
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Summary: Rehash pyenv shims (run this after installing executables)
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
@@ -30,19 +32,48 @@ remove_prototype_shim() {
|
|||||||
|
|
||||||
# The prototype shim file is a script that re-execs itself, passing
|
# The prototype shim file is a script that re-execs itself, passing
|
||||||
# its filename and any arguments to `pyenv exec`. This file is
|
# its filename and any arguments to `pyenv exec`. This file is
|
||||||
# hard-linked for every binary and then removed. The linking technique
|
# hard-linked for every executable and then removed. The linking
|
||||||
# is fast, uses less disk space than unique files, and also serves as
|
# technique is fast, uses less disk space than unique files, and also
|
||||||
# a locking mechanism.
|
# serves as a locking mechanism.
|
||||||
create_prototype_shim() {
|
create_prototype_shim() {
|
||||||
cat > "$PROTOTYPE_SHIM_PATH" <<SH
|
cat > "$PROTOTYPE_SHIM_PATH" <<SH
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
[ -n "\$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
|
program="\${0##*/}"
|
||||||
|
if [ "\$program" = "python" ]; then
|
||||||
|
for arg; do
|
||||||
|
case "\$arg" in
|
||||||
|
-c* | -- ) break ;;
|
||||||
|
*/* )
|
||||||
|
if [ -f "\$arg" ]; then
|
||||||
|
export PYENV_DIR="\${arg%/*}"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
export PYENV_ROOT="$PYENV_ROOT"
|
export PYENV_ROOT="$PYENV_ROOT"
|
||||||
exec pyenv exec "\${0##*/}" "\$@"
|
exec "$(command -v pyenv)" exec "\$program" "\$@"
|
||||||
SH
|
SH
|
||||||
chmod +x "$PROTOTYPE_SHIM_PATH"
|
chmod +x "$PROTOTYPE_SHIM_PATH"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# If the contents of the prototype shim file differ from the contents
|
||||||
|
# of the first shim in the shims directory, assume pyenv has been
|
||||||
|
# upgraded and the existing shims need to be removed.
|
||||||
|
remove_outdated_shims() {
|
||||||
|
for shim in *; do
|
||||||
|
if ! diff "$PROTOTYPE_SHIM_PATH" "$shim" >/dev/null 2>&1; then
|
||||||
|
for shim in *; do rm -f "$shim"; done
|
||||||
|
fi
|
||||||
|
break
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# The basename of each argument passed to `make_shims` will be
|
# The basename of each argument passed to `make_shims` will be
|
||||||
# registered for installation as a shim. In this way, plugins may call
|
# registered for installation as a shim. In this way, plugins may call
|
||||||
# `make_shims` with a glob to register many shims at once.
|
# `make_shims` with a glob to register many shims at once.
|
||||||
@@ -55,58 +86,27 @@ make_shims() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create an empty array for the list of registered shims.
|
# Create an empty array for the list of registered shims and an empty
|
||||||
|
# string to use as a search index.
|
||||||
registered_shims=()
|
registered_shims=()
|
||||||
|
registered_shims_index=""
|
||||||
|
|
||||||
# We will keep track of shims registered for installation with the
|
# We will keep track of shims registered for installation with the
|
||||||
# global `reigstered_shims` array and with a global variable for each
|
# global `reigstered_shims` array and with a global search index
|
||||||
# shim. The array will let us iterate over all registered shims. The
|
# string. The array will let us iterate over all registered shims. The
|
||||||
# global variables will let us quickly check whether a shim with the
|
# index string will let us quickly check whether a shim with the given
|
||||||
# given name has been registered or not.
|
# name has been registered or not.
|
||||||
register_shim() {
|
register_shim() {
|
||||||
local shim="$@"
|
local shim="$@"
|
||||||
local var="$(shim_variable_name "$shim")"
|
registered_shims["${#registered_shims[@]}"]="$shim"
|
||||||
|
registered_shims_index="$registered_shims_index/$shim/"
|
||||||
if [ -z "${!var}" ]; then
|
|
||||||
registered_shims[${#registered_shims[*]}]="$shim"
|
|
||||||
eval "${var}=1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# To compute the global variable name for a given shim we must first
|
|
||||||
# escape any non-alphanumeric characters. If the shim name is
|
|
||||||
# alphanumeric (including a hyphen or underscore) we can take a
|
|
||||||
# shorter path. Otherwise, we must iterate over each character and
|
|
||||||
# escape the non-alphanumeric ones using `printf`.
|
|
||||||
shim_variable_name() {
|
|
||||||
local shim="$1"
|
|
||||||
local result="_shim_"
|
|
||||||
|
|
||||||
if [[ ! "$shim" =~ [^[:alnum:]_-] ]]; then
|
|
||||||
shim="${shim//_/_5f}"
|
|
||||||
shim="${shim//-/_2d}"
|
|
||||||
result="$result$shim"
|
|
||||||
else
|
|
||||||
local length="${#shim}"
|
|
||||||
local char i
|
|
||||||
|
|
||||||
for ((i=0; i<length; i++)); do
|
|
||||||
char="${shim:$i:1}"
|
|
||||||
if [[ "$char" =~ [[:alnum:]] ]]; then
|
|
||||||
result="$result$char"
|
|
||||||
else
|
|
||||||
result="$result$(printf "_%02x" \'"$char")"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$result"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# To install all the registered shims, we iterate over the
|
# To install all the registered shims, we iterate over the
|
||||||
# `registered_shims` array and create a link if one does not already
|
# `registered_shims` array and create a link if one does not already
|
||||||
# exist.
|
# exist.
|
||||||
install_registered_shims() {
|
install_registered_shims() {
|
||||||
|
local shim
|
||||||
for shim in "${registered_shims[@]}"; do
|
for shim in "${registered_shims[@]}"; do
|
||||||
[ -e "$shim" ] || ln -f "$PROTOTYPE_SHIM_PATH" "$shim"
|
[ -e "$shim" ] || ln -f "$PROTOTYPE_SHIM_PATH" "$shim"
|
||||||
done
|
done
|
||||||
@@ -117,10 +117,9 @@ install_registered_shims() {
|
|||||||
# in the directory but has not been registered as a shim should be
|
# in the directory but has not been registered as a shim should be
|
||||||
# removed.
|
# removed.
|
||||||
remove_stale_shims() {
|
remove_stale_shims() {
|
||||||
local var
|
local shim
|
||||||
for shim in *; do
|
for shim in *; do
|
||||||
var="$(shim_variable_name "$shim")"
|
if [[ "$registered_shims_index" != *"/$shim/"* ]]; then
|
||||||
if [ -z "${!var}" ]; then
|
|
||||||
rm -f "$shim"
|
rm -f "$shim"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -129,10 +128,12 @@ remove_stale_shims() {
|
|||||||
|
|
||||||
# Change to the shims directory.
|
# Change to the shims directory.
|
||||||
cd "$SHIM_PATH"
|
cd "$SHIM_PATH"
|
||||||
|
|
||||||
# Create the prototype shim, then register shims for all known binaries.
|
|
||||||
create_prototype_shim
|
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
|
# Create the prototype shim, then register shims for all known
|
||||||
|
# executables.
|
||||||
|
create_prototype_shim
|
||||||
|
remove_outdated_shims
|
||||||
make_shims ../versions/*/bin/*
|
make_shims ../versions/*/bin/*
|
||||||
|
|
||||||
# Restore the previous working directory.
|
# Restore the previous working directory.
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Summary: Display the root directory where versions and shims are kept
|
||||||
echo $PYENV_ROOT
|
echo $PYENV_ROOT
|
||||||
|
|||||||
13
libexec/pyenv-sh-rehash
Executable file
13
libexec/pyenv-sh-rehash
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
|
# Provide pyenv completions
|
||||||
|
if [ "$1" = "--complete" ]; then
|
||||||
|
exec pyenv-rehash --complete
|
||||||
|
fi
|
||||||
|
|
||||||
|
# When pyenv shell integration is enabled, delegate to pyenv-rehash,
|
||||||
|
# then tell the shell to empty its command lookup cache.
|
||||||
|
pyenv-rehash
|
||||||
|
echo "hash -r"
|
||||||
@@ -1,4 +1,18 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Summary: Set or show the shell-specific Python version
|
||||||
|
#
|
||||||
|
# Usage: pyenv shell <version>
|
||||||
|
# pyenv shell --unset
|
||||||
|
#
|
||||||
|
# Sets a shell-specific Python version by setting the `PYENV_VERSION'
|
||||||
|
# environment variable in your shell. This version overrides local
|
||||||
|
# application-specific versions and the global version.
|
||||||
|
#
|
||||||
|
# <version> should be a string matching a Python version known to pyenv.
|
||||||
|
# The special version string `system' will use your default system Python.
|
||||||
|
# Run `pyenv versions' for a list of available Python versions.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
@@ -9,9 +23,9 @@ if [ "$1" = "--complete" ]; then
|
|||||||
exec pyenv-versions --bare
|
exec pyenv-versions --bare
|
||||||
fi
|
fi
|
||||||
|
|
||||||
version="$1"
|
versions=("$@")
|
||||||
|
|
||||||
if [ -z "$version" ]; then
|
if [ -z "$versions" ]; then
|
||||||
if [ -z "$PYENV_VERSION" ]; then
|
if [ -z "$PYENV_VERSION" ]; then
|
||||||
echo "pyenv: no shell-specific version configured" >&2
|
echo "pyenv: no shell-specific version configured" >&2
|
||||||
exit 1
|
exit 1
|
||||||
@@ -21,12 +35,16 @@ if [ -z "$version" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$version" = "--unset" ]; then
|
if [ "$versions" = "--unset" ]; then
|
||||||
echo "unset PYENV_VERSION"
|
echo "unset PYENV_VERSION"
|
||||||
exit 1
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure the specified version is installed.
|
# Make sure the specified version is installed.
|
||||||
pyenv-prefix "$version" >/dev/null
|
if pyenv-prefix "${versions[@]}" >/dev/null; then
|
||||||
|
IFS=: PYENV_VERSION="${versions[*]}"
|
||||||
echo "export PYENV_VERSION=\"${version}\""
|
echo "export PYENV_VERSION=\"${PYENV_VERSION}\""
|
||||||
|
else
|
||||||
|
echo "return 1"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Summary: List existing pyenv shims
|
||||||
|
# Usage: pyenv shims [--short]
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Summary: Show the current Python version and its origin
|
||||||
|
#
|
||||||
|
# Shows the currently selected Python version and how it was
|
||||||
|
# selected. To obtain only the version string, use `pyenv
|
||||||
|
# version-name'.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
echo "$(pyenv-version-name) (set by $(pyenv-version-origin))"
|
IFS=: PYENV_VERSION_NAMES=($(pyenv-version-name))
|
||||||
|
|
||||||
|
for PYENV_VERSION_NAME in "${PYENV_VERSION_NAMES[@]}"; do
|
||||||
|
echo "$PYENV_VERSION_NAME (set by $(pyenv-version-origin))"
|
||||||
|
done
|
||||||
|
|||||||
@@ -1,15 +1,24 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Summary: Detect the file that sets the current pyenv version
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
root="$PYENV_DIR"
|
find_local_version_file() {
|
||||||
while [ -n "$root" ]; do
|
local root="$1"
|
||||||
if [ -e "${root}/.pyenv-version" ]; then
|
while [ -n "$root" ]; do
|
||||||
echo "${root}/.pyenv-version"
|
if [ -e "${root}/.python-version" ]; then
|
||||||
exit
|
echo "${root}/.python-version"
|
||||||
fi
|
exit
|
||||||
root="${root%/*}"
|
elif [ -e "${root}/.pyenv-version" ]; then
|
||||||
done
|
echo "${root}/.pyenv-version"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
root="${root%/*}"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
find_local_version_file "$PYENV_DIR"
|
||||||
|
[ "$PYENV_DIR" = "$PWD" ] || find_local_version_file "$PWD"
|
||||||
|
|
||||||
global_version_file="${PYENV_ROOT}/version"
|
global_version_file="${PYENV_ROOT}/version"
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,27 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Usage: pyenv version-file-read <file>
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
VERSION_FILE="$1"
|
VERSION_FILE="$1"
|
||||||
|
|
||||||
if [ -e "$VERSION_FILE" ]; then
|
if [ -e "$VERSION_FILE" ]; then
|
||||||
# Read and print the first non-whitespace word from the specified
|
# Read the first non-whitespace word from the specified version file.
|
||||||
# version file.
|
# Be careful not to load it whole in case there's something crazy in it.
|
||||||
version=""
|
versions=()
|
||||||
while read -a words; do
|
while read -a words; do
|
||||||
word="${words[0]}"
|
word="${words[0]}"
|
||||||
if [ -z "$version" ] && [ -n "$word" ]; then
|
if [ -n "$word" ]; then
|
||||||
version="$word"
|
length="${#versions[@]}"
|
||||||
|
versions=("${versions[@]}" "$word")
|
||||||
fi
|
fi
|
||||||
done < <( cat "$VERSION_FILE" && echo )
|
done < <( cat "$VERSION_FILE" && echo )
|
||||||
|
|
||||||
if [ -n "$version" ]; then
|
if [ -n "$versions" ]; then
|
||||||
echo "$version"
|
{
|
||||||
|
IFS=:
|
||||||
|
echo "${versions[*]}"
|
||||||
|
}
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Usage: pyenv version-file-write <file> <version>
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
PYENV_VERSION_FILE="$1"
|
PYENV_VERSION_FILE="$1"
|
||||||
PYENV_VERSION="$2"
|
shift
|
||||||
|
versions=("$@")
|
||||||
|
|
||||||
if [ -z "$PYENV_VERSION" ] || [ -z "$PYENV_VERSION_FILE" ]; then
|
if [ -z "$versions" ] || [ -z "$PYENV_VERSION_FILE" ]; then
|
||||||
echo "usage: pyenv write-version-file FILENAME VERSION" >&2
|
pyenv-help --usage version-file-write >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Make sure the specified version is installed.
|
# Make sure the specified version is installed.
|
||||||
pyenv-prefix "$PYENV_VERSION" >/dev/null
|
pyenv-prefix "${versions[@]}" >/dev/null
|
||||||
|
|
||||||
# Write the version out to disk.
|
# Write the version out to disk.
|
||||||
echo "$PYENV_VERSION" > "$PYENV_VERSION_FILE"
|
rm -f "$PYENV_VERSION_FILE"
|
||||||
|
for version in "${versions[@]}"; do
|
||||||
|
echo "$version" >> "$PYENV_VERSION_FILE"
|
||||||
|
done
|
||||||
|
|||||||
@@ -1,22 +1,32 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Summary: Show the current Python version
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
if [ -z "$PYENV_VERSION" ]; then
|
if [ -n "$PYENV_VERSION" ]; then
|
||||||
|
IFS=: versions=($(echo "${PYENV_VERSION}"))
|
||||||
|
else
|
||||||
PYENV_VERSION_FILE="$(pyenv-version-file)"
|
PYENV_VERSION_FILE="$(pyenv-version-file)"
|
||||||
PYENV_VERSION="$(pyenv-version-file-read "$PYENV_VERSION_FILE" || true)"
|
IFS=: versions=($(pyenv-version-file-read "$PYENV_VERSION_FILE" || true))
|
||||||
|
IFS=: PYENV_VERSION="${versions[*]}"
|
||||||
|
export PYENV_VERSION
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$PYENV_VERSION" ] || [ "$PYENV_VERSION" = "system" ]; then
|
if [ -z "$versions" ]; then
|
||||||
echo "system"
|
echo "system"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PYENV_VERSION_PATH="${PYENV_ROOT}/versions/${PYENV_VERSION}"
|
version_exists() {
|
||||||
|
local version="$1"
|
||||||
|
[ -d "${PYENV_ROOT}/versions/${version}" ]
|
||||||
|
}
|
||||||
|
|
||||||
if [ -d "$PYENV_VERSION_PATH" ]; then
|
for version in "${versions[@]}"; do
|
||||||
echo "$PYENV_VERSION"
|
if [ "$version" != "system" ] && ! version_exists "$version"; then
|
||||||
else
|
echo "pyenv: version \`$version' is not installed" >&2
|
||||||
echo "pyenv: version \`$PYENV_VERSION' is not installed" >&2
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
done
|
||||||
|
|
||||||
|
echo "${PYENV_VERSION}"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Summary: Explain how the current Python version is set
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1,50 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Summary: List all Python versions available to pyenv
|
||||||
|
# Usage: pyenv versions [--bare]
|
||||||
|
#
|
||||||
|
# Lists all Python versions found in `$PYENV_ROOT/versions/*'.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
PYENV_VERSION_NAME="$(pyenv-version-name)"
|
|
||||||
|
|
||||||
if [ "$1" = "--bare" ]; then
|
if [ "$1" = "--bare" ]; then
|
||||||
hit_prefix=""
|
hit_prefix=""
|
||||||
miss_prefix=""
|
miss_prefix=""
|
||||||
print_version="$PYENV_VERSION_NAME"
|
IFS=: current_versions=()
|
||||||
|
version_origin=""
|
||||||
|
include_system=""
|
||||||
else
|
else
|
||||||
hit_prefix="* "
|
hit_prefix="* "
|
||||||
miss_prefix=" "
|
miss_prefix=" "
|
||||||
print_version="$(pyenv-version)"
|
IFS=: current_versions=($(pyenv-version-name || true))
|
||||||
|
version_origin=" (set by $(pyenv-version-origin))"
|
||||||
|
include_system="1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
array_exists() {
|
||||||
|
local x car="$1"
|
||||||
|
shift
|
||||||
|
for x in "$@"; do
|
||||||
|
[ "${x}" = "${car}" ] && return 0
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
print_version() {
|
||||||
|
if array_exists "$1" "${current_versions[@]}"; then
|
||||||
|
echo "${hit_prefix}${1}${version_origin}"
|
||||||
|
else
|
||||||
|
echo "${miss_prefix}${1}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Include "system" in the non-bare output, if it exists
|
||||||
|
if [ -n "$include_system" ] && PYENV_VERSION=system pyenv-which python >/dev/null 2>&1; then
|
||||||
|
print_version system
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for path in "${PYENV_ROOT}/versions/"*; do
|
for path in "${PYENV_ROOT}/versions/"*; do
|
||||||
if [ -d "$path" ]; then
|
if [ -d "$path" ]; then
|
||||||
version="${path##*/}"
|
print_version "${path##*/}"
|
||||||
|
|
||||||
if [ "$version" == "$PYENV_VERSION_NAME" ]; then
|
|
||||||
echo "${hit_prefix}${print_version}"
|
|
||||||
else
|
|
||||||
echo "${miss_prefix}${version}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Summary: List all Python versions that contain the given executable
|
||||||
|
# Usage: pyenv whence [--path] <command>
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
@@ -27,7 +30,7 @@ whence() {
|
|||||||
|
|
||||||
PYENV_COMMAND="$1"
|
PYENV_COMMAND="$1"
|
||||||
if [ -z "$PYENV_COMMAND" ]; then
|
if [ -z "$PYENV_COMMAND" ]; then
|
||||||
echo "usage: pyenv whence [--path] COMMAND" >&2
|
pyenv-help --usage whence >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Summary: Display the full path to an executable
|
||||||
|
#
|
||||||
|
# Usage: pyenv which <command>
|
||||||
|
#
|
||||||
|
# Displays the full path to the executable that pyenv will invoke when
|
||||||
|
# you run the given command.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
@@ -40,20 +48,26 @@ remove_from_path() {
|
|||||||
echo "${result%:}"
|
echo "${result%:}"
|
||||||
}
|
}
|
||||||
|
|
||||||
PYENV_VERSION="$(pyenv-version-name)"
|
IFS=: versions=($(pyenv-version-name))
|
||||||
|
IFS=: PYENV_VERSION="${versions[*]}"
|
||||||
PYENV_COMMAND="$1"
|
PYENV_COMMAND="$1"
|
||||||
|
|
||||||
if [ -z "$PYENV_COMMAND" ]; then
|
if [ -z "$PYENV_COMMAND" ]; then
|
||||||
echo "usage: pyenv which COMMAND" >&2
|
pyenv-help --usage which >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$PYENV_VERSION" = "system" ]; then
|
for version in "${versions[@]}"; do
|
||||||
PATH="$(remove_from_path "${PYENV_ROOT}/shims")"
|
if [ "$version" = "system" ]; then
|
||||||
PYENV_COMMAND_PATH="$(command -v "$PYENV_COMMAND")"
|
PATH="$(remove_from_path "${PYENV_ROOT}/shims")"
|
||||||
else
|
PYENV_COMMAND_PATH="$(command -v "$PYENV_COMMAND" || true)"
|
||||||
PYENV_COMMAND_PATH="${PYENV_ROOT}/versions/${PYENV_VERSION}/bin/${PYENV_COMMAND}"
|
else
|
||||||
fi
|
PYENV_COMMAND_PATH="${PYENV_ROOT}/versions/${version}/bin/${PYENV_COMMAND}"
|
||||||
|
fi
|
||||||
|
if [ -x "$PYENV_COMMAND_PATH" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
for script in $(pyenv-hooks which); do
|
for script in $(pyenv-hooks which); do
|
||||||
source "$script"
|
source "$script"
|
||||||
|
|||||||
4
plugins/.gitignore
vendored
Normal file
4
plugins/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
/*
|
||||||
|
!/.gitignore
|
||||||
|
!/version-ext-compat
|
||||||
|
!/python-build
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
Copyright (c) 2011 Sam Stephenson
|
|
||||||
Copyright (c) 2012 Yamashita, Yuu
|
|
||||||
|
|
||||||
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.
|
|
||||||
199
plugins/python-build/README.md
Normal file
199
plugins/python-build/README.md
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
# python-build
|
||||||
|
|
||||||
|
python-build is a [pyenv](https://github.com/yyuu/pyenv) plugin
|
||||||
|
that provides a `pyenv install` command to compile and install
|
||||||
|
different versions of Python on UNIX-like systems.
|
||||||
|
|
||||||
|
You can also use python-build without pyenv in environments where you
|
||||||
|
need precise control over Python version installation.
|
||||||
|
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### Installing as an pyenv plugin (recommended)
|
||||||
|
|
||||||
|
You need nothing to do since python-build is bundled with pyenv by
|
||||||
|
default.
|
||||||
|
|
||||||
|
### Installing as a standalone program (advanced)
|
||||||
|
|
||||||
|
Installing python-build as a standalone program will give you access to
|
||||||
|
the `python-build` command for precise control over Python version
|
||||||
|
installation. If you have pyenv installed, you will also be able to
|
||||||
|
use the `pyenv install` command.
|
||||||
|
|
||||||
|
git clone git://github.com/yyuu/pyenv.git
|
||||||
|
cd pyenv/plugins/python-build
|
||||||
|
./install.sh
|
||||||
|
|
||||||
|
This will install python-build into `/usr/local`. If you do not have
|
||||||
|
write permission to `/usr/local`, you will need to run `sudo
|
||||||
|
./install.sh` instead. You can install to a different prefix by
|
||||||
|
setting the `PREFIX` environment variable.
|
||||||
|
|
||||||
|
To update python-build after it has been installed, run `git pull` in
|
||||||
|
your cloned copy of the repository, then re-run the install script.
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Using `pyenv install` with pyenv
|
||||||
|
|
||||||
|
To install a Python version for use with pyenv, run `pyenv install` with
|
||||||
|
the exact name of the version you want to install. For example,
|
||||||
|
|
||||||
|
pyenv install 2.7.4
|
||||||
|
|
||||||
|
Python versions will be installed into a directory of the same name
|
||||||
|
under `~/.pyenv/versions`.
|
||||||
|
|
||||||
|
To see a list of all available Python versions, run `pyenv install --list`.
|
||||||
|
You may also tab-complete available Python
|
||||||
|
versions if your pyenv installation is properly configured.
|
||||||
|
|
||||||
|
### Using `python-build` standalone
|
||||||
|
|
||||||
|
If you have installed python-build as a standalone program, you can use
|
||||||
|
the `python-build` command to compile and install Python versions into
|
||||||
|
specific locations.
|
||||||
|
|
||||||
|
Run the `python-build` command with the exact name of the version you
|
||||||
|
want to install and the full path where you want to install it. For
|
||||||
|
example,
|
||||||
|
|
||||||
|
python-build 2.7.4 ~/local/python-2.7.4
|
||||||
|
|
||||||
|
To see a list of all available Python versions, run `python-build
|
||||||
|
--definitions`.
|
||||||
|
|
||||||
|
Pass the `-v` or `--verbose` flag to `python-build` as the first
|
||||||
|
argument to see what's happening under the hood.
|
||||||
|
|
||||||
|
### Custom definitions
|
||||||
|
|
||||||
|
Both `pyenv install` and `python-build` accept a path to a custom
|
||||||
|
definition file in place of a version name. Custom definitions let you
|
||||||
|
develop and install versions of Python that are not yet supported by
|
||||||
|
python-build.
|
||||||
|
|
||||||
|
See the [python-build built-in
|
||||||
|
definitions](https://github.com/yyuu/pyenv/tree/master/plugins/python-build/share/python-build)
|
||||||
|
as a starting point for custom definition files.
|
||||||
|
|
||||||
|
### Special environment variables
|
||||||
|
|
||||||
|
You can set certain environment variables to control the build
|
||||||
|
process.
|
||||||
|
|
||||||
|
* `TMPDIR` sets the location where python-build stores temporary files.
|
||||||
|
* `PYTHON_BUILD_BUILD_PATH` sets the location in which sources are
|
||||||
|
downloaded and built. By default, this is a subdirectory of
|
||||||
|
`TMPDIR`.
|
||||||
|
* `PYTHON_BUILD_CACHE_PATH`, if set, specifies a directory to use for
|
||||||
|
caching downloaded package files.
|
||||||
|
* `PYTHON_BUILD_MIRROR_URL` overrides the default mirror URL root to one
|
||||||
|
of your choosing.
|
||||||
|
* `PYTHON_BUILD_SKIP_MIRROR`, if set, forces python-build to download
|
||||||
|
packages from their original source URLs instead of using a mirror.
|
||||||
|
* `CC` sets the path to the C compiler.
|
||||||
|
* `CONFIGURE_OPTS` lets you pass additional options to `./configure`.
|
||||||
|
* `MAKE` lets you override the command to use for `make`. Useful for
|
||||||
|
specifying GNU make (`gmake`) on some systems.
|
||||||
|
* `MAKE_OPTS` (or `MAKEOPTS`) lets you pass additional options to
|
||||||
|
`make`.
|
||||||
|
* `PYTHON_CONFIGURE_OPTS` and `PYTHON_MAKE_OPTS` allow you to specify
|
||||||
|
configure and make options for buildling CPython. These variables will
|
||||||
|
be passed to Python only, not any dependent packages (e.g. libyaml).
|
||||||
|
|
||||||
|
### Checksum verification
|
||||||
|
|
||||||
|
If you have the `md5`, `openssl`, or `md5sum` tool installed,
|
||||||
|
python-build will automatically verify the MD5 checksum of each
|
||||||
|
downloaded package before installing it.
|
||||||
|
|
||||||
|
Checksums are optional and specified as anchors on the package URL in
|
||||||
|
each definition. (All bundled definitions include checksums.)
|
||||||
|
|
||||||
|
### Package download mirrors
|
||||||
|
|
||||||
|
python-build will first attempt to download package files from a mirror
|
||||||
|
hosted on Amazon CloudFront. If a package is not available on the
|
||||||
|
mirror, if the mirror is down, or if the download is corrupt,
|
||||||
|
python-build will fall back to the official URL specified in the
|
||||||
|
defintion file.
|
||||||
|
|
||||||
|
You can point python-build to another mirror by specifying the
|
||||||
|
`PYTHON_BUILD_MIRROR_URL` environment variable--useful if you'd like to
|
||||||
|
run your own local mirror, for example. Package mirror URLs are
|
||||||
|
constructed by joining this variable with the MD5 checksum of the
|
||||||
|
package file.
|
||||||
|
|
||||||
|
If you don't have an MD5 program installed, python-build will skip the
|
||||||
|
download mirror and use official URLs instead. You can force
|
||||||
|
python-build to bypass the mirror by setting the
|
||||||
|
`PYTHON_BUILD_SKIP_MIRROR` environment variable.
|
||||||
|
|
||||||
|
The official python-build download mirror is provided by [Git Hub Pages](http://yyuu.github.io/pythons/).
|
||||||
|
|
||||||
|
### Package download caching
|
||||||
|
|
||||||
|
You can instruct python-build to keep a local cache of downloaded
|
||||||
|
package files by setting the `PYTHON_BUILD_CACHE_PATH` environment
|
||||||
|
variable. When set, package files will be kept in this directory after
|
||||||
|
the first successful download and reused by subsequent invocations of
|
||||||
|
`python-build` and `pyenv install`.
|
||||||
|
|
||||||
|
The `pyenv install` command defaults this path to `~/.pyenv/cache`, so
|
||||||
|
in most cases you can enable download caching simply by creating that
|
||||||
|
directory.
|
||||||
|
|
||||||
|
### Keeping the build directory after installation
|
||||||
|
|
||||||
|
Both `python-build` and `pyenv install` accept the `-k` or `--keep`
|
||||||
|
flag, which tells python-build to keep the downloaded source after
|
||||||
|
installation. This can be useful if you need to use `gdb` and
|
||||||
|
`memprof` with Python.
|
||||||
|
|
||||||
|
Source code will be kept in a parallel directory tree
|
||||||
|
`~/.pyenv/sources` when using `--keep` with the `pyenv install`
|
||||||
|
command. You should specify the location of the source code with the
|
||||||
|
`PYTHON_BUILD_BUILD_PATH` environment variable when using `--keep` with
|
||||||
|
`python-build`.
|
||||||
|
|
||||||
|
|
||||||
|
## Getting Help
|
||||||
|
|
||||||
|
Please see the [python-build
|
||||||
|
wiki](https://github.com/yyuu/pyenv/wiki) for solutions to
|
||||||
|
common problems.
|
||||||
|
|
||||||
|
If you can't find an answer on the wiki, open an issue on the [issue
|
||||||
|
tracker](https://github.com/yyuu/pyenv/issues). Be sure to
|
||||||
|
include the full build log for build failures.
|
||||||
|
|
||||||
|
|
||||||
|
### License
|
||||||
|
|
||||||
|
(The MIT License)
|
||||||
|
|
||||||
|
* Copyright (c) 2013 Yamashita, Yuu
|
||||||
|
* Copyright (c) 2012 Sam Stephenson
|
||||||
|
|
||||||
|
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.
|
||||||
@@ -1,4 +1,22 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Summary: Install a Python version using the python-build plugin
|
||||||
|
#
|
||||||
|
# Usage: pyenv install [-f|--force] [-g|--debug] [-k|--keep] [-v|--verbose] <version>
|
||||||
|
# pyenv install [-f|--force] [-g|--debug] [-k|--keep] [-v|--verbose] <definition-file>
|
||||||
|
# pyenv install -l|--list
|
||||||
|
#
|
||||||
|
# -l/--list List all available versions
|
||||||
|
# -f/--force Install even if the version appears to be installed already
|
||||||
|
# -k/--keep Keep source tree in $PYENV_BUILD_ROOT after installation
|
||||||
|
# (defaults to $PYENV_ROOT/sources)
|
||||||
|
# -g/--debug Build a debug version
|
||||||
|
# -v/--verbose Verbose mode: print compilation status to stdout
|
||||||
|
#
|
||||||
|
# For detailed information on installing Python versions with
|
||||||
|
# python-build, including a list of environment variables for adjusting
|
||||||
|
# compilation, see: https://github.com/yyuu/pyenv#readme
|
||||||
|
#
|
||||||
set -e
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
@@ -15,22 +33,24 @@ fi
|
|||||||
eval "$(python-build --lib)"
|
eval "$(python-build --lib)"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
{ echo "usage: pyenv install [-k|--keep] [-v|--verbose] VERSION"
|
# We can remove the sed fallback once pyenv 0.4.0 is widely available.
|
||||||
echo " pyenv install [-k|--keep] [-v|--verbose] /path/to/definition"
|
pyenv-help install 2>/dev/null || sed -ne '/^#/!q;s/.//;s/.//;1,4d;p' < "$0"
|
||||||
echo " pyenv install -l|--list"
|
|
||||||
echo
|
|
||||||
echo " -l/--list List all available versions"
|
|
||||||
echo " -k/--keep Keep source tree in \$PYENV_BUILD_ROOT after installation"
|
|
||||||
echo " (defaults to ${PYENV_ROOT}/sources)"
|
|
||||||
echo " -v/--verbose Verbose mode: print compilation status to stdout"
|
|
||||||
echo
|
|
||||||
} >&2
|
|
||||||
|
|
||||||
[ -z "$1" ] || exit "$1"
|
[ -z "$1" ] || exit "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
definitions() {
|
||||||
|
local query="$1"
|
||||||
|
python-build --definitions | grep -F "$query" || true
|
||||||
|
}
|
||||||
|
|
||||||
|
indent() {
|
||||||
|
sed 's/^/ /'
|
||||||
|
}
|
||||||
|
|
||||||
|
unset FORCE
|
||||||
unset KEEP
|
unset KEEP
|
||||||
unset VERBOSE
|
unset VERBOSE
|
||||||
|
unset DEBUG
|
||||||
|
|
||||||
parse_options "$@"
|
parse_options "$@"
|
||||||
for option in "${OPTIONS[@]}"; do
|
for option in "${OPTIONS[@]}"; do
|
||||||
@@ -40,15 +60,21 @@ for option in "${OPTIONS[@]}"; do
|
|||||||
;;
|
;;
|
||||||
"l" | "list" )
|
"l" | "list" )
|
||||||
echo "Available versions:"
|
echo "Available versions:"
|
||||||
python-build --definitions | sed 's/^/ /'
|
definitions | indent
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
|
"f" | "force" )
|
||||||
|
FORCE=true
|
||||||
|
;;
|
||||||
"k" | "keep" )
|
"k" | "keep" )
|
||||||
[ -n "${PYENV_BUILD_ROOT}" ] || PYENV_BUILD_ROOT="${PYENV_ROOT}/sources"
|
[ -n "${PYENV_BUILD_ROOT}" ] || PYENV_BUILD_ROOT="${PYENV_ROOT}/sources"
|
||||||
;;
|
;;
|
||||||
"v" | "verbose" )
|
"v" | "verbose" )
|
||||||
VERBOSE="-v"
|
VERBOSE="-v"
|
||||||
;;
|
;;
|
||||||
|
"g" | "debug" )
|
||||||
|
DEBUG="-g"
|
||||||
|
;;
|
||||||
"version" )
|
"version" )
|
||||||
exec python-build --version
|
exec python-build --version
|
||||||
;;
|
;;
|
||||||
@@ -58,21 +84,118 @@ for option in "${OPTIONS[@]}"; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
unset VERSION_NAME
|
||||||
|
|
||||||
|
# The first argument contains the definition to install. If the
|
||||||
|
# argument is missing, try to install whatever local app-specific
|
||||||
|
# version is specified by pyenv. Show usage instructions if a local
|
||||||
|
# version is not specified.
|
||||||
DEFINITION="${ARGUMENTS[0]}"
|
DEFINITION="${ARGUMENTS[0]}"
|
||||||
|
[ -n "$DEFINITION" ] || DEFINITION="$(pyenv local 2>/dev/null || true)"
|
||||||
[ -n "$DEFINITION" ] || usage 1
|
[ -n "$DEFINITION" ] || usage 1
|
||||||
|
|
||||||
|
|
||||||
|
# Define `before_install` and `after_install` functions that allow
|
||||||
|
# plugin hooks to register a string of code for execution before or
|
||||||
|
# after the installation process.
|
||||||
|
declare -a before_hooks after_hooks
|
||||||
|
|
||||||
|
before_install() {
|
||||||
|
local hook="$1"
|
||||||
|
before_hooks["${#before_hooks[@]}"]="$hook"
|
||||||
|
}
|
||||||
|
|
||||||
|
after_install() {
|
||||||
|
local hook="$1"
|
||||||
|
after_hooks["${#after_hooks[@]}"]="$hook"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Load plugin hooks.
|
||||||
for script in $(pyenv-hooks install); do
|
for script in $(pyenv-hooks install); do
|
||||||
source "$script"
|
source "$script"
|
||||||
done
|
done
|
||||||
|
|
||||||
VERSION_NAME="${DEFINITION##*/}"
|
|
||||||
|
# Set VERSION_NAME from $DEFINITION, if it is not already set. Then
|
||||||
|
# compute the installation prefix.
|
||||||
|
[ -n "$VERSION_NAME" ] || VERSION_NAME="${DEFINITION##*/}"
|
||||||
|
[ -n "$DEBUG" ] && VERSION_NAME="${VERSION_NAME}-debug"
|
||||||
PREFIX="${PYENV_ROOT}/versions/${VERSION_NAME}"
|
PREFIX="${PYENV_ROOT}/versions/${VERSION_NAME}"
|
||||||
|
|
||||||
# If PYENV_BUILD_ROOT is set, then always pass keep options to python-build
|
[ -d "${PREFIX}" ] && PREFIX_EXISTS=1
|
||||||
|
|
||||||
|
# If the installation prefix exists, prompt for confirmation unless
|
||||||
|
# the --force option was specified.
|
||||||
|
if [ -z "$FORCE" ] && [ -d "${PREFIX}/bin" ]; then
|
||||||
|
echo "pyenv: $PREFIX already exists" >&2
|
||||||
|
read -p "continue with installation? (y/N) "
|
||||||
|
|
||||||
|
case "$REPLY" in
|
||||||
|
y* | Y* ) ;;
|
||||||
|
* ) exit 1 ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If PYENV_BUILD_ROOT is set, always pass keep options to python-build.
|
||||||
if [ -n "${PYENV_BUILD_ROOT}" ]; then
|
if [ -n "${PYENV_BUILD_ROOT}" ]; then
|
||||||
export PYTHON_BUILD_BUILD_PATH="${PYENV_BUILD_ROOT}/${VERSION_NAME}"
|
export PYTHON_BUILD_BUILD_PATH="${PYENV_BUILD_ROOT}/${VERSION_NAME}"
|
||||||
KEEP="-k"
|
KEEP="-k"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
python-build $KEEP $VERBOSE "$DEFINITION" "$PREFIX"
|
# Set PYTHON_BUILD_CACHE_PATH to $PYENV_ROOT/cache, if the directory
|
||||||
pyenv rehash
|
# exists and the variable is not already set.
|
||||||
|
if [ -z "${PYTHON_BUILD_CACHE_PATH}" ] && [ -d "${PYENV_ROOT}/cache" ]; then
|
||||||
|
export PYTHON_BUILD_CACHE_PATH="${PYENV_ROOT}/cache"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Default PYENV_VERSION to the globally-specified Python version. (The
|
||||||
|
# Python 3.4 installer requires an existing Python installation to run. An
|
||||||
|
# unsatisfied local .python-version file can cause the installer to
|
||||||
|
# fail.)
|
||||||
|
if [ -z "${PYENV_VERSION}" ]; then
|
||||||
|
export PYENV_VERSION="$(pyenv global 2>/dev/null || true)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Execute `before_install` hooks.
|
||||||
|
for hook in "${before_hooks[@]}"; do eval "$hook"; done
|
||||||
|
|
||||||
|
# Plan cleanup on unsuccessful installation.
|
||||||
|
cleanup() {
|
||||||
|
[ -z "${PREFIX_EXISTS}" ] && rm -rf "$PREFIX"
|
||||||
|
}
|
||||||
|
|
||||||
|
trap cleanup SIGINT
|
||||||
|
|
||||||
|
# Invoke `python-build` and record the exit status in $STATUS.
|
||||||
|
STATUS=0
|
||||||
|
python-build $KEEP $VERBOSE $DEBUG "$DEFINITION" "$PREFIX" || STATUS="$?"
|
||||||
|
|
||||||
|
# Display a more helpful message if the definition wasn't found.
|
||||||
|
if [ "$STATUS" == "2" ]; then
|
||||||
|
{ candidates="$(definitions "$DEFINITION")"
|
||||||
|
if [ -n "$candidates" ]; then
|
||||||
|
echo
|
||||||
|
echo "The following versions contain \`$DEFINITION' in the name:"
|
||||||
|
echo "$candidates" | indent
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
echo "You can list all available versions with \`pyenv install --list'."
|
||||||
|
echo
|
||||||
|
echo "If the version you're looking for is not present, first try upgrading"
|
||||||
|
echo "pyenv. If it's still missing, open a request on the pyenv"
|
||||||
|
echo "issue tracker: https://github.com/yyuu/pyenv/issues"
|
||||||
|
} >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Execute `after_install` hooks.
|
||||||
|
for hook in "${after_hooks[@]}"; do eval "$hook"; done
|
||||||
|
|
||||||
|
# Run `pyenv-rehash` after a successful installation.
|
||||||
|
if [ "$STATUS" == "0" ]; then
|
||||||
|
pyenv rehash
|
||||||
|
else
|
||||||
|
cleanup
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit "$STATUS"
|
||||||
|
|||||||
@@ -1,4 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Summary: Uninstall a specific Python version
|
||||||
|
#
|
||||||
|
# Usage: pyenv uninstall [-f|--force] <version>
|
||||||
|
#
|
||||||
|
# -f Attempt to remove the specified version without prompting
|
||||||
|
# for confirmation. If the version does not exist, do not
|
||||||
|
# display an error message.
|
||||||
|
#
|
||||||
|
# See `pyenv versions` for a complete list of installed versions.
|
||||||
|
#
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Provide pyenv completions
|
# Provide pyenv completions
|
||||||
@@ -11,7 +22,7 @@ if [ -z "$PYENV_ROOT" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
unset FORCE
|
unset FORCE
|
||||||
if [ "$1" = "-f" ]; then
|
if [ "$1" = "-f" ] || [ "$1" = "--force" ]; then
|
||||||
FORCE=true
|
FORCE=true
|
||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
@@ -19,15 +30,9 @@ fi
|
|||||||
DEFINITION="$1"
|
DEFINITION="$1"
|
||||||
case "$DEFINITION" in
|
case "$DEFINITION" in
|
||||||
"" | -* )
|
"" | -* )
|
||||||
{ echo "usage: pyenv uninstall [-f] VERSION"
|
# We can remove the sed fallback once pyenv 0.4.0 is widely available.
|
||||||
echo
|
{ pyenv-help uninstall 2>/dev/null ||
|
||||||
echo " -f Attempt to remove the specified version without prompting"
|
sed -ne '/^#/!q;s/.\{1,2\}//;1,4d;p' < "$0"
|
||||||
echo " for confirmation. If the version does not exist, do not"
|
|
||||||
echo " display an error message."
|
|
||||||
echo
|
|
||||||
echo "Installed versions:"
|
|
||||||
pyenv versions --bare | sed 's/^/ /'
|
|
||||||
echo
|
|
||||||
} >&2
|
} >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
PYTHON_BUILD_VERSION="20120815"
|
PYTHON_BUILD_VERSION="20130518"
|
||||||
|
|
||||||
set -E
|
set -E
|
||||||
exec 3<&2 # preserve original stderr at fd 3
|
exec 3<&2 # preserve original stderr at fd 3
|
||||||
@@ -57,6 +57,14 @@ abs_dirname() {
|
|||||||
cd "$cwd"
|
cd "$cwd"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
capitalize() {
|
||||||
|
printf "%s" "$1" | tr a-z A-Z
|
||||||
|
}
|
||||||
|
|
||||||
|
sanitize() {
|
||||||
|
printf "%s" "$1" | sed "s/[^A-Za-z0-9.-]/_/g; s/__*/_/g"
|
||||||
|
}
|
||||||
|
|
||||||
build_failed() {
|
build_failed() {
|
||||||
{ echo
|
{ echo
|
||||||
echo "BUILD FAILED"
|
echo "BUILD FAILED"
|
||||||
@@ -89,15 +97,27 @@ file_is_not_empty() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
install_package() {
|
install_package() {
|
||||||
install_package_using "tarball" 1 $*
|
install_package_using "tarball" 1 "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_git() {
|
install_git() {
|
||||||
install_package_using "git" 2 $*
|
install_package_using "git" 2 "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
install_hg() {
|
||||||
|
install_package_using "hg" 2 "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
install_svn() {
|
||||||
|
install_package_using "svn" 2 "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_jar() {
|
install_jar() {
|
||||||
install_package_using "jar" 1 $*
|
install_package_using "jar" 1 "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
install_zip() {
|
||||||
|
install_package_using "zip" 1 "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_package_using() {
|
install_package_using() {
|
||||||
@@ -106,13 +126,45 @@ install_package_using() {
|
|||||||
local package_name="$3"
|
local package_name="$3"
|
||||||
shift 3
|
shift 3
|
||||||
|
|
||||||
|
local fetch_args=( "$package_name" "${@:1:$package_type_nargs}" )
|
||||||
|
local make_args=( "$package_name" )
|
||||||
|
local arg last_arg
|
||||||
|
|
||||||
|
for arg in "${@:$(( $package_type_nargs + 1 ))}"; do
|
||||||
|
if [ "$last_arg" = "--if" ]; then
|
||||||
|
"$arg" || return 0
|
||||||
|
elif [ "$arg" != "--if" ]; then
|
||||||
|
make_args["${#make_args[@]}"]="$arg"
|
||||||
|
fi
|
||||||
|
last_arg="$arg"
|
||||||
|
done
|
||||||
|
|
||||||
pushd "$BUILD_PATH" >&4
|
pushd "$BUILD_PATH" >&4
|
||||||
"fetch_${package_type}" "$package_name" $*
|
"fetch_${package_type}" "${fetch_args[@]}"
|
||||||
shift $(($package_type_nargs))
|
make_package "${make_args[@]}"
|
||||||
make_package "$package_name" $*
|
|
||||||
popd >&4
|
popd >&4
|
||||||
|
|
||||||
echo "Installed ${package_name} to ${PREFIX_PATH}" >&2
|
{ echo "Installed ${package_name} to ${PREFIX_PATH}"
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
apply_patches() {
|
||||||
|
local package_name="$1"
|
||||||
|
local patches_path="${PYTHON_BUILD_ROOT}/share/python-build/patches/${DEFINITION_PATH##*/}"
|
||||||
|
|
||||||
|
# Support PYTHON_PATCH_STRIP, etc.
|
||||||
|
local package_var_name="$(capitalize "${package_name%%-*}")"
|
||||||
|
local PACKAGE_PATCH_STRIP="${package_var_name}_PATCH_STRIP"
|
||||||
|
|
||||||
|
for patch in "${patches_path}/${package_name}/"*; do
|
||||||
|
if [ -f "$patch" ]; then
|
||||||
|
{
|
||||||
|
echo "Applying ${patch##*/} to ${package_name}..."
|
||||||
|
patch "-p${!PACKAGE_PATCH_STRIP:-0}" < "$patch"
|
||||||
|
} >&4 2>&1
|
||||||
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
make_package() {
|
make_package() {
|
||||||
@@ -121,33 +173,163 @@ make_package() {
|
|||||||
|
|
||||||
pushd "$package_name" >&4
|
pushd "$package_name" >&4
|
||||||
before_install_package "$package_name"
|
before_install_package "$package_name"
|
||||||
|
apply_patches "$package_name"
|
||||||
build_package "$package_name" $*
|
build_package "$package_name" $*
|
||||||
after_install_package "$package_name"
|
after_install_package "$package_name"
|
||||||
fix_directory_permissions
|
fix_directory_permissions
|
||||||
popd >&4
|
popd >&4
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch_url() {
|
compute_md5() {
|
||||||
|
if type md5 &>/dev/null; then
|
||||||
|
md5 -q
|
||||||
|
elif type openssl &>/dev/null; then
|
||||||
|
local output="$(openssl md5)"
|
||||||
|
echo "${output##* }"
|
||||||
|
elif type md5sum &>/dev/null; then
|
||||||
|
local output="$(md5sum -b)"
|
||||||
|
echo "${output% *}"
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
verify_checksum() {
|
||||||
|
# If there's no MD5 support, return success
|
||||||
|
[ -n "$HAS_MD5_SUPPORT" ] || return 0
|
||||||
|
|
||||||
|
# If the specified filename doesn't exist, return success
|
||||||
|
local filename="$1"
|
||||||
|
[ -e "$filename" ] || return 0
|
||||||
|
|
||||||
|
# If there's no expected checksum, return success
|
||||||
|
local expected_checksum="$2"
|
||||||
|
[ -n "$expected_checksum" ] || return 0
|
||||||
|
|
||||||
|
# If the computed checksum is empty, return failure
|
||||||
|
local computed_checksum="$(compute_md5 < "$filename")"
|
||||||
|
[ -n "$computed_checksum" ] || return 1
|
||||||
|
|
||||||
|
if [ "$expected_checksum" != "$computed_checksum" ]; then
|
||||||
|
{ echo
|
||||||
|
echo "checksum mismatch: ${filename} (file is corrupt)"
|
||||||
|
echo "expected $expected_checksum, got $computed_checksum"
|
||||||
|
echo
|
||||||
|
} >&4
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
http() {
|
||||||
|
local method="$1"
|
||||||
|
local url="$2"
|
||||||
|
local file="$3"
|
||||||
|
[ -n "$url" ] || return 1
|
||||||
|
|
||||||
if type curl &>/dev/null; then
|
if type curl &>/dev/null; then
|
||||||
curl -L "$@"
|
"http_${method}_curl" "$url" "$file"
|
||||||
elif type wget &>/dev/null; then
|
elif type wget &>/dev/null; then
|
||||||
wget -O- "$@"
|
"http_${method}_wget" "$url" "$file"
|
||||||
else
|
else
|
||||||
echo "error: please install \`curl\` or \`wget\` and try again" >&2
|
echo "error: please install \`curl\` or \`wget\` and try again" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
http_head_curl() {
|
||||||
|
curl -qsILf "$1" >&4 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
http_get_curl() {
|
||||||
|
curl -C - -o "${2:--}" -qsSLf "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
http_head_wget() {
|
||||||
|
wget -q --spider "$1" >&4 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
http_get_wget() {
|
||||||
|
wget -nv -c -O "${2:--}" "$1"
|
||||||
|
}
|
||||||
|
|
||||||
fetch_tarball() {
|
fetch_tarball() {
|
||||||
local package_name="$1"
|
local package_name="$1"
|
||||||
local package_url="$2"
|
local package_url="$2"
|
||||||
|
local mirror_url
|
||||||
|
local checksum
|
||||||
|
|
||||||
echo "Downloading ${package_url}..." >&2
|
if [ "$package_url" != "${package_url/\#}" ]; then
|
||||||
{ fetch_url "$package_url" > "${package_name}.tar"
|
checksum="${package_url#*#}"
|
||||||
tar xvf "${package_name}.tar"
|
package_url="${package_url%%#*}"
|
||||||
|
|
||||||
|
if [ -n "$PYTHON_BUILD_MIRROR_URL" ]; then
|
||||||
|
mirror_url="${PYTHON_BUILD_MIRROR_URL}/$checksum"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
local _package_filename="${package_url##*/}"
|
||||||
|
local _package_suffix="${_package_filename##*.}"
|
||||||
|
case "${_package_suffix}" in
|
||||||
|
"Z" | "bz2" | "gz" | "xz" )
|
||||||
|
local package_suffix="tar.${_package_suffix}"
|
||||||
|
;;
|
||||||
|
* )
|
||||||
|
local package_suffix="${_package_suffix}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
local package_filename="${package_name}.${package_suffix}"
|
||||||
|
symlink_tarball_from_cache "$package_filename" "$checksum" || {
|
||||||
|
echo "Downloading ${package_filename}..." >&2
|
||||||
|
{ http head "$mirror_url" &&
|
||||||
|
download_tarball "$mirror_url" "$package_filename" "$checksum"
|
||||||
|
} ||
|
||||||
|
download_tarball "$package_url" "$package_filename" "$checksum"
|
||||||
|
}
|
||||||
|
|
||||||
|
{ if tar xvf "$package_filename"; then
|
||||||
|
if [ -z "$KEEP_BUILD_PATH" ]; then
|
||||||
|
rm -f "$package_filename"
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
} >&4 2>&1
|
} >&4 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
symlink_tarball_from_cache() {
|
||||||
|
[ -n "$PYTHON_BUILD_CACHE_PATH" ] || return 1
|
||||||
|
|
||||||
|
local package_filename="$1"
|
||||||
|
local cached_package_filename="${PYTHON_BUILD_CACHE_PATH}/$package_filename"
|
||||||
|
local checksum="$2"
|
||||||
|
|
||||||
|
[ -e "$cached_package_filename" ] || return 1
|
||||||
|
verify_checksum "$cached_package_filename" "$checksum" >&4 2>&1 || return 1
|
||||||
|
ln -s "$cached_package_filename" "$package_filename" >&4 2>&1 || return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
download_tarball() {
|
||||||
|
local package_url="$1"
|
||||||
|
[ -n "$package_url" ] || return 1
|
||||||
|
|
||||||
|
local package_filename="$2"
|
||||||
|
local checksum="$3"
|
||||||
|
|
||||||
|
echo "-> $package_url" >&2
|
||||||
|
|
||||||
|
{ http get "$package_url" "$package_filename"
|
||||||
|
verify_checksum "$package_filename" "$checksum"
|
||||||
|
} >&4 2>&1 || return 1
|
||||||
|
|
||||||
|
if [ -n "$PYTHON_BUILD_CACHE_PATH" ]; then
|
||||||
|
local cached_package_filename="${PYTHON_BUILD_CACHE_PATH}/$package_filename"
|
||||||
|
{ mv "$package_filename" "$cached_package_filename"
|
||||||
|
ln -s "$cached_package_filename" "$package_filename"
|
||||||
|
} >&4 2>&1 || return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
fetch_git() {
|
fetch_git() {
|
||||||
local package_name="$1"
|
local package_name="$1"
|
||||||
local git_url="$2"
|
local git_url="$2"
|
||||||
@@ -156,6 +338,20 @@ fetch_git() {
|
|||||||
echo "Cloning ${git_url}..." >&2
|
echo "Cloning ${git_url}..." >&2
|
||||||
|
|
||||||
if type git &>/dev/null; then
|
if type git &>/dev/null; then
|
||||||
|
if [ -n "$PYTHON_BUILD_CACHE_PATH" ]; then
|
||||||
|
pushd "$PYTHON_BUILD_CACHE_PATH" >&4
|
||||||
|
local clone_name="$(sanitize "$git_url")"
|
||||||
|
if [ -e "${clone_name}" ]; then
|
||||||
|
{ cd "${clone_name}"
|
||||||
|
git fetch --force "$git_url" "+${git_ref}:${git_ref}"
|
||||||
|
} >&4 2>&1
|
||||||
|
else
|
||||||
|
git clone --bare --branch "$git_ref" "$git_url" "${clone_name}" >&4 2>&1
|
||||||
|
fi
|
||||||
|
git_url="$PYTHON_BUILD_CACHE_PATH/${clone_name}"
|
||||||
|
popd >&4
|
||||||
|
fi
|
||||||
|
|
||||||
git clone --depth 1 --branch "$git_ref" "$git_url" "${package_name}" >&4 2>&1
|
git clone --depth 1 --branch "$git_ref" "$git_url" "${package_name}" >&4 2>&1
|
||||||
else
|
else
|
||||||
echo "error: please install \`git\` and try again" >&2
|
echo "error: please install \`git\` and try again" >&2
|
||||||
@@ -163,16 +359,131 @@ fetch_git() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fetch_hg() {
|
||||||
|
local package_name="$1"
|
||||||
|
local hg_url="$2"
|
||||||
|
local hg_ref="$3"
|
||||||
|
|
||||||
|
echo "Cloning ${hg_url}..." >&2
|
||||||
|
|
||||||
|
if type hg &>/dev/null; then
|
||||||
|
if [ -n "$PYTHON_BUILD_CACHE_PATH" ]; then
|
||||||
|
pushd "$PYTHON_BUILD_CACHE_PATH" >&4
|
||||||
|
local clone_name="$(sanitize "$hg_url")"
|
||||||
|
if [ -e "${clone_name}" ]; then
|
||||||
|
{ cd "${clone_name}"
|
||||||
|
hg pull --force "$hg_url"
|
||||||
|
} >&4 2>&1
|
||||||
|
else
|
||||||
|
{ hg clone --branch "$hg_ref" "$hg_url" "${clone_name}"
|
||||||
|
cd "${clone_name}"
|
||||||
|
hg update null
|
||||||
|
} >&4 2>&1
|
||||||
|
fi
|
||||||
|
hg_url="$PYTHON_BUILD_CACHE_PATH/${clone_name}"
|
||||||
|
popd >&4
|
||||||
|
fi
|
||||||
|
|
||||||
|
hg clone --branch "$hg_ref" "$hg_url" "${package_name}" >&4 2>&1
|
||||||
|
else
|
||||||
|
echo "error: please install \`hg\` and try again" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch_svn() {
|
||||||
|
local package_name="$1"
|
||||||
|
local svn_url="$2"
|
||||||
|
local svn_rev="$3"
|
||||||
|
|
||||||
|
echo "Checking out ${svn_url}..." >&2
|
||||||
|
|
||||||
|
if type svn &>/dev/null; then
|
||||||
|
svn co -r "$svn_rev" "$svn_url" "${package_name}" >&4 2>&1
|
||||||
|
else
|
||||||
|
echo "error: please install \`svn\` and try again" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
fetch_jar() {
|
fetch_jar() {
|
||||||
local package_name="$1"
|
local package_name="$1"
|
||||||
local package_url="$2"
|
local package_url="$2"
|
||||||
|
local mirror_url
|
||||||
|
local checksum
|
||||||
|
|
||||||
echo "Downloading ${package_url}..." >&2
|
if [ "$package_url" != "${package_url/\#}" ]; then
|
||||||
{ fetch_url "$package_url" > "${package_name}.jar"
|
checksum="${package_url#*#}"
|
||||||
$JAVA -jar ${package_name}.jar -s -d ${package_name}
|
package_url="${package_url%%#*}"
|
||||||
|
|
||||||
|
if [ -n "$PYTHON_BUILD_MIRROR_URL" ]; then
|
||||||
|
mirror_url="${PYTHON_BUILD_MIRROR_URL}/$checksum"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
local package_filename="${package_name}.jar"
|
||||||
|
symlink_jar_from_cache "$package_filename" "$checksum" || {
|
||||||
|
echo "Downloading ${package_filename}..." >&2
|
||||||
|
{ http head "$mirror_url" &&
|
||||||
|
download_jar "$mirror_url" "$package_filename" "$checksum"
|
||||||
|
} ||
|
||||||
|
download_jar "$package_url" "$package_filename" "$checksum"
|
||||||
|
}
|
||||||
|
{ $JAVA -jar ${package_name}.jar -s -d ${package_name}
|
||||||
|
rm -f "$package_filename"
|
||||||
} >&4 2>&1
|
} >&4 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
symlink_jar_from_cache() {
|
||||||
|
symlink_tarball_from_cache "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
download_jar() {
|
||||||
|
download_tarball "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch_zip() {
|
||||||
|
local package_name="$1"
|
||||||
|
local package_url="$2"
|
||||||
|
local mirror_url
|
||||||
|
local checksum
|
||||||
|
|
||||||
|
if [ "$package_url" != "${package_url/\#}" ]; then
|
||||||
|
checksum="${package_url#*#}"
|
||||||
|
package_url="${package_url%%#*}"
|
||||||
|
|
||||||
|
if [ -n "$PYTHON_BUILD_MIRROR_URL" ]; then
|
||||||
|
mirror_url="${PYTHON_BUILD_MIRROR_URL}/$checksum"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
local package_filename="${package_name}.zip"
|
||||||
|
symlink_zip_from_cache "$package_filename" "$checksum" || {
|
||||||
|
echo "Downloading ${package_filename}..." >&2
|
||||||
|
{ http head "$mirror_url" &&
|
||||||
|
download_zip "$mirror_url" "$package_filename" "$checksum"
|
||||||
|
} ||
|
||||||
|
download_zip "$package_url" "$package_filename" "$checksum"
|
||||||
|
}
|
||||||
|
|
||||||
|
{ if unzip "$package_filename"; then
|
||||||
|
if [ -z "$KEEP_BUILD_PATH" ]; then
|
||||||
|
rm -f "$package_filename"
|
||||||
|
else
|
||||||
|
true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
} >&4 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
symlink_zip_from_cache() {
|
||||||
|
symlink_tarball_from_cache "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
download_zip() {
|
||||||
|
download_tarball "$@"
|
||||||
|
}
|
||||||
|
|
||||||
build_package() {
|
build_package() {
|
||||||
local package_name="$1"
|
local package_name="$1"
|
||||||
shift
|
shift
|
||||||
@@ -186,20 +497,18 @@ build_package() {
|
|||||||
echo "Installing ${package_name}..." >&2
|
echo "Installing ${package_name}..." >&2
|
||||||
|
|
||||||
for command in $commands; do
|
for command in $commands; do
|
||||||
"build_package_${command}" "${package_name}"
|
"build_package_${command}" "$package_name"
|
||||||
done
|
done
|
||||||
|
}
|
||||||
|
|
||||||
if [ ! -f "$PYTHON_BIN" ]; then
|
package_option() {
|
||||||
for python in ${PREFIX_PATH}/bin/python*; do
|
local package_name="$1"
|
||||||
if basename "$python" | grep '^python[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; then
|
local command_name="$2"
|
||||||
{
|
local variable="$(capitalize "${package_name}_${command_name}")_OPTS_ARRAY"
|
||||||
cd ${PREFIX_PATH}/bin
|
local array="$variable[@]"
|
||||||
ln -fs "$(basename $python)" python
|
shift 2
|
||||||
}
|
local value=( "${!array}" "$@" )
|
||||||
break
|
eval "$variable=( \"\${value[@]}\" )"
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
build_package_standard() {
|
build_package_standard() {
|
||||||
@@ -211,10 +520,38 @@ build_package_standard() {
|
|||||||
MAKE_OPTS="-j 2"
|
MAKE_OPTS="-j 2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
{ ./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
|
# Support PYTHON_CONFIGURE_OPTS, etc.
|
||||||
make $MAKE_OPTS
|
local package_var_name="$(capitalize "${package_name%%-*}")"
|
||||||
make install
|
local PACKAGE_CONFIGURE="${package_var_name}_CONFIGURE"
|
||||||
|
local PACKAGE_PREFIX_PATH="${package_var_name}_PREFIX_PATH"
|
||||||
|
local PACKAGE_CONFIGURE_OPTS="${package_var_name}_CONFIGURE_OPTS"
|
||||||
|
local PACKAGE_CONFIGURE_OPTS_ARRAY="${package_var_name}_CONFIGURE_OPTS_ARRAY[@]"
|
||||||
|
local PACKAGE_MAKE_OPTS="${package_var_name}_MAKE_OPTS"
|
||||||
|
local PACKAGE_MAKE_OPTS_ARRAY="${package_var_name}_MAKE_OPTS_ARRAY[@]"
|
||||||
|
local PACKAGE_CFLAGS="${package_var_name}_CFLAGS"
|
||||||
|
|
||||||
|
( if [ "${CFLAGS+defined}" ] || [ "${!PACKAGE_CFLAGS+defined}" ]; then
|
||||||
|
export CFLAGS="$CFLAGS ${!PACKAGE_CFLAGS}"
|
||||||
|
fi
|
||||||
|
${!PACKAGE_CONFIGURE:-./configure} --prefix="${!PACKAGE_PREFIX_PATH:-$PREFIX_PATH}" $CONFIGURE_OPTS ${!PACKAGE_CONFIGURE_OPTS} "${!PACKAGE_CONFIGURE_OPTS_ARRAY}"
|
||||||
|
) >&4 2>&1
|
||||||
|
|
||||||
|
{ "$MAKE" $MAKE_OPTS ${!PACKAGE_MAKE_OPTS} "${!PACKAGE_MAKE_OPTS_ARRAY}"
|
||||||
|
"$MAKE" install
|
||||||
} >&4 2>&1
|
} >&4 2>&1
|
||||||
|
|
||||||
|
# Create `python` executable if missing
|
||||||
|
if [[ "${package_name}" == "Python"* ]] || [[ "${package_name}" == "stackless"* ]]; then
|
||||||
|
if [ ! -f "$PYTHON_BIN" ]; then
|
||||||
|
local python
|
||||||
|
for python in "${PREFIX_PATH}/bin/python"*; do
|
||||||
|
if expr "$(basename "$python")" : '^python[0-9][0-9]*\.[0-9][0-9]*$' 2>&1 >/dev/null; then
|
||||||
|
( cd "${PREFIX_PATH}/bin" && ln -fs "$(basename "$python")" python )
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
build_package_autoconf() {
|
build_package_autoconf() {
|
||||||
@@ -225,26 +562,45 @@ build_package_autoconf() {
|
|||||||
build_package_python() {
|
build_package_python() {
|
||||||
local package_name="$1"
|
local package_name="$1"
|
||||||
|
|
||||||
{
|
{ "$PYTHON_BIN" setup.py install
|
||||||
"$PYTHON_BIN" setup.py install
|
|
||||||
} >&4 2>&1
|
} >&4 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
build_package_jython() {
|
build_package_jython() {
|
||||||
{
|
build_package_copy
|
||||||
build_package_copy
|
{ if [ -x "${PREFIX_PATH}/bin/jython" ] && [ ! -x "${PREFIX_PATH}/bin/python" ]; then
|
||||||
cd "${PREFIX_PATH}/bin"
|
( cd "${PREFIX_PATH}/bin" && ln -fs jython python )
|
||||||
ln -fs jython python
|
fi
|
||||||
}
|
} >&4 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
build_package_jython_builder() {
|
||||||
|
ant >&4 2>&1
|
||||||
|
( cd "dist" && build_package_jython )
|
||||||
}
|
}
|
||||||
|
|
||||||
build_package_pypy() {
|
build_package_pypy() {
|
||||||
{
|
build_package_copy
|
||||||
mkdir -p "$PREFIX_PATH"
|
{ if [ -x "${PREFIX_PATH}/bin/pypy" ] && [ ! -x "${PREFIX_PATH}/bin/python" ]; then
|
||||||
cp -R . "$PREFIX_PATH"
|
( cd "${PREFIX_PATH}/bin" && ln -fs pypy python )
|
||||||
cd "${PREFIX_PATH}/bin"
|
fi
|
||||||
ln -fs pypy python
|
} >&4 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
build_package_pypy_builder() {
|
||||||
|
if [ -f "rpython/bin/rpython" ]; then # pypy 2.x
|
||||||
|
python "rpython/bin/rpython" ${PYPY_OPTS:-"-Ojit"} "pypy/goal/targetpypystandalone.py" >&4 2>&1
|
||||||
|
elif [ -f "pypy/translator/goal/translate.py" ]; then # pypy 1.x
|
||||||
|
( cd "pypy/translator/goal" && python "translate.py" ${PYPY_OPTS:-"--opt=jit"} "targetpypystandalone.py" ) 1>&4 2>&1
|
||||||
|
else
|
||||||
|
echo "not a pypy source tree" 1>&3
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [ -x "pypy-c" ] && [ ! -x "bin/pypy" ]; then
|
||||||
|
mkdir -p "bin"
|
||||||
|
mv -f "pypy-c" "bin/pypy"
|
||||||
|
fi
|
||||||
|
build_package_pypy
|
||||||
}
|
}
|
||||||
|
|
||||||
build_package_copy() {
|
build_package_copy() {
|
||||||
@@ -252,10 +608,6 @@ build_package_copy() {
|
|||||||
cp -R . "$PREFIX_PATH"
|
cp -R . "$PREFIX_PATH"
|
||||||
}
|
}
|
||||||
|
|
||||||
bild_package_noop() {
|
|
||||||
echo "Nothing to do."
|
|
||||||
}
|
|
||||||
|
|
||||||
before_install_package() {
|
before_install_package() {
|
||||||
local stub=1
|
local stub=1
|
||||||
}
|
}
|
||||||
@@ -266,7 +618,7 @@ after_install_package() {
|
|||||||
|
|
||||||
fix_directory_permissions() {
|
fix_directory_permissions() {
|
||||||
# Ensure installed directories are not world-writable to avoid Bundler warnings
|
# Ensure installed directories are not world-writable to avoid Bundler warnings
|
||||||
find "$PREFIX_PATH" -type d -exec chmod go-w {} \;
|
find "$PREFIX_PATH" -type d \( -perm -020 -o -perm -002 \) -exec chmod go-w {} \;
|
||||||
}
|
}
|
||||||
|
|
||||||
require_gcc() {
|
require_gcc() {
|
||||||
@@ -279,25 +631,6 @@ require_gcc() {
|
|||||||
echo "find a suitable \`gcc\` executable on your system. Please install GCC"
|
echo "find a suitable \`gcc\` executable on your system. Please install GCC"
|
||||||
echo "and try again."
|
echo "and try again."
|
||||||
echo
|
echo
|
||||||
|
|
||||||
if [ "$(uname -s)" = "Darwin" ]; then
|
|
||||||
echo "${esc}[1mDETAILS${esc}[0m: Apple no longer includes the official GCC compiler with Xcode"
|
|
||||||
echo "as of version 4.2. Instead, the \`gcc\` executable is a symlink to"
|
|
||||||
echo "\`llvm-gcc\`, a modified version of GCC which outputs LLVM bytecode."
|
|
||||||
echo
|
|
||||||
echo "For most programs the \`llvm-gcc\` compiler works fine. However,"
|
|
||||||
echo "versions of Python older than 1.9.3-p125 are incompatible with"
|
|
||||||
echo "\`llvm-gcc\`. To build older versions of Python you must have the official"
|
|
||||||
echo "GCC compiler installed on your system."
|
|
||||||
echo
|
|
||||||
echo "${esc}[1mTO FIX THE PROBLEM${esc}[0m: Install the official GCC compiler using these"
|
|
||||||
echo "packages: ${esc}[4mhttps://github.com/kennethreitz/osx-gcc-installer/downloads${esc}[0m"
|
|
||||||
echo
|
|
||||||
echo "You will need to install the official GCC compiler to build older"
|
|
||||||
echo "versions of Python even if you have installed Apple's Command Line Tools"
|
|
||||||
echo "for Xcode package. The Command Line Tools for Xcode package only"
|
|
||||||
echo "includes \`llvm-gcc\`."
|
|
||||||
fi
|
|
||||||
} >&3
|
} >&3
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -346,13 +679,150 @@ verify_gcc() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if echo "$version" | grep LLVM >/dev/null; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$gcc"
|
echo "$gcc"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
has_broken_mac_openssl() {
|
||||||
|
[ "$(uname -s)" = "Darwin" ] &&
|
||||||
|
[ "$(openssl version 2>/dev/null || true)" = "OpenSSL 0.9.8r 8 Feb 2011" ] #&&
|
||||||
|
# [[ "$PYTHON_CONFIGURE_OPTS" != *--with-openssl-dir=* ]] # The "--with-*-dir=" style arguments are only effective for mkmf.rb
|
||||||
|
}
|
||||||
|
|
||||||
|
build_package_mac_openssl() {
|
||||||
|
# Install to a subdirectory since we don't want shims for bin/openssl.
|
||||||
|
OPENSSL_PREFIX_PATH="${PREFIX_PATH}/openssl"
|
||||||
|
|
||||||
|
# Put openssl.conf, certs, etc in ~/.pyenv/versions/*/openssl/ssl
|
||||||
|
OPENSSLDIR="${OPENSSLDIR:-$OPENSSL_PREFIX_PATH/ssl}"
|
||||||
|
|
||||||
|
# Tell Python to use this openssl for its extension.
|
||||||
|
package_option python configure --with-openssl-dir="$OPENSSL_PREFIX_PATH"
|
||||||
|
|
||||||
|
# Hint OpenSSL that we prefer a 64-bit build.
|
||||||
|
export KERNEL_BITS="64"
|
||||||
|
OPENSSL_CONFIGURE="${OPENSSL_CONFIGURE:-./config}"
|
||||||
|
|
||||||
|
# Compile a shared lib with zlib dynamically linked, no kerberos.
|
||||||
|
package_option openssl configure --openssldir="$OPENSSLDIR" zlib-dynamic no-krb5 shared
|
||||||
|
|
||||||
|
# Default MAKE_OPTS are -j 2 which can confuse the build. Thankfully, make
|
||||||
|
# gives precedence to the last -j option, so we can override that.
|
||||||
|
package_option openssl make -j 1
|
||||||
|
|
||||||
|
build_package_standard "$@"
|
||||||
|
|
||||||
|
# Extract root certs from the system keychain in .pem format and rehash.
|
||||||
|
local pem_file="$OPENSSLDIR/cert.pem"
|
||||||
|
security find-certificate -a -p /Library/Keychains/System.keychain > "$pem_file"
|
||||||
|
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> "$pem_file"
|
||||||
|
}
|
||||||
|
|
||||||
|
has_broken_mac_readline() {
|
||||||
|
# MacOSX 10.4 has a broken readline.
|
||||||
|
# https://github.com/yyuu/pyenv/issues/23
|
||||||
|
local retval=1
|
||||||
|
local conftest="$BUILD_PATH/has_broken_mac_readline.h"
|
||||||
|
if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
|
echo "#include <readline/rlconf.h>" > "$conftest"
|
||||||
|
"${CPP:-cpp}" $CFLAGS $CPPFLAGS $LDFLAGS "$conftest" 1>/dev/null 2>&1 || retval=0
|
||||||
|
rm -f "$conftest"
|
||||||
|
fi
|
||||||
|
return "$retval"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Post-install check for Python 2.5.x
|
||||||
|
build_package_verify_py25() {
|
||||||
|
build_package_verify_readline "$@"
|
||||||
|
build_package_verify_sqlite3 "$@"
|
||||||
|
build_package_verify_zlib "$@"
|
||||||
|
build_package_verify_bz2 "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Post-install check for Python 2.6.x
|
||||||
|
build_package_verify_py26() {
|
||||||
|
build_package_verify_py25 "$@"
|
||||||
|
build_package_verify_ssl "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Post-install check for Python 2.7.x
|
||||||
|
build_package_verify_py27() {
|
||||||
|
build_package_verify_py26 "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Post-install check for Python 3.0.x
|
||||||
|
build_package_verify_py30() {
|
||||||
|
build_package_verify_readline "$@"
|
||||||
|
build_package_verify_ssl "$@"
|
||||||
|
build_package_verify_sqlite3 "$@"
|
||||||
|
build_package_verify_zlib "$@"
|
||||||
|
build_package_verify_bz2 "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Post-install check for Python 3.1.x
|
||||||
|
build_package_verify_py31() {
|
||||||
|
build_package_verify_py30 "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Post-install check for Python 3.2.x
|
||||||
|
build_package_verify_py32() {
|
||||||
|
build_package_verify_py31 "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Post-install check for Python 3.3.x
|
||||||
|
build_package_verify_py33() {
|
||||||
|
build_package_verify_py32 "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Post-install check for Python 3.4.x
|
||||||
|
build_package_verify_py34() {
|
||||||
|
build_package_verify_py33 "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Post-install check that the readline extension was built.
|
||||||
|
build_package_verify_readline() {
|
||||||
|
"$PYTHON_BIN" -c 'try:
|
||||||
|
import readline
|
||||||
|
except ImportError:
|
||||||
|
raise(ImportError("The Python readline extension was not compiled. Missing the GNU readline lib?"))
|
||||||
|
' >&4 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Post-install check that the ssl extension was built.
|
||||||
|
build_package_verify_ssl() {
|
||||||
|
"$PYTHON_BIN" -c 'try:
|
||||||
|
import ssl
|
||||||
|
except ImportError:
|
||||||
|
raise(ImportError("The Python ssl extension was not compiled. Missing the OpenSSL lib?"))
|
||||||
|
' >&4 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Post-install check that the sqlite3 extension was built.
|
||||||
|
build_package_verify_sqlite3() {
|
||||||
|
"$PYTHON_BIN" -c 'try:
|
||||||
|
import sqlite3
|
||||||
|
except ImportError:
|
||||||
|
raise(ImportError("The Python sqlite3 extension was not compiled. Missing the SQLite3 lib?"))
|
||||||
|
' >&4 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Post-install check that the zlib extension was built.
|
||||||
|
build_package_verify_zlib() {
|
||||||
|
"$PYTHON_BIN" -c 'try:
|
||||||
|
import zlib
|
||||||
|
except ImportError:
|
||||||
|
raise(ImportError("The Python zlib extension was not compiled. Missing the zlib?"))
|
||||||
|
' >&4 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Post-install check that the bz2 extension was built.
|
||||||
|
build_package_verify_bz2() {
|
||||||
|
"$PYTHON_BIN" -c 'try:
|
||||||
|
import bz2
|
||||||
|
except ImportError:
|
||||||
|
raise(ImportError("The Python bz2 extension was not compiled. Missing the bzip2 lib?"))
|
||||||
|
' >&4 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
require_java() {
|
require_java() {
|
||||||
local java="$(locate_java || true)"
|
local java="$(locate_java || true)"
|
||||||
|
|
||||||
@@ -420,7 +890,7 @@ version() {
|
|||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
{ version
|
{ version
|
||||||
echo "usage: python-build [-k|--keep] [-v|--verbose] definition prefix"
|
echo "usage: python-build [-g|--debug] [-k|--keep] [-v|--verbose] definition prefix"
|
||||||
echo " python-build --definitions"
|
echo " python-build --definitions"
|
||||||
} >&2
|
} >&2
|
||||||
|
|
||||||
@@ -431,7 +901,7 @@ usage() {
|
|||||||
|
|
||||||
list_definitions() {
|
list_definitions() {
|
||||||
{ for definition in "${PYTHON_BUILD_ROOT}/share/python-build/"*; do
|
{ for definition in "${PYTHON_BUILD_ROOT}/share/python-build/"*; do
|
||||||
echo "${definition##*/}"
|
[ -f "${definition}" ] && echo "${definition##*/}"
|
||||||
done
|
done
|
||||||
} | sort
|
} | sort
|
||||||
}
|
}
|
||||||
@@ -441,6 +911,7 @@ list_definitions() {
|
|||||||
unset VERBOSE
|
unset VERBOSE
|
||||||
unset KEEP_BUILD_PATH
|
unset KEEP_BUILD_PATH
|
||||||
PYTHON_BUILD_ROOT="$(abs_dirname "$0")/.."
|
PYTHON_BUILD_ROOT="$(abs_dirname "$0")/.."
|
||||||
|
unset DEBUG
|
||||||
|
|
||||||
parse_options "$@"
|
parse_options "$@"
|
||||||
|
|
||||||
@@ -450,6 +921,7 @@ for option in "${OPTIONS[@]}"; do
|
|||||||
usage without_exiting
|
usage without_exiting
|
||||||
{ echo
|
{ echo
|
||||||
echo " -k/--keep Do not remove source tree after installation"
|
echo " -k/--keep Do not remove source tree after installation"
|
||||||
|
echo " -g/--debug Build a debug version"
|
||||||
echo " -v/--verbose Verbose mode: print compilation status to stdout"
|
echo " -v/--verbose Verbose mode: print compilation status to stdout"
|
||||||
echo " --definitions List all built-in definitions"
|
echo " --definitions List all built-in definitions"
|
||||||
echo
|
echo
|
||||||
@@ -466,6 +938,9 @@ for option in "${OPTIONS[@]}"; do
|
|||||||
"v" | "verbose" )
|
"v" | "verbose" )
|
||||||
VERBOSE=true
|
VERBOSE=true
|
||||||
;;
|
;;
|
||||||
|
"g" | "debug" )
|
||||||
|
DEBUG=true
|
||||||
|
;;
|
||||||
"version" )
|
"version" )
|
||||||
version
|
version
|
||||||
exit 0
|
exit 0
|
||||||
@@ -482,7 +957,7 @@ elif [ ! -e "$DEFINITION_PATH" ]; then
|
|||||||
DEFINITION_PATH="$BUILTIN_DEFINITION_PATH"
|
DEFINITION_PATH="$BUILTIN_DEFINITION_PATH"
|
||||||
else
|
else
|
||||||
echo "python-build: definition not found: ${DEFINITION_PATH}" >&2
|
echo "python-build: definition not found: ${DEFINITION_PATH}" >&2
|
||||||
exit 1
|
exit 2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -497,6 +972,37 @@ else
|
|||||||
TMP="${TMPDIR%/}"
|
TMP="${TMPDIR%/}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$MAKE" ]; then
|
||||||
|
export MAKE="make"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$PYTHON_BUILD_CACHE_PATH" ] && [ -d "$PYTHON_BUILD_CACHE_PATH" ]; then
|
||||||
|
PYTHON_BUILD_CACHE_PATH="${PYTHON_BUILD_CACHE_PATH%/}"
|
||||||
|
else
|
||||||
|
unset PYTHON_BUILD_CACHE_PATH
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$PYTHON_BUILD_MIRROR_URL" ]; then
|
||||||
|
PYTHON_BUILD_MIRROR_URL="http://yyuu.github.io/pythons"
|
||||||
|
else
|
||||||
|
PYTHON_BUILD_MIRROR_URL="${PYTHON_BUILD_MIRROR_URL%/}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$PYTHON_BUILD_SKIP_MIRROR" ]; then
|
||||||
|
unset PYTHON_BUILD_MIRROR_URL
|
||||||
|
fi
|
||||||
|
|
||||||
|
if echo test | compute_md5 >/dev/null; then
|
||||||
|
HAS_MD5_SUPPORT=1
|
||||||
|
else
|
||||||
|
unset HAS_MD5_SUPPORT
|
||||||
|
unset PYTHON_BUILD_MIRROR_URL
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$DEBUG" ]; then
|
||||||
|
CONFIGURE_OPTS+=" --with-pydebug"
|
||||||
|
fi
|
||||||
|
|
||||||
SEED="$(date "+%Y%m%d%H%M%S").$$"
|
SEED="$(date "+%Y%m%d%H%M%S").$$"
|
||||||
LOG_PATH="${TMP}/python-build.${SEED}.log"
|
LOG_PATH="${TMP}/python-build.${SEED}.log"
|
||||||
PYTHON_BIN="${PREFIX_PATH}/bin/python"
|
PYTHON_BIN="${PREFIX_PATH}/bin/python"
|
||||||
@@ -505,20 +1011,21 @@ CWD="$(pwd)"
|
|||||||
if [ -z $PYTHON_BUILD_BUILD_PATH ]; then
|
if [ -z $PYTHON_BUILD_BUILD_PATH ]; then
|
||||||
BUILD_PATH="${TMP}/python-build.${SEED}"
|
BUILD_PATH="${TMP}/python-build.${SEED}"
|
||||||
else
|
else
|
||||||
BUILD_PATH=$PYTHON_BUILD_BUILD_PATH
|
BUILD_PATH="$PYTHON_BUILD_BUILD_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec 4<> "$LOG_PATH" # open the log file at fd 4
|
exec 4<> "$LOG_PATH" # open the log file at fd 4
|
||||||
if [ -n "$VERBOSE" ]; then
|
if [ -n "$VERBOSE" ]; then
|
||||||
tail -f "$LOG_PATH" &
|
tail -f "$LOG_PATH" &
|
||||||
trap "kill 0" SIGINT SIGTERM EXIT
|
TAIL_PID=$!
|
||||||
|
trap "kill $TAIL_PID" SIGINT SIGTERM EXIT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LDFLAGS="-L'${PREFIX_PATH}/lib' ${LDFLAGS}"
|
export LDFLAGS="-L'${PREFIX_PATH}/lib' ${LDFLAGS}"
|
||||||
export CPPFLAGS="-I'${PREFIX_PATH}/include' ${CPPFLAGS}"
|
export CPPFLAGS="-I'${PREFIX_PATH}/include' ${CPPFLAGS}"
|
||||||
|
|
||||||
unset PYTHONOPT
|
unset PYTHONHOME
|
||||||
unset PYTHONLIB
|
unset PYTHONPATH
|
||||||
|
|
||||||
trap build_failed ERR
|
trap build_failed ERR
|
||||||
mkdir -p "$BUILD_PATH"
|
mkdir -p "$BUILD_PATH"
|
||||||
|
|||||||
23
plugins/python-build/install.sh
Executable file
23
plugins/python-build/install.sh
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ -z "${PREFIX}" ]; then
|
||||||
|
PREFIX="/usr/local"
|
||||||
|
fi
|
||||||
|
|
||||||
|
BIN_PATH="${PREFIX}/bin"
|
||||||
|
SHARE_PATH="${PREFIX}/share/python-build"
|
||||||
|
|
||||||
|
mkdir -p "${BIN_PATH}"
|
||||||
|
mkdir -p "${SHARE_PATH}"
|
||||||
|
|
||||||
|
for file in bin/*; do
|
||||||
|
cp "${file}" "${BIN_PATH}"
|
||||||
|
done
|
||||||
|
|
||||||
|
for file in share/python-build/*; do
|
||||||
|
cp -Rp "${file}" "${SHARE_PATH}"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Installed python-build at ${PREFIX}"
|
||||||
5
plugins/python-build/share/python-build/2.5
Normal file
5
plugins/python-build/share/python-build/2.5
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.5" "http://www.python.org/ftp/python/2.5/Python-2.5.tgz#bc1b74f90a472a6c0a85481aaeb43f95" standard verify_py25
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/2.5.1
Normal file
5
plugins/python-build/share/python-build/2.5.1
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.5.1" "http://www.python.org/ftp/python/2.5.1/Python-2.5.1.tgz#cca695828df8adc3e69b637af07522e1" standard verify_py25
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/2.5.2
Normal file
5
plugins/python-build/share/python-build/2.5.2
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.5.2" "http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tgz#3f7ca8aa86c6bd275426d63b46e07992" standard verify_py25
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/2.5.3
Normal file
5
plugins/python-build/share/python-build/2.5.3
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.5.3" "http://www.python.org/ftp/python/2.5.3/Python-2.5.3.tgz#a971f8928d6beb31ae0de56f7034d6a2" standard verify_py25
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/2.5.4
Normal file
5
plugins/python-build/share/python-build/2.5.4
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.5.4" "http://www.python.org/ftp/python/2.5.4/Python-2.5.4.tgz#ad47b23778f64edadaaa8b5534986eed" standard verify_py25
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/2.5.5
Normal file
5
plugins/python-build/share/python-build/2.5.5
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.5.5" "http://www.python.org/ftp/python/2.5.5/Python-2.5.5.tgz#abc02139ca38f4258e8e372f7da05c88" standard verify_py25
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/2.5.6
Normal file
5
plugins/python-build/share/python-build/2.5.6
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.5.6" "http://www.python.org/ftp/python/2.5.6/Python-2.5.6.tgz#d1d9c83928561addf11d00b22a18ca50" standard verify_py25
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/2.6-dev
Normal file
5
plugins/python-build/share/python-build/2.6-dev
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_hg "Python-2.6-dev" "https://bitbucket.org/mirror/cpython" "2.6" standard verify_py26
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/2.6.6
Normal file
5
plugins/python-build/share/python-build/2.6.6
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.6.6" "http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz#b2f209df270a33315e62c1ffac1937f0" standard verify_py26
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/2.6.7
Normal file
5
plugins/python-build/share/python-build/2.6.7
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.6.7" "http://www.python.org/ftp/python/2.6.7/Python-2.6.7.tgz#af474f85a3af69ea50438a2a48039d7d" standard verify_py26
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
@@ -1,14 +1,5 @@
|
|||||||
before_install_package() {
|
|
||||||
local package_name="$1"
|
|
||||||
case "$package_name" in
|
|
||||||
Python*)
|
|
||||||
fetch_url "https://raw.github.com/saghul/pythonz/346450868902fed0fe654c472b7b58e2e31fde70/pythonz/patches/all/common/patch-setup.py.diff" > setup.patch
|
|
||||||
patch -p0 < setup.patch
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
require_gcc
|
require_gcc
|
||||||
install_package "Python-2.6.8" "http://www.python.org/ftp/python/2.6.8/Python-2.6.8.tgz"
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
install_package "Python-2.6.8" "http://www.python.org/ftp/python/2.6.8/Python-2.6.8.tgz#f6c1781f5d73ab7dfa5181f43ea065f6" standard verify_py26
|
||||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
|
|||||||
5
plugins/python-build/share/python-build/2.7
Normal file
5
plugins/python-build/share/python-build/2.7
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.7" "http://www.python.org/ftp/python/2.7/Python-2.7.tgz#35f56b092ecf39a6bd59d64f142aae0f" standard verify_py27
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/2.7-dev
Normal file
5
plugins/python-build/share/python-build/2.7-dev
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_hg "Python-2.7-dev" "https://bitbucket.org/mirror/cpython" "2.7" standard verify_py27
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/2.7.1
Normal file
5
plugins/python-build/share/python-build/2.7.1
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.7.1" "http://www.python.org/ftp/python/2.7.1/Python-2.7.1.tgz#15ed56733655e3fab785e49a7278d2fb" standard verify_py27
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/2.7.2
Normal file
5
plugins/python-build/share/python-build/2.7.2
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.7.2" "http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz#0ddfe265f1b3d0a8c2459f5bf66894c7" standard verify_py27
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
require_gcc
|
require_gcc
|
||||||
install_package "Python-2.7.3" "http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz"
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
install_package "Python-2.7.3" "http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz#2cf641732ac23b18d139be077bd906cd" standard verify_py27
|
||||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
|
|||||||
5
plugins/python-build/share/python-build/2.7.4
Normal file
5
plugins/python-build/share/python-build/2.7.4
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.7.4" "http://www.python.org/ftp/python/2.7.4/Python-2.7.4.tgz#592603cfaf4490a980e93ecb92bde44a" standard verify_py27
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/2.7.5
Normal file
5
plugins/python-build/share/python-build/2.7.5
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-2.7.5" "http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz#b4f01a1d0ba0b46b05c73b2ac909b1df" standard verify_py27
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
@@ -1,14 +1,5 @@
|
|||||||
before_install_package() {
|
|
||||||
local package_name="$1"
|
|
||||||
case "$package_name" in
|
|
||||||
Python*)
|
|
||||||
fetch_url "https://raw.github.com/saghul/pythonz/346450868902fed0fe654c472b7b58e2e31fde70/pythonz/patches/all/python30/patch-setup.py.diff" > setup.patch
|
|
||||||
patch -p0 < setup.patch
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
require_gcc
|
require_gcc
|
||||||
install_package "Python-3.0.1" "http://www.python.org/ftp/python/3.0.1/Python-3.0.1.tgz"
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
install_package "Python-3.0.1" "http://www.python.org/ftp/python/3.0.1/Python-3.0.1.tgz#220b73f0a1a20c4b1cdf9f9db4cd52fe" standard verify_py30
|
||||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
|
|||||||
5
plugins/python-build/share/python-build/3.1-dev
Normal file
5
plugins/python-build/share/python-build/3.1-dev
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_hg "Python-3.1-dev" "https://bitbucket.org/mirror/cpython" "3.1" standard verify_py31
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/3.1.3
Normal file
5
plugins/python-build/share/python-build/3.1.3
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-3.1.3" "http://www.python.org/ftp/python/3.1.3/Python-3.1.3.tgz#d797fa6abe82c21227e328f05a535424" standard verify_py31
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/3.1.4
Normal file
5
plugins/python-build/share/python-build/3.1.4
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-3.1.4" "http://www.python.org/ftp/python/3.1.4/Python-3.1.4.tgz#fa9f8efdc63944c8393870282e8b5c35" standard verify_py31
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
require_gcc
|
require_gcc
|
||||||
install_package "Python-3.1.5" "http://www.python.org/ftp/python/3.1.5/Python-3.1.5.tgz"
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
install_package "Python-3.1.5" "http://www.python.org/ftp/python/3.1.5/Python-3.1.5.tgz#02196d3fc7bc76bdda68aa36b0dd16ab" standard verify_py31
|
||||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
|
|||||||
5
plugins/python-build/share/python-build/3.2
Normal file
5
plugins/python-build/share/python-build/3.2
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-3.2" "http://www.python.org/ftp/python/3.2/Python-3.2.tgz#5efe838a7878b170f6728d7e5d7517af" standard verify_py32
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/3.2-dev
Normal file
5
plugins/python-build/share/python-build/3.2-dev
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_hg "Python-3.2-dev" "https://bitbucket.org/mirror/cpython" "3.2" standard verify_py32
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/3.2.1
Normal file
5
plugins/python-build/share/python-build/3.2.1
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-3.2.1" "http://www.python.org/ftp/python/3.2.1/Python-3.2.1.tgz#6c2aa3481cadb7bdf74e625fffc352b2" standard verify_py32
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/3.2.2
Normal file
5
plugins/python-build/share/python-build/3.2.2
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-3.2.2" "http://www.python.org/ftp/python/3.2.2/Python-3.2.2.tgz#3c63a6d97333f4da35976b6a0755eb67" standard verify_py32
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
require_gcc
|
require_gcc
|
||||||
install_package "Python-3.2.3" "http://www.python.org/ftp/python/3.2.3/Python-3.2.3.tgz"
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
install_package "Python-3.2.3" "http://www.python.org/ftp/python/3.2.3/Python-3.2.3.tgz#dcf3a738e7028f1deb41b180bf0e2cbc" standard verify_py32
|
||||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
|
|||||||
5
plugins/python-build/share/python-build/3.2.4
Normal file
5
plugins/python-build/share/python-build/3.2.4
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-3.2.4" "http://www.python.org/ftp/python/3.2.4/Python-3.2.4.tgz#3af05758d0bc2b1a27249e8d622c3e91" standard verify_py32
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/3.2.5
Normal file
5
plugins/python-build/share/python-build/3.2.5
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-3.2.5" "http://www.python.org/ftp/python/3.2.5/Python-3.2.5.tgz#ed8d5529d2aebc36b53f4e0a0c9e6728" standard verify_py32
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/3.3-dev
Normal file
5
plugins/python-build/share/python-build/3.3-dev
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_hg "Python-3.3-dev" "https://bitbucket.org/mirror/cpython" "3.3" standard verify_py33
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/3.3.0
Normal file
5
plugins/python-build/share/python-build/3.3.0
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-3.3.0" "http://python.org/ftp/python/3.3.0/Python-3.3.0.tgz#198a64f7a04d1d5e95ce2782d5fd8254" standard verify_py33
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/3.3.1
Normal file
5
plugins/python-build/share/python-build/3.3.1
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-3.3.1" "http://python.org/ftp/python/3.3.1/Python-3.3.1.tgz#c19bfd6ea252b61779a4f2996fb3b330" standard verify_py33
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
5
plugins/python-build/share/python-build/3.3.2
Normal file
5
plugins/python-build/share/python-build/3.3.2
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_package "Python-3.3.2" "http://python.org/ftp/python/3.3.2/Python-3.3.2.tgz#0a2ea57f6184baf45b150aee53c0c8da" standard verify_py33
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
12
plugins/python-build/share/python-build/3.4-dev
Normal file
12
plugins/python-build/share/python-build/3.4-dev
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Python 3.4 requires "python3.4" to be executable if it is in ${PATH}.
|
||||||
|
if ! pyenv-which python3.4 1>/dev/null 2>&1; then
|
||||||
|
if pyenv-whence python3.4 1>/dev/null 2>&1; then
|
||||||
|
export PYENV_VERSION="$(pyenv-whence python3.4 2>/dev/null | tail -1)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
require_gcc
|
||||||
|
install_package "readline-6.2" "ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||||
|
install_hg "Python-3.4-dev" "https://bitbucket.org/mirror/cpython" "default" standard verify_py34
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
install_package "pip-1.3.1" "http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||||
6
plugins/python-build/share/python-build/jython-2.5-dev
Normal file
6
plugins/python-build/share/python-build/jython-2.5-dev
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
require_java
|
||||||
|
install_hg "jython-2.5-dev" "http://hg.python.org/jython" "2.5" jython_builder
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
# pip (>= 1.3) does not work properly since it uses HTTPS for downloads
|
||||||
|
# * https://github.com/yyuu/pyenv/issues/15
|
||||||
|
install_package "pip-1.2.1" "http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz#db8a6d8a4564d3dc7f337ebed67b1a85" python
|
||||||
9
plugins/python-build/share/python-build/jython-2.5.0
Normal file
9
plugins/python-build/share/python-build/jython-2.5.0
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
require_java
|
||||||
|
install_jar "Jython-2.5.0" "https://downloads.sourceforge.net/project/jython/jython/2.5.0/jython_installer-2.5.0.jar#f98b83fce9669feec69d0a17ee515a20" jython
|
||||||
|
# distribute (>= 0.33) does not support Jython prior to 2.5.2
|
||||||
|
# * https://github.com/yyuu/pyenv/issues/15
|
||||||
|
# * https://bitbucket.org/tarek/distribute/issue/367/importing-setuptoolssandbox-fails-on
|
||||||
|
install_package "distribute-0.6.32" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.32.tar.gz#acb7a2da81e3612bfb1608abe4f0e568" python
|
||||||
|
# pip (>= 1.3) does not work properly since it uses HTTPS for downloads
|
||||||
|
# * https://github.com/yyuu/pyenv/issues/15
|
||||||
|
install_package "pip-1.2.1" "http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz#db8a6d8a4564d3dc7f337ebed67b1a85" python
|
||||||
9
plugins/python-build/share/python-build/jython-2.5.1
Normal file
9
plugins/python-build/share/python-build/jython-2.5.1
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
require_java
|
||||||
|
install_jar "Jython-2.5.1" "https://downloads.sourceforge.net/project/jython/jython/2.5.1/jython_installer-2.5.1.jar#2ee978eff4306b23753b3fe9d7af5b37" jython
|
||||||
|
# distribute (>= 0.33) does not support Jython prior to 2.5.2
|
||||||
|
# * https://github.com/yyuu/pyenv/issues/15
|
||||||
|
# * https://bitbucket.org/tarek/distribute/issue/367/importing-setuptoolssandbox-fails-on
|
||||||
|
install_package "distribute-0.6.32" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.32.tar.gz#acb7a2da81e3612bfb1608abe4f0e568" python
|
||||||
|
# pip (>= 1.3) does not work properly since it uses HTTPS for downloads
|
||||||
|
# * https://github.com/yyuu/pyenv/issues/15
|
||||||
|
install_package "pip-1.2.1" "http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz#db8a6d8a4564d3dc7f337ebed67b1a85" python
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
require_java
|
require_java
|
||||||
install_jar "Jython-2.5.2" "https://downloads.sourceforge.net/project/jython/jython/2.5.2/jython_installer-2.5.2.jar" jython
|
install_jar "Jython-2.5.2" "https://downloads.sourceforge.net/project/jython/jython/2.5.2/jython_installer-2.5.2.jar#7c7d9abd8985df480edeacd27ed9dcd5" jython
|
||||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
# pip (>= 1.3) does not work properly since it uses HTTPS for downloads
|
||||||
|
# * https://github.com/yyuu/pyenv/issues/15
|
||||||
|
install_package "pip-1.2.1" "http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz#db8a6d8a4564d3dc7f337ebed67b1a85" python
|
||||||
|
|||||||
6
plugins/python-build/share/python-build/jython-2.5.3
Normal file
6
plugins/python-build/share/python-build/jython-2.5.3
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
require_java
|
||||||
|
install_jar "Jython-2.5.3" "http://search.maven.org/remotecontent?filepath=org/python/jython-installer/2.5.3/jython-installer-2.5.3.jar#41633b4557483d6d4237ee79ffcebe7b" jython
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
# pip (>= 1.3) does not work properly since it uses HTTPS for downloads
|
||||||
|
# * https://github.com/yyuu/pyenv/issues/15
|
||||||
|
install_package "pip-1.2.1" "http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz#db8a6d8a4564d3dc7f337ebed67b1a85" python
|
||||||
6
plugins/python-build/share/python-build/jython-2.5.4-rc1
Normal file
6
plugins/python-build/share/python-build/jython-2.5.4-rc1
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
require_java
|
||||||
|
install_jar "Jython-2.5.4-rc1" "http://search.maven.org/remotecontent?filepath=org/python/jython-installer/2.5.4-rc1/jython-installer-2.5.4-rc1.jar#1be8d75d02886ce1a8542bb794a20db2" jython
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
# pip (>= 1.3) does not work properly since it uses HTTPS for downloads
|
||||||
|
# * https://github.com/yyuu/pyenv/issues/15
|
||||||
|
install_package "pip-1.2.1" "http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz#db8a6d8a4564d3dc7f337ebed67b1a85" python
|
||||||
6
plugins/python-build/share/python-build/jython-2.7-beta1
Normal file
6
plugins/python-build/share/python-build/jython-2.7-beta1
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
require_java
|
||||||
|
install_jar "Jython-2.7-beta1" "http://search.maven.org/remotecontent?filepath=org/python/jython-installer/2.7-b1/jython-installer-2.7-b1.jar" jython
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
# pip (>= 1.3) does not work properly since it uses HTTPS for downloads
|
||||||
|
# * https://github.com/yyuu/pyenv/issues/15
|
||||||
|
install_package "pip-1.2.1" "http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz#db8a6d8a4564d3dc7f337ebed67b1a85" python
|
||||||
6
plugins/python-build/share/python-build/jython-dev
Normal file
6
plugins/python-build/share/python-build/jython-dev
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
require_java
|
||||||
|
install_hg "jython-dev" "http://hg.python.org/jython" "default" jython_builder
|
||||||
|
install_package "setuptools-0.7.2" "https://bitbucket.org/pypa/setuptools/downloads/setuptools-0.7.2.tar.gz#20003718b266929c4a49e5d7ba3f792c" python
|
||||||
|
# pip (>= 1.3) does not work properly since it uses HTTPS for downloads
|
||||||
|
# * https://github.com/yyuu/pyenv/issues/15
|
||||||
|
install_package "pip-1.2.1" "http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz#db8a6d8a4564d3dc7f337ebed67b1a85" python
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
--- setup.py.orig 2011-07-07 19:19:43.800122463 +0900
|
||||||
|
+++ setup.py 2011-07-07 19:25:04.548416377 +0900
|
||||||
|
@@ -13,6 +13,7 @@
|
||||||
|
from distutils.command.build_ext import build_ext
|
||||||
|
from distutils.command.install import install
|
||||||
|
from distutils.command.install_lib import install_lib
|
||||||
|
+from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
# This global variable is used to hold the list of modules to be disabled.
|
||||||
|
disabled_module_list = []
|
||||||
|
@@ -242,10 +243,34 @@
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ fp = open(tmpfile)
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ fp.close()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
diff -r -u ./Makefile.pre.in ../Python-2.5.1/Makefile.pre.in
|
||||||
|
--- ./Makefile.pre.in 2006-12-09 05:46:13.000000000 +0900
|
||||||
|
+++ ../Python-2.5.1/Makefile.pre.in 2013-05-08 19:05:06.000000000 +0900
|
||||||
|
@@ -455,7 +455,7 @@
|
||||||
|
$(SIGNAL_OBJS) \
|
||||||
|
$(MODOBJS) \
|
||||||
|
$(srcdir)/Modules/getbuildinfo.c
|
||||||
|
- $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
+ $(CC) -c $(PY_CFLAGS) -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
|
||||||
|
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
|
||||||
|
$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
|
||||||
|
diff -r -u ./Modules/getbuildinfo.c ../Python-2.5.1/Modules/getbuildinfo.c
|
||||||
|
--- ./Modules/getbuildinfo.c 2006-01-18 18:13:51.000000000 +0900
|
||||||
|
+++ ../Python-2.5.1/Modules/getbuildinfo.c 2013-05-08 19:05:31.000000000 +0900
|
||||||
|
@@ -43,6 +43,6 @@
|
||||||
|
#ifdef SVNVERSION
|
||||||
|
return SVNVERSION;
|
||||||
|
#else
|
||||||
|
- return "exported";
|
||||||
|
+ return "Unversioned directory";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
diff -r -u ./Python/sysmodule.c ../Python-2.5.1/Python/sysmodule.c
|
||||||
|
--- ./Python/sysmodule.c 2007-04-16 15:12:02.000000000 +0900
|
||||||
|
+++ ../Python-2.5.1/Python/sysmodule.c 2013-05-08 19:05:49.000000000 +0900
|
||||||
|
@@ -1011,7 +1011,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
svnversion = _Py_svnversion();
|
||||||
|
- if (strcmp(svnversion, "exported") != 0)
|
||||||
|
+ if (strcmp(svnversion, "Unversioned directory") != 0)
|
||||||
|
svn_revision = svnversion;
|
||||||
|
else if (istag) {
|
||||||
|
len = strlen(_patchlevel_revision);
|
||||||
|
diff -r -u ./configure.in ../Python-2.5.1/configure.in
|
||||||
|
--- ./configure.in 2007-03-12 19:50:51.000000000 +0900
|
||||||
|
+++ ../Python-2.5.1/configure.in 2013-05-08 19:04:36.000000000 +0900
|
||||||
|
@@ -691,7 +691,7 @@
|
||||||
|
then
|
||||||
|
SVNVERSION="svnversion \$(srcdir)"
|
||||||
|
else
|
||||||
|
- SVNVERSION="echo exported"
|
||||||
|
+ SVNVERSION="echo Unversioned directory"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $MACHDEP in
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
--- setup.py.orig 2011-07-07 19:19:43.800122463 +0900
|
||||||
|
+++ setup.py 2011-07-07 19:25:04.548416377 +0900
|
||||||
|
@@ -13,6 +13,7 @@
|
||||||
|
from distutils.command.build_ext import build_ext
|
||||||
|
from distutils.command.install import install
|
||||||
|
from distutils.command.install_lib import install_lib
|
||||||
|
+from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
# This global variable is used to hold the list of modules to be disabled.
|
||||||
|
disabled_module_list = []
|
||||||
|
@@ -242,10 +243,34 @@
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ fp = open(tmpfile)
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ fp.close()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
--- configure.in
|
||||||
|
+++ configure.in
|
||||||
|
@@ -767,7 +767,7 @@
|
||||||
|
then
|
||||||
|
SVNVERSION="svnversion \$(srcdir)"
|
||||||
|
else
|
||||||
|
- SVNVERSION="echo exported"
|
||||||
|
+ SVNVERSION="echo Unversioned directory"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $MACHDEP in
|
||||||
|
--- Makefile.pre.in
|
||||||
|
+++ Makefile.pre.in
|
||||||
|
@@ -501,7 +501,7 @@
|
||||||
|
$(SIGNAL_OBJS) \
|
||||||
|
$(MODOBJS) \
|
||||||
|
$(srcdir)/Modules/getbuildinfo.c
|
||||||
|
- $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
+ $(CC) -c $(PY_CFLAGS) -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
|
||||||
|
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
|
||||||
|
$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
|
||||||
|
--- Modules/getbuildinfo.c
|
||||||
|
+++ Modules/getbuildinfo.c
|
||||||
|
@@ -48,5 +48,5 @@
|
||||||
|
static const char svnversion[] = SVNVERSION;
|
||||||
|
if (svnversion[0] != '$')
|
||||||
|
return svnversion; /* it was interpolated, or passed on command line */
|
||||||
|
- return "exported";
|
||||||
|
+ return "Unversioned directory";
|
||||||
|
}
|
||||||
|
--- Python/sysmodule.c
|
||||||
|
+++ Python/sysmodule.c
|
||||||
|
@@ -1161,7 +1161,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
svnversion = _Py_svnversion();
|
||||||
|
- if (strcmp(svnversion, "exported") != 0)
|
||||||
|
+ if (strcmp(svnversion, "Unversioned directory") != 0 && strcmp(svnversion, "exported") != 0)
|
||||||
|
svn_revision = svnversion;
|
||||||
|
else if (istag) {
|
||||||
|
len = strlen(_patchlevel_revision);
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
--- setup.py.orig 2011-07-07 19:19:43.800122463 +0900
|
||||||
|
+++ setup.py 2011-07-07 19:25:04.548416377 +0900
|
||||||
|
@@ -13,6 +13,7 @@
|
||||||
|
from distutils.command.build_ext import build_ext
|
||||||
|
from distutils.command.install import install
|
||||||
|
from distutils.command.install_lib import install_lib
|
||||||
|
+from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
# This global variable is used to hold the list of modules to be disabled.
|
||||||
|
disabled_module_list = []
|
||||||
|
@@ -242,10 +243,34 @@
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ fp = open(tmpfile)
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ fp.close()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
--- configure.in
|
||||||
|
+++ configure.in
|
||||||
|
@@ -767,7 +767,7 @@
|
||||||
|
then
|
||||||
|
SVNVERSION="svnversion \$(srcdir)"
|
||||||
|
else
|
||||||
|
- SVNVERSION="echo exported"
|
||||||
|
+ SVNVERSION="echo Unversioned directory"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $MACHDEP in
|
||||||
|
--- Makefile.pre.in
|
||||||
|
+++ Makefile.pre.in
|
||||||
|
@@ -501,7 +501,7 @@
|
||||||
|
$(SIGNAL_OBJS) \
|
||||||
|
$(MODOBJS) \
|
||||||
|
$(srcdir)/Modules/getbuildinfo.c
|
||||||
|
- $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
+ $(CC) -c $(PY_CFLAGS) -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
|
||||||
|
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
|
||||||
|
$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
|
||||||
|
--- Modules/getbuildinfo.c
|
||||||
|
+++ Modules/getbuildinfo.c
|
||||||
|
@@ -48,5 +48,5 @@
|
||||||
|
static const char svnversion[] = SVNVERSION;
|
||||||
|
if (svnversion[0] != '$')
|
||||||
|
return svnversion; /* it was interpolated, or passed on command line */
|
||||||
|
- return "exported";
|
||||||
|
+ return "Unversioned directory";
|
||||||
|
}
|
||||||
|
--- Python/sysmodule.c
|
||||||
|
+++ Python/sysmodule.c
|
||||||
|
@@ -1161,7 +1161,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
svnversion = _Py_svnversion();
|
||||||
|
- if (strcmp(svnversion, "exported") != 0)
|
||||||
|
+ if (strcmp(svnversion, "Unversioned directory") != 0 && strcmp(svnversion, "exported") != 0)
|
||||||
|
svn_revision = svnversion;
|
||||||
|
else if (istag) {
|
||||||
|
len = strlen(_patchlevel_revision);
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
--- setup.py.orig 2011-07-07 19:19:43.800122463 +0900
|
||||||
|
+++ setup.py 2011-07-07 19:25:04.548416377 +0900
|
||||||
|
@@ -13,6 +13,7 @@
|
||||||
|
from distutils.command.build_ext import build_ext
|
||||||
|
from distutils.command.install import install
|
||||||
|
from distutils.command.install_lib import install_lib
|
||||||
|
+from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
# This global variable is used to hold the list of modules to be disabled.
|
||||||
|
disabled_module_list = []
|
||||||
|
@@ -242,10 +243,34 @@
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ fp = open(tmpfile)
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ fp.close()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
--- configure.in
|
||||||
|
+++ configure.in
|
||||||
|
@@ -767,7 +767,7 @@
|
||||||
|
then
|
||||||
|
SVNVERSION="svnversion \$(srcdir)"
|
||||||
|
else
|
||||||
|
- SVNVERSION="echo exported"
|
||||||
|
+ SVNVERSION="echo Unversioned directory"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $MACHDEP in
|
||||||
|
--- Makefile.pre.in
|
||||||
|
+++ Makefile.pre.in
|
||||||
|
@@ -501,7 +501,7 @@
|
||||||
|
$(SIGNAL_OBJS) \
|
||||||
|
$(MODOBJS) \
|
||||||
|
$(srcdir)/Modules/getbuildinfo.c
|
||||||
|
- $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
+ $(CC) -c $(PY_CFLAGS) -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
|
||||||
|
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
|
||||||
|
$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
|
||||||
|
--- Modules/getbuildinfo.c
|
||||||
|
+++ Modules/getbuildinfo.c
|
||||||
|
@@ -48,5 +48,5 @@
|
||||||
|
static const char svnversion[] = SVNVERSION;
|
||||||
|
if (svnversion[0] != '$')
|
||||||
|
return svnversion; /* it was interpolated, or passed on command line */
|
||||||
|
- return "exported";
|
||||||
|
+ return "Unversioned directory";
|
||||||
|
}
|
||||||
|
--- Python/sysmodule.c
|
||||||
|
+++ Python/sysmodule.c
|
||||||
|
@@ -1161,7 +1161,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
svnversion = _Py_svnversion();
|
||||||
|
- if (strcmp(svnversion, "exported") != 0)
|
||||||
|
+ if (strcmp(svnversion, "Unversioned directory") != 0 && strcmp(svnversion, "exported") != 0)
|
||||||
|
svn_revision = svnversion;
|
||||||
|
else if (istag) {
|
||||||
|
len = strlen(_patchlevel_revision);
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
--- setup.py.orig 2011-07-07 19:19:43.800122463 +0900
|
||||||
|
+++ setup.py 2011-07-07 19:25:04.548416377 +0900
|
||||||
|
@@ -13,6 +13,7 @@
|
||||||
|
from distutils.command.build_ext import build_ext
|
||||||
|
from distutils.command.install import install
|
||||||
|
from distutils.command.install_lib import install_lib
|
||||||
|
+from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
# This global variable is used to hold the list of modules to be disabled.
|
||||||
|
disabled_module_list = []
|
||||||
|
@@ -242,10 +243,34 @@
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ fp = open(tmpfile)
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ fp.close()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
--- configure.in
|
||||||
|
+++ configure.in
|
||||||
|
@@ -767,7 +767,7 @@
|
||||||
|
then
|
||||||
|
SVNVERSION="svnversion \$(srcdir)"
|
||||||
|
else
|
||||||
|
- SVNVERSION="echo exported"
|
||||||
|
+ SVNVERSION="echo Unversioned directory"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $MACHDEP in
|
||||||
|
--- Makefile.pre.in
|
||||||
|
+++ Makefile.pre.in
|
||||||
|
@@ -501,7 +501,7 @@
|
||||||
|
$(SIGNAL_OBJS) \
|
||||||
|
$(MODOBJS) \
|
||||||
|
$(srcdir)/Modules/getbuildinfo.c
|
||||||
|
- $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
+ $(CC) -c $(PY_CFLAGS) -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
|
||||||
|
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
|
||||||
|
$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
|
||||||
|
--- Modules/getbuildinfo.c
|
||||||
|
+++ Modules/getbuildinfo.c
|
||||||
|
@@ -48,5 +48,5 @@
|
||||||
|
static const char svnversion[] = SVNVERSION;
|
||||||
|
if (svnversion[0] != '$')
|
||||||
|
return svnversion; /* it was interpolated, or passed on command line */
|
||||||
|
- return "exported";
|
||||||
|
+ return "Unversioned directory";
|
||||||
|
}
|
||||||
|
--- Python/sysmodule.c
|
||||||
|
+++ Python/sysmodule.c
|
||||||
|
@@ -1161,7 +1161,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
svnversion = _Py_svnversion();
|
||||||
|
- if (strcmp(svnversion, "exported") != 0)
|
||||||
|
+ if (strcmp(svnversion, "Unversioned directory") != 0 && strcmp(svnversion, "exported") != 0)
|
||||||
|
svn_revision = svnversion;
|
||||||
|
else if (istag) {
|
||||||
|
len = strlen(_patchlevel_revision);
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
--- setup.py.orig 2011-07-07 19:19:43.800122463 +0900
|
||||||
|
+++ setup.py 2011-07-07 19:25:04.548416377 +0900
|
||||||
|
@@ -13,6 +13,7 @@
|
||||||
|
from distutils.command.build_ext import build_ext
|
||||||
|
from distutils.command.install import install
|
||||||
|
from distutils.command.install_lib import install_lib
|
||||||
|
+from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
# This global variable is used to hold the list of modules to be disabled.
|
||||||
|
disabled_module_list = []
|
||||||
|
@@ -242,10 +243,34 @@
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ fp = open(tmpfile)
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ fp.close()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
--- configure.in
|
||||||
|
+++ configure.in
|
||||||
|
@@ -767,7 +767,7 @@
|
||||||
|
then
|
||||||
|
SVNVERSION="svnversion \$(srcdir)"
|
||||||
|
else
|
||||||
|
- SVNVERSION="echo exported"
|
||||||
|
+ SVNVERSION="echo Unversioned directory"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $MACHDEP in
|
||||||
|
--- Makefile.pre.in
|
||||||
|
+++ Makefile.pre.in
|
||||||
|
@@ -501,7 +501,7 @@
|
||||||
|
$(SIGNAL_OBJS) \
|
||||||
|
$(MODOBJS) \
|
||||||
|
$(srcdir)/Modules/getbuildinfo.c
|
||||||
|
- $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
+ $(CC) -c $(PY_CFLAGS) -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
|
||||||
|
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
|
||||||
|
$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
|
||||||
|
--- Modules/getbuildinfo.c
|
||||||
|
+++ Modules/getbuildinfo.c
|
||||||
|
@@ -48,5 +48,5 @@
|
||||||
|
static const char svnversion[] = SVNVERSION;
|
||||||
|
if (svnversion[0] != '$')
|
||||||
|
return svnversion; /* it was interpolated, or passed on command line */
|
||||||
|
- return "exported";
|
||||||
|
+ return "Unversioned directory";
|
||||||
|
}
|
||||||
|
--- Python/sysmodule.c
|
||||||
|
+++ Python/sysmodule.c
|
||||||
|
@@ -1161,7 +1161,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
svnversion = _Py_svnversion();
|
||||||
|
- if (strcmp(svnversion, "exported") != 0)
|
||||||
|
+ if (strcmp(svnversion, "Unversioned directory") != 0 && strcmp(svnversion, "exported") != 0)
|
||||||
|
svn_revision = svnversion;
|
||||||
|
else if (istag) {
|
||||||
|
len = strlen(_patchlevel_revision);
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
--- setup.py.orig 2011-07-07 19:19:43.800122463 +0900
|
||||||
|
+++ setup.py 2011-07-07 19:25:04.548416377 +0900
|
||||||
|
@@ -13,6 +13,7 @@
|
||||||
|
from distutils.command.build_ext import build_ext
|
||||||
|
from distutils.command.install import install
|
||||||
|
from distutils.command.install_lib import install_lib
|
||||||
|
+from distutils.spawn import find_executable
|
||||||
|
|
||||||
|
# This global variable is used to hold the list of modules to be disabled.
|
||||||
|
disabled_module_list = []
|
||||||
|
@@ -242,10 +243,34 @@
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ fp = open(tmpfile)
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ fp.close()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
diff -r -u ./Makefile.pre.in ../Python-2.5/Makefile.pre.in
|
||||||
|
--- ./Makefile.pre.in 2006-07-31 01:20:10.000000000 +0900
|
||||||
|
+++ ../Python-2.5/Makefile.pre.in 2013-05-08 19:19:27.000000000 +0900
|
||||||
|
@@ -455,7 +455,7 @@
|
||||||
|
$(SIGNAL_OBJS) \
|
||||||
|
$(MODOBJS) \
|
||||||
|
$(srcdir)/Modules/getbuildinfo.c
|
||||||
|
- $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LANG=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
+ $(CC) -c $(PY_CFLAGS) -DSVNVERSION="\"`LANG=C $(SVNVERSION)`\"" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
|
||||||
|
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
|
||||||
|
$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
|
||||||
|
diff -r -u ./Modules/getbuildinfo.c ../Python-2.5/Modules/getbuildinfo.c
|
||||||
|
--- ./Modules/getbuildinfo.c 2006-01-18 18:13:51.000000000 +0900
|
||||||
|
+++ ../Python-2.5/Modules/getbuildinfo.c 2013-05-08 19:19:40.000000000 +0900
|
||||||
|
@@ -43,6 +43,6 @@
|
||||||
|
#ifdef SVNVERSION
|
||||||
|
return SVNVERSION;
|
||||||
|
#else
|
||||||
|
- return "exported";
|
||||||
|
+ return "Unversioned directory";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
diff -r -u ./Python/sysmodule.c ../Python-2.5/Python/sysmodule.c
|
||||||
|
--- ./Python/sysmodule.c 2006-07-21 14:32:28.000000000 +0900
|
||||||
|
+++ ../Python-2.5/Python/sysmodule.c 2013-05-08 19:19:55.000000000 +0900
|
||||||
|
@@ -1009,7 +1009,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
svnversion = _Py_svnversion();
|
||||||
|
- if (strcmp(svnversion, "exported") != 0)
|
||||||
|
+ if (strcmp(svnversion, "Unversioned directory") != 0)
|
||||||
|
svn_revision = svnversion;
|
||||||
|
else if (istag) {
|
||||||
|
len = strlen(_patchlevel_revision);
|
||||||
|
diff -r -u ./configure.in ../Python-2.5/configure.in
|
||||||
|
--- ./configure.in 2006-09-05 11:54:42.000000000 +0900
|
||||||
|
+++ ../Python-2.5/configure.in 2013-05-08 19:20:05.000000000 +0900
|
||||||
|
@@ -686,7 +686,7 @@
|
||||||
|
then
|
||||||
|
SVNVERSION="svnversion \$(srcdir)"
|
||||||
|
else
|
||||||
|
- SVNVERSION="echo exported"
|
||||||
|
+ SVNVERSION="echo Unversioned directory"
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $MACHDEP in
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
# HG changeset patch
|
||||||
|
# User Barry Warsaw <barry@python.org>
|
||||||
|
# Date 1302190091 14400
|
||||||
|
# Node ID bd0f73a9538e05f526feaf05821e68bdcff498fa
|
||||||
|
# Parent 2e4cdaffe493e879fb5367a4aa454491de451137
|
||||||
|
Backport for Python 2.7 of issue 11715 support for building Python on
|
||||||
|
multiarch Debian/Ubuntu.
|
||||||
|
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
--- setup.py.orig
|
||||||
|
+++ setup.py
|
||||||
|
@@ -345,10 +345,33 @@ class PyBuildExt(build_ext):
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ with open(tmpfile) as fp:
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
|
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
diff -r -u ./Lib/ssl.py ../Python-2.6.8/Lib/ssl.py
|
||||||
|
--- ./Lib/ssl.py 2012-04-11 00:32:06.000000000 +0900
|
||||||
|
+++ ../Python-2.6.8/Lib/ssl.py 2013-05-08 19:44:49.000000000 +0900
|
||||||
|
@@ -61,7 +61,19 @@
|
||||||
|
|
||||||
|
from _ssl import SSLError
|
||||||
|
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
|
||||||
|
-from _ssl import PROTOCOL_SSLv2, PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
|
||||||
|
+from _ssl import PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
|
||||||
|
+_PROTOCOL_NAMES = {
|
||||||
|
+ PROTOCOL_TLSv1: "TLSv1",
|
||||||
|
+ PROTOCOL_SSLv23: "SSLv23",
|
||||||
|
+ PROTOCOL_SSLv3: "SSLv3",
|
||||||
|
+}
|
||||||
|
+try:
|
||||||
|
+ from _ssl import PROTOCOL_SSLv2
|
||||||
|
+ _SSLv2_IF_EXISTS = PROTOCOL_SSLv2
|
||||||
|
+except ImportError:
|
||||||
|
+ _SSLv2_IF_EXISTS = None
|
||||||
|
+else:
|
||||||
|
+ _PROTOCOL_NAMES[PROTOCOL_SSLv2] = "SSLv2"
|
||||||
|
from _ssl import RAND_status, RAND_egd, RAND_add
|
||||||
|
from _ssl import \
|
||||||
|
SSL_ERROR_ZERO_RETURN, \
|
||||||
|
@@ -402,16 +414,7 @@
|
||||||
|
return DER_cert_to_PEM_cert(dercert)
|
||||||
|
|
||||||
|
def get_protocol_name(protocol_code):
|
||||||
|
- if protocol_code == PROTOCOL_TLSv1:
|
||||||
|
- return "TLSv1"
|
||||||
|
- elif protocol_code == PROTOCOL_SSLv23:
|
||||||
|
- return "SSLv23"
|
||||||
|
- elif protocol_code == PROTOCOL_SSLv2:
|
||||||
|
- return "SSLv2"
|
||||||
|
- elif protocol_code == PROTOCOL_SSLv3:
|
||||||
|
- return "SSLv3"
|
||||||
|
- else:
|
||||||
|
- return "<unknown>"
|
||||||
|
+ return _PROTOCOL_NAMES.get(protocol_code, '<unknown>')
|
||||||
|
|
||||||
|
|
||||||
|
# a replacement for the old socket.ssl function
|
||||||
|
diff -r -u ./Modules/_ssl.c ../Python-2.6.8/Modules/_ssl.c
|
||||||
|
--- ./Modules/_ssl.c 2012-04-11 00:32:09.000000000 +0900
|
||||||
|
+++ ../Python-2.6.8/Modules/_ssl.c 2013-05-08 17:34:38.000000000 +0900
|
||||||
|
@@ -62,7 +62,9 @@
|
||||||
|
};
|
||||||
|
|
||||||
|
enum py_ssl_version {
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PY_SSL_VERSION_SSL2,
|
||||||
|
+#endif
|
||||||
|
PY_SSL_VERSION_SSL3,
|
||||||
|
PY_SSL_VERSION_SSL23,
|
||||||
|
PY_SSL_VERSION_TLS1
|
||||||
|
@@ -302,8 +304,10 @@
|
||||||
|
self->ctx = SSL_CTX_new(TLSv1_method()); /* Set up context */
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL3)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv3_method()); /* Set up context */
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL2)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */
|
||||||
|
+#endif
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL23)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */
|
||||||
|
PySSL_END_ALLOW_THREADS
|
||||||
|
@@ -1688,8 +1692,10 @@
|
||||||
|
PY_SSL_CERT_REQUIRED);
|
||||||
|
|
||||||
|
/* protocol versions */
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv2",
|
||||||
|
PY_SSL_VERSION_SSL2);
|
||||||
|
+#endif
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv3",
|
||||||
|
PY_SSL_VERSION_SSL3);
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv23",
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
# HG changeset patch
|
||||||
|
# User Barry Warsaw <barry@python.org>
|
||||||
|
# Date 1302190091 14400
|
||||||
|
# Node ID bd0f73a9538e05f526feaf05821e68bdcff498fa
|
||||||
|
# Parent 2e4cdaffe493e879fb5367a4aa454491de451137
|
||||||
|
Backport for Python 2.7 of issue 11715 support for building Python on
|
||||||
|
multiarch Debian/Ubuntu.
|
||||||
|
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
--- setup.py.orig
|
||||||
|
+++ setup.py
|
||||||
|
@@ -345,10 +345,33 @@ class PyBuildExt(build_ext):
|
||||||
|
return platform
|
||||||
|
return sys.platform
|
||||||
|
|
||||||
|
+ def add_multiarch_paths(self):
|
||||||
|
+ # Debian/Ubuntu multiarch support.
|
||||||
|
+ # https://wiki.ubuntu.com/MultiarchSpec
|
||||||
|
+ if not find_executable('dpkg-architecture'):
|
||||||
|
+ return
|
||||||
|
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
|
||||||
|
+ if not os.path.exists(self.build_temp):
|
||||||
|
+ os.makedirs(self.build_temp)
|
||||||
|
+ ret = os.system(
|
||||||
|
+ 'dpkg-architecture -qDEB_HOST_MULTIARCH > %s 2> /dev/null' %
|
||||||
|
+ tmpfile)
|
||||||
|
+ try:
|
||||||
|
+ if ret >> 8 == 0:
|
||||||
|
+ with open(tmpfile) as fp:
|
||||||
|
+ multiarch_path_component = fp.readline().strip()
|
||||||
|
+ add_dir_to_list(self.compiler.library_dirs,
|
||||||
|
+ '/usr/lib/' + multiarch_path_component)
|
||||||
|
+ add_dir_to_list(self.compiler.include_dirs,
|
||||||
|
+ '/usr/include/' + multiarch_path_component)
|
||||||
|
+ finally:
|
||||||
|
+ os.unlink(tmpfile)
|
||||||
|
+
|
||||||
|
def detect_modules(self):
|
||||||
|
# Ensure that /usr/local is always used
|
||||||
|
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
|
||||||
|
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||||
|
+ self.add_multiarch_paths()
|
||||||
|
|
||||||
|
# Add paths specified in the environment variables LDFLAGS and
|
||||||
|
# CPPFLAGS for header and library files.
|
||||||
|
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
diff -r -u ./Lib/ssl.py ../Python-2.6.8/Lib/ssl.py
|
||||||
|
--- ./Lib/ssl.py 2012-04-11 00:32:06.000000000 +0900
|
||||||
|
+++ ../Python-2.6.8/Lib/ssl.py 2013-05-08 19:44:49.000000000 +0900
|
||||||
|
@@ -61,7 +61,19 @@
|
||||||
|
|
||||||
|
from _ssl import SSLError
|
||||||
|
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
|
||||||
|
-from _ssl import PROTOCOL_SSLv2, PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
|
||||||
|
+from _ssl import PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
|
||||||
|
+_PROTOCOL_NAMES = {
|
||||||
|
+ PROTOCOL_TLSv1: "TLSv1",
|
||||||
|
+ PROTOCOL_SSLv23: "SSLv23",
|
||||||
|
+ PROTOCOL_SSLv3: "SSLv3",
|
||||||
|
+}
|
||||||
|
+try:
|
||||||
|
+ from _ssl import PROTOCOL_SSLv2
|
||||||
|
+ _SSLv2_IF_EXISTS = PROTOCOL_SSLv2
|
||||||
|
+except ImportError:
|
||||||
|
+ _SSLv2_IF_EXISTS = None
|
||||||
|
+else:
|
||||||
|
+ _PROTOCOL_NAMES[PROTOCOL_SSLv2] = "SSLv2"
|
||||||
|
from _ssl import RAND_status, RAND_egd, RAND_add
|
||||||
|
from _ssl import \
|
||||||
|
SSL_ERROR_ZERO_RETURN, \
|
||||||
|
@@ -402,16 +414,7 @@
|
||||||
|
return DER_cert_to_PEM_cert(dercert)
|
||||||
|
|
||||||
|
def get_protocol_name(protocol_code):
|
||||||
|
- if protocol_code == PROTOCOL_TLSv1:
|
||||||
|
- return "TLSv1"
|
||||||
|
- elif protocol_code == PROTOCOL_SSLv23:
|
||||||
|
- return "SSLv23"
|
||||||
|
- elif protocol_code == PROTOCOL_SSLv2:
|
||||||
|
- return "SSLv2"
|
||||||
|
- elif protocol_code == PROTOCOL_SSLv3:
|
||||||
|
- return "SSLv3"
|
||||||
|
- else:
|
||||||
|
- return "<unknown>"
|
||||||
|
+ return _PROTOCOL_NAMES.get(protocol_code, '<unknown>')
|
||||||
|
|
||||||
|
|
||||||
|
# a replacement for the old socket.ssl function
|
||||||
|
diff -r -u ./Modules/_ssl.c ../Python-2.6.8/Modules/_ssl.c
|
||||||
|
--- ./Modules/_ssl.c 2012-04-11 00:32:09.000000000 +0900
|
||||||
|
+++ ../Python-2.6.8/Modules/_ssl.c 2013-05-08 17:34:38.000000000 +0900
|
||||||
|
@@ -62,7 +62,9 @@
|
||||||
|
};
|
||||||
|
|
||||||
|
enum py_ssl_version {
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PY_SSL_VERSION_SSL2,
|
||||||
|
+#endif
|
||||||
|
PY_SSL_VERSION_SSL3,
|
||||||
|
PY_SSL_VERSION_SSL23,
|
||||||
|
PY_SSL_VERSION_TLS1
|
||||||
|
@@ -302,8 +304,10 @@
|
||||||
|
self->ctx = SSL_CTX_new(TLSv1_method()); /* Set up context */
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL3)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv3_method()); /* Set up context */
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL2)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */
|
||||||
|
+#endif
|
||||||
|
else if (proto_version == PY_SSL_VERSION_SSL23)
|
||||||
|
self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */
|
||||||
|
PySSL_END_ALLOW_THREADS
|
||||||
|
@@ -1688,8 +1692,10 @@
|
||||||
|
PY_SSL_CERT_REQUIRED);
|
||||||
|
|
||||||
|
/* protocol versions */
|
||||||
|
+#ifndef OPENSSL_NO_SSL2
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv2",
|
||||||
|
PY_SSL_VERSION_SSL2);
|
||||||
|
+#endif
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv3",
|
||||||
|
PY_SSL_VERSION_SSL3);
|
||||||
|
PyModule_AddIntConstant(m, "PROTOCOL_SSLv23",
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user