1 |
Arfrever Frehtes Taifersar Arahesis |
2 |
2010-02-05 17:40:00 napisał(a): |
3 |
> The following changes should be made in ebuilds of packages supporting only Python 2: |
4 |
> - Dependency on Python 2 should be set correctly. You can specify it directly in |
5 |
> {,R}DEPEND or use PYTHON_DEPEND. |
6 |
> |
7 |
> Example: |
8 |
> PYTHON_DEPEND="2" |
9 |
> |
10 |
> inherit python |
11 |
> |
12 |
> - Miscellaneous actions should be executed with correct version of Python. |
13 |
> |
14 |
> - In ebuilds of packages supporting installation for multiple versions of Python, |
15 |
> please remember to disable installation for all versions of Python 3. |
16 |
> (Please do not use python_set_active_version() in ebuilds of these packages.) |
17 |
> |
18 |
> Example: |
19 |
> RESTRICT_PYTHON_ABIS="3.*" |
20 |
> |
21 |
> - In ebuilds of packages not supporting installation for multiple versions of Python, |
22 |
> set active version of Python using python_set_active_version(). |
23 |
> (Please avoid passing precisely specified Python ABI to python_set_active_version().) |
24 |
> |
25 |
> Example: |
26 |
> pkg_setup() { |
27 |
> python_set_active_version 2 |
28 |
> } |
29 |
> |
30 |
> (If given package currently cannot be installed for multiple versions of Python, |
31 |
> but it is theoretically possible (e.g. this package installs .py files into |
32 |
> /usr/lib/pythonX.Y/site-packages and does not install any non-versioned libraries |
33 |
> into /usr/lib), then please try to adjust ebuilds of this package to allow |
34 |
> installation for multiple versions of Python.) |
35 |
|
36 |
I forgot about 2 other types of changes: |
37 |
- Shebangs in installed scripts should be correct. If build system installs scripts |
38 |
with too generic shebangs (e.g. '#!/usr/bin/python'), then you can use |
39 |
python_convert_shebangs() to convert shebangs. |
40 |
|
41 |
Example: |
42 |
src_install() { |
43 |
... |
44 |
|
45 |
python_convert_shebangs -r 2 "${D}usr/bin" |
46 |
} |
47 |
|
48 |
(Please note that wrapper scripts generated by python_generate_wrapper_scripts() work |
49 |
with all versions of Python from 2.4 to 3.2, so shebangs in these scripts do not need |
50 |
any changes.) |
51 |
|
52 |
- Some deprecated functions (python_version(), distutils_python_version()) and variables |
53 |
(${python}, ${PYVER} etc.) should not be used. |
54 |
|
55 |
Documentation [1] has been updated. |
56 |
|
57 |
I will start filing bugs maybe in this week. |
58 |
|
59 |
[1] http://www.gentoo.org/proj/en/Python/developersguide.xml |
60 |
|
61 |
-- |
62 |
Arfrever Frehtes Taifersar Arahesis |