mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-08 11:33:49 -05:00
Compare commits
161 Commits
v0.1.1
...
v0.4.0-201
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce66352f6d | ||
|
|
9e133adf99 | ||
|
|
b1851f2aff | ||
|
|
b943e0abff | ||
|
|
d6d556911b | ||
|
|
b8ecd2d6dd | ||
|
|
1e5ef005fb | ||
|
|
d11db0f0f2 | ||
|
|
8e43e72082 | ||
|
|
ae86a253e2 | ||
|
|
0c38147fcb | ||
|
|
e1ea64b0b9 | ||
|
|
fa35e792c1 | ||
|
|
f5807424c2 | ||
|
|
4c006959fa | ||
|
|
f9a19e3f24 | ||
|
|
d5c24f5122 | ||
|
|
392e404cc6 | ||
|
|
b04e067c83 | ||
|
|
ed2937f4d1 | ||
|
|
8848006540 | ||
|
|
7a4fe458b8 | ||
|
|
f76faa88b8 | ||
|
|
9ce760c798 | ||
|
|
152ebe6e61 | ||
|
|
1a6eb80bcd | ||
|
|
745bceac22 | ||
|
|
583f3b0e21 | ||
|
|
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 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
#/plugins
|
||||
/cache
|
||||
/shims
|
||||
/version
|
||||
/versions
|
||||
/sources
|
||||
|
||||
52
CHANGELOG.md
Normal file
52
CHANGELOG.md
Normal file
@@ -0,0 +1,52 @@
|
||||
## Version History
|
||||
|
||||
#### 0.4.0-20130726
|
||||
|
||||
* pyenv: Fix minor issue of variable scope in `pyenv versions`
|
||||
* python-build: Update base version to ruby-build v20130628
|
||||
* python-build: Use brew managed OpenSSL and GNU Readline if they are available
|
||||
* python-build: Fix build of CPython 3.3+ on OS X (#29)
|
||||
* python-build: Fix build of native modules of CPython 2.5 on OS X (#33)
|
||||
* python-build: Fix build of CPython 2.6+ on openSUSE (#36)
|
||||
* python-build: Add ancient versions; 2.4.2 and 2.4.6. The build might be broken. (#37)
|
||||
* python-build: Update default pip version (1.3.1 -> 1.4)
|
||||
* python-build: Update default setuptools version (0.7.2 -> 0.9.7)
|
||||
|
||||
#### 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) 2012 Yamashita, Yuu
|
||||
Copyright (c) 2013 Yamashita, Yuu
|
||||
Copyright (c) 2013 Sam Stephenson
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
344
README.md
344
README.md
@@ -4,12 +4,12 @@ pyenv lets you easily switch between multiple versions of Python. It's
|
||||
simple, unobtrusive, and follows the UNIX tradition of single-purpose
|
||||
tools that do one thing well.
|
||||
|
||||
This project was forked from [rbenv](https://github.com/sstephenson/rbenv) and.
|
||||
[ruby-build](https://github.com/sstephenson/ruby-build) and modified for Python.
|
||||
This project was forked from [rbenv](https://github.com/sstephenson/rbenv) and
|
||||
[ruby-build](https://github.com/sstephenson/ruby-build), and modified for Python.
|
||||
|
||||
<img src="http://gyazo.com/9c829fafdf5e58880c820349c4e9197e.png?1346414267" width="849" height="454">
|
||||
|
||||
### pyenv _does…_
|
||||
### pyenv _does..._
|
||||
|
||||
* Let you **change the global Python version** on a per-user basis.
|
||||
* Provide support for **per-project Python versions**.
|
||||
@@ -18,49 +18,130 @@ This project was forked from [rbenv](https://github.com/sstephenson/rbenv) and.
|
||||
* 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
|
||||
|
||||
* [1 How It Works](#section_1)
|
||||
* [2 Installation](#section_2)
|
||||
* [2.1 Basic GitHub Checkout](#section_2.1)
|
||||
* [2.1.1 Upgrading](#section_2.1.1)
|
||||
* [2.2 Neckbeard Configuration](#section_2.3)
|
||||
* [3 Usage](#section_3)
|
||||
* [3.1 pyenv global](#section_3.1)
|
||||
* [3.2 pyenv local](#section_3.2)
|
||||
* [3.3 pyenv shell](#section_3.3)
|
||||
* [3.4 pyenv versions](#section_3.4)
|
||||
* [3.5 pyenv version](#section_3.5)
|
||||
* [3.6 pyenv rehash](#section_3.6)
|
||||
* [3.7 pyenv which](#section_3.7)
|
||||
* [3.8 pyenv whence](#section_3.8)
|
||||
* [4 Development](#section_4)
|
||||
* [4.1 Version History](#section_4.1)
|
||||
* [4.2 License](#section_4.2)
|
||||
* [How It Works](#how-it-works)
|
||||
* [Understanding PATH](#understanding-path)
|
||||
* [Understanding Shims](#understanding-shims)
|
||||
* [Choosing the Python Version](#choosing-the-python-version)
|
||||
* [Locating the Python Installation](#locating-the-python-installation)
|
||||
* [Installation](#installation)
|
||||
* [Basic GitHub Checkout](#basic-github-checkout)
|
||||
* [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
|
||||
pyenv correspond to subdirectories of `~/.pyenv/versions`. For
|
||||
example, you might have `~/.pyenv/versions/2.7.3` and
|
||||
`~/.pyenv/versions/2.7.3`.
|
||||
At a high level, pyenv intercepts Python commands using shim
|
||||
executables injected into your `PATH`, determines which Python version
|
||||
has been specified by your application, and passes your commands along
|
||||
to the correct Python installation.
|
||||
|
||||
Each version is a working tree with its own binaries, like
|
||||
`~/.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.
|
||||
### Understanding PATH
|
||||
|
||||
These shims are simple wrapper scripts that live in `~/.pyenv/shims`
|
||||
and detect which Python version you want to use. They insert the
|
||||
directory for the selected version at the beginning of your `$PATH`
|
||||
and then execute the corresponding binary.
|
||||
When you run a command like `python` or `pip`, your operating system
|
||||
searches through a list of directories to find an executable file with
|
||||
that name. This list of directories lives in an environment variable
|
||||
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
|
||||
pyenv is `~/.pyenv/shims` in your `$PATH`.
|
||||
/usr/local/bin:/usr/bin:/bin
|
||||
|
||||
## <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
|
||||
easy to fork and contribute any changes back upstream.
|
||||
@@ -89,17 +170,20 @@ easy to fork and contribute any changes back upstream.
|
||||
$ exec $SHELL
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
#### <a name="section_2.1.1"></a> 2.1.1 Upgrading
|
||||
#### Upgrading
|
||||
|
||||
If you've installed pyenv using the instructions above, you can
|
||||
upgrade your installation at any time using git.
|
||||
@@ -118,7 +202,24 @@ tag:
|
||||
v0.1.0
|
||||
$ git checkout v0.1.0
|
||||
|
||||
### <a name="section_2.2"></a> 2.2 Neckbeard Configuration
|
||||
### Homebrew on Mac OS X
|
||||
|
||||
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.
|
||||
@@ -150,19 +251,68 @@ opposed to this idea. Here's what `pyenv init` actually does:
|
||||
Run `pyenv init -` for yourself to see exactly what happens under the
|
||||
hood.
|
||||
|
||||
## <a name="section_3"></a> 3 Usage
|
||||
### 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:
|
||||
|
||||
### <a name="section_3.1"></a> 3.1 pyenv global
|
||||
### 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 a per-project `.pyenv-version` file, or by setting the
|
||||
`PYENV_VERSION` environment variable.
|
||||
overridden by an application-specific `.python-version` file, or by
|
||||
setting the `PYENV_VERSION` environment variable.
|
||||
|
||||
$ pyenv global 2.7.3
|
||||
$ pyenv global 2.7.5
|
||||
|
||||
The special version name `system` tells pyenv to use the system Python
|
||||
(detected by searching your `$PATH`).
|
||||
@@ -170,40 +320,27 @@ The special version name `system` tells pyenv to use the system Python
|
||||
When run without a version number, `pyenv global` reports the
|
||||
currently configured global version.
|
||||
|
||||
_pyenv extension_
|
||||
**pyenv feature**
|
||||
|
||||
You can specify multiple versions for global Python. Commands within
|
||||
these versions are searched by specified order.
|
||||
You can specify multiple versions as global Python. Commands
|
||||
within these Python versions are searched by specified order.
|
||||
|
||||
$ pyenv global 2.7.3 3.2.3
|
||||
$ pyenv global 2.7.5 3.2.5
|
||||
$ pyenv global
|
||||
2.7.3
|
||||
3.2.3
|
||||
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
|
||||
|
||||
### <a name="section_3.2"></a> 3.2 pyenv local
|
||||
|
||||
Sets a local per-project Python version by writing the version name to
|
||||
an `.pyenv-version` file in the current directory. This version
|
||||
overrides the global, and can be overridden itself by setting the
|
||||
`PYENV_VERSION` environment variable or with the `pyenv shell`
|
||||
command.
|
||||
|
||||
$ pyenv local rbx-1.2.4
|
||||
|
||||
When run without a version number, `pyenv local` reports the currently
|
||||
configured local version. You can also unset the local version:
|
||||
|
||||
$ pyenv local --unset
|
||||
|
||||
_pyenv extension_
|
||||
|
||||
You can specify multiple versions for local Python.
|
||||
|
||||
### <a name="section_3.3"></a> 3.3 pyenv shell
|
||||
### pyenv shell
|
||||
|
||||
Sets a shell-specific Python version by setting the `PYENV_VERSION`
|
||||
environment variable in your shell. This version overrides both
|
||||
project-specific versions and the global version.
|
||||
environment variable in your shell. This version overrides
|
||||
application-specific versions and the global version.
|
||||
|
||||
$ pyenv shell pypy-1.9
|
||||
|
||||
@@ -219,7 +356,19 @@ prefer not to use shell integration, you may simply set the
|
||||
|
||||
$ export PYENV_VERSION=pypy-1.9
|
||||
|
||||
### <a name="section_3.4"></a> 3.4 pyenv versions
|
||||
**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.
|
||||
@@ -227,45 +376,45 @@ the currently active version.
|
||||
$ pyenv versions
|
||||
2.5.6
|
||||
2.6.8
|
||||
* 2.7.3 (set by /home/yyuu/.pyenv/version)
|
||||
3.2.3
|
||||
* 2.7.5 (set by /home/yyuu/.pyenv/version)
|
||||
3.2.5
|
||||
jython-2.5.3
|
||||
pypy-1.9
|
||||
|
||||
### <a name="section_3.5"></a> 3.5 pyenv version
|
||||
### pyenv version
|
||||
|
||||
Displays the currently active Python version, along with information on
|
||||
how it was set.
|
||||
|
||||
$ pyenv version
|
||||
2.7.3 (set by /home/yyuu/.pyenv/version)
|
||||
2.7.5 (set by /home/yyuu/.pyenv/version)
|
||||
|
||||
### <a name="section_3.6"></a> 3.6 pyenv rehash
|
||||
### 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 gem that provides binaries.
|
||||
version of Python, or install a package that provides binaries.
|
||||
|
||||
$ pyenv rehash
|
||||
|
||||
### <a name="section_3.7"></a> 3.7 pyenv which
|
||||
### pyenv which
|
||||
|
||||
Displays the full path to the binary that pyenv will execute when you
|
||||
run the given command.
|
||||
Displays the full path to the executable that pyenv will invoke when
|
||||
you run the given command.
|
||||
|
||||
$ pyenv which python3.2
|
||||
/Users/sam/.pyenv/versions/3.2.3/bin/python3.2
|
||||
/home/yyuu/.pyenv/versions/3.2.5/bin/python3.2
|
||||
|
||||
### <a name="section_3.8"></a> 3.8 pyenv whence
|
||||
### pyenv whence
|
||||
|
||||
Lists all Python versions with the given command installed.
|
||||
|
||||
$ pyenv whence 2to3
|
||||
2.6.8
|
||||
2.7.3
|
||||
3.2.3
|
||||
2.7.5
|
||||
3.2.5
|
||||
|
||||
## <a name="section_4"></a> 4 Development
|
||||
## Development
|
||||
|
||||
The pyenv source code is [hosted on
|
||||
GitHub](https://github.com/yyuu/pyenv). It's clean, modular,
|
||||
@@ -274,22 +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
|
||||
tracker](https://github.com/yyuu/pyenv/issues).
|
||||
|
||||
### <a name="section_4.1"></a> 4.1 Version History
|
||||
### Version History
|
||||
|
||||
**0.1.1** (September 3, 2012)
|
||||
See CHANGELOG.md.
|
||||
|
||||
* Support multiple versions of Python at a time.
|
||||
|
||||
**0.1.0** (August 31, 2012)
|
||||
|
||||
* Initial public release.
|
||||
|
||||
### <a name="section_4.2"></a> 4.2 License
|
||||
### License
|
||||
|
||||
(The MIT license)
|
||||
|
||||
* Copyright (c) 2011 Sam Stephenson
|
||||
* Copyright (c) 2012 Yamashita, Yuu
|
||||
* Copyright (c) 2013 Yamashita, Yuu
|
||||
* Copyright (c) 2013 Sam Stephenson
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
||||
@@ -13,4 +13,11 @@
|
||||
|
||||
set -e
|
||||
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 "$@"
|
||||
|
||||
@@ -5,8 +5,10 @@ _pyenv() {
|
||||
if [ "$COMP_CWORD" -eq 1 ]; then
|
||||
COMPREPLY=( $(compgen -W "$(pyenv commands)" -- "$word") )
|
||||
else
|
||||
local command="${COMP_WORDS[1]}"
|
||||
local completions="$(pyenv completions "$command")"
|
||||
local words=("${COMP_WORDS[@]}")
|
||||
unset words[0]
|
||||
unset words[$COMP_CWORD]
|
||||
local completions=$(pyenv completions "${words[@]}")
|
||||
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -5,14 +5,13 @@ fi
|
||||
compctl -K _pyenv pyenv
|
||||
|
||||
_pyenv() {
|
||||
local word words completions
|
||||
local words completions
|
||||
read -cA words
|
||||
word="${words[2]}"
|
||||
|
||||
if [ "${#words}" -eq 2 ]; then
|
||||
completions="$(pyenv commands)"
|
||||
else
|
||||
completions="$(pyenv completions "${word}")"
|
||||
completions="$(pyenv completions "${words[2,-2]}")"
|
||||
fi
|
||||
|
||||
reply=("${(ps:\n:)completions}")
|
||||
|
||||
@@ -60,7 +60,10 @@ shopt -u nullglob
|
||||
command="$1"
|
||||
case "$command" in
|
||||
"" | "-h" | "--help" )
|
||||
echo -e "pyenv 0.1.1\n$(pyenv-help)" >&2
|
||||
echo -e "$(pyenv---version)\n$(pyenv-help)" >&2
|
||||
;;
|
||||
"-v" )
|
||||
exec pyenv---version
|
||||
;;
|
||||
* )
|
||||
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-20130726"
|
||||
|
||||
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
|
||||
# Summary: List all available pyenv commands
|
||||
# Usage: pyenv commands [--sh|--no-sh]
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# Usage: pyenv completions <command> [arg1 arg2...]
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
COMMAND="$1"
|
||||
if [ -z "$COMMAND" ]; then
|
||||
echo "usage: pyenv completions COMMAND [arg1 arg2...]" >&2
|
||||
pyenv-help --usage completions >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,4 +1,18 @@
|
||||
#!/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
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
@@ -7,9 +21,11 @@ if [ "$1" = "--complete" ]; then
|
||||
exec pyenv shims --short
|
||||
fi
|
||||
|
||||
export PYENV_VERSION="$(pyenv-version-name)"
|
||||
PYENV_COMMAND="$1"
|
||||
|
||||
if [ -z "$PYENV_COMMAND" ]; then
|
||||
echo "usage: pyenv exec COMMAND [arg1 arg2...]" >&2
|
||||
pyenv-help --usage exec >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -21,5 +37,7 @@ for script in $(pyenv-hooks exec); do
|
||||
done
|
||||
|
||||
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" "$@"
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
#!/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
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
@@ -8,19 +21,19 @@ if [ "$1" = "--complete" ]; then
|
||||
exec pyenv-versions --bare
|
||||
fi
|
||||
|
||||
PYENV_VERSION=($@)
|
||||
versions=($@)
|
||||
PYENV_VERSION_FILE="${PYENV_ROOT}/version"
|
||||
|
||||
if [ -n "$PYENV_VERSION" ]; then
|
||||
pyenv-version-file-write "$PYENV_VERSION_FILE" "${PYENV_VERSION[@]}"
|
||||
if [ -n "$versions" ]; then
|
||||
pyenv-version-file-write "$PYENV_VERSION_FILE" "${versions[@]}"
|
||||
else
|
||||
IFS=: PYENV_VERSION=($(
|
||||
IFS=: versions=($(
|
||||
pyenv-version-file-read "$PYENV_VERSION_FILE" ||
|
||||
pyenv-version-file-read "${PYENV_ROOT}/global" ||
|
||||
pyenv-version-file-read "${PYENV_ROOT}/default" ||
|
||||
echo system
|
||||
))
|
||||
for version in "${PYENV_VERSION[@]}"; do
|
||||
for version in "${versions[@]}"; do
|
||||
echo "$version"
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -1,99 +1,162 @@
|
||||
#!/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
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
print_set_version() {
|
||||
echo "<version> should be a string matching a Python version known by pyenv."
|
||||
|
||||
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"
|
||||
command_path() {
|
||||
local command="$1"
|
||||
command -v pyenv-"$command" || command -v pyenv-sh-"$command" || true
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"") echo "usage: pyenv <command> [<args>]
|
||||
extract_initial_comment_block() {
|
||||
sed -ne "
|
||||
/^#/ !{
|
||||
q
|
||||
}
|
||||
|
||||
Some useful pyenv commands are:
|
||||
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
|
||||
s/^#$/# /
|
||||
|
||||
See 'pyenv help <command>' for information on a specific command.
|
||||
For full documentation, see: https://github.com/sstephenson/pyenv#readme"
|
||||
;;
|
||||
commands) echo "usage: pyenv commands
|
||||
pyenv commands --sh
|
||||
pyenv commands --no-sh
|
||||
/^# / {
|
||||
s/^# //
|
||||
p
|
||||
}
|
||||
"
|
||||
}
|
||||
|
||||
List all pyenv commands."
|
||||
;;
|
||||
global) echo "usage: pyenv global <version>
|
||||
collect_documentation() {
|
||||
awk '
|
||||
/^Summary:/ {
|
||||
summary = substr($0, 10)
|
||||
next
|
||||
}
|
||||
|
||||
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.
|
||||
/^Usage:/ {
|
||||
reading_usage = 1
|
||||
usage = usage "\n" $0
|
||||
next
|
||||
}
|
||||
|
||||
$(print_set_version)"
|
||||
;;
|
||||
local) echo "usage: pyenv local <version>
|
||||
pyenv local --unset
|
||||
/^( *$| )/ && reading_usage {
|
||||
usage = usage "\n" $0
|
||||
next
|
||||
}
|
||||
|
||||
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'
|
||||
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', or the version specified in the
|
||||
PYENV_VERSION environment variable.
|
||||
function escape(str) {
|
||||
gsub(/[`\\$"]/, "\\\\&", str)
|
||||
return str
|
||||
}
|
||||
|
||||
$(print_set_version)"
|
||||
;;
|
||||
shell) echo "usage: pyenv shell <version>
|
||||
pyenv shell --unset
|
||||
function trim(str) {
|
||||
gsub(/^\n*/, "", str)
|
||||
gsub(/\n*$/, "", str)
|
||||
return str
|
||||
}
|
||||
|
||||
Sets a shell-specific Python version by setting the 'PYENV_VERSION'
|
||||
environment variable in your shell. This version overrides both
|
||||
project-specific versions and the global version.
|
||||
END {
|
||||
if (usage || summary) {
|
||||
print "summary=\"" escape(summary) "\""
|
||||
print "usage=\"" escape(trim(usage)) "\""
|
||||
print "help=\"" escape(trim(help)) "\""
|
||||
}
|
||||
}
|
||||
'
|
||||
}
|
||||
|
||||
$(print_set_version)"
|
||||
;;
|
||||
versions) echo "usage: pyenv versions
|
||||
pyenv versions --bare
|
||||
|
||||
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'"
|
||||
documentation_for() {
|
||||
local filename="$(command_path "$1")"
|
||||
if [ -n "$filename" ]; then
|
||||
extract_initial_comment_block < "$filename" | collect_documentation
|
||||
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
|
||||
# Summary: List hook scripts for a given pyenv command
|
||||
# Usage: pyenv hooks <command>
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
@@ -12,7 +15,7 @@ fi
|
||||
|
||||
PYENV_COMMAND="$1"
|
||||
if [ -z "$PYENV_COMMAND" ]; then
|
||||
echo "usage: pyenv hooks COMMAND" >&2
|
||||
pyenv-help --usage hooks >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# Summary: Configure the shell environment for pyenv
|
||||
# Usage: eval "$(pyenv init - [--no-rehash] [<shell>])"
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
@@ -82,11 +85,12 @@ if [ -z "$no_rehash" ]; then
|
||||
echo 'pyenv rehash 2>/dev/null'
|
||||
fi
|
||||
|
||||
commands=(`pyenv commands --sh`)
|
||||
commands=(`pyenv-commands --sh`)
|
||||
IFS="|"
|
||||
cat <<EOS
|
||||
pyenv() {
|
||||
local command="\$1"
|
||||
typeset command
|
||||
command="\$1"
|
||||
if [ "\$#" -gt 0 ]; then
|
||||
shift
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,28 @@
|
||||
#!/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
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
@@ -9,21 +33,27 @@ if [ "$1" = "--complete" ]; then
|
||||
exec pyenv-versions --bare
|
||||
fi
|
||||
|
||||
PYENV_VERSION=($@)
|
||||
PYENV_VERSION_FILE=".pyenv-version"
|
||||
versions=($@)
|
||||
|
||||
if [ "$PYENV_VERSION" = "--unset" ]; then
|
||||
rm -f "$PYENV_VERSION_FILE"
|
||||
elif [ -n "$PYENV_VERSION" ]; then
|
||||
pyenv-version-file-write "$PYENV_VERSION_FILE" "${PYENV_VERSION[@]}"
|
||||
if [ "$versions" = "--unset" ]; then
|
||||
rm -f .python-version .pyenv-version
|
||||
elif [ -n "$versions" ]; then
|
||||
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
|
||||
IFS=: PYENV_VERSION=($(
|
||||
pyenv-version-file-read "$PYENV_VERSION_FILE" ||
|
||||
IFS=: versions=($(
|
||||
pyenv-version-file-read .python-version ||
|
||||
pyenv-version-file-read .pyenv-version ||
|
||||
{ echo "pyenv: no local version configured for this directory"
|
||||
exit 1
|
||||
} >&2
|
||||
))
|
||||
for version in "${PYENV_VERSION[@]}"; do
|
||||
for version in "${versions[@]}"; do
|
||||
echo "$version"
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
#!/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
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
@@ -9,20 +16,21 @@ if [ "$1" = "--complete" ]; then
|
||||
fi
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
export PYENV_VERSION=($@)
|
||||
versions=($@)
|
||||
IFS=: PYENV_VERSION="${versions[*]}"
|
||||
export PYENV_VERSION
|
||||
else
|
||||
IFS=: PYENV_VERSION=($(pyenv-version-name))
|
||||
fi
|
||||
|
||||
if [ "$PYENV_VERSION" = "system" ]; then
|
||||
PYTHON_PATH="$(pyenv-which python)"
|
||||
echo "${PYTHON_PATH%/*}"
|
||||
exit
|
||||
IFS=: versions=($(pyenv-version-name))
|
||||
fi
|
||||
|
||||
PYENV_PREFIX_PATHS=()
|
||||
for version in "${PYENV_VERSION[@]}"; do
|
||||
PYENV_PREFIX_PATH="${PYENV_ROOT}/versions/${version}"
|
||||
for version in "${versions[@]}"; do
|
||||
if [ "$version" = "system" ]; then
|
||||
PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python || true)"
|
||||
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
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Summary: Rehash pyenv shims (run this after installing executables)
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
@@ -30,19 +32,48 @@ remove_prototype_shim() {
|
||||
|
||||
# The prototype shim file is a script that re-execs itself, passing
|
||||
# its filename and any arguments to `pyenv exec`. This file is
|
||||
# hard-linked for every binary and then removed. The linking technique
|
||||
# is fast, uses less disk space than unique files, and also serves as
|
||||
# a locking mechanism.
|
||||
# hard-linked for every executable and then removed. The linking
|
||||
# technique is fast, uses less disk space than unique files, and also
|
||||
# serves as a locking mechanism.
|
||||
create_prototype_shim() {
|
||||
cat > "$PROTOTYPE_SHIM_PATH" <<SH
|
||||
#!/usr/bin/env bash
|
||||
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"
|
||||
exec pyenv exec "\${0##*/}" "\$@"
|
||||
exec "$(command -v pyenv)" exec "\$program" "\$@"
|
||||
SH
|
||||
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
|
||||
# registered for installation as a shim. In this way, plugins may call
|
||||
# `make_shims` with a glob to register many shims at once.
|
||||
@@ -55,58 +86,27 @@ make_shims() {
|
||||
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_index=""
|
||||
|
||||
# We will keep track of shims registered for installation with the
|
||||
# global `reigstered_shims` array and with a global variable for each
|
||||
# shim. The array will let us iterate over all registered shims. The
|
||||
# global variables will let us quickly check whether a shim with the
|
||||
# given name has been registered or not.
|
||||
# global `reigstered_shims` array and with a global search index
|
||||
# string. The array will let us iterate over all registered shims. The
|
||||
# index string will let us quickly check whether a shim with the given
|
||||
# name has been registered or not.
|
||||
register_shim() {
|
||||
local shim="$@"
|
||||
local var="$(shim_variable_name "$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"
|
||||
registered_shims["${#registered_shims[@]}"]="$shim"
|
||||
registered_shims_index="$registered_shims_index/$shim/"
|
||||
}
|
||||
|
||||
# To install all the registered shims, we iterate over the
|
||||
# `registered_shims` array and create a link if one does not already
|
||||
# exist.
|
||||
install_registered_shims() {
|
||||
local shim
|
||||
for shim in "${registered_shims[@]}"; do
|
||||
[ -e "$shim" ] || ln -f "$PROTOTYPE_SHIM_PATH" "$shim"
|
||||
done
|
||||
@@ -117,10 +117,9 @@ install_registered_shims() {
|
||||
# in the directory but has not been registered as a shim should be
|
||||
# removed.
|
||||
remove_stale_shims() {
|
||||
local var
|
||||
local shim
|
||||
for shim in *; do
|
||||
var="$(shim_variable_name "$shim")"
|
||||
if [ -z "${!var}" ]; then
|
||||
if [[ "$registered_shims_index" != *"/$shim/"* ]]; then
|
||||
rm -f "$shim"
|
||||
fi
|
||||
done
|
||||
@@ -129,10 +128,12 @@ remove_stale_shims() {
|
||||
|
||||
# Change to the shims directory.
|
||||
cd "$SHIM_PATH"
|
||||
|
||||
# Create the prototype shim, then register shims for all known binaries.
|
||||
create_prototype_shim
|
||||
shopt -s nullglob
|
||||
|
||||
# Create the prototype shim, then register shims for all known
|
||||
# executables.
|
||||
create_prototype_shim
|
||||
remove_outdated_shims
|
||||
make_shims ../versions/*/bin/*
|
||||
|
||||
# Restore the previous working directory.
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
# Summary: Display the root directory where versions and shims are kept
|
||||
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
|
||||
#
|
||||
# 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
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
@@ -9,9 +23,9 @@ if [ "$1" = "--complete" ]; then
|
||||
exec pyenv-versions --bare
|
||||
fi
|
||||
|
||||
version="$1"
|
||||
versions=("$@")
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
if [ -z "$versions" ]; then
|
||||
if [ -z "$PYENV_VERSION" ]; then
|
||||
echo "pyenv: no shell-specific version configured" >&2
|
||||
exit 1
|
||||
@@ -21,12 +35,16 @@ if [ -z "$version" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$version" = "--unset" ]; then
|
||||
if [ "$versions" = "--unset" ]; then
|
||||
echo "unset PYENV_VERSION"
|
||||
exit 1
|
||||
exit
|
||||
fi
|
||||
|
||||
# Make sure the specified version is installed.
|
||||
pyenv-prefix $version >/dev/null
|
||||
|
||||
echo "export PYENV_VERSION=\"${version}\""
|
||||
if pyenv-prefix "${versions[@]}" >/dev/null; then
|
||||
IFS=: PYENV_VERSION="${versions[*]}"
|
||||
echo "export PYENV_VERSION=\"${PYENV_VERSION}\""
|
||||
else
|
||||
echo "return 1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# Summary: List existing pyenv shims
|
||||
# Usage: pyenv shims [--short]
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
#!/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
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
|
||||
@@ -1,15 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
# Summary: Detect the file that sets the current pyenv version
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
root="$PYENV_DIR"
|
||||
while [ -n "$root" ]; do
|
||||
if [ -e "${root}/.pyenv-version" ]; then
|
||||
echo "${root}/.pyenv-version"
|
||||
exit
|
||||
fi
|
||||
root="${root%/*}"
|
||||
done
|
||||
find_local_version_file() {
|
||||
local root="$1"
|
||||
while [ -n "$root" ]; do
|
||||
if [ -e "${root}/.python-version" ]; then
|
||||
echo "${root}/.python-version"
|
||||
exit
|
||||
elif [ -e "${root}/.pyenv-version" ]; then
|
||||
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"
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# Usage: pyenv version-file-read <file>
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
VERSION_FILE="$1"
|
||||
|
||||
if [ -e "$VERSION_FILE" ]; then
|
||||
# Read and print the first non-whitespace word from the specified
|
||||
# version file.
|
||||
# Read the first non-whitespace word from the specified version file.
|
||||
# Be careful not to load it whole in case there's something crazy in it.
|
||||
versions=()
|
||||
while read -a words; do
|
||||
word="${words[0]}"
|
||||
|
||||
@@ -1,26 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
# Usage: pyenv version-file-write <file> <version>
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
PYENV_VERSION_FILE="$1"
|
||||
shift
|
||||
PYENV_VERSION=()
|
||||
for version in "$@"; do
|
||||
PYENV_VERSION=("${PYENV_VERSION[@]}" "$version")
|
||||
done
|
||||
versions=("$@")
|
||||
|
||||
if [ -z "$PYENV_VERSION" ] || [ -z "$PYENV_VERSION_FILE" ]; then
|
||||
echo "usage: pyenv write-version-file FILENAME VERSIONS..." >&2
|
||||
if [ -z "$versions" ] || [ -z "$PYENV_VERSION_FILE" ]; then
|
||||
pyenv-help --usage version-file-write >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Make sure the specified version is installed.
|
||||
for version in "${PYENV_VERSION[@]}"; do
|
||||
pyenv-prefix "$version" >/dev/null
|
||||
done
|
||||
pyenv-prefix "${versions[@]}" >/dev/null
|
||||
|
||||
# Write the version out to disk.
|
||||
rm -f "$PYENV_VERSION_FILE"
|
||||
for version in "${PYENV_VERSION[@]}"; do
|
||||
for version in "${versions[@]}"; do
|
||||
echo "$version" >> "$PYENV_VERSION_FILE"
|
||||
done
|
||||
|
||||
@@ -1,24 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
# Summary: Show the current Python version
|
||||
set -e
|
||||
[ -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)"
|
||||
IFS=: 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
|
||||
|
||||
if [ -z "$PYENV_VERSION" ] || [ "$PYENV_VERSION" = "system" ] ; then
|
||||
if [ -z "$versions" ]; then
|
||||
echo "system"
|
||||
exit
|
||||
fi
|
||||
|
||||
for version in "${PYENV_VERSION[@]}"; do
|
||||
PYENV_VERSION_PATH="${PYENV_ROOT}/versions/${version}"
|
||||
version_exists() {
|
||||
local version="$1"
|
||||
[ -d "${PYENV_ROOT}/versions/${version}" ]
|
||||
}
|
||||
|
||||
if [ ! -d "$PYENV_VERSION_PATH" ]; then
|
||||
for version in "${versions[@]}"; do
|
||||
if [ "$version" != "system" ] && ! version_exists "$version"; then
|
||||
echo "pyenv: version \`$version' is not installed" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
IFS=: echo "${PYENV_VERSION[*]}"
|
||||
echo "${PYENV_VERSION}"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Summary: Explain how the current Python version is set
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
|
||||
@@ -1,27 +1,50 @@
|
||||
#!/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
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
IFS=: PYENV_VERSION_NAMES=($(pyenv-version-name))
|
||||
|
||||
if [ "$1" = "--bare" ]; then
|
||||
hit_prefix=""
|
||||
miss_prefix=""
|
||||
print_version="$PYENV_VERSION_NAMES"
|
||||
current_versions=()
|
||||
version_origin=""
|
||||
include_system=""
|
||||
else
|
||||
hit_prefix="* "
|
||||
miss_prefix=" "
|
||||
print_version="$PYENV_VERSION_NAMES (set by $(pyenv-version-origin))"
|
||||
current_versions=($(IFS=:; for version in $(pyenv-version-name); do echo "$version"; done || 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
|
||||
|
||||
for path in "${PYENV_ROOT}/versions/"*; do
|
||||
if [ -d "$path" ]; then
|
||||
version="${path##*/}"
|
||||
|
||||
if [ "$version" == "$PYENV_VERSION_NAMES" ]; then
|
||||
echo "${hit_prefix}${print_version}"
|
||||
else
|
||||
echo "${miss_prefix}${version}"
|
||||
fi
|
||||
print_version "${path##*/}"
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# Summary: List all Python versions that contain the given executable
|
||||
# Usage: pyenv whence [--path] <command>
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
@@ -27,7 +30,7 @@ whence() {
|
||||
|
||||
PYENV_COMMAND="$1"
|
||||
if [ -z "$PYENV_COMMAND" ]; then
|
||||
echo "usage: pyenv whence [--path] COMMAND" >&2
|
||||
pyenv-help --usage whence >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
#!/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
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
@@ -41,23 +49,23 @@ remove_from_path() {
|
||||
}
|
||||
|
||||
IFS=: versions=($(pyenv-version-name))
|
||||
PYENV_VERSION=("${versions[@]}")
|
||||
IFS=: PYENV_VERSION="${versions[*]}"
|
||||
PYENV_COMMAND="$1"
|
||||
|
||||
if [ -z "$PYENV_COMMAND" ]; then
|
||||
echo "usage: pyenv which COMMAND" >&2
|
||||
pyenv-help --usage which >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for version in "${PYENV_VERSION[@]}"; do
|
||||
for version in "${versions[@]}"; do
|
||||
if [ "$version" = "system" ]; then
|
||||
PATH="$(remote_from_path "${PYENV_ROOT}/shims")"
|
||||
PYENV_COMMAND_PATH="$(command -v "$PYENV_COMMAND")"
|
||||
PATH="$(remove_from_path "${PYENV_ROOT}/shims")"
|
||||
PYENV_COMMAND_PATH="$(command -v "$PYENV_COMMAND" || true)"
|
||||
else
|
||||
PYENV_COMMAND_PATH="${PYENV_ROOT}/versions/${version}/bin/${PYENV_COMMAND}"
|
||||
if [ -x "$PYENV_COMMAND_PATH" ]; then
|
||||
break
|
||||
fi
|
||||
fi
|
||||
if [ -x "$PYENV_COMMAND_PATH" ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -69,5 +77,15 @@ if [ -x "$PYENV_COMMAND_PATH" ]; then
|
||||
echo "$PYENV_COMMAND_PATH"
|
||||
else
|
||||
echo "pyenv: $PYENV_COMMAND: command not found" >&2
|
||||
|
||||
versions="$(pyenv-whence "$PYENV_COMMAND" || true)"
|
||||
if [ -n "$versions" ]; then
|
||||
{ echo
|
||||
echo "The \`$1' command exists in these Python versions:"
|
||||
echo "$versions" | sed 's/^/ /g'
|
||||
echo
|
||||
} >&2
|
||||
fi
|
||||
|
||||
exit 127
|
||||
fi
|
||||
|
||||
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
|
||||
#
|
||||
# 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
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
@@ -15,22 +33,24 @@ fi
|
||||
eval "$(python-build --lib)"
|
||||
|
||||
usage() {
|
||||
{ echo "usage: pyenv install [-k|--keep] [-v|--verbose] VERSION"
|
||||
echo " pyenv install [-k|--keep] [-v|--verbose] /path/to/definition"
|
||||
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
|
||||
|
||||
# We can remove the sed fallback once pyenv 0.4.0 is widely available.
|
||||
pyenv-help install 2>/dev/null || sed -ne '/^#/!q;s/.//;s/.//;1,4d;p' < "$0"
|
||||
[ -z "$1" ] || exit "$1"
|
||||
}
|
||||
|
||||
definitions() {
|
||||
local query="$1"
|
||||
python-build --definitions | grep -F "$query" || true
|
||||
}
|
||||
|
||||
indent() {
|
||||
sed 's/^/ /'
|
||||
}
|
||||
|
||||
unset FORCE
|
||||
unset KEEP
|
||||
unset VERBOSE
|
||||
unset DEBUG
|
||||
|
||||
parse_options "$@"
|
||||
for option in "${OPTIONS[@]}"; do
|
||||
@@ -40,15 +60,21 @@ for option in "${OPTIONS[@]}"; do
|
||||
;;
|
||||
"l" | "list" )
|
||||
echo "Available versions:"
|
||||
python-build --definitions | sed 's/^/ /'
|
||||
definitions | indent
|
||||
exit
|
||||
;;
|
||||
"f" | "force" )
|
||||
FORCE=true
|
||||
;;
|
||||
"k" | "keep" )
|
||||
[ -n "${PYENV_BUILD_ROOT}" ] || PYENV_BUILD_ROOT="${PYENV_ROOT}/sources"
|
||||
;;
|
||||
"v" | "verbose" )
|
||||
VERBOSE="-v"
|
||||
;;
|
||||
"g" | "debug" )
|
||||
DEBUG="-g"
|
||||
;;
|
||||
"version" )
|
||||
exec python-build --version
|
||||
;;
|
||||
@@ -58,21 +84,116 @@ for option in "${OPTIONS[@]}"; do
|
||||
esac
|
||||
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]}"
|
||||
[ -n "$DEFINITION" ] || DEFINITION="$(pyenv local 2>/dev/null || true)"
|
||||
[ -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
|
||||
source "$script"
|
||||
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}"
|
||||
|
||||
# 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
|
||||
export PYTHON_BUILD_BUILD_PATH="${PYENV_BUILD_ROOT}/${VERSION_NAME}"
|
||||
KEEP="-k"
|
||||
fi
|
||||
|
||||
python-build $KEEP $VERBOSE "$DEFINITION" "$PREFIX"
|
||||
pyenv rehash
|
||||
# Set PYTHON_BUILD_CACHE_PATH to $PYENV_ROOT/cache, if the directory
|
||||
# exists and the variable is not already set.
|
||||
if [ -z "${PYTHON_BUILD_CACHE_PATH}" ] && [ -d "${PYENV_ROOT}/cache" ]; then
|
||||
export PYTHON_BUILD_CACHE_PATH="${PYENV_ROOT}/cache"
|
||||
fi
|
||||
|
||||
# Default PYENV_VERSION to the globally-specified Python version. (The
|
||||
# CPython installer requires an existing Python installation to run. An
|
||||
# unsatisfied local .python-version file can cause the installer to
|
||||
# fail.)
|
||||
#export PYENV_VERSION="$(pyenv global 2>/dev/null || true)"
|
||||
|
||||
|
||||
# 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
|
||||
#
|
||||
# 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
|
||||
|
||||
# Provide pyenv completions
|
||||
@@ -11,7 +22,7 @@ if [ -z "$PYENV_ROOT" ]; then
|
||||
fi
|
||||
|
||||
unset FORCE
|
||||
if [ "$1" = "-f" ]; then
|
||||
if [ "$1" = "-f" ] || [ "$1" = "--force" ]; then
|
||||
FORCE=true
|
||||
shift
|
||||
fi
|
||||
@@ -19,15 +30,9 @@ fi
|
||||
DEFINITION="$1"
|
||||
case "$DEFINITION" in
|
||||
"" | -* )
|
||||
{ echo "usage: pyenv uninstall [-f] VERSION"
|
||||
echo
|
||||
echo " -f Attempt to remove the specified version without prompting"
|
||||
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
|
||||
# We can remove the sed fallback once pyenv 0.4.0 is widely available.
|
||||
{ pyenv-help uninstall 2>/dev/null ||
|
||||
sed -ne '/^#/!q;s/.\{1,2\}//;1,4d;p' < "$0"
|
||||
} >&2
|
||||
exit 1
|
||||
;;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
PYTHON_BUILD_VERSION="20120815"
|
||||
PYTHON_BUILD_VERSION="20130628"
|
||||
|
||||
set -E
|
||||
exec 3<&2 # preserve original stderr at fd 3
|
||||
@@ -57,6 +57,14 @@ abs_dirname() {
|
||||
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() {
|
||||
{ echo
|
||||
echo "BUILD FAILED"
|
||||
@@ -89,15 +97,27 @@ file_is_not_empty() {
|
||||
}
|
||||
|
||||
install_package() {
|
||||
install_package_using "tarball" 1 $*
|
||||
install_package_using "tarball" 1 "$@"
|
||||
}
|
||||
|
||||
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_package_using "jar" 1 $*
|
||||
install_package_using "jar" 1 "$@"
|
||||
}
|
||||
|
||||
install_zip() {
|
||||
install_package_using "zip" 1 "$@"
|
||||
}
|
||||
|
||||
install_package_using() {
|
||||
@@ -106,13 +126,45 @@ install_package_using() {
|
||||
local package_name="$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
|
||||
"fetch_${package_type}" "$package_name" $*
|
||||
shift $(($package_type_nargs))
|
||||
make_package "$package_name" $*
|
||||
"fetch_${package_type}" "${fetch_args[@]}"
|
||||
make_package "${make_args[@]}"
|
||||
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() {
|
||||
@@ -121,33 +173,163 @@ make_package() {
|
||||
|
||||
pushd "$package_name" >&4
|
||||
before_install_package "$package_name"
|
||||
apply_patches "$package_name"
|
||||
build_package "$package_name" $*
|
||||
after_install_package "$package_name"
|
||||
fix_directory_permissions
|
||||
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=`echo "$2" | tr [A-Z] [a-z]`
|
||||
[ -n "$expected_checksum" ] || return 0
|
||||
|
||||
# If the computed checksum is empty, return failure
|
||||
local computed_checksum=`echo "$(compute_md5 < "$filename")" | tr [A-Z] [a-z]`
|
||||
[ -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
|
||||
curl -L "$@"
|
||||
"http_${method}_curl" "$url" "$file"
|
||||
elif type wget &>/dev/null; then
|
||||
wget -O- "$@"
|
||||
"http_${method}_wget" "$url" "$file"
|
||||
else
|
||||
echo "error: please install \`curl\` or \`wget\` and try again" >&2
|
||||
exit 1
|
||||
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() {
|
||||
local package_name="$1"
|
||||
local package_url="$2"
|
||||
local mirror_url
|
||||
local checksum
|
||||
|
||||
echo "Downloading ${package_url}..." >&2
|
||||
{ fetch_url "$package_url" > "${package_name}.tar"
|
||||
tar xvf "${package_name}.tar"
|
||||
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_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
|
||||
}
|
||||
|
||||
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() {
|
||||
local package_name="$1"
|
||||
local git_url="$2"
|
||||
@@ -156,6 +338,20 @@ fetch_git() {
|
||||
echo "Cloning ${git_url}..." >&2
|
||||
|
||||
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
|
||||
else
|
||||
echo "error: please install \`git\` and try again" >&2
|
||||
@@ -163,16 +359,131 @@ fetch_git() {
|
||||
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() {
|
||||
local package_name="$1"
|
||||
local package_url="$2"
|
||||
local mirror_url
|
||||
local checksum
|
||||
|
||||
echo "Downloading ${package_url}..." >&2
|
||||
{ fetch_url "$package_url" > "${package_name}.jar"
|
||||
$JAVA -jar ${package_name}.jar -s -d ${package_name}
|
||||
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}.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
|
||||
}
|
||||
|
||||
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() {
|
||||
local package_name="$1"
|
||||
shift
|
||||
@@ -186,20 +497,18 @@ build_package() {
|
||||
echo "Installing ${package_name}..." >&2
|
||||
|
||||
for command in $commands; do
|
||||
"build_package_${command}" "${package_name}"
|
||||
"build_package_${command}" "$package_name"
|
||||
done
|
||||
}
|
||||
|
||||
if [ ! -f "$PYTHON_BIN" ]; then
|
||||
for python in ${PREFIX_PATH}/bin/python*; do
|
||||
if basename "$python" | grep '^python[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; then
|
||||
{
|
||||
cd ${PREFIX_PATH}/bin
|
||||
ln -fs "$(basename $python)" python
|
||||
}
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
package_option() {
|
||||
local package_name="$1"
|
||||
local command_name="$2"
|
||||
local variable="$(capitalize "${package_name}_${command_name}")_OPTS_ARRAY"
|
||||
local array="$variable[@]"
|
||||
shift 2
|
||||
local value=( "${!array}" "$@" )
|
||||
eval "$variable=( \"\${value[@]}\" )"
|
||||
}
|
||||
|
||||
build_package_standard() {
|
||||
@@ -211,10 +520,40 @@ build_package_standard() {
|
||||
MAKE_OPTS="-j 2"
|
||||
fi
|
||||
|
||||
{ ./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
|
||||
make $MAKE_OPTS
|
||||
make install
|
||||
# Support YAML_CONFIGURE_OPTS, PYTHON_CONFIGURE_OPTS, etc.
|
||||
local package_var_name="$(capitalize "${package_name%%-*}")"
|
||||
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}" \
|
||||
--libdir="${!PACKAGE_PREFIX_PATH:-$PREFIX_PATH}/lib" \
|
||||
$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
|
||||
|
||||
# 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() {
|
||||
@@ -225,26 +564,45 @@ build_package_autoconf() {
|
||||
build_package_python() {
|
||||
local package_name="$1"
|
||||
|
||||
{
|
||||
"$PYTHON_BIN" setup.py install
|
||||
{ "$PYTHON_BIN" setup.py install
|
||||
} >&4 2>&1
|
||||
}
|
||||
|
||||
build_package_jython() {
|
||||
{
|
||||
build_package_copy
|
||||
cd "${PREFIX_PATH}/bin"
|
||||
ln -fs jython python
|
||||
}
|
||||
build_package_copy
|
||||
{ if [ -x "${PREFIX_PATH}/bin/jython" ] && [ ! -x "${PREFIX_PATH}/bin/python" ]; then
|
||||
( cd "${PREFIX_PATH}/bin" && ln -fs jython python )
|
||||
fi
|
||||
} >&4 2>&1
|
||||
}
|
||||
|
||||
build_package_jython_builder() {
|
||||
ant >&4 2>&1
|
||||
( cd "dist" && build_package_jython )
|
||||
}
|
||||
|
||||
build_package_pypy() {
|
||||
{
|
||||
mkdir -p "$PREFIX_PATH"
|
||||
cp -R . "$PREFIX_PATH"
|
||||
cd "${PREFIX_PATH}/bin"
|
||||
ln -fs pypy python
|
||||
}
|
||||
build_package_copy
|
||||
{ if [ -x "${PREFIX_PATH}/bin/pypy" ] && [ ! -x "${PREFIX_PATH}/bin/python" ]; then
|
||||
( cd "${PREFIX_PATH}/bin" && ln -fs pypy python )
|
||||
fi
|
||||
} >&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() {
|
||||
@@ -252,10 +610,6 @@ build_package_copy() {
|
||||
cp -R . "$PREFIX_PATH"
|
||||
}
|
||||
|
||||
bild_package_noop() {
|
||||
echo "Nothing to do."
|
||||
}
|
||||
|
||||
before_install_package() {
|
||||
local stub=1
|
||||
}
|
||||
@@ -266,40 +620,57 @@ after_install_package() {
|
||||
|
||||
fix_directory_permissions() {
|
||||
# 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() {
|
||||
local gcc="$(locate_gcc || true)"
|
||||
require_cc "gcc"
|
||||
}
|
||||
|
||||
if [ -z "$gcc" ]; then
|
||||
require_cc() {
|
||||
while [ -n "$1" ]; do
|
||||
if [ "$1" = "--if" ]; then
|
||||
"$2" || return 0
|
||||
shift 2
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
local cc
|
||||
local ccname="${1:-cc}"
|
||||
cc="$(locate_cc "$ccname" || true)"
|
||||
|
||||
if [ -z "$cc" ]; then
|
||||
local esc=$'\033'
|
||||
{ echo
|
||||
echo "${esc}[1mERROR${esc}[0m: This package must be compiled with GCC, but python-build couldn't"
|
||||
echo "find a suitable \`gcc\` executable on your system. Please install GCC"
|
||||
echo "${esc}[1mERROR${esc}[0m: This package must be compiled with $ccname, but python-build couldn't"
|
||||
echo "find a suitable \`$ccname\` executable on your system. Please install $ccname"
|
||||
echo "and try again."
|
||||
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."
|
||||
fi
|
||||
} >&3
|
||||
return 1
|
||||
fi
|
||||
|
||||
export CC="$gcc"
|
||||
export CC="$cc"
|
||||
}
|
||||
|
||||
locate_gcc() {
|
||||
local gcc gccs
|
||||
IFS=: gccs=($(gccs_in_path))
|
||||
locate_cc "gcc" "$@"
|
||||
}
|
||||
|
||||
verify_gcc "$CC" ||
|
||||
verify_gcc "$(command -v gcc || true)" || {
|
||||
for gcc in "${gccs[@]}"; do
|
||||
verify_gcc "$gcc" && break || true
|
||||
locate_cc() {
|
||||
local ccname="$1"; shift
|
||||
if [ -z "$ccname" ]; then
|
||||
return 1
|
||||
fi
|
||||
local cc ccs
|
||||
IFS=: ccs=($(ccs_in_path "${ccname}"))
|
||||
|
||||
verify_cc "${ccname}" "$CC" ||
|
||||
verify_cc "${ccname}" "$(command -v "${ccname}" || true)" || {
|
||||
for cc in "${ccs[@]}"; do
|
||||
verify_cc "${ccname}" "$cc" && break || true
|
||||
done
|
||||
}
|
||||
|
||||
@@ -307,33 +678,49 @@ locate_gcc() {
|
||||
}
|
||||
|
||||
gccs_in_path() {
|
||||
local gcc path paths
|
||||
local gccs=()
|
||||
ccs_in_path "gcc" "$@"
|
||||
}
|
||||
|
||||
ccs_in_path() {
|
||||
local ccname="$1"; shift
|
||||
if [ -z "$ccname" ]; then
|
||||
return 1
|
||||
fi
|
||||
local cc path paths
|
||||
local ccs=()
|
||||
IFS=: paths=($PATH)
|
||||
|
||||
shopt -s nullglob
|
||||
for path in "${paths[@]}"; do
|
||||
for gcc in "$path"/gcc-*; do
|
||||
gccs["${#gccs[@]}"]="$gcc"
|
||||
for cc in "$path"/${ccname}-*; do
|
||||
ccs["${#ccs[@]}"]="$cc"
|
||||
done
|
||||
done
|
||||
shopt -u nullglob
|
||||
|
||||
printf :%s "${gccs[@]}"
|
||||
printf :%s "${ccs[@]}"
|
||||
}
|
||||
|
||||
verify_gcc() {
|
||||
local gcc="$1"
|
||||
if [ -z "$gcc" ]; then
|
||||
verify_cc "gcc" "$@"
|
||||
}
|
||||
|
||||
verify_cc() {
|
||||
local ccname="$1"; shift
|
||||
if [ -z "$ccname" ]; then
|
||||
return 1
|
||||
fi
|
||||
local cc="$1"
|
||||
if [ -z "$cc" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
local version="$("$gcc" --version || true)"
|
||||
local version="$("$cc" --version || true)"
|
||||
if [ -z "$version" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "$gcc"
|
||||
echo "$cc"
|
||||
}
|
||||
|
||||
require_java() {
|
||||
@@ -397,13 +784,190 @@ verify_java() {
|
||||
echo "$java"
|
||||
}
|
||||
|
||||
has_broken_mac_openssl() {
|
||||
[ "$(uname -s)" = "Darwin" ] &&
|
||||
[[ "$(openssl version 2>/dev/null || true)" = "OpenSSL 0.9.8"?* ]] &&
|
||||
! use_homebrew_openssl
|
||||
}
|
||||
|
||||
use_homebrew_openssl() {
|
||||
local ssldir="$(brew --prefix openssl 2>/dev/null || true)"
|
||||
if [ -d "$ssldir" ]; then
|
||||
CPPFLAGS="-I$ssldir/include $CPPFLAGS"
|
||||
LDFLAGS="-L$ssldir/lib $LDFLAGS"
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
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() {
|
||||
[ "$(uname -s)" = "Darwin" ] &&
|
||||
_has_broken_mac_readline &&
|
||||
! use_homebrew_readline
|
||||
}
|
||||
|
||||
_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}" $CPPFLAGS "$conftest" 1>/dev/null 2>&1 || retval=0
|
||||
rm -f "$conftest"
|
||||
fi
|
||||
return "$retval"
|
||||
}
|
||||
|
||||
use_homebrew_readline() {
|
||||
local rldir="$(brew --prefix readline 2>/dev/null || true)"
|
||||
if [ -d "$rldir" ]; then
|
||||
CPPFLAGS="-I$rldir/include $CPPFLAGS"
|
||||
LDFLAGS="-L$rldir/lib $LDFLAGS"
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
has_broken_mac_llvm_gcc() {
|
||||
[ "$(uname -s)" = "Darwin" ] &&
|
||||
[[ "$(gcc --version 2>/dev/null || true)" == *"llvm-gcc-4.2"* ]]
|
||||
}
|
||||
|
||||
# Post-install check for Python 2.4.x
|
||||
build_package_verify_py24() {
|
||||
build_package_verify_readline "$@"
|
||||
build_package_verify_zlib "$@"
|
||||
build_package_verify_bz2 "$@"
|
||||
}
|
||||
|
||||
# Post-install check for Python 2.5.x
|
||||
build_package_verify_py25() {
|
||||
build_package_verify_py24 "$@"
|
||||
build_package_verify_sqlite3 "$@"
|
||||
}
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
version() {
|
||||
echo "python-build ${PYTHON_BUILD_VERSION}"
|
||||
}
|
||||
|
||||
usage() {
|
||||
{ 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"
|
||||
} >&2
|
||||
|
||||
@@ -414,7 +978,7 @@ usage() {
|
||||
|
||||
list_definitions() {
|
||||
{ for definition in "${PYTHON_BUILD_ROOT}/share/python-build/"*; do
|
||||
echo "${definition##*/}"
|
||||
[ -f "${definition}" ] && echo "${definition##*/}"
|
||||
done
|
||||
} | sort
|
||||
}
|
||||
@@ -424,6 +988,7 @@ list_definitions() {
|
||||
unset VERBOSE
|
||||
unset KEEP_BUILD_PATH
|
||||
PYTHON_BUILD_ROOT="$(abs_dirname "$0")/.."
|
||||
unset DEBUG
|
||||
|
||||
parse_options "$@"
|
||||
|
||||
@@ -433,6 +998,7 @@ for option in "${OPTIONS[@]}"; do
|
||||
usage without_exiting
|
||||
{ echo
|
||||
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 " --definitions List all built-in definitions"
|
||||
echo
|
||||
@@ -449,6 +1015,9 @@ for option in "${OPTIONS[@]}"; do
|
||||
"v" | "verbose" )
|
||||
VERBOSE=true
|
||||
;;
|
||||
"g" | "debug" )
|
||||
DEBUG=true
|
||||
;;
|
||||
"version" )
|
||||
version
|
||||
exit 0
|
||||
@@ -465,7 +1034,7 @@ elif [ ! -e "$DEFINITION_PATH" ]; then
|
||||
DEFINITION_PATH="$BUILTIN_DEFINITION_PATH"
|
||||
else
|
||||
echo "python-build: definition not found: ${DEFINITION_PATH}" >&2
|
||||
exit 1
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -480,6 +1049,47 @@ else
|
||||
TMP="${TMPDIR%/}"
|
||||
fi
|
||||
|
||||
# Work around warnings building Ruby 2.0 on Clang 2.x:
|
||||
# pass -Wno-error=shorten-64-to-32 if the compiler accepts it.
|
||||
#
|
||||
# When we set CFLAGS, Ruby won't apply its default flags, though. Since clang
|
||||
# builds 1.9.x and 2.x only, where -O3 is default, we can safely set that flag.
|
||||
# Ensure it's the first flag since later flags take precedence.
|
||||
#if "${CC:-cc}" -x c /dev/null -E -Wno-error=shorten-64-to-32 &>/dev/null; then
|
||||
# PYTHON_CFLAGS="-O3 -Wno-error=shorten-64-to-32 $PYTHON_CFLAGS"
|
||||
#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").$$"
|
||||
LOG_PATH="${TMP}/python-build.${SEED}.log"
|
||||
PYTHON_BIN="${PREFIX_PATH}/bin/python"
|
||||
@@ -488,20 +1098,21 @@ CWD="$(pwd)"
|
||||
if [ -z $PYTHON_BUILD_BUILD_PATH ]; then
|
||||
BUILD_PATH="${TMP}/python-build.${SEED}"
|
||||
else
|
||||
BUILD_PATH=$PYTHON_BUILD_BUILD_PATH
|
||||
BUILD_PATH="$PYTHON_BUILD_BUILD_PATH"
|
||||
fi
|
||||
|
||||
exec 4<> "$LOG_PATH" # open the log file at fd 4
|
||||
if [ -n "$VERBOSE" ]; then
|
||||
tail -f "$LOG_PATH" &
|
||||
trap "kill 0" SIGINT SIGTERM EXIT
|
||||
TAIL_PID=$!
|
||||
trap "kill $TAIL_PID" SIGINT SIGTERM EXIT
|
||||
fi
|
||||
|
||||
export LDFLAGS="-L'${PREFIX_PATH}/lib' ${LDFLAGS}"
|
||||
export CPPFLAGS="-I'${PREFIX_PATH}/include' ${CPPFLAGS}"
|
||||
|
||||
unset PYTHONOPT
|
||||
unset PYTHONLIB
|
||||
unset PYTHONHOME
|
||||
unset PYTHONPATH
|
||||
|
||||
trap build_failed ERR
|
||||
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.4.2
Normal file
5
plugins/python-build/share/python-build/2.4.2
Normal file
@@ -0,0 +1,5 @@
|
||||
require_gcc
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||
install_package "Python-2.4.2" "http://www.python.org/ftp/python/2.4.2/Python-2.4.2.tgz#07cfc759546f6723bb367be5b1ce9875" standard verify_py24
|
||||
install_package "setuptools-0.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.1" "https://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz#62a9f08dd5dc69d76734568a6c040508" python
|
||||
5
plugins/python-build/share/python-build/2.4.6
Normal file
5
plugins/python-build/share/python-build/2.4.6
Normal file
@@ -0,0 +1,5 @@
|
||||
require_gcc
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||
install_package "Python-2.4.6" "http://www.python.org/ftp/python/2.4.6/Python-2.4.6.tgz#7564b2b142b1b8345cd5358b7aaaa482" standard verify_py24
|
||||
install_package "setuptools-0.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.1" "https://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz#62a9f08dd5dc69d76734568a6c040508" python
|
||||
@@ -1,14 +1,5 @@
|
||||
case "$OSTYPE" in
|
||||
linux*)
|
||||
case $(uname -m) in
|
||||
x86_64)
|
||||
export LDFLAGS="-L/usr/lib/x86_64-linux-gnu" # to fix build on Debian amd64
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
require_gcc
|
||||
install_package "Python-2.5" "http://www.python.org/ftp/python/2.5/Python-2.5.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.3.1" "https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
case "$OSTYPE" in
|
||||
linux*)
|
||||
case $(uname -m) in
|
||||
x86_64)
|
||||
export LDFLAGS="-L/usr/lib/x86_64-linux-gnu" # to fix build on Debian amd64
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
require_gcc
|
||||
install_package "Python-2.5.1" "http://www.python.org/ftp/python/2.5.1/Python-2.5.1.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.3.1" "https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
case "$OSTYPE" in
|
||||
linux*)
|
||||
case $(uname -m) in
|
||||
x86_64)
|
||||
export LDFLAGS="-L/usr/lib/x86_64-linux-gnu" # to fix build on Debian amd64
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
require_gcc
|
||||
install_package "Python-2.5.2" "http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.3.1" "https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
case "$OSTYPE" in
|
||||
linux*)
|
||||
case $(uname -m) in
|
||||
x86_64)
|
||||
export LDFLAGS="-L/usr/lib/x86_64-linux-gnu" # to fix build on Debian amd64
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
require_gcc
|
||||
install_package "Python-2.5.3" "http://www.python.org/ftp/python/2.5.3/Python-2.5.3.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.3.1" "https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
case "$OSTYPE" in
|
||||
linux*)
|
||||
case $(uname -m) in
|
||||
x86_64)
|
||||
export LDFLAGS="-L/usr/lib/x86_64-linux-gnu" # to fix build on Debian amd64
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
require_gcc
|
||||
install_package "Python-2.5.4" "http://www.python.org/ftp/python/2.5.4/Python-2.5.4.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.3.1" "https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
case "$OSTYPE" in
|
||||
linux*)
|
||||
case $(uname -m) in
|
||||
x86_64)
|
||||
export LDFLAGS="-L/usr/lib/x86_64-linux-gnu" # to fix build on Debian amd64
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
require_gcc
|
||||
install_package "Python-2.5.5" "http://www.python.org/ftp/python/2.5.5/Python-2.5.5.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.3.1" "https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#cbb27a191cebc58997c4da8513863153" python
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
case "$OSTYPE" in
|
||||
linux*)
|
||||
case $(uname -m) in
|
||||
x86_64)
|
||||
export LDFLAGS="-L/usr/lib/x86_64-linux-gnu" # to fix build on Debian amd64
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
require_gcc
|
||||
install_package "Python-2.5.6" "http://www.python.org/ftp/python/2.5.6/Python-2.5.6.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.3.1" "https://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" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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
|
||||
install_package "Python-2.6.6" "http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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
|
||||
install_package "Python-2.6.7" "http://www.python.org/ftp/python/2.6.7/Python-2.6.7.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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
|
||||
install_package "Python-2.6.8" "http://www.python.org/ftp/python/2.6.8/Python-2.6.8.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||
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 "setuptools-0.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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
|
||||
install_package "Python-2.7" "http://www.python.org/ftp/python/2.7/Python-2.7.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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
|
||||
install_package "Python-2.7.1" "http://www.python.org/ftp/python/2.7.1/Python-2.7.1.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" python
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
require_gcc
|
||||
install_package "Python-2.7.2" "http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" python
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
require_gcc
|
||||
install_package "Python-2.7.3" "http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||
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 "setuptools-0.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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
|
||||
install_package "Python-3.0.1" "http://www.python.org/ftp/python/3.0.1/Python-3.0.1.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||
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 "setuptools-0.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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
|
||||
install_package "Python-3.1.3" "http://www.python.org/ftp/python/3.1.3/Python-3.1.3.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" python
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
require_gcc
|
||||
install_package "Python-3.1.4" "http://www.python.org/ftp/python/3.1.4/Python-3.1.4.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" python
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
require_gcc
|
||||
install_package "Python-3.1.5" "http://www.python.org/ftp/python/3.1.5/Python-3.1.5.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||
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 "setuptools-0.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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/python32/patch-setup.py.diff" > setup.patch
|
||||
patch -p0 < setup.patch
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
require_gcc
|
||||
install_package "Python-3.2" "http://www.python.org/ftp/python/3.2/Python-3.2.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" python
|
||||
@@ -1,4 +1,5 @@
|
||||
require_gcc
|
||||
install_package "Python-3.2.1" "http://www.python.org/ftp/python/3.2.1/Python-3.2.1.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" python
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
require_gcc
|
||||
install_package "Python-3.2.2" "http://www.python.org/ftp/python/3.2.2/Python-3.2.2.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" python
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
require_gcc
|
||||
install_package "Python-3.2.3" "http://www.python.org/ftp/python/3.2.3/Python-3.2.3.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz#67948acb2ca081f23359d0256e9a271c" standard --if has_broken_mac_readline
|
||||
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 "setuptools-0.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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_cc --if has_broken_mac_llvm_gcc "clang"
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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_cc --if has_broken_mac_llvm_gcc "clang"
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" python
|
||||
@@ -1,4 +0,0 @@
|
||||
require_gcc
|
||||
install_package "Python-3.3.0rc1" "http://python.org/ftp/python/3.3.0/Python-3.3.0rc1.tgz"
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" 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_cc --if has_broken_mac_llvm_gcc "clang"
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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_cc --if has_broken_mac_llvm_gcc "clang"
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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-version-name):$(pyenv-whence python3.4 2>/dev/null | tail -1)"
|
||||
fi
|
||||
fi
|
||||
|
||||
require_cc --if has_broken_mac_llvm_gcc "clang"
|
||||
install_package "readline-6.2" "http://ftpmirror.gnu.org/readline/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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" python
|
||||
install_package "pip-1.4" "https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#ca790be30004937987767eac42cfa44a" 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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" 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" "https://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz#db8a6d8a4564d3dc7f337ebed67b1a85" python
|
||||
@@ -1,4 +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" jython
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
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" "https://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" "https://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz#db8a6d8a4564d3dc7f337ebed67b1a85" python
|
||||
|
||||
@@ -1,4 +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" jython
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
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" "https://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" "https://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz#db8a6d8a4564d3dc7f337ebed67b1a85" python
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
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_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
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 "setuptools-0.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" 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" "https://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz#db8a6d8a4564d3dc7f337ebed67b1a85" python
|
||||
|
||||
@@ -1,4 +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" jython
|
||||
install_package "distribute-0.6.28" "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz" python
|
||||
install_package "pip-1.1" "http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz" python
|
||||
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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" 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" "https://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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" 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" "https://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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" 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" "https://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.9.7" "https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.7.tar.gz#ce3bb480e4f6d71fc2fb3388f6fe8123" 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" "https://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,166 @@
|
||||
diff -r -u ./configure ../Python-2.5/configure
|
||||
--- ./configure 2006-09-05 11:54:42.000000000 +0900
|
||||
+++ ../Python-2.5/configure 2013-07-19 15:27:46.000000000 +0900
|
||||
@@ -1396,6 +1396,16 @@
|
||||
_ACEOF
|
||||
|
||||
|
||||
+# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
|
||||
+# certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable
|
||||
+# them.
|
||||
+
|
||||
+cat >>confdefs.h <<\_ACEOF
|
||||
+#define _DARWIN_C_SOURCE 1
|
||||
+_ACEOF
|
||||
+
|
||||
+
|
||||
+
|
||||
define_xopen_source=yes
|
||||
|
||||
# Arguments passed to configure.
|
||||
@@ -3885,11 +3895,110 @@
|
||||
;;
|
||||
# is there any other compiler on Darwin besides gcc?
|
||||
Darwin*)
|
||||
- BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp -mno-fused-madd"
|
||||
+ # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
|
||||
+ # used to be here, but non-Apple gcc doesn't accept them.
|
||||
+ if test "${CC}" = gcc
|
||||
+ then
|
||||
+ { echo "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5
|
||||
+echo -n "checking which compiler should be used... " >&6; }
|
||||
+ case "${UNIVERSALSDK}" in
|
||||
+ */MacOSX10.4u.sdk)
|
||||
+ # Build using 10.4 SDK, force usage of gcc when the
|
||||
+ # compiler is gcc, otherwise the user will get very
|
||||
+ # confusing error messages when building on OSX 10.6
|
||||
+ CC=gcc-4.0
|
||||
+ CPP=cpp-4.0
|
||||
+ ;;
|
||||
+ esac
|
||||
+ { echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
|
||||
+echo "$CC" >&6; }
|
||||
+ fi
|
||||
+
|
||||
+
|
||||
if test "${enable_universalsdk}"; then
|
||||
- BASECFLAGS="-arch ppc -arch i386 -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
|
||||
+ UNIVERSAL_ARCH_FLAGS=""
|
||||
+ if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
|
||||
+ ARCH_RUN_32BIT=""
|
||||
+ LIPO_32BIT_FLAGS=""
|
||||
+ elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
|
||||
+ LIPO_32BIT_FLAGS=""
|
||||
+ ARCH_RUN_32BIT="true"
|
||||
+
|
||||
+ elif test "$UNIVERSAL_ARCHS" = "all" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
|
||||
+ LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
||||
+ ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
||||
+
|
||||
+ elif test "$UNIVERSAL_ARCHS" = "intel" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
|
||||
+ LIPO_32BIT_FLAGS="-extract i386"
|
||||
+ ARCH_RUN_32BIT="/usr/bin/arch -i386"
|
||||
+
|
||||
+ elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
|
||||
+ LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
||||
+ ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
||||
+
|
||||
+ else
|
||||
+ as_fn_error $? "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5
|
||||
+
|
||||
+ fi
|
||||
+
|
||||
+
|
||||
+ CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
|
||||
+ if test "${UNIVERSALSDK}" != "/"
|
||||
+ then
|
||||
+ CFLAGS="-isysroot ${UNIVERSALSDK} ${CFLAGS}"
|
||||
+ LDFLAGS="-isysroot ${UNIVERSALSDK} ${LDFLAGS}"
|
||||
+ CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
|
||||
+ fi
|
||||
fi
|
||||
|
||||
+ # Calculate the right deployment target for this build.
|
||||
+ #
|
||||
+ cur_target=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'`
|
||||
+ if test ${cur_target} '>' 10.2 && \
|
||||
+ test ${cur_target} '<' 10.6
|
||||
+ then
|
||||
+ cur_target=10.3
|
||||
+ if test ${enable_universalsdk}; then
|
||||
+ if test "${UNIVERSAL_ARCHS}" = "all"; then
|
||||
+ # Ensure that the default platform for a
|
||||
+ # 4-way universal build is OSX 10.5,
|
||||
+ # that's the first OS release where
|
||||
+ # 4-way builds make sense.
|
||||
+ cur_target='10.5'
|
||||
+
|
||||
+ elif test "${UNIVERSAL_ARCHS}" = "3-way"; then
|
||||
+ cur_target='10.5'
|
||||
+
|
||||
+ elif test "${UNIVERSAL_ARCHS}" = "intel"; then
|
||||
+ cur_target='10.5'
|
||||
+
|
||||
+ elif test "${UNIVERSAL_ARCHS}" = "64-bit"; then
|
||||
+ cur_target='10.5'
|
||||
+ fi
|
||||
+ else
|
||||
+ if test `/usr/bin/arch` = "i386"; then
|
||||
+ # On Intel macs default to a deployment
|
||||
+ # target of 10.4, that's the first OSX
|
||||
+ # release with Intel support.
|
||||
+ cur_target="10.4"
|
||||
+ fi
|
||||
+ fi
|
||||
+ fi
|
||||
+ CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
|
||||
+
|
||||
+ # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
|
||||
+ # environment with a value that is the same as what we'll use
|
||||
+ # in the Makefile to ensure that we'll get the same compiler
|
||||
+ # environment during configure and build time.
|
||||
+ MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
|
||||
+ export MACOSX_DEPLOYMENT_TARGET
|
||||
+ EXPORT_MACOSX_DEPLOYMENT_TARGET=''
|
||||
+
|
||||
;;
|
||||
OSF*)
|
||||
BASECFLAGS="$BASECFLAGS -mieee"
|
||||
@@ -10851,7 +10960,7 @@
|
||||
if test "${enable_universalsdk}"; then
|
||||
:
|
||||
else
|
||||
- LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
|
||||
+ LIBTOOL_CRUFT="${LIBTOOL_CRUFT}"
|
||||
fi
|
||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
||||
@@ -10863,7 +10972,7 @@
|
||||
else
|
||||
LIBTOOL_CRUFT=""
|
||||
fi
|
||||
- LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only `arch`"
|
||||
+ LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs"
|
||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
||||
esac
|
||||
diff -r -u ./pyconfig.h.in ../Python-2.5/pyconfig.h.in
|
||||
--- ./pyconfig.h.in 2006-07-30 23:09:47.000000000 +0900
|
||||
+++ ../Python-2.5/pyconfig.h.in 2013-07-17 23:12:31.000000000 +0900
|
||||
@@ -912,6 +912,11 @@
|
||||
/* Define on Irix to enable u_int */
|
||||
#undef _BSD_TYPES
|
||||
|
||||
+/* Define on Darwin to activate all library features */
|
||||
+#ifndef _DARWIN_C_SOURCE
|
||||
+#define _DARWIN_C_SOURCE
|
||||
+#endif
|
||||
+
|
||||
/* This must be set to 64 on some systems to enable large file support. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
diff -r -u ./Include/pymactoolbox.h ../Python-2.5/Include/pymactoolbox.h
|
||||
--- ./Include/pymactoolbox.h 2004-11-05 16:02:59.000000000 +0900
|
||||
+++ ../Python-2.5/Include/pymactoolbox.h 2013-07-17 23:38:51.000000000 +0900
|
||||
@@ -8,7 +8,10 @@
|
||||
#endif
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
+
|
||||
+#ifndef __LP64__
|
||||
#include <QuickTime/QuickTime.h>
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/*
|
||||
** Helper routines for error codes and such.
|
||||
@@ -18,8 +21,11 @@
|
||||
PyObject *PyMac_GetOSErrException(void); /* Initialize & return it */
|
||||
PyObject *PyErr_Mac(PyObject *, int); /* Exception with a mac error */
|
||||
PyObject *PyMac_Error(OSErr); /* Uses PyMac_GetOSErrException */
|
||||
+#ifndef __LP64__
|
||||
extern OSErr PyMac_GetFullPathname(FSSpec *, char *, int); /* convert
|
||||
fsspec->path */
|
||||
+#endif /* __LP64__ */
|
||||
+
|
||||
/*
|
||||
** These conversion routines are defined in mactoolboxglue.c itself.
|
||||
*/
|
||||
@@ -83,8 +89,10 @@
|
||||
#endif /* USE_TOOLBOX_OBJECT_GLUE */
|
||||
|
||||
/* macfs exports */
|
||||
+#ifndef __LP64__
|
||||
int PyMac_GetFSSpec(PyObject *, FSSpec *); /* argument parser for FSSpec */
|
||||
PyObject *PyMac_BuildFSSpec(FSSpec *); /* Convert FSSpec to PyObject */
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
int PyMac_GetFSRef(PyObject *, FSRef *); /* argument parser for FSRef */
|
||||
PyObject *PyMac_BuildFSRef(FSRef *); /* Convert FSRef to PyObject */
|
||||
@@ -101,39 +109,54 @@
|
||||
extern int CmpInstObj_Convert(PyObject *, ComponentInstance *);
|
||||
|
||||
/* Ctl exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *CtlObj_New(ControlHandle);
|
||||
extern int CtlObj_Convert(PyObject *, ControlHandle *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Dlg exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *DlgObj_New(DialogPtr);
|
||||
extern int DlgObj_Convert(PyObject *, DialogPtr *);
|
||||
extern PyObject *DlgObj_WhichDialog(DialogPtr);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Drag exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *DragObj_New(DragReference);
|
||||
extern int DragObj_Convert(PyObject *, DragReference *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* List exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *ListObj_New(ListHandle);
|
||||
extern int ListObj_Convert(PyObject *, ListHandle *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Menu exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *MenuObj_New(MenuHandle);
|
||||
extern int MenuObj_Convert(PyObject *, MenuHandle *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Qd exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *GrafObj_New(GrafPtr);
|
||||
extern int GrafObj_Convert(PyObject *, GrafPtr *);
|
||||
extern PyObject *BMObj_New(BitMapPtr);
|
||||
extern int BMObj_Convert(PyObject *, BitMapPtr *);
|
||||
extern PyObject *QdRGB_New(RGBColor *);
|
||||
extern int QdRGB_Convert(PyObject *, RGBColor *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Qdoffs exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *GWorldObj_New(GWorldPtr);
|
||||
extern int GWorldObj_Convert(PyObject *, GWorldPtr *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Qt exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *TrackObj_New(Track);
|
||||
extern int TrackObj_Convert(PyObject *, Track *);
|
||||
extern PyObject *MovieObj_New(Movie);
|
||||
@@ -146,6 +169,7 @@
|
||||
extern int UserDataObj_Convert(PyObject *, UserData *);
|
||||
extern PyObject *MediaObj_New(Media);
|
||||
extern int MediaObj_Convert(PyObject *, Media *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Res exports */
|
||||
extern PyObject *ResObj_New(Handle);
|
||||
@@ -154,13 +178,17 @@
|
||||
extern int OptResObj_Convert(PyObject *, Handle *);
|
||||
|
||||
/* TE exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *TEObj_New(TEHandle);
|
||||
extern int TEObj_Convert(PyObject *, TEHandle *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Win exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *WinObj_New(WindowPtr);
|
||||
extern int WinObj_Convert(PyObject *, WindowPtr *);
|
||||
extern PyObject *WinObj_WhichWindow(WindowPtr);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* CF exports */
|
||||
extern PyObject *CFObj_New(CFTypeRef);
|
||||
diff -r -u ./Mac/Modules/res/_Resmodule.c ../Python-2.5/Mac/Modules/res/_Resmodule.c
|
||||
--- ./Mac/Modules/res/_Resmodule.c 2005-07-04 05:59:44.000000000 +0900
|
||||
+++ ../Python-2.5/Mac/Modules/res/_Resmodule.c 2013-07-17 23:38:51.000000000 +0900
|
||||
@@ -414,6 +414,7 @@
|
||||
return _res;
|
||||
}
|
||||
|
||||
+#ifndef __LP64__
|
||||
static PyObject *ResObj_as_Control(ResourceObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@@ -431,6 +432,7 @@
|
||||
return _res;
|
||||
|
||||
}
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
static PyObject *ResObj_LoadResource(ResourceObject *_self, PyObject *_args)
|
||||
{
|
||||
@@ -1152,6 +1154,7 @@
|
||||
return _res;
|
||||
}
|
||||
|
||||
+#ifndef __LP64__
|
||||
static PyObject *Res_OpenRFPerm(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@@ -1287,6 +1290,7 @@
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
static PyObject *Res_InsertResourceFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@@ -1327,6 +1331,7 @@
|
||||
return _res;
|
||||
}
|
||||
|
||||
+#ifndef __LP64__
|
||||
static PyObject *Res_FSpResourceFileAlreadyOpen(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@@ -1413,6 +1418,7 @@
|
||||
nextRefNum);
|
||||
return _res;
|
||||
}
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
static PyObject *Res_FSOpenResFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@@ -1438,6 +1444,7 @@
|
||||
return _res;
|
||||
}
|
||||
|
||||
+#ifndef __LP64__
|
||||
static PyObject *Res_FSCreateResFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@@ -1534,6 +1541,7 @@
|
||||
PyMac_BuildFSSpec, &newSpec);
|
||||
return _res;
|
||||
}
|
||||
+#endif /* __LP64__ */
|
||||
|
||||
static PyObject *Res_FSOpenResourceFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@@ -1637,6 +1645,7 @@
|
||||
PyDoc_STR("(short refNum) -> (short _rv)")},
|
||||
{"SetResFileAttrs", (PyCFunction)Res_SetResFileAttrs, 1,
|
||||
PyDoc_STR("(short refNum, short attrs) -> None")},
|
||||
+#ifndef __LP64__
|
||||
{"OpenRFPerm", (PyCFunction)Res_OpenRFPerm, 1,
|
||||
PyDoc_STR("(Str255 fileName, short vRefNum, SignedByte permission) -> (short _rv)")},
|
||||
{"HOpenResFile", (PyCFunction)Res_HOpenResFile, 1,
|
||||
@@ -1647,10 +1656,12 @@
|
||||
PyDoc_STR("(FSSpec spec, SignedByte permission) -> (short _rv)")},
|
||||
{"FSpCreateResFile", (PyCFunction)Res_FSpCreateResFile, 1,
|
||||
PyDoc_STR("(FSSpec spec, OSType creator, OSType fileType, ScriptCode scriptTag) -> None")},
|
||||
+#endif /* !__LP64__ */
|
||||
{"InsertResourceFile", (PyCFunction)Res_InsertResourceFile, 1,
|
||||
PyDoc_STR("(SInt16 refNum, RsrcChainLocation where) -> None")},
|
||||
{"DetachResourceFile", (PyCFunction)Res_DetachResourceFile, 1,
|
||||
PyDoc_STR("(SInt16 refNum) -> None")},
|
||||
+#ifndef __LP64__
|
||||
{"FSpResourceFileAlreadyOpen", (PyCFunction)Res_FSpResourceFileAlreadyOpen, 1,
|
||||
PyDoc_STR("(FSSpec resourceFile) -> (Boolean _rv, Boolean inChain, SInt16 refNum)")},
|
||||
{"FSpOpenOrphanResFile", (PyCFunction)Res_FSpOpenOrphanResFile, 1,
|
||||
@@ -1659,14 +1670,17 @@
|
||||
PyDoc_STR("() -> (SInt16 refNum)")},
|
||||
{"GetNextResourceFile", (PyCFunction)Res_GetNextResourceFile, 1,
|
||||
PyDoc_STR("(SInt16 curRefNum) -> (SInt16 nextRefNum)")},
|
||||
+#endif /* __LP64__ */
|
||||
{"FSOpenResFile", (PyCFunction)Res_FSOpenResFile, 1,
|
||||
PyDoc_STR("(FSRef ref, SignedByte permission) -> (short _rv)")},
|
||||
+#ifndef __LP64__
|
||||
{"FSCreateResFile", (PyCFunction)Res_FSCreateResFile, 1,
|
||||
PyDoc_STR("(FSRef parentRef, Buffer nameLength) -> (FSRef newRef, FSSpec newSpec)")},
|
||||
{"FSResourceFileAlreadyOpen", (PyCFunction)Res_FSResourceFileAlreadyOpen, 1,
|
||||
PyDoc_STR("(FSRef resourceFileRef) -> (Boolean _rv, Boolean inChain, SInt16 refNum)")},
|
||||
{"FSCreateResourceFile", (PyCFunction)Res_FSCreateResourceFile, 1,
|
||||
PyDoc_STR("(FSRef parentRef, Buffer nameLength, Buffer forkNameLength) -> (FSRef newRef, FSSpec newSpec)")},
|
||||
+#endif /* __LP64__ */
|
||||
{"FSOpenResourceFile", (PyCFunction)Res_FSOpenResourceFile, 1,
|
||||
PyDoc_STR("(FSRef ref, Buffer forkNameLength, SignedByte permissions) -> (SInt16 refNum)")},
|
||||
{"Handle", (PyCFunction)Res_Handle, 1,
|
||||
diff -r -u ./Modules/_ctypes/libffi/src/darwin/ffitarget.h ../Python-2.5/Modules/_ctypes/libffi/src/darwin/ffitarget.h
|
||||
--- ./Modules/_ctypes/libffi/src/darwin/ffitarget.h 2006-05-26 06:58:05.000000000 +0900
|
||||
+++ ../Python-2.5/Modules/_ctypes/libffi/src/darwin/ffitarget.h 2013-07-17 23:38:51.000000000 +0900
|
||||
@@ -4,7 +4,7 @@
|
||||
* created by configure). This makes is possible to build a univeral binary
|
||||
* of ctypes in one go.
|
||||
*/
|
||||
-#if defined(__i386__)
|
||||
+#if defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
#ifndef X86_DARWIN
|
||||
#define X86_DARWIN
|
||||
diff -r -u ./Python/mactoolboxglue.c ../Python-2.5/Python/mactoolboxglue.c
|
||||
--- ./Python/mactoolboxglue.c 2006-07-12 01:44:25.000000000 +0900
|
||||
+++ ../Python-2.5/Python/mactoolboxglue.c 2013-07-17 23:39:09.000000000 +0900
|
||||
@@ -106,6 +106,7 @@
|
||||
}
|
||||
|
||||
|
||||
+#ifndef __LP64__
|
||||
OSErr
|
||||
PyMac_GetFullPathname(FSSpec *fss, char *path, int len)
|
||||
{
|
||||
@@ -153,6 +154,7 @@
|
||||
Py_XDECREF(fs);
|
||||
return err;
|
||||
}
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Convert a 4-char string object argument to an OSType value */
|
||||
int
|
||||
@@ -417,6 +419,7 @@
|
||||
GLUE_NEW(GWorldPtr, GWorldObj_New, "Carbon.Qdoffs")
|
||||
GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, "Carbon.Qdoffs")
|
||||
|
||||
+#ifndef __LP64__
|
||||
GLUE_NEW(Track, TrackObj_New, "Carbon.Qt")
|
||||
GLUE_CONVERT(Track, TrackObj_Convert, "Carbon.Qt")
|
||||
GLUE_NEW(Movie, MovieObj_New, "Carbon.Qt")
|
||||
@@ -429,6 +432,7 @@
|
||||
GLUE_CONVERT(UserData, UserDataObj_Convert, "Carbon.Qt")
|
||||
GLUE_NEW(Media, MediaObj_New, "Carbon.Qt")
|
||||
GLUE_CONVERT(Media, MediaObj_Convert, "Carbon.Qt")
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
GLUE_NEW(Handle, ResObj_New, "Carbon.Res")
|
||||
GLUE_CONVERT(Handle, ResObj_Convert, "Carbon.Res")
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,124 @@
|
||||
diff --git ./Mac/Modules/cg/_CGmodule.c ./Mac/Modules/cg/_CGmodule.c
|
||||
index 8115614..e36fce9 100755
|
||||
--- ./Mac/Modules/cg/_CGmodule.c
|
||||
+++ ./Mac/Modules/cg/_CGmodule.c
|
||||
@@ -1025,6 +1025,7 @@ static PyObject *CGContextRefObj_CGContextSetShouldAntialias(CGContextRefObject
|
||||
return _res;
|
||||
}
|
||||
|
||||
+#ifndef __LP64__
|
||||
static PyObject *CGContextRefObj_SyncCGContextOriginWithPort(CGContextRefObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@@ -1055,6 +1056,7 @@ static PyObject *CGContextRefObj_ClipCGContextToRegion(CGContextRefObject *_self
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
+#endif
|
||||
|
||||
static PyMethodDef CGContextRefObj_methods[] = {
|
||||
{"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1,
|
||||
@@ -1173,10 +1175,12 @@ static PyMethodDef CGContextRefObj_methods[] = {
|
||||
PyDoc_STR("() -> None")},
|
||||
{"CGContextSetShouldAntialias", (PyCFunction)CGContextRefObj_CGContextSetShouldAntialias, 1,
|
||||
PyDoc_STR("(int shouldAntialias) -> None")},
|
||||
+#ifndef __LP64__
|
||||
{"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1,
|
||||
PyDoc_STR("(CGrafPtr port) -> None")},
|
||||
{"ClipCGContextToRegion", (PyCFunction)CGContextRefObj_ClipCGContextToRegion, 1,
|
||||
PyDoc_STR("(Rect portRect, RgnHandle region) -> None")},
|
||||
+#endif
|
||||
{NULL, NULL, 0}
|
||||
};
|
||||
|
||||
@@ -1254,6 +1258,7 @@ PyTypeObject CGContextRef_Type = {
|
||||
/* ------------------ End object type CGContextRef ------------------ */
|
||||
|
||||
|
||||
+#ifndef __LP64__
|
||||
static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@@ -1271,10 +1276,13 @@ static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
|
||||
}
|
||||
+#endif
|
||||
|
||||
static PyMethodDef CG_methods[] = {
|
||||
+#ifndef __LP64__
|
||||
{"CreateCGContextForPort", (PyCFunction)CG_CreateCGContextForPort, 1,
|
||||
PyDoc_STR("(CGrafPtr) -> CGContextRef")},
|
||||
+#endif
|
||||
{NULL, NULL, 0}
|
||||
};
|
||||
|
||||
diff --git ./Modules/_curses_panel.c ./Modules/_curses_panel.c
|
||||
index 0acf3fd..1728b59 100644
|
||||
--- ./Modules/_curses_panel.c
|
||||
+++ ./Modules/_curses_panel.c
|
||||
@@ -56,7 +56,7 @@ typedef struct {
|
||||
|
||||
PyTypeObject PyCursesPanel_Type;
|
||||
|
||||
-#define PyCursesPanel_Check(v) ((v)->ob_type == &PyCursesPanel_Type)
|
||||
+#define PyCursesPanel_Check(v) (Py_TYPE(v) == &PyCursesPanel_Type)
|
||||
|
||||
/* Some helper functions. The problem is that there's always a window
|
||||
associated with a panel. To ensure that Python's GC doesn't pull
|
||||
@@ -178,12 +178,13 @@ PyCursesPanel_New(PANEL *pan, PyCursesWindowObject *wo)
|
||||
po = PyObject_NEW(PyCursesPanelObject, &PyCursesPanel_Type);
|
||||
if (po == NULL) return NULL;
|
||||
po->pan = pan;
|
||||
- po->wo = wo;
|
||||
- Py_INCREF(wo);
|
||||
if (insert_lop(po) < 0) {
|
||||
- PyObject_DEL(po);
|
||||
- return NULL;
|
||||
+ po->wo = NULL;
|
||||
+ Py_DECREF(po);
|
||||
+ return NULL;
|
||||
}
|
||||
+ po->wo = wo;
|
||||
+ Py_INCREF(wo);
|
||||
return (PyObject *)po;
|
||||
}
|
||||
|
||||
@@ -191,8 +192,10 @@ static void
|
||||
PyCursesPanel_Dealloc(PyCursesPanelObject *po)
|
||||
{
|
||||
(void)del_panel(po->pan);
|
||||
- Py_DECREF(po->wo);
|
||||
- remove_lop(po);
|
||||
+ if (po->wo != NULL) {
|
||||
+ Py_DECREF(po->wo);
|
||||
+ remove_lop(po);
|
||||
+ }
|
||||
PyObject_DEL(po);
|
||||
}
|
||||
|
||||
@@ -338,11 +341,10 @@ PyCursesPanel_GetAttr(PyCursesPanelObject *self, char *name)
|
||||
/* -------------------------------------------------------*/
|
||||
|
||||
PyTypeObject PyCursesPanel_Type = {
|
||||
- PyObject_HEAD_INIT(NULL)
|
||||
- 0, /*ob_size*/
|
||||
- "_curses_panel.curses panel", /*tp_name*/
|
||||
- sizeof(PyCursesPanelObject), /*tp_basicsize*/
|
||||
- 0, /*tp_itemsize*/
|
||||
+ PyVarObject_HEAD_INIT(NULL, 0)
|
||||
+ "_curses_panel.curses panel", /*tp_name*/
|
||||
+ sizeof(PyCursesPanelObject), /*tp_basicsize*/
|
||||
+ 0, /*tp_itemsize*/
|
||||
/* methods */
|
||||
(destructor)PyCursesPanel_Dealloc, /*tp_dealloc*/
|
||||
0, /*tp_print*/
|
||||
@@ -458,7 +460,7 @@ init_curses_panel(void)
|
||||
PyObject *m, *d, *v;
|
||||
|
||||
/* Initialize object type */
|
||||
- PyCursesPanel_Type.ob_type = &PyType_Type;
|
||||
+ Py_TYPE(&PyCursesPanel_Type) = &PyType_Type;
|
||||
|
||||
import_curses();
|
||||
|
||||
@@ -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,166 @@
|
||||
diff -r -u ./configure ../Python-2.5/configure
|
||||
--- ./configure 2006-09-05 11:54:42.000000000 +0900
|
||||
+++ ../Python-2.5/configure 2013-07-19 15:27:46.000000000 +0900
|
||||
@@ -1396,6 +1396,16 @@
|
||||
_ACEOF
|
||||
|
||||
|
||||
+# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
|
||||
+# certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable
|
||||
+# them.
|
||||
+
|
||||
+cat >>confdefs.h <<\_ACEOF
|
||||
+#define _DARWIN_C_SOURCE 1
|
||||
+_ACEOF
|
||||
+
|
||||
+
|
||||
+
|
||||
define_xopen_source=yes
|
||||
|
||||
# Arguments passed to configure.
|
||||
@@ -3885,11 +3895,110 @@
|
||||
;;
|
||||
# is there any other compiler on Darwin besides gcc?
|
||||
Darwin*)
|
||||
- BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp -mno-fused-madd"
|
||||
+ # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
|
||||
+ # used to be here, but non-Apple gcc doesn't accept them.
|
||||
+ if test "${CC}" = gcc
|
||||
+ then
|
||||
+ { echo "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5
|
||||
+echo -n "checking which compiler should be used... " >&6; }
|
||||
+ case "${UNIVERSALSDK}" in
|
||||
+ */MacOSX10.4u.sdk)
|
||||
+ # Build using 10.4 SDK, force usage of gcc when the
|
||||
+ # compiler is gcc, otherwise the user will get very
|
||||
+ # confusing error messages when building on OSX 10.6
|
||||
+ CC=gcc-4.0
|
||||
+ CPP=cpp-4.0
|
||||
+ ;;
|
||||
+ esac
|
||||
+ { echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
|
||||
+echo "$CC" >&6; }
|
||||
+ fi
|
||||
+
|
||||
+
|
||||
if test "${enable_universalsdk}"; then
|
||||
- BASECFLAGS="-arch ppc -arch i386 -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
|
||||
+ UNIVERSAL_ARCH_FLAGS=""
|
||||
+ if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
|
||||
+ ARCH_RUN_32BIT=""
|
||||
+ LIPO_32BIT_FLAGS=""
|
||||
+ elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
|
||||
+ LIPO_32BIT_FLAGS=""
|
||||
+ ARCH_RUN_32BIT="true"
|
||||
+
|
||||
+ elif test "$UNIVERSAL_ARCHS" = "all" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
|
||||
+ LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
||||
+ ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
||||
+
|
||||
+ elif test "$UNIVERSAL_ARCHS" = "intel" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
|
||||
+ LIPO_32BIT_FLAGS="-extract i386"
|
||||
+ ARCH_RUN_32BIT="/usr/bin/arch -i386"
|
||||
+
|
||||
+ elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
|
||||
+ LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
||||
+ ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
||||
+
|
||||
+ else
|
||||
+ as_fn_error $? "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5
|
||||
+
|
||||
+ fi
|
||||
+
|
||||
+
|
||||
+ CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
|
||||
+ if test "${UNIVERSALSDK}" != "/"
|
||||
+ then
|
||||
+ CFLAGS="-isysroot ${UNIVERSALSDK} ${CFLAGS}"
|
||||
+ LDFLAGS="-isysroot ${UNIVERSALSDK} ${LDFLAGS}"
|
||||
+ CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
|
||||
+ fi
|
||||
fi
|
||||
|
||||
+ # Calculate the right deployment target for this build.
|
||||
+ #
|
||||
+ cur_target=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'`
|
||||
+ if test ${cur_target} '>' 10.2 && \
|
||||
+ test ${cur_target} '<' 10.6
|
||||
+ then
|
||||
+ cur_target=10.3
|
||||
+ if test ${enable_universalsdk}; then
|
||||
+ if test "${UNIVERSAL_ARCHS}" = "all"; then
|
||||
+ # Ensure that the default platform for a
|
||||
+ # 4-way universal build is OSX 10.5,
|
||||
+ # that's the first OS release where
|
||||
+ # 4-way builds make sense.
|
||||
+ cur_target='10.5'
|
||||
+
|
||||
+ elif test "${UNIVERSAL_ARCHS}" = "3-way"; then
|
||||
+ cur_target='10.5'
|
||||
+
|
||||
+ elif test "${UNIVERSAL_ARCHS}" = "intel"; then
|
||||
+ cur_target='10.5'
|
||||
+
|
||||
+ elif test "${UNIVERSAL_ARCHS}" = "64-bit"; then
|
||||
+ cur_target='10.5'
|
||||
+ fi
|
||||
+ else
|
||||
+ if test `/usr/bin/arch` = "i386"; then
|
||||
+ # On Intel macs default to a deployment
|
||||
+ # target of 10.4, that's the first OSX
|
||||
+ # release with Intel support.
|
||||
+ cur_target="10.4"
|
||||
+ fi
|
||||
+ fi
|
||||
+ fi
|
||||
+ CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
|
||||
+
|
||||
+ # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
|
||||
+ # environment with a value that is the same as what we'll use
|
||||
+ # in the Makefile to ensure that we'll get the same compiler
|
||||
+ # environment during configure and build time.
|
||||
+ MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
|
||||
+ export MACOSX_DEPLOYMENT_TARGET
|
||||
+ EXPORT_MACOSX_DEPLOYMENT_TARGET=''
|
||||
+
|
||||
;;
|
||||
OSF*)
|
||||
BASECFLAGS="$BASECFLAGS -mieee"
|
||||
@@ -10851,7 +10960,7 @@
|
||||
if test "${enable_universalsdk}"; then
|
||||
:
|
||||
else
|
||||
- LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
|
||||
+ LIBTOOL_CRUFT="${LIBTOOL_CRUFT}"
|
||||
fi
|
||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
||||
@@ -10863,7 +10972,7 @@
|
||||
else
|
||||
LIBTOOL_CRUFT=""
|
||||
fi
|
||||
- LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only `arch`"
|
||||
+ LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs"
|
||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
||||
esac
|
||||
diff -r -u ./pyconfig.h.in ../Python-2.5/pyconfig.h.in
|
||||
--- ./pyconfig.h.in 2006-07-30 23:09:47.000000000 +0900
|
||||
+++ ../Python-2.5/pyconfig.h.in 2013-07-17 23:12:31.000000000 +0900
|
||||
@@ -912,6 +912,11 @@
|
||||
/* Define on Irix to enable u_int */
|
||||
#undef _BSD_TYPES
|
||||
|
||||
+/* Define on Darwin to activate all library features */
|
||||
+#ifndef _DARWIN_C_SOURCE
|
||||
+#define _DARWIN_C_SOURCE
|
||||
+#endif
|
||||
+
|
||||
/* This must be set to 64 on some systems to enable large file support. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
diff -r -u ./Include/pymactoolbox.h ../Python-2.5/Include/pymactoolbox.h
|
||||
--- ./Include/pymactoolbox.h 2004-11-05 16:02:59.000000000 +0900
|
||||
+++ ../Python-2.5/Include/pymactoolbox.h 2013-07-17 23:38:51.000000000 +0900
|
||||
@@ -8,7 +8,10 @@
|
||||
#endif
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
+
|
||||
+#ifndef __LP64__
|
||||
#include <QuickTime/QuickTime.h>
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/*
|
||||
** Helper routines for error codes and such.
|
||||
@@ -18,8 +21,11 @@
|
||||
PyObject *PyMac_GetOSErrException(void); /* Initialize & return it */
|
||||
PyObject *PyErr_Mac(PyObject *, int); /* Exception with a mac error */
|
||||
PyObject *PyMac_Error(OSErr); /* Uses PyMac_GetOSErrException */
|
||||
+#ifndef __LP64__
|
||||
extern OSErr PyMac_GetFullPathname(FSSpec *, char *, int); /* convert
|
||||
fsspec->path */
|
||||
+#endif /* __LP64__ */
|
||||
+
|
||||
/*
|
||||
** These conversion routines are defined in mactoolboxglue.c itself.
|
||||
*/
|
||||
@@ -83,8 +89,10 @@
|
||||
#endif /* USE_TOOLBOX_OBJECT_GLUE */
|
||||
|
||||
/* macfs exports */
|
||||
+#ifndef __LP64__
|
||||
int PyMac_GetFSSpec(PyObject *, FSSpec *); /* argument parser for FSSpec */
|
||||
PyObject *PyMac_BuildFSSpec(FSSpec *); /* Convert FSSpec to PyObject */
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
int PyMac_GetFSRef(PyObject *, FSRef *); /* argument parser for FSRef */
|
||||
PyObject *PyMac_BuildFSRef(FSRef *); /* Convert FSRef to PyObject */
|
||||
@@ -101,39 +109,54 @@
|
||||
extern int CmpInstObj_Convert(PyObject *, ComponentInstance *);
|
||||
|
||||
/* Ctl exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *CtlObj_New(ControlHandle);
|
||||
extern int CtlObj_Convert(PyObject *, ControlHandle *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Dlg exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *DlgObj_New(DialogPtr);
|
||||
extern int DlgObj_Convert(PyObject *, DialogPtr *);
|
||||
extern PyObject *DlgObj_WhichDialog(DialogPtr);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Drag exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *DragObj_New(DragReference);
|
||||
extern int DragObj_Convert(PyObject *, DragReference *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* List exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *ListObj_New(ListHandle);
|
||||
extern int ListObj_Convert(PyObject *, ListHandle *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Menu exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *MenuObj_New(MenuHandle);
|
||||
extern int MenuObj_Convert(PyObject *, MenuHandle *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Qd exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *GrafObj_New(GrafPtr);
|
||||
extern int GrafObj_Convert(PyObject *, GrafPtr *);
|
||||
extern PyObject *BMObj_New(BitMapPtr);
|
||||
extern int BMObj_Convert(PyObject *, BitMapPtr *);
|
||||
extern PyObject *QdRGB_New(RGBColor *);
|
||||
extern int QdRGB_Convert(PyObject *, RGBColor *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Qdoffs exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *GWorldObj_New(GWorldPtr);
|
||||
extern int GWorldObj_Convert(PyObject *, GWorldPtr *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Qt exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *TrackObj_New(Track);
|
||||
extern int TrackObj_Convert(PyObject *, Track *);
|
||||
extern PyObject *MovieObj_New(Movie);
|
||||
@@ -146,6 +169,7 @@
|
||||
extern int UserDataObj_Convert(PyObject *, UserData *);
|
||||
extern PyObject *MediaObj_New(Media);
|
||||
extern int MediaObj_Convert(PyObject *, Media *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Res exports */
|
||||
extern PyObject *ResObj_New(Handle);
|
||||
@@ -154,13 +178,17 @@
|
||||
extern int OptResObj_Convert(PyObject *, Handle *);
|
||||
|
||||
/* TE exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *TEObj_New(TEHandle);
|
||||
extern int TEObj_Convert(PyObject *, TEHandle *);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Win exports */
|
||||
+#ifndef __LP64__
|
||||
extern PyObject *WinObj_New(WindowPtr);
|
||||
extern int WinObj_Convert(PyObject *, WindowPtr *);
|
||||
extern PyObject *WinObj_WhichWindow(WindowPtr);
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* CF exports */
|
||||
extern PyObject *CFObj_New(CFTypeRef);
|
||||
diff -r -u ./Mac/Modules/res/_Resmodule.c ../Python-2.5/Mac/Modules/res/_Resmodule.c
|
||||
--- ./Mac/Modules/res/_Resmodule.c 2005-07-04 05:59:44.000000000 +0900
|
||||
+++ ../Python-2.5/Mac/Modules/res/_Resmodule.c 2013-07-17 23:38:51.000000000 +0900
|
||||
@@ -414,6 +414,7 @@
|
||||
return _res;
|
||||
}
|
||||
|
||||
+#ifndef __LP64__
|
||||
static PyObject *ResObj_as_Control(ResourceObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@@ -431,6 +432,7 @@
|
||||
return _res;
|
||||
|
||||
}
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
static PyObject *ResObj_LoadResource(ResourceObject *_self, PyObject *_args)
|
||||
{
|
||||
@@ -1152,6 +1154,7 @@
|
||||
return _res;
|
||||
}
|
||||
|
||||
+#ifndef __LP64__
|
||||
static PyObject *Res_OpenRFPerm(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@@ -1287,6 +1290,7 @@
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
static PyObject *Res_InsertResourceFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@@ -1327,6 +1331,7 @@
|
||||
return _res;
|
||||
}
|
||||
|
||||
+#ifndef __LP64__
|
||||
static PyObject *Res_FSpResourceFileAlreadyOpen(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@@ -1413,6 +1418,7 @@
|
||||
nextRefNum);
|
||||
return _res;
|
||||
}
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
static PyObject *Res_FSOpenResFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@@ -1438,6 +1444,7 @@
|
||||
return _res;
|
||||
}
|
||||
|
||||
+#ifndef __LP64__
|
||||
static PyObject *Res_FSCreateResFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@@ -1534,6 +1541,7 @@
|
||||
PyMac_BuildFSSpec, &newSpec);
|
||||
return _res;
|
||||
}
|
||||
+#endif /* __LP64__ */
|
||||
|
||||
static PyObject *Res_FSOpenResourceFile(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
@@ -1637,6 +1645,7 @@
|
||||
PyDoc_STR("(short refNum) -> (short _rv)")},
|
||||
{"SetResFileAttrs", (PyCFunction)Res_SetResFileAttrs, 1,
|
||||
PyDoc_STR("(short refNum, short attrs) -> None")},
|
||||
+#ifndef __LP64__
|
||||
{"OpenRFPerm", (PyCFunction)Res_OpenRFPerm, 1,
|
||||
PyDoc_STR("(Str255 fileName, short vRefNum, SignedByte permission) -> (short _rv)")},
|
||||
{"HOpenResFile", (PyCFunction)Res_HOpenResFile, 1,
|
||||
@@ -1647,10 +1656,12 @@
|
||||
PyDoc_STR("(FSSpec spec, SignedByte permission) -> (short _rv)")},
|
||||
{"FSpCreateResFile", (PyCFunction)Res_FSpCreateResFile, 1,
|
||||
PyDoc_STR("(FSSpec spec, OSType creator, OSType fileType, ScriptCode scriptTag) -> None")},
|
||||
+#endif /* !__LP64__ */
|
||||
{"InsertResourceFile", (PyCFunction)Res_InsertResourceFile, 1,
|
||||
PyDoc_STR("(SInt16 refNum, RsrcChainLocation where) -> None")},
|
||||
{"DetachResourceFile", (PyCFunction)Res_DetachResourceFile, 1,
|
||||
PyDoc_STR("(SInt16 refNum) -> None")},
|
||||
+#ifndef __LP64__
|
||||
{"FSpResourceFileAlreadyOpen", (PyCFunction)Res_FSpResourceFileAlreadyOpen, 1,
|
||||
PyDoc_STR("(FSSpec resourceFile) -> (Boolean _rv, Boolean inChain, SInt16 refNum)")},
|
||||
{"FSpOpenOrphanResFile", (PyCFunction)Res_FSpOpenOrphanResFile, 1,
|
||||
@@ -1659,14 +1670,17 @@
|
||||
PyDoc_STR("() -> (SInt16 refNum)")},
|
||||
{"GetNextResourceFile", (PyCFunction)Res_GetNextResourceFile, 1,
|
||||
PyDoc_STR("(SInt16 curRefNum) -> (SInt16 nextRefNum)")},
|
||||
+#endif /* __LP64__ */
|
||||
{"FSOpenResFile", (PyCFunction)Res_FSOpenResFile, 1,
|
||||
PyDoc_STR("(FSRef ref, SignedByte permission) -> (short _rv)")},
|
||||
+#ifndef __LP64__
|
||||
{"FSCreateResFile", (PyCFunction)Res_FSCreateResFile, 1,
|
||||
PyDoc_STR("(FSRef parentRef, Buffer nameLength) -> (FSRef newRef, FSSpec newSpec)")},
|
||||
{"FSResourceFileAlreadyOpen", (PyCFunction)Res_FSResourceFileAlreadyOpen, 1,
|
||||
PyDoc_STR("(FSRef resourceFileRef) -> (Boolean _rv, Boolean inChain, SInt16 refNum)")},
|
||||
{"FSCreateResourceFile", (PyCFunction)Res_FSCreateResourceFile, 1,
|
||||
PyDoc_STR("(FSRef parentRef, Buffer nameLength, Buffer forkNameLength) -> (FSRef newRef, FSSpec newSpec)")},
|
||||
+#endif /* __LP64__ */
|
||||
{"FSOpenResourceFile", (PyCFunction)Res_FSOpenResourceFile, 1,
|
||||
PyDoc_STR("(FSRef ref, Buffer forkNameLength, SignedByte permissions) -> (SInt16 refNum)")},
|
||||
{"Handle", (PyCFunction)Res_Handle, 1,
|
||||
diff -r -u ./Modules/_ctypes/libffi/src/darwin/ffitarget.h ../Python-2.5/Modules/_ctypes/libffi/src/darwin/ffitarget.h
|
||||
--- ./Modules/_ctypes/libffi/src/darwin/ffitarget.h 2006-05-26 06:58:05.000000000 +0900
|
||||
+++ ../Python-2.5/Modules/_ctypes/libffi/src/darwin/ffitarget.h 2013-07-17 23:38:51.000000000 +0900
|
||||
@@ -4,7 +4,7 @@
|
||||
* created by configure). This makes is possible to build a univeral binary
|
||||
* of ctypes in one go.
|
||||
*/
|
||||
-#if defined(__i386__)
|
||||
+#if defined(__i386__) || defined(__x86_64__)
|
||||
|
||||
#ifndef X86_DARWIN
|
||||
#define X86_DARWIN
|
||||
diff -r -u ./Python/mactoolboxglue.c ../Python-2.5/Python/mactoolboxglue.c
|
||||
--- ./Python/mactoolboxglue.c 2006-07-12 01:44:25.000000000 +0900
|
||||
+++ ../Python-2.5/Python/mactoolboxglue.c 2013-07-17 23:39:09.000000000 +0900
|
||||
@@ -106,6 +106,7 @@
|
||||
}
|
||||
|
||||
|
||||
+#ifndef __LP64__
|
||||
OSErr
|
||||
PyMac_GetFullPathname(FSSpec *fss, char *path, int len)
|
||||
{
|
||||
@@ -153,6 +154,7 @@
|
||||
Py_XDECREF(fs);
|
||||
return err;
|
||||
}
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
/* Convert a 4-char string object argument to an OSType value */
|
||||
int
|
||||
@@ -417,6 +419,7 @@
|
||||
GLUE_NEW(GWorldPtr, GWorldObj_New, "Carbon.Qdoffs")
|
||||
GLUE_CONVERT(GWorldPtr, GWorldObj_Convert, "Carbon.Qdoffs")
|
||||
|
||||
+#ifndef __LP64__
|
||||
GLUE_NEW(Track, TrackObj_New, "Carbon.Qt")
|
||||
GLUE_CONVERT(Track, TrackObj_Convert, "Carbon.Qt")
|
||||
GLUE_NEW(Movie, MovieObj_New, "Carbon.Qt")
|
||||
@@ -429,6 +432,7 @@
|
||||
GLUE_CONVERT(UserData, UserDataObj_Convert, "Carbon.Qt")
|
||||
GLUE_NEW(Media, MediaObj_New, "Carbon.Qt")
|
||||
GLUE_CONVERT(Media, MediaObj_Convert, "Carbon.Qt")
|
||||
+#endif /* !__LP64__ */
|
||||
|
||||
GLUE_NEW(Handle, ResObj_New, "Carbon.Res")
|
||||
GLUE_CONVERT(Handle, ResObj_Convert, "Carbon.Res")
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,124 @@
|
||||
diff --git ./Mac/Modules/cg/_CGmodule.c ./Mac/Modules/cg/_CGmodule.c
|
||||
index 8115614..e36fce9 100755
|
||||
--- ./Mac/Modules/cg/_CGmodule.c
|
||||
+++ ./Mac/Modules/cg/_CGmodule.c
|
||||
@@ -1025,6 +1025,7 @@ static PyObject *CGContextRefObj_CGContextSetShouldAntialias(CGContextRefObject
|
||||
return _res;
|
||||
}
|
||||
|
||||
+#ifndef __LP64__
|
||||
static PyObject *CGContextRefObj_SyncCGContextOriginWithPort(CGContextRefObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@@ -1055,6 +1056,7 @@ static PyObject *CGContextRefObj_ClipCGContextToRegion(CGContextRefObject *_self
|
||||
_res = Py_None;
|
||||
return _res;
|
||||
}
|
||||
+#endif
|
||||
|
||||
static PyMethodDef CGContextRefObj_methods[] = {
|
||||
{"CGContextSaveGState", (PyCFunction)CGContextRefObj_CGContextSaveGState, 1,
|
||||
@@ -1173,10 +1175,12 @@ static PyMethodDef CGContextRefObj_methods[] = {
|
||||
PyDoc_STR("() -> None")},
|
||||
{"CGContextSetShouldAntialias", (PyCFunction)CGContextRefObj_CGContextSetShouldAntialias, 1,
|
||||
PyDoc_STR("(int shouldAntialias) -> None")},
|
||||
+#ifndef __LP64__
|
||||
{"SyncCGContextOriginWithPort", (PyCFunction)CGContextRefObj_SyncCGContextOriginWithPort, 1,
|
||||
PyDoc_STR("(CGrafPtr port) -> None")},
|
||||
{"ClipCGContextToRegion", (PyCFunction)CGContextRefObj_ClipCGContextToRegion, 1,
|
||||
PyDoc_STR("(Rect portRect, RgnHandle region) -> None")},
|
||||
+#endif
|
||||
{NULL, NULL, 0}
|
||||
};
|
||||
|
||||
@@ -1254,6 +1258,7 @@ PyTypeObject CGContextRef_Type = {
|
||||
/* ------------------ End object type CGContextRef ------------------ */
|
||||
|
||||
|
||||
+#ifndef __LP64__
|
||||
static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args)
|
||||
{
|
||||
PyObject *_res = NULL;
|
||||
@@ -1271,10 +1276,13 @@ static PyObject *CG_CreateCGContextForPort(PyObject *_self, PyObject *_args)
|
||||
return _res;
|
||||
|
||||
}
|
||||
+#endif
|
||||
|
||||
static PyMethodDef CG_methods[] = {
|
||||
+#ifndef __LP64__
|
||||
{"CreateCGContextForPort", (PyCFunction)CG_CreateCGContextForPort, 1,
|
||||
PyDoc_STR("(CGrafPtr) -> CGContextRef")},
|
||||
+#endif
|
||||
{NULL, NULL, 0}
|
||||
};
|
||||
|
||||
diff --git ./Modules/_curses_panel.c ./Modules/_curses_panel.c
|
||||
index 0acf3fd..1728b59 100644
|
||||
--- ./Modules/_curses_panel.c
|
||||
+++ ./Modules/_curses_panel.c
|
||||
@@ -56,7 +56,7 @@ typedef struct {
|
||||
|
||||
PyTypeObject PyCursesPanel_Type;
|
||||
|
||||
-#define PyCursesPanel_Check(v) ((v)->ob_type == &PyCursesPanel_Type)
|
||||
+#define PyCursesPanel_Check(v) (Py_TYPE(v) == &PyCursesPanel_Type)
|
||||
|
||||
/* Some helper functions. The problem is that there's always a window
|
||||
associated with a panel. To ensure that Python's GC doesn't pull
|
||||
@@ -178,12 +178,13 @@ PyCursesPanel_New(PANEL *pan, PyCursesWindowObject *wo)
|
||||
po = PyObject_NEW(PyCursesPanelObject, &PyCursesPanel_Type);
|
||||
if (po == NULL) return NULL;
|
||||
po->pan = pan;
|
||||
- po->wo = wo;
|
||||
- Py_INCREF(wo);
|
||||
if (insert_lop(po) < 0) {
|
||||
- PyObject_DEL(po);
|
||||
- return NULL;
|
||||
+ po->wo = NULL;
|
||||
+ Py_DECREF(po);
|
||||
+ return NULL;
|
||||
}
|
||||
+ po->wo = wo;
|
||||
+ Py_INCREF(wo);
|
||||
return (PyObject *)po;
|
||||
}
|
||||
|
||||
@@ -191,8 +192,10 @@ static void
|
||||
PyCursesPanel_Dealloc(PyCursesPanelObject *po)
|
||||
{
|
||||
(void)del_panel(po->pan);
|
||||
- Py_DECREF(po->wo);
|
||||
- remove_lop(po);
|
||||
+ if (po->wo != NULL) {
|
||||
+ Py_DECREF(po->wo);
|
||||
+ remove_lop(po);
|
||||
+ }
|
||||
PyObject_DEL(po);
|
||||
}
|
||||
|
||||
@@ -338,11 +341,10 @@ PyCursesPanel_GetAttr(PyCursesPanelObject *self, char *name)
|
||||
/* -------------------------------------------------------*/
|
||||
|
||||
PyTypeObject PyCursesPanel_Type = {
|
||||
- PyObject_HEAD_INIT(NULL)
|
||||
- 0, /*ob_size*/
|
||||
- "_curses_panel.curses panel", /*tp_name*/
|
||||
- sizeof(PyCursesPanelObject), /*tp_basicsize*/
|
||||
- 0, /*tp_itemsize*/
|
||||
+ PyVarObject_HEAD_INIT(NULL, 0)
|
||||
+ "_curses_panel.curses panel", /*tp_name*/
|
||||
+ sizeof(PyCursesPanelObject), /*tp_basicsize*/
|
||||
+ 0, /*tp_itemsize*/
|
||||
/* methods */
|
||||
(destructor)PyCursesPanel_Dealloc, /*tp_dealloc*/
|
||||
0, /*tp_print*/
|
||||
@@ -458,7 +460,7 @@ init_curses_panel(void)
|
||||
PyObject *m, *d, *v;
|
||||
|
||||
/* Initialize object type */
|
||||
- PyCursesPanel_Type.ob_type = &PyType_Type;
|
||||
+ Py_TYPE(&PyCursesPanel_Type) = &PyType_Type;
|
||||
|
||||
import_curses();
|
||||
|
||||
@@ -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,166 @@
|
||||
diff -r -u ./configure ../Python-2.5/configure
|
||||
--- ./configure 2006-09-05 11:54:42.000000000 +0900
|
||||
+++ ../Python-2.5/configure 2013-07-19 15:27:46.000000000 +0900
|
||||
@@ -1396,6 +1396,16 @@
|
||||
_ACEOF
|
||||
|
||||
|
||||
+# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
|
||||
+# certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable
|
||||
+# them.
|
||||
+
|
||||
+cat >>confdefs.h <<\_ACEOF
|
||||
+#define _DARWIN_C_SOURCE 1
|
||||
+_ACEOF
|
||||
+
|
||||
+
|
||||
+
|
||||
define_xopen_source=yes
|
||||
|
||||
# Arguments passed to configure.
|
||||
@@ -3885,11 +3895,110 @@
|
||||
;;
|
||||
# is there any other compiler on Darwin besides gcc?
|
||||
Darwin*)
|
||||
- BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp -mno-fused-madd"
|
||||
+ # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd
|
||||
+ # used to be here, but non-Apple gcc doesn't accept them.
|
||||
+ if test "${CC}" = gcc
|
||||
+ then
|
||||
+ { echo "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5
|
||||
+echo -n "checking which compiler should be used... " >&6; }
|
||||
+ case "${UNIVERSALSDK}" in
|
||||
+ */MacOSX10.4u.sdk)
|
||||
+ # Build using 10.4 SDK, force usage of gcc when the
|
||||
+ # compiler is gcc, otherwise the user will get very
|
||||
+ # confusing error messages when building on OSX 10.6
|
||||
+ CC=gcc-4.0
|
||||
+ CPP=cpp-4.0
|
||||
+ ;;
|
||||
+ esac
|
||||
+ { echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
|
||||
+echo "$CC" >&6; }
|
||||
+ fi
|
||||
+
|
||||
+
|
||||
if test "${enable_universalsdk}"; then
|
||||
- BASECFLAGS="-arch ppc -arch i386 -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
|
||||
+ UNIVERSAL_ARCH_FLAGS=""
|
||||
+ if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
|
||||
+ ARCH_RUN_32BIT=""
|
||||
+ LIPO_32BIT_FLAGS=""
|
||||
+ elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
|
||||
+ LIPO_32BIT_FLAGS=""
|
||||
+ ARCH_RUN_32BIT="true"
|
||||
+
|
||||
+ elif test "$UNIVERSAL_ARCHS" = "all" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
|
||||
+ LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
||||
+ ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
||||
+
|
||||
+ elif test "$UNIVERSAL_ARCHS" = "intel" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
|
||||
+ LIPO_32BIT_FLAGS="-extract i386"
|
||||
+ ARCH_RUN_32BIT="/usr/bin/arch -i386"
|
||||
+
|
||||
+ elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
|
||||
+ UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
|
||||
+ LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
|
||||
+ ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
|
||||
+
|
||||
+ else
|
||||
+ as_fn_error $? "proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" "$LINENO" 5
|
||||
+
|
||||
+ fi
|
||||
+
|
||||
+
|
||||
+ CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
|
||||
+ if test "${UNIVERSALSDK}" != "/"
|
||||
+ then
|
||||
+ CFLAGS="-isysroot ${UNIVERSALSDK} ${CFLAGS}"
|
||||
+ LDFLAGS="-isysroot ${UNIVERSALSDK} ${LDFLAGS}"
|
||||
+ CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
|
||||
+ fi
|
||||
fi
|
||||
|
||||
+ # Calculate the right deployment target for this build.
|
||||
+ #
|
||||
+ cur_target=`sw_vers -productVersion | sed 's/\(10\.[0-9]*\).*/\1/'`
|
||||
+ if test ${cur_target} '>' 10.2 && \
|
||||
+ test ${cur_target} '<' 10.6
|
||||
+ then
|
||||
+ cur_target=10.3
|
||||
+ if test ${enable_universalsdk}; then
|
||||
+ if test "${UNIVERSAL_ARCHS}" = "all"; then
|
||||
+ # Ensure that the default platform for a
|
||||
+ # 4-way universal build is OSX 10.5,
|
||||
+ # that's the first OS release where
|
||||
+ # 4-way builds make sense.
|
||||
+ cur_target='10.5'
|
||||
+
|
||||
+ elif test "${UNIVERSAL_ARCHS}" = "3-way"; then
|
||||
+ cur_target='10.5'
|
||||
+
|
||||
+ elif test "${UNIVERSAL_ARCHS}" = "intel"; then
|
||||
+ cur_target='10.5'
|
||||
+
|
||||
+ elif test "${UNIVERSAL_ARCHS}" = "64-bit"; then
|
||||
+ cur_target='10.5'
|
||||
+ fi
|
||||
+ else
|
||||
+ if test `/usr/bin/arch` = "i386"; then
|
||||
+ # On Intel macs default to a deployment
|
||||
+ # target of 10.4, that's the first OSX
|
||||
+ # release with Intel support.
|
||||
+ cur_target="10.4"
|
||||
+ fi
|
||||
+ fi
|
||||
+ fi
|
||||
+ CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
|
||||
+
|
||||
+ # Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
|
||||
+ # environment with a value that is the same as what we'll use
|
||||
+ # in the Makefile to ensure that we'll get the same compiler
|
||||
+ # environment during configure and build time.
|
||||
+ MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET"
|
||||
+ export MACOSX_DEPLOYMENT_TARGET
|
||||
+ EXPORT_MACOSX_DEPLOYMENT_TARGET=''
|
||||
+
|
||||
;;
|
||||
OSF*)
|
||||
BASECFLAGS="$BASECFLAGS -mieee"
|
||||
@@ -10851,7 +10960,7 @@
|
||||
if test "${enable_universalsdk}"; then
|
||||
:
|
||||
else
|
||||
- LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
|
||||
+ LIBTOOL_CRUFT="${LIBTOOL_CRUFT}"
|
||||
fi
|
||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
||||
@@ -10863,7 +10972,7 @@
|
||||
else
|
||||
LIBTOOL_CRUFT=""
|
||||
fi
|
||||
- LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only `arch`"
|
||||
+ LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs"
|
||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
||||
esac
|
||||
diff -r -u ./pyconfig.h.in ../Python-2.5/pyconfig.h.in
|
||||
--- ./pyconfig.h.in 2006-07-30 23:09:47.000000000 +0900
|
||||
+++ ../Python-2.5/pyconfig.h.in 2013-07-17 23:12:31.000000000 +0900
|
||||
@@ -912,6 +912,11 @@
|
||||
/* Define on Irix to enable u_int */
|
||||
#undef _BSD_TYPES
|
||||
|
||||
+/* Define on Darwin to activate all library features */
|
||||
+#ifndef _DARWIN_C_SOURCE
|
||||
+#define _DARWIN_C_SOURCE
|
||||
+#endif
|
||||
+
|
||||
/* This must be set to 64 on some systems to enable large file support. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user