Line 0
Link Here
|
0 |
- |
1 |
# Copyright 1999-2016 Gentoo Foundation |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Id$ |
4 |
|
5 |
EAPI=6 |
6 |
|
7 |
PYTHON_COMPAT=( python2_7 python3_{4,5} ) |
8 |
PYTHON_REQ_USE="sqlite" |
9 |
|
10 |
inherit distutils-r1 flag-o-matic virtualx |
11 |
|
12 |
MYSLOT=2 |
13 |
MY_PN=${PN}${MYSLOT} |
14 |
MY_P=${MY_PN}-${PV} |
15 |
|
16 |
DESCRIPTION="Python interface to the R Programming Language" |
17 |
HOMEPAGE="http://rpy.sourceforge.net/ https://pypi.python.org/pypi/rpy2" |
18 |
SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz" |
19 |
|
20 |
LICENSE="AGPL-3 GPL-2 LGPL-2.1 MPL-1.1" |
21 |
SLOT="0" |
22 |
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" |
23 |
IUSE="test" |
24 |
|
25 |
RDEPEND=" |
26 |
>=dev-lang/R-3.2 |
27 |
dev-python/numpy[${PYTHON_USEDEP}] |
28 |
>=dev-python/pandas-0.13.1[${PYTHON_USEDEP}] |
29 |
dev-python/six[${PYTHON_USEDEP}] |
30 |
virtual/python-singledispatch[${PYTHON_USEDEP}] |
31 |
" |
32 |
DEPEND="${RDEPEND} |
33 |
test? ( >=dev-lang/R-3.2[X,png] ) |
34 |
dev-python/setuptools[${PYTHON_USEDEP}]" |
35 |
PDEPEND="dev-python/ipython[${PYTHON_USEDEP}]" |
36 |
|
37 |
# ggplot2 is an optional test dep but not in portage |
38 |
S="${WORKDIR}/${MY_P}" |
39 |
|
40 |
# Tarball absent of doc files in doc folder |
41 |
# https://bitbucket.org/rpy2/rpy2/issues/229 |
42 |
|
43 |
python_prepare() { |
44 |
if ! python_is_python3; then |
45 |
# https://bitbucket.org/rpy2/rpy2/pull-requests/56 |
46 |
sed -e '1i# coding=utf-8' \ |
47 |
-i rpy/rinterface/tests/test_SexpClosure.py \ |
48 |
-i rpy/rinterface/tests/test_SexpEnvironment.py || die |
49 |
fi |
50 |
} |
51 |
|
52 |
python_compile() { |
53 |
if ! python_is_python3; then |
54 |
local CFLAGS=${CFLAGS} |
55 |
append-cflags -fno-strict-aliasing |
56 |
fi |
57 |
distutils-r1_python_compile |
58 |
} |
59 |
|
60 |
python_test() { |
61 |
cd "${BUILD_DIR}"/lib || die |
62 |
virtx ${PYTHON} -m 'rpy2.tests' || die |
63 |
} |