diff options
author | Tim Harder <radhermit@gentoo.org> | 2013-04-21 23:26:59 +0000 |
---|---|---|
committer | Tim Harder <radhermit@gentoo.org> | 2013-04-21 23:26:59 +0000 |
commit | ee9ed153896fe485f561eb9501e695fe471fa9e0 (patch) | |
tree | 0efc9266904066f3ed97cad8bd8f5dfabbd1dc7c /eclass/vim.eclass | |
parent | Remove pre-EAPI 2 code blocks (patch by mgorny, bug #458794). (diff) | |
download | historical-ee9ed153896fe485f561eb9501e695fe471fa9e0.tar.gz historical-ee9ed153896fe485f561eb9501e695fe471fa9e0.tar.bz2 historical-ee9ed153896fe485f561eb9501e695fe471fa9e0.zip |
Use python-r1 in EAPI 5 (patch by mgorny, bug #458794).
Diffstat (limited to 'eclass/vim.eclass')
-rw-r--r-- | eclass/vim.eclass | 68 |
1 files changed, 55 insertions, 13 deletions
diff --git a/eclass/vim.eclass b/eclass/vim.eclass index d419fea1feba..e3912738258a 100644 --- a/eclass/vim.eclass +++ b/eclass/vim.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/vim.eclass,v 1.209 2013/04/21 23:25:34 radhermit Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/vim.eclass,v 1.210 2013/04/21 23:26:59 radhermit Exp $ # Authors: # Jim Ramsay <lack@gentoo.org> @@ -29,6 +29,9 @@ case "${EAPI:-0}" in ;; 2|3) ;; + 5) + HAS_PYTHON_R1=1 + ;; *) die "Unknown EAPI ${EAPI}" ;; @@ -38,11 +41,16 @@ esac MY_PN=${PN%-cvs} if [[ ${MY_PN} != "vim-core" ]] ; then - # vim supports python-2 only - PYTHON_DEPEND="python? 2" - PYTHON_USE_WITH_OPT="python" - PYTHON_USE_WITH="threads" - inherit python + if [[ ${HAS_PYTHON_R1} ]]; then + PYTHON_REQ_USE=threads + inherit python-r1 + else + # vim supports python-2 only + PYTHON_DEPEND="python? 2" + PYTHON_USE_WITH_OPT="python" + PYTHON_USE_WITH="threads" + inherit python + fi fi inherit eutils vim-doc flag-o-matic versionator fdo-mime bash-completion-r1 prefix @@ -77,6 +85,20 @@ if [[ ${MY_PN} == "vim-core" ]] ; then else IUSE="${IUSE} cscope debug gpm perl python ruby" + if [[ ${HAS_PYTHON_R1} ]]; then + DEPEND="${DEPEND} + python? ( ${PYTHON_DEPS} )" + RDEPEND="${RDEPEND} + python? ( ${PYTHON_DEPS} )" + # at most one version of py2 and one of py3 + REQUIRED_USE="${REQUIRED_USE} + python? ( + || ( $(python_gen_useflags '*') ) + ?? ( $(python_gen_useflags 'python2*') ) + ?? ( $(python_gen_useflags 'python3*') ) + )" + fi + DEPEND="${DEPEND} cscope? ( dev-util/cscope ) gpm? ( >=sys-libs/gpm-1.19.3 ) @@ -233,12 +255,14 @@ vim_pkg_setup() { mkdir -p "${T}/home" export HOME="${T}/home" - if [[ ${MY_PN} != "vim-core" ]] && use python; then - # vim supports python-2 only - python_set_active_version 2 - # python.eclass only defines python_pkg_setup for EAPIs that support - # USE dependencies - python_pkg_setup + if [[ ! ${HAS_PYTHON_R1} ]]; then + if [[ ${MY_PN} != "vim-core" ]] && use python; then + # vim supports python-2 only + python_set_active_version 2 + # python.eclass only defines python_pkg_setup for EAPIs that support + # USE dependencies + python_pkg_setup + fi fi } @@ -410,7 +434,25 @@ vim_src_configure() { myconf="${myconf} `use_enable cscope`" myconf="${myconf} `use_enable gpm`" myconf="${myconf} `use_enable perl perlinterp`" - myconf="${myconf} `use_enable python pythoninterp`" + if [[ ${HAS_PYTHON_R1} ]]; then + if use python; then + py_add_interp() { + local v + + [[ ${EPYTHON} == python3* ]] && v=3 + + myconf="${myconf} --enable-python${v}interp + vi_cv_path_python${v}=${PYTHON}" + } + + python_foreach_impl py_add_interp + else + myconf="${myconf} --disable-pythoninterp + --disable-python3interp" + fi + else + myconf="${myconf} `use_enable python pythoninterp`" + fi myconf="${myconf} `use_enable ruby rubyinterp`" # tclinterp is broken; when you --enable-tclinterp flag, then # the following command never returns: |