Lines 6-12
EAPI=8
Link Here
|
6 |
PYTHON_COMPAT=( python3_{8..10} ) |
6 |
PYTHON_COMPAT=( python3_{8..10} ) |
7 |
DISTUTILS_USE_PEP517=setuptools |
7 |
DISTUTILS_USE_PEP517=setuptools |
8 |
|
8 |
|
9 |
inherit distutils-r1 |
9 |
inherit distutils-r1 multiprocessing |
10 |
|
10 |
|
11 |
DESCRIPTION="Python wrapper for OpenCL" |
11 |
DESCRIPTION="Python wrapper for OpenCL" |
12 |
HOMEPAGE="https://mathema.tician.de/software/pyopencl/ |
12 |
HOMEPAGE="https://mathema.tician.de/software/pyopencl/ |
Lines 16-22
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
Link Here
|
16 |
LICENSE="GPL-2" |
16 |
LICENSE="GPL-2" |
17 |
SLOT="0" |
17 |
SLOT="0" |
18 |
KEYWORDS="~amd64 ~ppc64" |
18 |
KEYWORDS="~amd64 ~ppc64" |
19 |
IUSE="examples opengl" |
19 |
IUSE="examples opengl test" |
20 |
|
20 |
|
21 |
DEPEND=">=virtual/opencl-2" |
21 |
DEPEND=">=virtual/opencl-2" |
22 |
RDEPEND="${DEPEND} |
22 |
RDEPEND="${DEPEND} |
Lines 27-41
RDEPEND="${DEPEND}
Link Here
|
27 |
# libglvnd is only needed for the headers |
27 |
# libglvnd is only needed for the headers |
28 |
BDEPEND="dev-python/numpy[${PYTHON_USEDEP}] |
28 |
BDEPEND="dev-python/numpy[${PYTHON_USEDEP}] |
29 |
>=dev-python/pybind11-2.5.0[${PYTHON_USEDEP}] |
29 |
>=dev-python/pybind11-2.5.0[${PYTHON_USEDEP}] |
30 |
opengl? ( media-libs/libglvnd )" |
30 |
opengl? ( media-libs/libglvnd ) |
|
|
31 |
test? ( dev-libs/pocl )" |
31 |
|
32 |
|
32 |
# The test suite fails if there are no OpenCL platforms available, and |
33 |
distutils_enable_tests pytest |
33 |
# even if there is one (which requires the presence of both an OpenCL |
|
|
34 |
# runtime *and* hardware supported by it - simply emerging any runtime |
35 |
# is not enough) the vast majority of tests end up skipped because by |
36 |
# default the portage user hasn't got sufficient privileges to talk |
37 |
# to the GPU. |
38 |
RESTRICT="test" |
39 |
|
34 |
|
40 |
python_configure_all() { |
35 |
python_configure_all() { |
41 |
local myconf=() |
36 |
local myconf=() |
Lines 47-52
python_configure_all() {
Link Here
|
47 |
"${myconf[@]}" |
42 |
"${myconf[@]}" |
48 |
} |
43 |
} |
49 |
|
44 |
|
|
|
45 |
python_test() { |
46 |
# Use dev-libs/pocl for testing; ignore any other OpenCL devices that might be present |
47 |
local -x PYOPENCL_TEST="portable:pthread" |
48 |
# Set the number of threads to match MAKEOPTS |
49 |
local -x POCL_MAX_PTHREAD_COUNT=$(makeopts_jobs) |
50 |
# Change to the 'test' directory so that python does not try to import pyopencl from the source directory |
51 |
# (Importing from the source directory fails, because the compiled '_cl' module is only in the build directory) |
52 |
pushd 'test' |
53 |
epytest |
54 |
popd |
55 |
} |
56 |
|
50 |
python_install_all() { |
57 |
python_install_all() { |
51 |
if use examples; then |
58 |
if use examples; then |
52 |
dodoc -r examples |
59 |
dodoc -r examples |
53 |
- |
|
|