summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/python-r1.eclass4
-rw-r--r--eclass/python-utils-r1.eclass20
-rwxr-xr-xeclass/tests/python-utils-r1.sh10
4 files changed, 29 insertions, 11 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 3703e1846073..aa66f20465ae 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1402 2014/11/05 00:24:33 dilfridge Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1403 2014/11/05 23:03:01 mgorny Exp $
+
+ 05 Nov 2014; Michał Górny <mgorny@gentoo.org> python-r1.eclass,
+ python-utils-r1.eclass, tests/python-utils-r1.sh:
+ Add support for PyPy3.
05 Nov 2014; Andreas K. Huettel <dilfridge@gentoo.org> perl-module.eclass:
Remove unused function perl_set_eprefix
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index e127f5d94519..d1e1632a0a89 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.76 2014/08/18 08:56:06 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-r1.eclass,v 1.77 2014/11/05 23:03:01 mgorny Exp $
# @ECLASS: python-r1
# @MAINTAINER:
@@ -565,7 +565,7 @@ _python_check_USE_PYTHON() {
local abi
case "${impl}" in
- pypy|python3_4)
+ pypy|pypy3|python3_4)
# unsupported in python.eclass
continue
;;
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index d0c0acdca85b..82419c630a4e 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.62 2014/10/18 22:36:17 floppym Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.63 2014/11/05 23:03:01 mgorny Exp $
# @ECLASS: python-utils-r1
# @MAINTAINER:
@@ -41,7 +41,7 @@ inherit eutils multilib toolchain-funcs
# All supported Python implementations, most preferred last.
_PYTHON_ALL_IMPLS=(
jython2_5 jython2_7
- pypy
+ pypy pypy3
python3_2 python3_3 python3_4
python2_7
)
@@ -72,7 +72,7 @@ _python_impl_supported() {
pypy1_[89]|pypy2_0|python2_[56]|python3_1)
return 1
;;
- pypy)
+ pypy|pypy3)
if [[ ${EAPI:-0} == [01234] ]]; then
die "PyPy is supported in EAPI 5 and newer only."
fi
@@ -235,7 +235,7 @@ python_export() {
impl=${1/_/.}
shift
;;
- pypy)
+ pypy|pypy3)
impl=${1}
shift
;;
@@ -261,7 +261,7 @@ python_export() {
PYTHON_SITEDIR)
local dir
case "${impl}" in
- python*|pypy)
+ python*|pypy|pypy3)
dir=/usr/$(get_libdir)/${impl}
;;
jython*)
@@ -278,7 +278,7 @@ python_export() {
python*)
dir=/usr/include/${impl}
;;
- pypy)
+ pypy|pypy3)
dir=/usr/$(get_libdir)/${impl}/include
;;
*)
@@ -350,6 +350,8 @@ python_export() {
PYTHON_PKG_DEP="dev-lang/python:${impl#python}";;
pypy)
PYTHON_PKG_DEP='virtual/pypy:0=';;
+ pypy3)
+ PYTHON_PKG_DEP='virtual/pypy3:0=';;
jython2.5)
PYTHON_PKG_DEP='>=dev-java/jython-2.5.3-r2:2.5';;
jython2.7)
@@ -914,7 +916,7 @@ python_is_python3() {
local impl=${1:-${EPYTHON}}
[[ ${impl} ]] || die "python_is_python3: no impl nor EPYTHON"
- [[ ${impl} == python3* ]]
+ [[ ${impl} == python3* || ${impl} == pypy3 ]]
}
# @FUNCTION: python_fix_shebang
@@ -1001,7 +1003,7 @@ python_fix_shebang() {
fi
break
;;
- *python[23].[0123456789]|*pypy|*jython[23].[0123456789])
+ *python[23].[0123456789]|*pypy|*pypy3|*jython[23].[0123456789])
# Explicit mismatch.
if [[ ! ${force} ]]; then
error=1
@@ -1011,6 +1013,8 @@ python_fix_shebang() {
from="python[23].[0123456789]";;
*pypy)
from="pypy";;
+ *pypy3)
+ from="pypy3";;
*jython[23].[0123456789])
from="jython[23].[0123456789]";;
*)
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index e417fced6e1d..54bd47a16781 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -87,15 +87,24 @@ test_var PYTHON_INCLUDEDIR pypy /usr/lib/pypy/include
test_var PYTHON_PKG_DEP pypy '*virtual/pypy*:0='
test_var PYTHON_SCRIPTDIR pypy /usr/lib/python-exec/pypy
+test_var EPYTHON pypy3 pypy3
+test_var PYTHON pypy3 /usr/bin/pypy3
+test_var PYTHON_SITEDIR pypy3 /usr/lib/pypy3/site-packages
+test_var PYTHON_INCLUDEDIR pypy3 /usr/lib/pypy3/include
+test_var PYTHON_PKG_DEP pypy3 '*virtual/pypy3*:0='
+test_var PYTHON_SCRIPTDIR pypy3 /usr/lib/python-exec/pypy3
+
test_is "python_is_python3 python2.7" 1
test_is "python_is_python3 python3.2" 0
test_is "python_is_python3 jython2.7" 1
test_is "python_is_python3 pypy" 1
+test_is "python_is_python3 pypy3" 0
# generic shebangs
test_fix_shebang '#!/usr/bin/python' python2.7 '#!/usr/bin/python2.7'
test_fix_shebang '#!/usr/bin/python' python3.4 '#!/usr/bin/python3.4'
test_fix_shebang '#!/usr/bin/python' pypy '#!/usr/bin/pypy'
+test_fix_shebang '#!/usr/bin/python' pypy3 '#!/usr/bin/pypy3'
test_fix_shebang '#!/usr/bin/python' jython2.7 '#!/usr/bin/jython2.7'
# python2/python3 matching
@@ -149,6 +158,7 @@ test_is "_python_impl_supported pypy1_8" 1
test_is "_python_impl_supported pypy1_9" 1
test_is "_python_impl_supported pypy2_0" 1
test_is "_python_impl_supported pypy" 0
+test_is "_python_impl_supported pypy3" 0
test_is "_python_impl_supported jython2_5" 0
test_is "_python_impl_supported jython2_7" 0