| 1 | # Copyright 1999-2009 Gentoo Foundation |
1 | # Copyright 1999-2009 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.64 2009/08/15 21:50:31 betelgeuse Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.65 2009/08/15 23:32:58 arfrever Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: python.eclass |
5 | # @ECLASS: python.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # python@gentoo.org |
7 | # python@gentoo.org |
| 8 | # |
8 | # |
| 9 | # original author: Alastair Tse <liquidx@gentoo.org> |
9 | # original author: Alastair Tse <liquidx@gentoo.org> |
| 10 | # @BLURB: A Utility Eclass that should be inherited by anything that deals with Python or Python modules. |
10 | # @BLURB: A Utility Eclass that should be inherited by anything that deals with Python or Python modules. |
| 11 | # @DESCRIPTION: |
11 | # @DESCRIPTION: |
| 12 | # Some useful functions for dealing with python. |
12 | # Some useful functions for dealing with python. |
| 13 | inherit alternatives multilib |
|
|
| 14 | |
13 | |
|
|
14 | inherit multilib |
| 15 | |
15 | |
| 16 | if [[ -n "${NEED_PYTHON}" ]] ; then |
16 | if [[ -n "${NEED_PYTHON}" ]] ; then |
| 17 | PYTHON_ATOM=">=dev-lang/python-${NEED_PYTHON}" |
17 | PYTHON_ATOM=">=dev-lang/python-${NEED_PYTHON}" |
| 18 | DEPEND="${PYTHON_ATOM}" |
18 | DEPEND="${PYTHON_ATOM}" |
| 19 | RDEPEND="${DEPEND}" |
19 | RDEPEND="${DEPEND}" |
| … | |
… | |
| 477 | # @FUNCTION: python_get_sitedir |
477 | # @FUNCTION: python_get_sitedir |
| 478 | # @DESCRIPTION: |
478 | # @DESCRIPTION: |
| 479 | # Run without arguments, returns the Python site-packages directory. |
479 | # Run without arguments, returns the Python site-packages directory. |
| 480 | python_get_sitedir() { |
480 | python_get_sitedir() { |
| 481 | echo "$(python_get_libdir)/site-packages" |
481 | echo "$(python_get_libdir)/site-packages" |
| 482 | } |
|
|
| 483 | |
|
|
| 484 | # @FUNCTION: python_makesym |
|
|
| 485 | # @DESCRIPTION: |
|
|
| 486 | # Run without arguments, it will create the /usr/bin/python symlinks |
|
|
| 487 | # to the latest installed version |
|
|
| 488 | python_makesym() { |
|
|
| 489 | alternatives_auto_makesym "/usr/bin/python" "python[0-9].[0-9]" |
|
|
| 490 | alternatives_auto_makesym "/usr/bin/python2" "python2.[0-9]" |
|
|
| 491 | } |
482 | } |
| 492 | |
483 | |
| 493 | # @FUNCTION: python_tkinter_exists |
484 | # @FUNCTION: python_tkinter_exists |
| 494 | # @DESCRIPTION: |
485 | # @DESCRIPTION: |
| 495 | # Run without arguments, checks if python was compiled with Tkinter |
486 | # Run without arguments, checks if python was compiled with Tkinter |